diff --git a/scripts/ingest-tarball.sh b/scripts/ingest-tarball.sh index fad2ddd..91c5ef7 100755 --- a/scripts/ingest-tarball.sh +++ b/scripts/ingest-tarball.sh @@ -259,10 +259,11 @@ tar_first_file=$(tar tf "${tar_file}" | head -n 1) tar_top_level_dir=$(echo "${tar_first_file}" | cut -d/ -f1) # 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) + tar_contents_start_level=3 else - tar_contents_type_dir=$(tar tf "${tar_file}" | head -n 2 | tail -n 1 | cut -d/ -f2) + tar_contents_start_level=2 fi +tar_contents_type_dir=$(tar tf "${tar_file}" | head -n 2 | tail -n 1 | cut -d/ -f${tar_contents_start_level}) # Check if we are running as the CVMFS repo owner, otherwise run cvmfs_server with sudo is_repo_owner || cvmfs_server="sudo cvmfs_server"