add Liberapay: field with username as data

Liberapay was originally included using a numeric ID, since they had
not yet finalized the public URLs.  Now it is a username.  So this
logic prefers the username in Liberapay: field, and keeps the old
LiberapayID: to ease migration.  LiberapayID: will not override
Liberapay:.  Clients are expected to prefer Liberapay: over LiberapayID:

# Conflicts:
#	fdroidserver/update.py
#	tests/metadata/info.guardianproject.checkey.yml
#	tests/metadata/obb.main.oldversion.yml
#	tests/metadata/org.adaway.yml
#	tests/update.TestCase
This commit is contained in:
Hans-Christoph Steiner 2020-06-16 14:39:46 +02:00
parent 0ff3c561c0
commit 6bbf0a1722
11 changed files with 25 additions and 4 deletions

View File

@ -33,7 +33,7 @@ metadata_v0:
- echo "accepted_formats = ('txt', 'yml')" >> config.py
- ../tests/dump_internal_metadata_format.py
- sed -i
-e '/kivy:\sfalse/d'
-e '/Liberapay:/d'
-e '/OpenCollective/d'
metadata/dump_*/*.yaml
- diff -uw metadata/dump_*

View File

@ -139,9 +139,11 @@ regex_checks = {
],
'Donate': http_checks + [
(re.compile(r'.*flattr\.com'),
_("Flattr donation methods belong in the FlattrID flag")),
_("Flattr donation methods belong in the FlattrID: field")),
(re.compile(r'.*liberapay\.com'),
_("Liberapay donation methods belong in the LiberapayID flag")),
_("Liberapay donation methods belong in the Liberapay: field")),
(re.compile(r'.*opencollective\.com'),
_("OpenCollective donation methods belong in the OpenCollective: field")),
],
'Changelog': http_checks,
'Author Name': [

View File

@ -36,6 +36,10 @@ from fdroidserver.exception import MetaDataException, FDroidException
srclibs = None
warnings_action = None
# validates usernames based on a loose collection of rules from GitHub, GitLab,
# Liberapay and issuehunt. This is mostly to block abuse.
VALID_USERNAME_REGEX = re.compile(r'^[a-z\d](?:[a-z\d/._-]){0,38}$', re.IGNORECASE)
def warn_or_exception(value):
'''output warning or Exception depending on -W'''
@ -65,6 +69,7 @@ app_fields = set([
'Changelog',
'Donate',
'FlattrID',
'Liberapay',
'LiberapayID',
'OpenCollective',
'Bitcoin',
@ -110,6 +115,7 @@ yaml_app_field_order = [
'Changelog',
'Donate',
'FlattrID',
'Liberapay',
'LiberapayID',
'OpenCollective',
'Bitcoin',
@ -170,6 +176,7 @@ class App(dict):
self.Changelog = ''
self.Donate = None
self.FlattrID = None
self.Liberapay = None
self.LiberapayID = None
self.OpenCollective = None
self.Bitcoin = None
@ -443,6 +450,10 @@ valuetypes = {
r'^[0-9a-z]+$',
['FlattrID']),
FieldValidator("Liberapay",
VALID_USERNAME_REGEX,
['Liberapay']),
FieldValidator("Liberapay ID",
r'^[0-9]+$',
['LiberapayID']),

View File

@ -17,6 +17,7 @@ Disabled: null
Donate: null
FlattrID: null
IssueTracker: https://github.com/miguelvps/PoliteDroid/issues
Liberapay: null
LiberapayID: null
License: GPL-3.0-only
Litecoin: null

View File

@ -40,7 +40,8 @@ Disabled: null
Donate: http://sufficientlysecure.org/index.php/adaway
FlattrID: '369138'
IssueTracker: https://github.com/dschuermann/ad-away/issues
LiberapayID: null
Liberapay: null
LiberapayID: '1234567890'
License: GPL-3.0-only
Litecoin: null
MaintainerNotes: ''

View File

@ -37,6 +37,7 @@ Disabled: null
Donate: null
FlattrID: null
IssueTracker: https://github.com/SMSSecure/SMSSecure/issues
Liberapay: null
LiberapayID: null
License: GPL-3.0-only
Litecoin: null

View File

@ -24,6 +24,7 @@ Disabled: null
Donate: http://www.videolan.org/contribute.html#money
FlattrID: null
IssueTracker: http://www.videolan.org/support/index.html#bugs
Liberapay: null
LiberapayID: null
License: GPL-3.0-only
Litecoin: null

View File

@ -5,6 +5,7 @@ Source Code:https://github.com/guardianproject/checkey
Issue Tracker:https://dev.guardianproject.info/projects/checkey/issues
Translation:https://www.transifex.com/otf/checkey
Bitcoin:1Fi5xUHiAPRKxHvyUGVFGt9extBe8Srdbk
Liberapay:GuardianProject
Auto Name:Checkey

View File

@ -2,6 +2,7 @@ Categories:Development
License:GPL-3.0-only
Source Code:https://github.com/eighthave/urzip
Bitcoin:1Fi5xUHiAPRKxHvyUGVFGt9extBe8Srdbk
Liberapay:12334
Auto Name:OBB Main Old Version

View File

@ -22,6 +22,7 @@
"Donate": "http://sufficientlysecure.org/index.php/adaway",
"FlattrID": "369138",
"IssueTracker": "https://github.com/dschuermann/ad-away/issues",
"LiberapayID": "1234567890",
"License": "GPL-3.0-only",
"Provides": "org.sufficientlysecure.adaway",
"Repo": "https://github.com/dschuermann/ad-away.git",

View File

@ -104,6 +104,7 @@
"Development"
],
"suggestedVersionCode": "99999999",
"liberapay": "12334",
"license": "GPL-3.0-only",
"name": "OBB Main Old Version",
"sourceCode": "https://github.com/eighthave/urzip",