From 772b3f0547136d44a18fd4a4d1e1f5b10996dc22 Mon Sep 17 00:00:00 2001 From: Neves-P Date: Sun, 1 Dec 2024 10:30:18 +0100 Subject: [PATCH] Handle longer dev.eessi.io prefix in ingestion --- scripts/ingest-tarball.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/ingest-tarball.sh b/scripts/ingest-tarball.sh index e6f1321..e4f3e0a 100755 --- a/scripts/ingest-tarball.sh +++ b/scripts/ingest-tarball.sh @@ -258,7 +258,12 @@ 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) tar_top_level_dir=$(echo "${tar_first_file}" | cut -d/ -f1) -tar_contents_type_dir=$(tar tf "${tar_file}" | head -n 2 | tail -n 1 | cut -d/ -f2) +# Handle longer prefix with project name in dev.eessi.io +if [ "${cvmfs_repo}" = "dev.eessi.io" ]; then + tar_contents_type_dir=$(tar tf "${tar_file}" | head -n 2 | tail -n 1 | cut -d/ -f3) +else + tar_contents_type_dir=$(tar tf "${tar_file}" | head -n 2 | tail -n 1 | cut -d/ -f2) +fi # Check if we are running as the CVMFS repo owner, otherwise run cvmfs_server with sudo is_repo_owner || cvmfs_server="sudo cvmfs_server"