Skip to content

Commit

Permalink
Merge pull request #203 from Neves-P/fix/dev.eessi.io-prefix
Browse files Browse the repository at this point in the history
Handle longer `dev.eessi.io` prefix in ingestion
  • Loading branch information
bedroge authored Dec 2, 2024
2 parents a5b099d + c267a52 commit b72e65a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions scripts/ingest-tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function cvmfs_ingest_tarball() {

function check_os() {
# Check if the operating system directory is correctly set for the contents of the tarball
os=$(echo "${tar_first_file}" | cut -d / -f 3)
os=$(echo "${tar_first_file}" | cut -d / -f $(( $tar_contents_start_level + 1 )))
if [ -z "${os}" ]
then
error "no operating system directory found in the tarball!"
Expand All @@ -156,7 +156,7 @@ function check_os() {

function check_arch() {
# Check if the architecture directory is correctly set for the contents of the tarball
arch=$(echo "${tar_first_file}" | cut -d / -f 4)
arch=$(echo "${tar_first_file}" | cut -d / -f $(( $tar_contents_start_level + 2 )))
if [ -z "${arch}" ]
then
error "no architecture directory found in the tarball!"
Expand Down Expand Up @@ -258,7 +258,13 @@ 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_start_level=3
else
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"
Expand Down

0 comments on commit b72e65a

Please sign in to comment.