1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-14 02:50:12 +01:00

Merge branch 'master' into verbose-rewrite

This commit is contained in:
Daniel Martí 2013-11-02 19:56:31 +01:00
commit 67b8825560
5 changed files with 32 additions and 29 deletions

View File

@ -455,7 +455,7 @@ fdroid rewritemetadata
The following sections describe the fields recognised within the file. The following sections describe the fields recognised within the file.
@menu @menu
* Category:: * Categories::
* License:: * License::
* Name:: * Name::
* Auto Name:: * Auto Name::
@ -484,19 +484,19 @@ The following sections describe the fields recognised within the file.
* No Source Since:: * No Source Since::
@end menu @end menu
@node Category @node Categories
@section Category @section Categories
A single category for the application to be placed in. There is no fixed list Any number of categories for the application to be placed in. There is no
of categories - both the client and the web site will automatically show any fixed list of categories - both the client and the web site will automatically
categories that exist in any applications. However, if your metadata is show any categories that exist in any applications. However, if your metadata
intended for the main F-Droid repository, you should use one of the existing is intended for the main F-Droid repository, you should use one of the
categories (look at the site/client), or discuss the proposal to add existing categories (look at the site/client), or discuss the proposal to add
a new one. a new one.
Additional categories can be specified, by using ';' as a separator. In this Categories must be separated by a single comma character, ','. For backwards
case the first is the primary category, and the only one that will be seen by compatibility, F-Droid will use the first category given as <category> element
clients that only understand one. for older clients to at least see one category.
@node License @node License
@section License @section License

View File

@ -119,7 +119,8 @@ def check_tags(app, sdk_path):
paths = common.manifest_paths(build_dir, flavour) paths = common.manifest_paths(build_dir, flavour)
version, vercode, package = common.parse_androidmanifests(paths) version, vercode, package = common.parse_androidmanifests(paths)
if package and package == app['id'] and version and vercode: if package and package == app['id'] and version and vercode:
print "Manifest exists. Found version %s" % version print "Manifest exists. Found version %s (%s)" % (
version, vercode)
if int(vercode) > int(hcode): if int(vercode) > int(hcode):
htag = tag htag = tag
hcode = str(int(vercode)) hcode = str(int(vercode))
@ -336,6 +337,7 @@ def main():
tag = None tag = None
msg = None msg = None
vercode = None
mode = app['Update Check Mode'] mode = app['Update Check Mode']
if mode == 'Tags': if mode == 'Tags':
(version, vercode, tag) = check_tags(app, config['sdk_path']) (version, vercode, tag) = check_tags(app, config['sdk_path'])

View File

