Skip to content

Commit 54ed29e

Browse files
authored
Merge pull request #212 from Neves-P/fork/main
Handle tarballs with `dev.eessi.io` project subdir in name
2 parents bfc4157 + 36e0bae commit 54ed29e

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

scripts/ingest-tarball.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,17 @@ version=$(echo "${tar_file_basename}" | cut -d- -f2)
258258
contents_type_dir=$(echo "${tar_file_basename}" | cut -d- -f3)
259259
tar_first_file=$(tar tf "${tar_file}" | head -n 1)
260260
tar_top_level_dir=$(echo "${tar_first_file}" | cut -d/ -f1)
261-
# Handle longer prefix with project name in dev.eessi.io
261+
# Handle longer prefix with project name in dev.eessi.io and
262+
# get the right basedir from the tarball name
262263
if [ "${cvmfs_repo}" = "dev.eessi.io" ]; then
263-
tar_contents_start_level=3
264+
# the project name is the second to last field in the filename (e.g. eessi-2023.06-software-linux-x86_64-amd-zen4-myproject-1744725142.tar.gz)
265+
project_name=$(echo "${tar_file_basename}" | rev | cut -d- -f2 | rev)
266+
basedir="${project_name}"/versions
264267
else
265-
tar_contents_start_level=2
268+
basedir=versions
266269
fi
270+
271+
tar_contents_start_level=2
267272
tar_contents_type_dir=$(tar tf "${tar_file}" | head -n 2 | tail -n 1 | cut -d/ -f${tar_contents_start_level})
268273

269274
# Check if we are running as the CVMFS repo owner, otherwise run cvmfs_server with sudo

0 commit comments

Comments
 (0)