Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion scripts/ingest-tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,13 @@ fi
tar_file_basename=$(basename "${tar_file}")
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)
# find the first file in the tarball that corresponds to $contents_type_dir,
# e.g. the first file that actually belongs to the software layer for software tarballs
# (and, hence, skip other files, like init scripts)
tar_first_file=$(tar tf "${tar_file}" | grep -m 1 "/${contents_type_dir}/")
if [ -z ${tar_first_file} ]; then
tar_first_file=$(tar tf "${tar_file}" | head -n 1)
fi
tar_top_level_dir=$(echo "${tar_first_file}" | cut -d/ -f1)
# Handle longer prefix with project name in dev.eessi.io and
# get the right basedir from the tarball name
Expand Down
Loading