amprolla

devuan's apt repo merger
git clone git://parazyd.org/amprolla.git
Log | Files | Refs | README | LICENSE

commit 740333927d14cfef6d09e196b2b74c1d60faa146
parent 28a1381c596bc63d5aac5fcfe9ce27b3e69df242
Author: parazyd <parazyd@dyne.org>
Date:   Tue,  6 Jun 2017 22:47:31 +0200

optional gpg signing of release file (defaults to True)

Diffstat:
Mlib/release.py | 15++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/lib/release.py b/lib/release.py @@ -12,9 +12,10 @@ from lib.config import release_keys, checksums, signingkey from lib.parse import parse_release_head -def write_release(oldrel, newrel, filelist, r): +def write_release(oldrel, newrel, filelist, r, sign=True): """ Generates a valid Release file + if sign=False: do not use gnupg to sign the file Arguments taken: oldrel, newrel, filelist, r * location of the old Release file (used to take metadata) @@ -50,7 +51,8 @@ def write_release(oldrel, newrel, filelist, r): new.close() - sign_release(newrel) + if sign: + sign_release(newrel) def sign_release(infile): @@ -62,10 +64,9 @@ def sign_release(infile): stream = open(infile, 'rb') # Clearsign - signed_data = gpg.sign_file(stream, keyid=signingkey, clearsign=True, - detach=False, - output=infile.replace('Release', 'InRelease')) + gpg.sign_file(stream, keyid=signingkey, clearsign=True, detach=False, + output=infile.replace('Release', 'InRelease')) # Detached signature (somewhat broken?) - # signed_data = gpg.sign_file(stream, keyid=signingkey, clearsign=False, - # detach=True, output=infile + '.gpg') + # gpg.sign_file(stream, keyid=signingkey, clearsign=False, detach=True, + # output=infile + '.gpg')