remove url-unsafe characters from "current version" symlink names

This prevents the URL from having ugly %20 stuff in the app name.
This commit is contained in:
Hans-Christoph Steiner 2014-10-10 21:12:48 -04:00
parent 803ec39e23
commit b33cae375a

View file

@ -868,7 +868,9 @@ def make_index(apps, sortedids, apks, repodir, archive, categories):
if current_version_file is not None \ if current_version_file is not None \
and config['make_current_version_link'] \ and config['make_current_version_link'] \
and repodir == 'repo': # only create these and repodir == 'repo': # only create these
apklinkname = app[config['current_version_name_source']] + '.apk' sanitized_name = re.sub('''[ '"&%?+=]''', '',
app[config['current_version_name_source']])
apklinkname = sanitized_name + '.apk'
current_version_path = os.path.join(repodir, current_version_file) current_version_path = os.path.join(repodir, current_version_file)
if os.path.exists(apklinkname): if os.path.exists(apklinkname):
os.remove(apklinkname) os.remove(apklinkname)