File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 286286tar_file_basename=$( basename " ${tar_file} " )
287287version=$( echo " ${tar_file_basename} " | cut -d- -f2)
288288contents_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} /" )
293+ if [ -z ${tar_first_file} ]; then
294+ tar_first_file=$( tar tf " ${tar_file} " | head -n 1)
295+ fi
290296tar_top_level_dir=$( echo " ${tar_first_file} " | cut -d/ -f1)
291297# Handle longer prefix with project name in dev.eessi.io and
292298# get the right basedir from the tarball name
You can’t perform that action at this time.
0 commit comments