From 726e7a9eaca0ae0b5aa2c9fb17754854f300d39f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Mon, 24 Nov 2025 10:40:43 +0100 Subject: [PATCH 1/2] allow version suffix in the tarball --- scripts/ingest-tarball.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/ingest-tarball.sh b/scripts/ingest-tarball.sh index 952c8629..6d7b2514 100755 --- a/scripts/ingest-tarball.sh +++ b/scripts/ingest-tarball.sh @@ -80,10 +80,13 @@ function check_version() { error "${version} is not a valid EESSI version." fi - # Check if the version encoded in the filename matches the top-level dir inside the tarball - if [ "${version}" != "${tar_top_level_dir}" ] + # Cut off any suffix from the top-level directory name (which should correspond to the version) + unsuffixed_tar_top_level_dir=$(echo ${tar_top_level_dir} | sed -E 's/-[0-9A-Za-z._-]+//') + + # Check if the version encoded in the filename matches the unsuffixed top-level dir inside the tarball + if [ "${version}" != "${unsuffixed_tar_top_level_dir}" ] then - error "the version in the filename (${version}) does not match the top-level directory in the tarball (${tar_top_level_dir})." + error "the version in the filename (${version}) does not match the (unsuffixed) top-level directory in the tarball (${unsuffixed_tar_top_level_dir})." fi } From 8fddfc9d02f775ddcfc7058f162e918558bd6a78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Mon, 24 Nov 2025 10:40:52 +0100 Subject: [PATCH 2/2] additional tests for version suffixes --- scripts/test-ingest-tarball.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/test-ingest-tarball.sh b/scripts/test-ingest-tarball.sh index 6e5eaab3..dd5dcb51 100755 --- a/scripts/test-ingest-tarball.sh +++ b/scripts/test-ingest-tarball.sh @@ -57,6 +57,9 @@ tarballs_success=( "$tstdir/eessi-2000.01-scripts-123456.tar.gz 2000.01 scripts" "$tstdir/eessi-2000.01-software-123456.tar.gz 2000.01 software/linux/x86_64/intel/haswell" "$tstdir/eessi-2000.01-software-123456.tar.zst 2000.01 software/linux/x86_64/intel/haswell" + # Version suffixes inside the tarball are allowed if they match: -[0-9A-Za-z._-]+ + "$tstdir/eessi-2000.01-software-123456.tar.gz 2000.01-001 software/linux/x86_64/intel/haswell" + "$tstdir/eessi-2000.01-software-123456.tar.gz 2000.01-20250101-001-abc software/linux/x86_64/intel/haswell" ) # Test that should return an error @@ -92,6 +95,8 @@ tarballs_fail=( # Invalid compression / file extension "$tstdir/eessi-2000.01-software-123456.tar 2000.01 software/linux/x86_64/intel/haswell" "$tstdir/eessi-2000.01-software-123456.tar.xz 2000.01 software/linux/x86_64/intel/haswell" + # Invalid version suffix in the tarball + "$tstdir/eessi-2000.01-software-123456.tar.gz 2000.01#001 software/linux/x86_64/intel/haswell" ) # update_lmod_caches.sh script requires that directory exists,