Skip to content

Commit 5db6d93

Browse files
committed
migration: Fix timestamp issue and hwloc windows
Fix two unrelated issues in the tarball staging script: 1) We weren't identifying the windows builds for hwloc, which meant they would be lost. Now add them into the special case for weird filenames. 2) We were setting build_time, not build_unix_time, which meant that we didn't have a useful datestamp for the website. Signed-off-by: Brian Barrett <[email protected]>
1 parent a6dbe35 commit 5db6d93

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

migration/build-staged-tarball-migration.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,26 +64,32 @@ def do_migrate(input_path, output_path):
6464
output_dir = os.path.join(output_path, output_root)
6565

6666
if name == 'latest_snapshot.txt':
67-
# make sure the directory exists...
68-
if not os.access(output_dir, os.F_OK):
69-
os.makedirs(output_dir)
70-
shutil.copyfile(os.path.join(root, name),
71-
os.path.join(output_dir, name))
67+
continue
7268

73-
pattern = '\.dmg\.gz|\.exe|\.tar\.gz|\.tar\.bz2|-[0-9]+\.src\.rpm'
69+
pattern = '\.dmg\.gz|\.exe|\.tar\.gz|\.tar\.bz2|-[0-9]+\.src\.rpm|\.zip'
7470
if re.search(pattern, name):
7571
base_filename = re.sub(pattern, '', name)
7672
full_filename = os.path.join(root, name)
7773

7874
print("==> %s" % (full_filename))
7975

80-
# clean up windows names
76+
# clean up Open MPI windows names
8177
if re.search('\.exe', name) :
8278
version_search = re.search('OpenMPI_v(.*)-.*', base_filename)
8379
if version_search:
8480
base_filename = 'openmpi-' + version_search.group(1)
8581
else:
8682
print("--> no joy %s" % base_filename)
83+
continue
84+
85+
# clean up hwloc windows names
86+
if re.search('\.zip', name):
87+
version_search = re.search('(hwloc|libtopology)-win.*-build-(.*)', base_filename)
88+
if version_search:
89+
base_filename = '%s-%s' % (version_search.group(1), version_search.group(2))
90+
else:
91+
print("--> no joy %s" % base_filename)
92+
continue
8793

8894
# skip the bad tarballs entirely...
8995
if re.search('\.tar\.', name):
@@ -132,7 +138,7 @@ def do_migrate(input_path, output_path):
132138
# changed in the migration from IU to
133139
# hostgator. So look at the top level
134140
# directory in the tarball instead.
135-
builddata['build_time'] = tar.getmembers()[0].mtime
141+
builddata['build_unix_time'] = tar.getmembers()[0].mtime
136142

137143
hashes = compute_hashes(full_filename)
138144
info = os.stat(full_filename)

0 commit comments

Comments
 (0)