1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-19 21:30:10 +01:00
This commit is contained in:
Daniel Martí 2015-06-03 15:52:01 +02:00
commit 4b59f913f1
6 changed files with 39 additions and 2 deletions

View File

@ -470,6 +470,7 @@ The following sections describe the fields recognised within the file.
* Web Site:: * Web Site::
* Source Code:: * Source Code::
* Issue Tracker:: * Issue Tracker::
* Changelog::
* Donate:: * Donate::
* FlattrID:: * FlattrID::
* Bitcoin:: * Bitcoin::
@ -634,6 +635,16 @@ applications have one.
This is converted to (@code{<tracker>}) in the public index file. This is converted to (@code{<tracker>}) 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{<changelog>}) in the public index file.
@node Donate @node Donate
@section Donate @section Donate

View File

@ -128,6 +128,7 @@ def main():
# Figure out what kind of project it is... # Figure out what kind of project it is...
projecttype = None projecttype = None
issuetracker = None issuetracker = None
changelog = None
license = None license = None
website = url # by default, we might override it website = url # by default, we might override it
if url.startswith('git://'): if url.startswith('git://'):
@ -143,6 +144,7 @@ def main():
sourcecode = url sourcecode = url
issuetracker = url + '/issues' issuetracker = url + '/issues'
website = "" website = ""
changelog = url + '/commits'
elif url.startswith('https://gitlab.com/'): elif url.startswith('https://gitlab.com/'):
projecttype = 'gitlab' projecttype = 'gitlab'
repo = url repo = url
@ -286,6 +288,8 @@ def main():
app['Source Code'] = sourcecode app['Source Code'] = sourcecode
if issuetracker: if issuetracker:
app['Issue Tracker'] = issuetracker app['Issue Tracker'] = issuetracker
if changelog:
app['Changelog'] = changelog
if license: if license:
app['License'] = license app['License'] = license
app['Repo Type'] = repotype app['Repo Type'] = repotype

View File

