From b1ec8cc47a0f5e79832b112a9086e86db1f8a24a Mon Sep 17 00:00:00 2001 From: Boris Kraut Date: Sun, 11 Jan 2015 02:26:41 +0100 Subject: [PATCH] Add "Changelog:" metadata field. --- docs/fdroid.texi | 11 +++++++++++ fdroidserver/import.py | 4 ++++ fdroidserver/lint.py | 12 ++++++++++++ fdroidserver/metadata.py | 4 +++- fdroidserver/update.py | 5 ++++- wp-fdroid/wp-fdroid.php | 5 +++++ 6 files changed, 39 insertions(+), 2 deletions(-) diff --git a/docs/fdroid.texi b/docs/fdroid.texi index a1d01077..ef1c374b 100644 --- a/docs/fdroid.texi +++ b/docs/fdroid.texi @@ -468,6 +468,7 @@ The following sections describe the fields recognised within the file. * Web Site:: * Source Code:: * Issue Tracker:: +* Changelog:: * Donate:: * FlattrID:: * Bitcoin:: @@ -632,6 +633,16 @@ applications have one. This is converted to (@code{}) in the public index file. +@node Changelog +@section Changelog + +@cindex Changelog + +The URL for the application's changelog. Optional, since not all +applications have one. + +This is converted to (@code{}) in the public index file. + @node Donate @section Donate diff --git a/fdroidserver/import.py b/fdroidserver/import.py index c837fffd..c2f0bbd7 100644 --- a/fdroidserver/import.py +++ b/fdroidserver/import.py @@ -128,6 +128,7 @@ def main(): # Figure out what kind of project it is... projecttype = None issuetracker = None + changelog = None license = None website = url # by default, we might override it if url.startswith('git://'): @@ -142,6 +143,7 @@ def main(): repotype = 'git' sourcecode = url issuetracker = url + '/issues' + changelog = url + '/commits' elif url.startswith('https://gitlab.com/'): projecttype = 'gitlab' repo = url @@ -275,6 +277,8 @@ def main(): app['Source Code'] = sourcecode if issuetracker: app['Issue Tracker'] = issuetracker + if changelog: + app['Changelog'] = changelog if license: app['License'] = license app['Repo Type'] = repotype diff --git a/fdroidserver/lint.py b/fdroidserver/lint.py index 8cf1bf61..19dfcada 100644 --- a/fdroidserver/lint.py +++ b/fdroidserver/lint.py @@ -74,6 +74,14 @@ regex_warnings = { (re.compile(r'.*[^sS]://gitorious\.org/.*'), "gitorious URLs should always use https:// not http://"), ], + 'Changelog': [ + (re.compile(r'.*[^sS]://code\.google\.com/.*'), + "code.google.com URLs should always use https:// not http://"), + (re.compile(r'.*[^sS]://github\.com/.*'), + "github URLs should always use https:// not http://"), + (re.compile(r'.*[^sS]://gitorious\.org/.*'), + "gitorious URLs should always use https:// not http://"), + ], 'License': [ (re.compile(r'^(|None|Unknown)$'), "No license specified"), @@ -119,6 +127,10 @@ regex_pedantic = { (re.compile(r'.*github\.com/[^/]+/[^/]+/issues/.*'), "/issues is often enough on its own"), ], + 'Changelog': [ + (re.compile(r'.*commit.*', re.IGNORECASE), + "Not every commit log is suitable as change log"), + ], 'Summary': [ (re.compile(r'.*\b(free software|open source)\b.*', re.IGNORECASE), "No need to specify that the app is Free Software"), diff --git a/fdroidserver/metadata.py b/fdroidserver/metadata.py index 2e29cd79..5b56048c 100644 --- a/fdroidserver/metadata.py +++ b/fdroidserver/metadata.py @@ -48,6 +48,7 @@ app_defaults = OrderedDict([ ('Web Site', ''), ('Source Code', ''), ('Issue Tracker', ''), + ('Changelog', ''), ('Donate', None), ('FlattrID', None), ('Bitcoin', None), @@ -169,7 +170,7 @@ valuetypes = { FieldValidator("HTTP link", r'^http[s]?://', None, - ["Web Site", "Source Code", "Issue Tracker", "Donate"], []), + ["Web Site", "Source Code", "Issue Tracker", "Changelog", "Donate"], []), FieldValidator("Bitcoin address", r'^[a-zA-Z0-9]{27,34}$', None, @@ -826,6 +827,7 @@ def write_metadata(dest, app): writefield('Web Site') writefield('Source Code') writefield('Issue Tracker') + writefield('Changelog') writefield_nonempty('Donate') writefield_nonempty('FlattrID') writefield_nonempty('Bitcoin') diff --git a/fdroidserver/update.py b/fdroidserver/update.py index 1ec8dad5..cc42fe2f 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -92,7 +92,7 @@ def update_wiki(apps, sortedids, apks): if app['AntiFeatures']: for af in app['AntiFeatures'].split(','): wikidata += '{{AntiFeature|' + af + '}}\n' - wikidata += '{{App|id=%s|name=%s|added=%s|lastupdated=%s|source=%s|tracker=%s|web=%s|donate=%s|flattr=%s|bitcoin=%s|litecoin=%s|dogecoin=%s|license=%s|root=%s}}\n' % ( + wikidata += '{{App|id=%s|name=%s|added=%s|lastupdated=%s|source=%s|tracker=%s|web=%s|changelog=%s|donate=%s|flattr=%s|bitcoin=%s|litecoin=%s|dogecoin=%s|license=%s|root=%s}}\n' % ( appid, app['Name'], time.strftime('%Y-%m-%d', app['added']) if 'added' in app else '', @@ -100,6 +100,7 @@ def update_wiki(apps, sortedids, apks): app['Source Code'], app['Issue Tracker'], app['Web Site'], + app['Changelog'], app['Donate'], app['FlattrID'], app['Bitcoin'], @@ -780,6 +781,7 @@ def make_index(apps, sortedids, apks, repodir, archive, categories): addElement('web', app['Web Site'], doc, apel) addElement('source', app['Source Code'], doc, apel) addElement('tracker', app['Issue Tracker'], doc, apel) + addElement('changelog', app['Changelog'], doc, apel) if app['Donate']: addElement('donate', app['Donate'], doc, apel) if app['Bitcoin']: @@ -1064,6 +1066,7 @@ def main(): f.write("Web Site:\n") f.write("Source Code:\n") f.write("Issue Tracker:\n") + f.write("Changelog:\n") f.write("Summary:" + apk['name'] + "\n") f.write("Description:\n") f.write(apk['name'] + "\n") diff --git a/wp-fdroid/wp-fdroid.php b/wp-fdroid/wp-fdroid.php index 98fffbdf..bdb53f29 100644 --- a/wp-fdroid/wp-fdroid.php +++ b/wp-fdroid/wp-fdroid.php @@ -284,6 +284,9 @@ class FDroid case "tracker": $issues=$el; break; + case "changelog": + $changelog=$el; + break; case "donate": $donate=$el; break; @@ -398,6 +401,8 @@ class FDroid $out.='Issue Tracker: '.$issues.'
'; if(strlen($source)>0) $out.='Source Code: '.$source.'
'; + if(strlen($changelog)>0) + $out.='Changelog: '.$changelog.'
'; if(isset($donate) && strlen($donate)>0) $out.='Donate: '.$donate.'
'; if(isset($flattr) && strlen($flattr)>0) -- 2.30.2