From: Michael Tremer Date: Sat, 14 Apr 2012 10:57:04 +0000 (+0200) Subject: Use the host key properly in build mode. X-Git-Tag: 0.9.22~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a8efa0fc79c9ad5a78fb6cc20c3b309d8393d05e;p=pakfire.git Use the host key properly in build mode. --- diff --git a/python/pakfire/builder.py b/python/pakfire/builder.py index edc4dee68..5a0ea0a29 100644 --- a/python/pakfire/builder.py +++ b/python/pakfire/builder.py @@ -203,10 +203,15 @@ class BuildEnviron(object): "enable_loop_devices" : True, "enable_ccache" : True, "enable_icecream" : False, - "sign_packages" : True, + "sign_packages" : False, } #self.settings.update(settings) + # Try to get the configured host key. If it is available, + # we will automatically sign all packages with it. + if self.keyring.get_host_key(secret=True): + self.settings["sign_packages"] = True + # Lock the buildroot self._lock = None self.lock() @@ -739,7 +744,7 @@ class BuildEnviron(object): # Sign all built packages with the host key (if available). if self.settings.get("sign_packages"): - host_key = self.keyring.get_host_key() + host_key = self.keyring.get_host_key_id() assert host_key # Do the signing... diff --git a/python/pakfire/keyring.py b/python/pakfire/keyring.py index f7242e77d..8fe052e9b 100644 --- a/python/pakfire/keyring.py +++ b/python/pakfire/keyring.py @@ -212,6 +212,8 @@ class Keyring(object): def sign(self, keyid, cleartext): key = self.ctx.get_key(keyid, True) + assert key, "Key was not found or no secret key installed." + self.ctx.signers = [key,] cleartext = io.BytesIO(cleartext)