Skip to content

Commit 80a1d0c

Browse files
committed
for mixed tarballs, find the first file that corresponds to the type encoded in the filename
1 parent fd73ab5 commit 80a1d0c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

scripts/ingest-tarball.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,10 @@ fi
286286
tar_file_basename=$(basename "${tar_file}")
287287
version=$(echo "${tar_file_basename}" | cut -d- -f2)
288288
contents_type_dir=$(echo "${tar_file_basename}" | cut -d- -f3)
289-
tar_first_file=$(tar tf "${tar_file}" | head -n 1)
289+
# find the first file in the tarball that corresponds to $contents_type_dir,
290+
# e.g. the first file that actually belongs to the software layer for software tarballs
291+
# (and, hence, skip other files, like init scripts)
292+
tar_first_file=$(tar tf "${tar_file}" | grep -m 1 "/${contents_type_dir}/")
290293
tar_top_level_dir=$(echo "${tar_first_file}" | cut -d/ -f1)
291294
# Handle longer prefix with project name in dev.eessi.io and
292295
# get the right basedir from the tarball name

0 commit comments

Comments
 (0)