Skip to content

Commit

Permalink
Merge pull request #195 from boegel/fix_tarball_overview_staging
Browse files Browse the repository at this point in the history
try to determine common prefix for paths in tarball after filtering out `*/init/*` paths
  • Loading branch information
bedroge authored Jun 26, 2024
2 parents 6a3f33a + ecf5b22 commit 23b8bb1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/automated_ingestion/eessitarball.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,15 @@ def get_contents_overview(self):

else:
tar_members_desc = 'Summarized overview of the contents of the tarball:'
prefix = os.path.commonprefix(paths)
# determine prefix after filtering out '<EESSI version>/init' subdirectory,
# to get actual prefix for specific CPU target (like '2023.06/software/linux/aarch64/neoverse_v1')
init_subdir = os.path.join('*', 'init')
non_init_paths = sorted([p for p in paths if not any(x.match(init_subdir) for x in PurePosixPath(p).parents)])
if non_init_paths:
prefix = os.path.commonprefix(non_init_paths)
else:
prefix = os.path.commonprefix(paths)

# TODO: this only works for software tarballs, how to handle compat layer tarballs?
swdirs = [ # all directory names with the pattern: <prefix>/software/<name>/<version>
m.path
Expand Down

0 comments on commit 23b8bb1

Please sign in to comment.