@@ -143,7 +143,7 @@ function cvmfs_ingest_tarball() {
143
143
144
144
function check_os() {
145
145
# Check if the operating system directory is correctly set for the contents of the tarball
146
- os=$( echo " ${tar_first_file} " | cut -d / -f 3 )
146
+ os=$( echo " ${tar_first_file} " | cut -d / -f $(( $tar_contents_start_level + 1 )) )
147
147
if [ -z " ${os} " ]
148
148
then
149
149
error " no operating system directory found in the tarball!"
@@ -156,7 +156,7 @@ function check_os() {
156
156
157
157
function check_arch() {
158
158
# Check if the architecture directory is correctly set for the contents of the tarball
159
- arch=$( echo " ${tar_first_file} " | cut -d / -f 4 )
159
+ arch=$( echo " ${tar_first_file} " | cut -d / -f $(( $tar_contents_start_level + 2 )) )
160
160
if [ -z " ${arch} " ]
161
161
then
162
162
error " no architecture directory found in the tarball!"
@@ -258,7 +258,13 @@ version=$(echo "${tar_file_basename}" | cut -d- -f2)
258
258
contents_type_dir=$( echo " ${tar_file_basename} " | cut -d- -f3)
259
259
tar_first_file=$( tar tf " ${tar_file} " | head -n 1)
260
260
tar_top_level_dir=$( echo " ${tar_first_file} " | cut -d/ -f1)
261
- tar_contents_type_dir=$( tar tf " ${tar_file} " | head -n 2 | tail -n 1 | cut -d/ -f2)
261
+ # Handle longer prefix with project name in dev.eessi.io
262
+ if [ " ${cvmfs_repo} " = " dev.eessi.io" ]; then
263
+ tar_contents_start_level=3
264
+ else
265
+ tar_contents_start_level=2
266
+ fi
267
+ tar_contents_type_dir=$( tar tf " ${tar_file} " | head -n 2 | tail -n 1 | cut -d/ -f${tar_contents_start_level} )
262
268
263
269
# Check if we are running as the CVMFS repo owner, otherwise run cvmfs_server with sudo
264
270
is_repo_owner || cvmfs_server=" sudo cvmfs_server"
0 commit comments