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

View File

@ -119,7 +119,8 @@ def check_tags(app, sdk_path):
paths = common.manifest_paths(build_dir, flavour)
version, vercode, package = common.parse_androidmanifests(paths)
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):
htag = tag
hcode = str(int(vercode))
@ -336,6 +337,7 @@ def main():
tag = None
msg = None
vercode = None
mode = app['Update Check Mode']
if mode == 'Tags':
(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:
raise VCSException("Hg clone failed")
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:
raise VCSException("Hg clean failed")
if not self.refreshed:
@ -409,11 +409,11 @@ class vcs_hg(vcs):
self.refreshed = True
rev = str(rev if rev else 'default')
if rev:
revargs = [rev]
if subprocess.call(['hg', 'checkout', '-C'] + revargs,
cwd=self.local) != 0:
raise VCSException("Hg checkout failed")
if not rev:
return
if subprocess.call(['hg', 'update', '-C', rev],
cwd=self.local) != 0:
raise VCSException("Hg checkout failed")
def gettags(self):
p = subprocess.Popen(['hg', 'tags', '-q'],
@ -565,7 +565,7 @@ def parse_metadata(metafile):
# Defaults for fields that come from metadata...
thisinfo['Name'] = None
thisinfo['Auto Name'] = ''
thisinfo['Category'] = 'None'
thisinfo['Categories'] = 'None'
thisinfo['Description'] = []
thisinfo['Summary'] = ''
thisinfo['License'] = 'Unknown'
@ -655,6 +655,8 @@ def parse_metadata(metafile):
if len(value) > 0:
raise MetaDataException("Unexpected text on same line as " + field + " in " + metafile.name)
elif fieldtype == 'string':
if field == 'Category' and thisinfo['Categories'] == 'None':
thisinfo['Categories'] = value.replace(';',',')
thisinfo[field] = value
elif fieldtype == 'flag':
if value == 'Yes':
@ -775,7 +777,7 @@ def write_metadata(dest, app):
writefield('Disabled')
if app['AntiFeatures']:
writefield('AntiFeatures')
writefield('Category')
writefield('Categories')
writefield('License')
writefield('Web Site')
writefield('Source Code')
@ -1125,7 +1127,7 @@ def parse_androidmanifests(paths):
vnsearch = re.compile(r'.*android:versionName="([^"]+?)".*').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
psearch_g = re.compile(r'.*packageName[ =]*"([^"]+)".*').search

View File

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

View File

@ -526,14 +526,13 @@ def make_index(apps, apks, repodir, archive, categories):
addElement('desc',
common.description_html(app['Description'], linkres), 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
# the desired effect of making clients that only understand one
# category see that one.
cats = app['Category'].split(';')
cats.reverse()
for cat in cats:
addElement('category', cat, doc, apel)
addElement('category', appcategories[0], doc, apel)
addElement('web', app['Web Site'], doc, apel)
addElement('source', app['Source Code'], doc, apel)
addElement('tracker', app['Issue Tracker'], doc, apel)
@ -731,7 +730,7 @@ def main():
# Generate a list of categories...
categories = []
for app in apps:
cats = app['Category'].split(';')
cats = app['Categories'].split(',')
for cat in cats:
if cat not in categories:
categories.append(cat)