@ -399,7 +399,7 @@ class vcs_hg(vcs):
if subprocess.call(['hg', 'clone', self.remote, self.local]) !=0: if subprocess.call(['hg', 'clone', self.remote, self.local]) !=0:
raise VCSException("Hg clone failed") raise VCSException("Hg clone failed")
else: else:
if subprocess.call('hg status -u | xargs rm -rf', if subprocess.call('hg status -uS | xargs rm -rf',
cwd=self.local, shell=True) != 0: cwd=self.local, shell=True) != 0:
raise VCSException("Hg clean failed") raise VCSException("Hg clean failed")
if not self.refreshed: if not self.refreshed:
@ -409,11 +409,11 @@ class vcs_hg(vcs):
self.refreshed = True self.refreshed = True
rev = str(rev if rev else 'default') rev = str(rev if rev else 'default')
if rev: if not rev:
revargs = [rev] return
if subprocess.call(['hg', 'checkout', '-C'] + revargs, if subprocess.call(['hg', 'update', '-C', rev],
cwd=self.local) != 0: cwd=self.local) != 0:
raise VCSException("Hg checkout failed") raise VCSException("Hg checkout failed")
def gettags(self): def gettags(self):
p = subprocess.Popen(['hg', 'tags', '-q'], p = subprocess.Popen(['hg', 'tags', '-q'],
@ -565,7 +565,7 @@ def parse_metadata(metafile):
# Defaults for fields that come from metadata... # Defaults for fields that come from metadata...
thisinfo['Name'] = None thisinfo['Name'] = None
thisinfo['Auto Name'] = '' thisinfo['Auto Name'] = ''
thisinfo['Category'] = 'None' thisinfo['Categories'] = 'None'
thisinfo['Description'] = [] thisinfo['Description'] = []
thisinfo['Summary'] = '' thisinfo['Summary'] = ''
thisinfo['License'] = 'Unknown' thisinfo['License'] = 'Unknown'
@ -655,6 +655,8 @@ def parse_metadata(metafile):
if len(value) > 0: if len(value) > 0:
raise MetaDataException("Unexpected text on same line as " + field + " in " + metafile.name) raise MetaDataException("Unexpected text on same line as " + field + " in " + metafile.name)
elif fieldtype == 'string': elif fieldtype == 'string':
if field == 'Category' and thisinfo['Categories'] == 'None':
thisinfo['Categories'] = value.replace(';',',')
thisinfo[field] = value thisinfo[field] = value
elif fieldtype == 'flag': elif fieldtype == 'flag':
if value == 'Yes': if value == 'Yes':
@ -775,7 +777,7 @@ def write_metadata(dest, app):
writefield('Disabled') writefield('Disabled')
if app['AntiFeatures']: if app['AntiFeatures']:
writefield('AntiFeatures') writefield('AntiFeatures')
writefield('Category') writefield('Categories')
writefield('License') writefield('License')
writefield('Web Site') writefield('Web Site')
writefield('Source Code') writefield('Source Code')
@ -1125,7 +1127,7 @@ def parse_androidmanifests(paths):
vnsearch = re.compile(r'.*android:versionName="([^"]+?)".*').search vnsearch = re.compile(r'.*android:versionName="([^"]+?)".*').search
psearch = re.compile(r'.*package="([^"]+)".*').search psearch = re.compile(r'.*package="([^"]+)".*').search
vcsearch_g = re.compile(r'.*versionCode[ =]*([0-9]+?).*').search vcsearch_g = re.compile(r'.*versionCode[ =]*([0-9]+?)[^\d].*').search
vnsearch_g = re.compile(r'.*versionName[ =]*"([^"]+?)".*').search vnsearch_g = re.compile(r'.*versionName[ =]*"([^"]+?)".*').search
psearch_g = re.compile(r'.*packageName[ =]*"([^"]+)".*').search psearch_g = re.compile(r'.*packageName[ =]*"([^"]+)".*').search

View File

@ -183,9 +183,9 @@ def main():
ctgs = {} ctgs = {}
for app in metaapps: for app in metaapps:
if app['Category'] is None: if app['Categories'] is None:
continue continue
categories = [c.strip() for c in app['Category'].split(';')] categories = [c.strip() for c in app['Categories'].split(',')]
for category in categories: for category in categories:
if category in ctgs: if category in ctgs:
ctgs[category] += 1; ctgs[category] += 1;

View File

@ -526,14 +526,13 @@ def make_index(apps, apks, repodir, archive, categories):
addElement('desc', addElement('desc',
common.description_html(app['Description'], linkres), doc, apel) common.description_html(app['Description'], linkres), doc, apel)
addElement('license', app['License'], doc, apel) addElement('license', app['License'], doc, apel)
if 'Category' in app: if 'Categories' in app:
appcategories = [c.strip() for c in app['Categories'].split(',')]
addElement('categories', ','.join(appcategories), doc, apel)
# We put the first (primary) category in LAST, which will have # We put the first (primary) category in LAST, which will have
# the desired effect of making clients that only understand one # the desired effect of making clients that only understand one
# category see that one. # category see that one.
cats = app['Category'].split(';') addElement('category', appcategories[0], doc, apel)
cats.reverse()
for cat in cats:
addElement('category', cat, doc, apel)
addElement('web', app['Web Site'], doc, apel) addElement('web', app['Web Site'], doc, apel)
addElement('source', app['Source Code'], doc, apel) addElement('source', app['Source Code'], doc, apel)
addElement('tracker', app['Issue Tracker'], doc, apel) addElement('tracker', app['Issue Tracker'], doc, apel)
@ -731,7 +730,7 @@ def main():
# Generate a list of categories... # Generate a list of categories...
categories = [] categories = []
for app in apps: for app in apps:
cats = app['Category'].split(';') cats = app['Categories'].split(',')
for cat in cats: for cat in cats:
if cat not in categories: if cat not in categories:
categories.append(cat) categories.append(cat)