Skip to content

Commit 23b8bb1

Browse files
authored
Merge pull request #195 from boegel/fix_tarball_overview_staging
try to determine common prefix for paths in tarball after filtering out `*/init/*` paths
2 parents 6a3f33a + ecf5b22 commit 23b8bb1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

scripts/automated_ingestion/eessitarball.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,15 @@ def get_contents_overview(self):
9595

9696
else:
9797
tar_members_desc = 'Summarized overview of the contents of the tarball:'
98-
prefix = os.path.commonprefix(paths)
98+
# determine prefix after filtering out '<EESSI version>/init' subdirectory,
99+
# to get actual prefix for specific CPU target (like '2023.06/software/linux/aarch64/neoverse_v1')
100+
init_subdir = os.path.join('*', 'init')
101+
non_init_paths = sorted([p for p in paths if not any(x.match(init_subdir) for x in PurePosixPath(p).parents)])
102+
if non_init_paths:
103+
prefix = os.path.commonprefix(non_init_paths)
104+
else:
105+
prefix = os.path.commonprefix(paths)
106+
99107
# TODO: this only works for software tarballs, how to handle compat layer tarballs?
100108
swdirs = [ # all directory names with the pattern: <prefix>/software/<name>/<version>
101109
m.path

0 commit comments

Comments
 (0)