chiark / gitweb /
remove url-unsafe characters from "current version" symlink names
authorHans-Christoph Steiner <hans@eds.org>
Sat, 11 Oct 2014 01:12:48 +0000 (21:12 -0400)
committerHans-Christoph Steiner <hans@eds.org>
Tue, 11 Nov 2014 14:06:53 +0000 (15:06 +0100)
This prevents the URL from having ugly %20 stuff in the app name.

fdroidserver/update.py

index b96d860ef4cc0de06d9fde0c67ed4927af9c1c05..0339f4606fb1c4119d4cc53db3e48bf155be4e9c 100644 (file)
@@ -868,7 +868,9 @@ def make_index(apps, sortedids, apks, repodir, archive, categories):
         if current_version_file is not None \
                 and config['make_current_version_link'] \
                 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)
             if os.path.exists(apklinkname):
                 os.remove(apklinkname)