Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle longer dev.eessi.io prefix in ingestion #203

Merged
merged 7 commits into from
Dec 2, 2024
10 changes: 7 additions & 3 deletions scripts/ingest-tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ 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)
if [ -z "${os}" ]
then
error "no operating system directory found in the tarball!"
Expand All @@ -156,7 +155,6 @@ 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)
if [ -z "${arch}" ]
then
error "no architecture directory found in the tarball!"
Expand Down Expand Up @@ -258,7 +256,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
Loading