From 4afe5aefd5c7efc427ee37a78f8618959d4330c3 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 6 Dec 2017 22:32:24 +0100 Subject: [PATCH] nightly: create app metadata using template of parsed data --- fdroidserver/nightly.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fdroidserver/nightly.py b/fdroidserver/nightly.py index 50c859f4..75c05645 100644 --- a/fdroidserver/nightly.py +++ b/fdroidserver/nightly.py @@ -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 + '/')