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 
This commit is contained in:
Norman Feske 2022-09-08 09:46:30 +02:00
parent 96191fe577
commit 5b4b243e3d

View File

@ -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]]
}