chiark / gitweb /
standardize on .yml as the file extension for YAML
authorHans-Christoph Steiner <hans@eds.org>
Mon, 21 Mar 2016 20:51:23 +0000 (21:51 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Wed, 23 Mar 2016 16:16:28 +0000 (17:16 +0100)
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

fdroidserver/common.py
fdroidserver/import.py
fdroidserver/metadata.py
fdroidserver/rewritemeta.py
tests/metadata.TestCase
tests/metadata/org.videolan.vlc.pickle
tests/metadata/org.videolan.vlc.yml [moved from tests/metadata/org.videolan.vlc.yaml with 100% similarity]
tests/run-tests

index 72af49d8035a979114a57cbcaa55ce5fc77f707e..acaeaffda6b2832aee4f79adfc0883af80ef9a72 100644 (file)
@@ -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,
index 4d342f044c2be815f2ccce115f3134f9d2758d64..8c7f5107a5faa9fef7e763b976d5b347207b99a5 100644 (file)
@@ -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'):
index 722e1710a29bed277360dc804fd96e70207b3eef..71da84535cbceb29c1e16359053e8a01e8a000cf 100644 (file)
@@ -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)
index 75888a23b28bf84f199963993cd6931aed4bf82b..8335ed9c17e2f5f27493412456f9941017e3afb9 100644 (file)
@@ -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")
index 9dfe2bbcdf1adf94180959cde2ebe21b0bc7b6f6..c287a212723db8723326ceb51490f0072d64d844 100755 (executable)
@@ -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)
index 45af8916c9d89828d789db317ee8aa0a1790f5dd..a1810e600d7f2c48e0c21a5ba2a8bda56294d535 100644 (file)
@@ -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
index 8ec03c353c106f163b172773e664b519d07d52b9..62d27aa757aea20f1714803927c6c9dfaa28be1c 100755 (executable)
@@ -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