chiark / gitweb /
Optimise wiki update
authorCiaran Gultnieks <ciaran@ciarang.com>
Tue, 23 Apr 2013 12:28:43 +0000 (13:28 +0100)
committerCiaran Gultnieks <ciaran@ciarang.com>
Tue, 23 Apr 2013 12:28:43 +0000 (13:28 +0100)
fdroidserver/update.py

index 21cd4add3d763a4fd6b8af18d6c4dc5e88606e34..d793a48cdcfc4d7fdb65e29cad0514194379b6fe 100644 (file)
@@ -130,6 +130,12 @@ def update_wiki(apps, apks, verbose=False):
         # We can't have underscores in the page name, even if they're in
         # the package ID, because MediaWiki messes with them...
         pagename = app['id'].replace('_', ' ')
+
+        # Drop a trailing newline, because mediawiki is going to drop it anyway
+        # and it we don't we'll think the page has changed when it hasn't...
+        if wikidata.endswith('\n'):
+            wikidata = wikidata[:-1]
+
         generated_pages[pagename] = wikidata
 
         # Make a redirect from the name to the ID too, unless there's