mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-20 13:50:12 +01:00
standardize on .yml as the file extension for YAML
Though the YAML people recommend .yaml for the file extension, in Android land it seems clear that .yml has won out: * .travis.yml * .gitlab-ci.yml * .circle.yml * Ansible main.yml
This commit is contained in:
parent
19189b9b04
commit
9cd6b444f8
@ -63,7 +63,7 @@ default_config = {
|
||||
'ant': "ant",
|
||||
'mvn3': "mvn",
|
||||
'gradle': 'gradle',
|
||||
'accepted_formats': ['txt', 'yaml'],
|
||||
'accepted_formats': ['txt', 'yml'],
|
||||
'sync_from_local_copy_dir': False,
|
||||
'per_app_repos': False,
|
||||
'make_current_version_link': True,
|
||||
|
@ -261,7 +261,7 @@ def main():
|
||||
app.builds.append(build)
|
||||
|
||||
if write_local_file:
|
||||
metadata.write_metadata('.fdroid.yaml', app)
|
||||
metadata.write_metadata('.fdroid.yml', app)
|
||||
else:
|
||||
# Keep the repo directory to save bandwidth...
|
||||
if not os.path.exists('build'):
|
||||
|
@ -779,10 +779,10 @@ def read_metadata(xref=True):
|
||||
for metadatapath in sorted(glob.glob(os.path.join('metadata', '*.txt'))
|
||||
+ glob.glob(os.path.join('metadata', '*.json'))
|
||||
+ glob.glob(os.path.join('metadata', '*.xml'))
|
||||
+ glob.glob(os.path.join('metadata', '*.yaml'))
|
||||
+ glob.glob(os.path.join('metadata', '*.yml'))
|
||||
+ glob.glob('.fdroid.json')
|
||||
+ glob.glob('.fdroid.xml')
|
||||
+ glob.glob('.fdroid.yaml')):
|
||||
+ glob.glob('.fdroid.yml')):
|
||||
app = parse_metadata(metadatapath)
|
||||
if app.id in apps:
|
||||
raise MetaDataException("Found multiple metadata files for " + app.id)
|
||||
@ -950,7 +950,7 @@ def parse_metadata(metadatapath):
|
||||
parse_json_metadata(mf, app)
|
||||
elif ext == 'xml':
|
||||
parse_xml_metadata(mf, app)
|
||||
elif ext == 'yaml':
|
||||
elif ext == 'yml':
|
||||
parse_yaml_metadata(mf, app)
|
||||
else:
|
||||
raise MetaDataException('Unknown metadata format: %s' % metadatapath)
|
||||
@ -1387,6 +1387,6 @@ def write_metadata(metadatapath, app):
|
||||
with open(metadatapath, 'w') as mf:
|
||||
if ext == 'txt':
|
||||
return write_txt(mf, app)
|
||||
elif ext == 'yaml':
|
||||
elif ext == 'yml':
|
||||
return write_yaml(mf, app)
|
||||
raise MetaDataException('Unknown metadata format: %s' % metadatapath)
|
||||
|
@ -64,7 +64,7 @@ def main():
|
||||
if options.list and options.to is not None:
|
||||
parser.error("Cannot use --list and --to at the same time")
|
||||
|
||||
supported = ['txt', 'yaml']
|
||||
supported = ['txt', 'yml']
|
||||
|
||||
if options.to is not None and options.to not in supported:
|
||||
parser.error("Must give a valid format to --to")
|
||||
|
@ -33,7 +33,7 @@ class MetadataTest(unittest.TestCase):
|
||||
config = dict()
|
||||
config['sdk_path'] = '/opt/android-sdk'
|
||||
config['ndk_paths'] = dict()
|
||||
config['accepted_formats'] = ['json', 'txt', 'xml', 'yaml']
|
||||
config['accepted_formats'] = ['json', 'txt', 'xml', 'yml']
|
||||
fdroidserver.common.config = config
|
||||
|
||||
apps = fdroidserver.metadata.read_metadata(xref=True)
|
||||
|
@ -4618,7 +4618,7 @@ sasS'FlattrID'
|
||||
p1324
|
||||
NsS'metadatapath'
|
||||
p1325
|
||||
S'metadata/org.videolan.vlc.yaml'
|
||||
S'metadata/org.videolan.vlc.yml'
|
||||
p1326
|
||||
sS'Disabled'
|
||||
p1327
|
||||
|
@ -163,7 +163,7 @@ cp $WORKSPACE/tests/metadata/org.smssecure.smssecure.txt $REPOROOT/metadata/
|
||||
$fdroid readmeta
|
||||
|
||||
# now make a fake duplicate
|
||||
touch $REPOROOT/metadata/org.smssecure.smssecure.yaml
|
||||
touch $REPOROOT/metadata/org.smssecure.smssecure.yml
|
||||
|
||||
set +e
|
||||
$fdroid readmeta
|
||||
|
Loading…
Reference in New Issue
Block a user