From 40503680c1fd7a39bb7c50b2d289253516e7a3f3 Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Wed, 4 Aug 2010 15:14:37 +0200 Subject: [PATCH] tweak output about used keys --- osc/build.py | 2 +- osc/fetch.py | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/osc/build.py b/osc/build.py index 0d2b3b3b..95d52805 100644 --- a/osc/build.py +++ b/osc/build.py @@ -749,7 +749,7 @@ def main(apiurl, opts, argv): print 'Skipping verification of package signatures' else: print 'Verifying integrity of cached packages' - verify_pacs([ i.fullfilename for i in bi.deps ], bi.keys) + verify_pacs(bi) elif bi.pacsuffix == 'deb': if vm_type == "xen" or vm_type == "kvm" or vm_type == "lxc": diff --git a/osc/fetch.py b/osc/fetch.py index 7b3bf26a..6ecc63fd 100644 --- a/osc/fetch.py +++ b/osc/fetch.py @@ -230,8 +230,6 @@ class Fetcher: if self.http_debug: print "can't fetch key for %s: %s" %(i, e.strerror) print "url: %s" % url - else: - print "%s doesn't have a gpg key" % i if os.path.exists(dest): os.unlink(dest) @@ -308,30 +306,29 @@ def verify_pacs_old(pac_list): sys.exit(1) -def verify_pacs(pac_list, key_list): +def verify_pacs(bi): """Take a list of rpm filenames and verify their signatures. In case of failure, exit. """ + pac_list = [ i.fullfilename for i in bi.deps ] if not conf.config.get('builtin_signature_check', True): return verify_pacs_old(pac_list) if not pac_list: return - if not key_list: - print "no keys" - sys.exit(1) - return + if not bi.keys: + raise oscerr.APIError("can't verify packages due to lack of GPG keys") - print key_list + print "using keys from", ', '.join(bi.prjkeys) import checker failed = False checker = checker.Checker() try: - checker.readkeys(key_list) + checker.readkeys(bi.keys) for pkg in pac_list: try: checker.check(pkg)