chiark / gitweb /
nightly: create app metadata using template of parsed data
authorHans-Christoph Steiner <hans@eds.org>
Wed, 6 Dec 2017 21:32:24 +0000 (22:32 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Thu, 7 Dec 2017 21:39:32 +0000 (22:39 +0100)
fdroidserver/nightly.py

index 50c859f4fe9758a4ee18fa8659818cbe195520c4..75c05645e31741cba3831713fab0d327bbea9d89 100644 (file)
@@ -28,6 +28,7 @@ import shutil
 import subprocess
 import sys
 import tempfile
+import yaml
 from urllib.parse import urlparse
 from argparse import ArgumentParser
 
@@ -264,6 +265,18 @@ Last updated: {date}'''.format(repo_git_base=repo_git_base,
             except subprocess.CalledProcessError:
                 pass
 
+        app_url = clone_url[:-len(NIGHTLY)]
+        template = dict()
+        template['AuthorName'] = clone_url.split('/')[4]
+        template['AuthorWebSite'] = '/'.join(clone_url.split('/')[:4])
+        template['Categories'] = ['nightly']
+        template['SourceCode'] = app_url
+        template['IssueTracker'] = app_url + '/issues'
+        template['Summary'] = 'Nightly build of ' + urlparse(app_url).path[1:]
+        template['Description'] = template['Summary']
+        with open('template.yml', 'w') as fp:
+            yaml.dump(template, fp)
+
         subprocess.check_call(['fdroid', 'update', '--rename-apks', '--create-metadata', '--verbose'],
                               cwd=repo_basedir)
         common.local_rsync(options, repo_basedir + '/metadata/', git_mirror_metadatadir + '/')