1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-09 00:40:11 +01:00

Merge branch '290-make-rewrite-metadata-respect-key-word-sort-order' into 'master'

Resolve "make `fdroid rewritemeta` respect key-word sort order for YAML files"

Closes #290

See merge request !295
This commit is contained in:
Hans-Christoph Steiner 2017-07-04 12:24:17 +00:00
commit 2508393884
5 changed files with 5 additions and 5 deletions

View File

@ -837,7 +837,7 @@ def post_metadata_parse(app):
elif v == [False]: elif v == [False]:
return ['no'] return ['no']
_bool_allowed = ('disable', 'kivy', 'maven') _bool_allowed = ('disable', 'kivy', 'maven', 'buildozer')
builds = [] builds = []
if 'builds' in app: if 'builds' in app:
@ -1063,7 +1063,7 @@ def write_yaml(mf, app):
value = getattr(build, field) value = getattr(build, field)
if field == 'gradle' and value == ['off']: if field == 'gradle' and value == ['off']:
value = [ruamel.yaml.scalarstring.SingleQuotedScalarString('off')] value = [ruamel.yaml.scalarstring.SingleQuotedScalarString('off')]
if field in ('disable', 'kivy', 'maven'): if field in ('disable', 'kivy', 'maven', 'buildozer'):
if value == 'no': if value == 'no':
continue continue
elif value == 'yes': elif value == 'yes':

View File

@ -72,7 +72,7 @@ class MetadataTest(unittest.TestCase):
# assert rewrite result # assert rewrite result
with open(os.path.join(testdir, 'fake.ota.update.yml'), 'r', encoding='utf-8') as result: with open(os.path.join(testdir, 'fake.ota.update.yml'), 'r', encoding='utf-8') as result:
with open('metadata/rewrite-yml/fake.ota.update.yml', 'r', encoding='utf-8') as orig: with open('metadata-rewrite-yml/fake.ota.update.yml', 'r', encoding='utf-8') as orig:
self.maxDiff = None self.maxDiff = None
self.assertEqual(result.read(), orig.read()) self.assertEqual(result.read(), orig.read())
@ -93,7 +93,7 @@ class MetadataTest(unittest.TestCase):
# assert rewrite result # assert rewrite result
with open(os.path.join(testdir, 'org.fdroid.fdroid.yml'), 'r', encoding='utf-8') as result: with open(os.path.join(testdir, 'org.fdroid.fdroid.yml'), 'r', encoding='utf-8') as result:
with open('metadata/rewrite-yml/org.fdroid.fdroid.yml', 'r', encoding='utf-8') as orig: with open('metadata-rewrite-yml/org.fdroid.fdroid.yml', 'r', encoding='utf-8') as orig:
self.maxDiff = None self.maxDiff = None
self.assertEqual(result.read(), orig.read()) self.assertEqual(result.read(), orig.read())
@ -114,7 +114,7 @@ class MetadataTest(unittest.TestCase):
# assert rewrite result # assert rewrite result
with open(os.path.join(testdir, 'app.with.special.build.params.yml'), 'r', encoding='utf-8') as result: with open(os.path.join(testdir, 'app.with.special.build.params.yml'), 'r', encoding='utf-8') as result:
with open('metadata/rewrite-yml/app.with.special.build.params.yml', 'r', encoding='utf-8') as orig: with open('metadata-rewrite-yml/app.with.special.build.params.yml', 'r', encoding='utf-8') as orig:
self.maxDiff = None self.maxDiff = None
self.assertEqual(result.read(), orig.read()) self.assertEqual(result.read(), orig.read())