From 80a1d0c0cd6170ce9fdc2c86eca1ba27b7309c0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 18 Nov 2025 22:57:10 +0100 Subject: [PATCH 1/2] for mixed tarballs, find the first file that corresponds to the type encoded in the filename --- scripts/ingest-tarball.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/ingest-tarball.sh b/scripts/ingest-tarball.sh index 634f6f61..3d92ab74 100755 --- a/scripts/ingest-tarball.sh +++ b/scripts/ingest-tarball.sh @@ -286,7 +286,10 @@ fi tar_file_basename=$(basename "${tar_file}") version=$(echo "${tar_file_basename}" | cut -d- -f2) contents_type_dir=$(echo "${tar_file_basename}" | cut -d- -f3) -tar_first_file=$(tar tf "${tar_file}" | head -n 1) +# find the first file in the tarball that corresponds to $contents_type_dir, +# e.g. the first file that actually belongs to the software layer for software tarballs +# (and, hence, skip other files, like init scripts) +tar_first_file=$(tar tf "${tar_file}" | grep -m 1 "/${contents_type_dir}/") tar_top_level_dir=$(echo "${tar_first_file}" | cut -d/ -f1) # Handle longer prefix with project name in dev.eessi.io and # get the right basedir from the tarball name From b03c328843530f6baffe264d30ba2c77a33b789b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 18 Nov 2025 23:09:07 +0100 Subject: [PATCH 2/2] fallback to old method for getting the first file in the tarball --- scripts/ingest-tarball.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/ingest-tarball.sh b/scripts/ingest-tarball.sh index 3d92ab74..9a2580d2 100755 --- a/scripts/ingest-tarball.sh +++ b/scripts/ingest-tarball.sh @@ -290,6 +290,9 @@ contents_type_dir=$(echo "${tar_file_basename}" | cut -d- -f3) # e.g. the first file that actually belongs to the software layer for software tarballs # (and, hence, skip other files, like init scripts) tar_first_file=$(tar tf "${tar_file}" | grep -m 1 "/${contents_type_dir}/") +if [ -z ${tar_first_file} ]; then + tar_first_file=$(tar tf "${tar_file}" | head -n 1) +fi tar_top_level_dir=$(echo "${tar_first_file}" | cut -d/ -f1) # Handle longer prefix with project name in dev.eessi.io and # get the right basedir from the tarball name