diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2019-09-09 22:31:46 +0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2019-09-09 22:31:46 +0200 |
commit | 0903137f1b3841c0468ac602d3b344357bdccecb (patch) | |
tree | 744bf693dee2ffbfca4ef0fbdc4ecd2bb2b762a1 | |
parent | a576156e5bf9de147efe2c76af1ee29f5efd773e (diff) | |
download | blogc-0903137f1b3841c0468ac602d3b344357bdccecb.tar.gz blogc-0903137f1b3841c0468ac602d3b344357bdccecb.tar.bz2 blogc-0903137f1b3841c0468ac602d3b344357bdccecb.zip |
maint: use python3, sign distfiles
-rwxr-xr-x | maint/download_release.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/maint/download_release.py b/maint/download_release.py index 3046406..f3e2866 100755 --- a/maint/download_release.py +++ b/maint/download_release.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # coding: utf-8 import os @@ -12,6 +12,7 @@ re_version = re.compile(r'blogc-([^\'"]+)\.tar\.gz') re_distfile = re.compile(r'(blogc[^\'"]+)\.sha512') base_url = 'https://distfiles.rgm.io/blogc' cwd = os.path.dirname(os.path.abspath(__file__)) +gpg_key = '0xE00C52C92FEBED9B' def download_release(version): @@ -19,7 +20,7 @@ def download_release(version): release_url = '%s/LATEST' % (base_url,) r = requests.get(release_url) r.raise_for_status() - match = re_version.search(r.content) + match = re_version.search(r.text) if match is None: raise RuntimeError('Could not guess version') version = match.group(1) @@ -33,12 +34,15 @@ def download_release(version): shutil.rmtree(dest_path) os.makedirs(dest_path) - for distfile in set(re_distfile.findall(r.content)): + for distfile in set(re_distfile.findall(r.text)): file_url = '%s/%s' % (release_url, distfile) subprocess.check_call(['wget', '-P', dest_path, file_url, '%s.sha512' % file_url]) subprocess.check_call(['sha512sum', '-c', '%s.sha512' % distfile], cwd=dest_path) + subprocess.check_call(['gpg', '--local-user', gpg_key, '--detach-sign', + '--armor', distfile], + cwd=dest_path) if __name__ == '__main__': |