From 23f5a4b1add06b29348edb60ec7dea515b1d78c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Mart=C3=AD?= Date: Tue, 31 Dec 2013 10:47:50 +0100 Subject: [PATCH] New field: Provides --- docs/fdroid.texi | 12 ++++++++++++ fdroidserver/metadata.py | 3 +++ fdroidserver/update.py | 6 ++++++ 3 files changed, 21 insertions(+) diff --git a/docs/fdroid.texi b/docs/fdroid.texi index a0006388..842d8d60 100644 --- a/docs/fdroid.texi +++ b/docs/fdroid.texi @@ -461,6 +461,7 @@ The following sections describe the fields recognised within the file. * Categories:: * License:: * Name:: +* Provides:: * Auto Name:: * Web Site:: * Source Code:: @@ -585,6 +586,17 @@ overridden using this. Note that this only overrides the name in the list of apps presented in the client; it doesn't changed the name or application label in the source code. +@node Provides +@section Provides + +@cindex Provides + +Comma-separated list of application IDs that this app provides. In other +words, if the user has any of these apps installed, F-Droid will show this app +as installed instead. It will also appear if the user clicks on urls linking +to the other app IDs. Useful when an app switches package name, or when you +want an app to act as multiple apps. + @node Web Site @section Web Site diff --git a/fdroidserver/metadata.py b/fdroidserver/metadata.py index 1dc948ed..337a7d4d 100644 --- a/fdroidserver/metadata.py +++ b/fdroidserver/metadata.py @@ -472,6 +472,7 @@ def parse_metadata(metafile): # Defaults for fields that come from metadata... thisinfo['Name'] = None + thisinfo['Provides'] = None thisinfo['Auto Name'] = '' thisinfo['Categories'] = 'None' thisinfo['Description'] = [] @@ -641,6 +642,8 @@ def write_metadata(dest, app): writefield('Disabled') if app['AntiFeatures']: writefield('AntiFeatures') + if app['Provides']: + writefield('Provides') writefield('Categories') writefield('License') writefield('Web Site') diff --git a/fdroidserver/update.py b/fdroidserver/update.py index 0b705312..b1393b82 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -71,6 +71,9 @@ def update_wiki(apps, apks): app['License'], app.get('Requires Root', 'No')) + if app['Provides']: + wikidata += "This app provides: %s" % ', '.join(app['Summary'].split(',')) + wikidata += app['Summary'] wikidata += " - [http://f-droid.org/repository/browse/?fdid=" + app['id'] + " view in repository]\n\n" @@ -580,6 +583,9 @@ def make_index(apps, apks, repodir, archive, categories): af.remove('UpstreamNonFree') if af: addElement('antifeatures', ','.join(af), doc, apel) + if app['Provides']: + pv = app['Provides'].split(',') + addElement('provides', ','.join(pv), doc, apel) if app['Requires Root']: addElement('requirements', 'root', doc, apel) -- 2.30.2