run: handle empty create_tar_from_depot_binaries

This patch works around 'tar' erroring out when faced with an empty list
of files:

  tar: Cowardly refusing to create an empty archive

This can happen when using sculpt.run for a scenario with only a runtime
but no deploy or launcher configuration.

Issue #4369
This commit is contained in:
Norman Feske 2022-02-15 16:08:32 +01:00
parent 300cdc435d
commit 14b93c5ff3

View File

@ -343,7 +343,11 @@ proc create_tar_from_depot_binaries { archive_path args } {
check_for_missing_depot_archives
eval "exec tar cf $archive_path -C [depot_dir] [lsort -unique $content]"
if {[llength $args] > 0} {
eval "exec tar cf $archive_path -C [depot_dir] [lsort -unique $content]"
} else {
eval "exec tar cf $archive_path -T /dev/null"
}
}