@ -74,6 +74,14 @@ regex_warnings = {
# (re.compile(r'.*://code\.google\.com/.*'), # (re.compile(r'.*://code\.google\.com/.*'),
# "code.google.com will be soon switching down, perhaps it moved to github.com?"), # "code.google.com will be soon switching down, perhaps it moved to github.com?"),
], ],
'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': [ 'License': [
(re.compile(r'^(|None|Unknown)$'), (re.compile(r'^(|None|Unknown)$'),
"No license specified"), "No license specified"),
@ -117,6 +125,10 @@ regex_pedantic = {
(re.compile(r'.*github\.com/[^/]+/[^/]+/issues/.*'), (re.compile(r'.*github\.com/[^/]+/[^/]+/issues/.*'),
"/issues is often enough on its own"), "/issues is often enough on its own"),
], ],
'Changelog': [
(re.compile(r'.*commit.*', re.IGNORECASE),
"Not every commit log is suitable as change log"),
],
'Summary': [ 'Summary': [
(re.compile(r'.*[a-z0-9][.!?][ $]'), (re.compile(r'.*[a-z0-9][.!?][ $]'),
"Punctuation should be avoided"), "Punctuation should be avoided"),

View File

@ -48,6 +48,7 @@ app_defaults = OrderedDict([
('Web Site', ''), ('Web Site', ''),
('Source Code', ''), ('Source Code', ''),
('Issue Tracker', ''), ('Issue Tracker', ''),
('Changelog', ''),
('Donate', None), ('Donate', None),
('FlattrID', None), ('FlattrID', None),
('Bitcoin', None), ('Bitcoin', None),
@ -169,7 +170,7 @@ valuetypes = {
FieldValidator("HTTP link", FieldValidator("HTTP link",
r'^http[s]?://', None, r'^http[s]?://', None,
["Web Site", "Source Code", "Issue Tracker", "Donate"], []), ["Web Site", "Source Code", "Issue Tracker", "Changelog", "Donate"], []),
FieldValidator("Bitcoin address", FieldValidator("Bitcoin address",
r'^[a-zA-Z0-9]{27,34}$', None, r'^[a-zA-Z0-9]{27,34}$', None,
@ -830,6 +831,7 @@ def write_metadata(dest, app):
writefield('Web Site') writefield('Web Site')
writefield('Source Code') writefield('Source Code')
writefield('Issue Tracker') writefield('Issue Tracker')
writefield('Changelog')
writefield_nonempty('Donate') writefield_nonempty('Donate')
writefield_nonempty('FlattrID') writefield_nonempty('FlattrID')
writefield_nonempty('Bitcoin') writefield_nonempty('Bitcoin')

View File

@ -94,7 +94,7 @@ def update_wiki(apps, sortedids, apks):
if app['AntiFeatures']: if app['AntiFeatures']:
for af in app['AntiFeatures'].split(','): for af in app['AntiFeatures'].split(','):
wikidata += '{{AntiFeature|' + af + '}}\n' 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, appid,
app['Name'], app['Name'],
time.strftime('%Y-%m-%d', app['added']) if 'added' in app else '', time.strftime('%Y-%m-%d', app['added']) if 'added' in app else '',
@ -102,6 +102,7 @@ def update_wiki(apps, sortedids, apks):
app['Source Code'], app['Source Code'],
app['Issue Tracker'], app['Issue Tracker'],
app['Web Site'], app['Web Site'],
app['Changelog'],
app['Donate'], app['Donate'],
app['FlattrID'], app['FlattrID'],
app['Bitcoin'], app['Bitcoin'],
@ -814,6 +815,7 @@ def make_index(apps, sortedids, apks, repodir, archive, categories):
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)
addElement('changelog', app['Changelog'], doc, apel)
if app['Donate']: if app['Donate']:
addElement('donate', app['Donate'], doc, apel) addElement('donate', app['Donate'], doc, apel)
if app['Bitcoin']: if app['Bitcoin']:
@ -1133,6 +1135,7 @@ def main():
f.write("Web Site:\n") f.write("Web Site:\n")
f.write("Source Code:\n") f.write("Source Code:\n")
f.write("Issue Tracker:\n") f.write("Issue Tracker:\n")
f.write("Changelog:\n")
f.write("Summary:" + apk['name'] + "\n") f.write("Summary:" + apk['name'] + "\n")
f.write("Description:\n") f.write("Description:\n")
f.write(apk['name'] + "\n") f.write(apk['name'] + "\n")

View File

@ -285,6 +285,9 @@ class FDroid
case "tracker": case "tracker":
$issues=$el; $issues=$el;
break; break;
case "changelog":
$changelog=$el;
break;
case "donate": case "donate":
$donate=$el; $donate=$el;
break; break;
@ -399,6 +402,8 @@ class FDroid
$out.='<b>Issue Tracker:</b> <a href="'.$issues.'">'.$issues.'</a><br />'; $out.='<b>Issue Tracker:</b> <a href="'.$issues.'">'.$issues.'</a><br />';
if(strlen($source)>0) if(strlen($source)>0)
$out.='<b>Source Code:</b> <a href="'.$source.'">'.$source.'</a><br />'; $out.='<b>Source Code:</b> <a href="'.$source.'">'.$source.'</a><br />';
if(strlen($changelog)>0)
$out.='<b>Changelog:</b> <a href="'.$changelog.'">'.$changelog.'</a><br />';
if(isset($donate) && strlen($donate)>0) if(isset($donate) && strlen($donate)>0)
$out.='<b>Donate:</b> <a href="'.$donate.'">'.$donate.'</a><br />'; $out.='<b>Donate:</b> <a href="'.$donate.'">'.$donate.'</a><br />';
if(isset($flattr) && strlen($flattr)>0) if(isset($flattr) && strlen($flattr)>0)