1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-26 01:46:13 +01:00

ignore gpg key import errors

Some projects use the same gpg key. To avoid osc from quitting when
building against two or more such projects at the same time ignore
gpg key import errors as long as at least one key could be imported.
This commit is contained in:
Ludwig Nussel 2010-08-17 15:13:36 +02:00
parent be425d3261
commit 3d610e6e0b
2 changed files with 10 additions and 3 deletions

View File

@ -26,7 +26,13 @@ class Checker:
def readkeys(self, keys=[]):
rpm.addMacro('_dbpath', self.dbdir)
for key in keys:
self.readkey(key)
try:
self.readkey(key)
except KeyError, e:
print e
if not len(self.imported):
raise KeyError('', "no key imported")
rpm.delMacro("_dbpath")

View File

@ -218,8 +218,9 @@ class Fetcher:
url = "%s/source/%s/_pubkey" % (buildinfo.apiurl, i)
try:
OscFileGrabber().urlgrab(url, dest)
buildinfo.keys.append(dest)
buildinfo.prjkeys.append(i)
if not i in buildinfo.prjkeys: # not that many keys usually
buildinfo.keys.append(dest)
buildinfo.prjkeys.append(i)
except KeyboardInterrupt:
print 'Cancelled by user (ctrl-c)'
print 'Exiting.'