copy-wheels: fix index path, remove f-strings

I swear this should work now ... $f is the full path to the wheel
directory

Additionally ... f-strings aren't available on Python 3.5, and we
still build for Trusty which has Python 3.5 ... sigh :/ convert to
regular strings.

Change-Id: Ia03b97198f9f45914b8b99c222680d732c2cc8f8
This commit is contained in:
Ian Wienand 2020-01-15 20:24:54 +11:00
parent f767e5230a
commit 34f963a924
2 changed files with 8 additions and 7 deletions

View File

@ -23,7 +23,7 @@ for f in $FILES; do
# Run the indexer over this directory
# NOTE(ianw) : remove temporary "--output" when working
/usr/local/bin/wheel-indexer.py --debug --output "index.html.tmp" $MIRROR_ROOT/$f
/usr/local/bin/wheel-indexer.py --debug --output "index.html.tmp" $f
fi
done

View File

@ -98,13 +98,13 @@ def create_index(path, files):
project = os.path.basename(path)
output = f'''<html>
output = '''<html>
<head>
<title>{project}</title>
<title>%s</title>
</head>
<body>
<ul>
'''
''' % (project)
for f in files:
f_full = os.path.join(path, f)
@ -129,10 +129,10 @@ def create_index(path, files):
sha256 = get_sha256(f_full)
logging.debug("sha256 for %s: %s" % (f_full, sha256))
output += f' <li><a href="{f}#sha256={sha256}"'
output += ' <li><a href="%s#sha256=%s"' % (f, sha256)
if requirements:
output += f' data-requires-python="{requirements}" '
output += f'>{f}</a></li>\n'
output += ' data-requires-python="%s" ' % (requirements)
output += '>%s</a></li>\n' % (f)
output += ''' </ul>
</body>
@ -144,6 +144,7 @@ def create_index(path, files):
return output
logging.debug("Building indexes from: %s" % args.toplevel)
for root, dirs, files in os.walk(args.toplevel):
# sanity check we are only called from leaf directories by the
# driver script