From 5b4b243e3ddedfd9fd05ed5ee69587a528b4af8a Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Thu, 8 Sep 2022 09:46:30 +0200 Subject: [PATCH] sculpt.run: distinguish DEPOT=list from DEPOT=omit This patch splits the former DEPOT=omit option into two variants. The new 'list' option behaves like the former 'omit' option, skipping the creation of the tar archive from the depot content referenced by the deploy configuration but showing a list of depot archives that need to be published for the deployment. When specifying 'omit' in th new version, the local depot is not queried for the packages referenced in the deploy configuration. So the deployment can refer to packaged hosted only remotely. Fixes #4605 --- repos/gems/run/sculpt.run | 51 ++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/repos/gems/run/sculpt.run b/repos/gems/run/sculpt.run index 24165b456e..4f534f752d 100644 --- a/repos/gems/run/sculpt.run +++ b/repos/gems/run/sculpt.run @@ -803,12 +803,40 @@ proc pkg_archive_paths { values } { } +## +# Return which kind of depot archive is wanted: 'tar', 'omit', or 'list' +# +# tar - includes the depot content referenced by the deploy configuration as +# tar archive named 'depot.tar' +# +# omit - skips the evaluation of the deploy configuration +# +# list - outputs the list of packages needed for the deployment, which can +# taken as input for manually publishing those packages +# +proc depot_archive { } { + + global ::env + + set archive "tar" + if {[info exists ::env(DEPOT)]} { + set archive "$::env(DEPOT)" } + + if {$archive != "omit" && $archive != "tar" && $archive != "list"} { + puts stderr "Error: invalid value of DEPOT=$archive variable!" } + + return $archive +} + + # # Trigger the creation / updating of referenced depot content # # This step may update pkg versions if '--depot-auto-update' is enabled. # -_collect_from_depot [pkg_archive_paths [referenced_pkg_values]] +if {[depot_archive] == "tar" || [depot_archive] == "list"} { + _collect_from_depot [pkg_archive_paths [referenced_pkg_values]] +} # @@ -866,30 +894,13 @@ exec sed -i "/config/s/arch=\"\"/arch=\"[depot_spec]\"/" [initial_config_file de ## Depot content integrated in the Sculpt image ## -## -# Return which kind of depot archive is wanted 'tar' or 'omit' -# -proc depot_archive { } { - - global ::env - - set archive "tar" - if {[info exists ::env(DEPOT)]} { - set archive "$::env(DEPOT)" } - - if {$archive != "omit" && $archive != "tar"} { - puts stderr "Error: invalid value of DEPOT=$archive variable!" } - - return $archive -} - proc create_depot_archive { } { - global ::env if {[depot_archive] == "tar"} { create_tar_from_depot_binaries [run_dir]/genode/depot.tar \ {*}[pkg_archive_paths [referenced_pkg_values]] - } else { + + } elseif {[depot_archive] == "list"} { puts "Do not forget to publish:" puts [pkg_archive_paths [referenced_pkg_values]] }