1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-25 11:42:12 +01:00

- disable signature check when getting data from a rpm file

- catch rpm.error exceptions
This commit is contained in:
Marcus Hüwe 2008-07-08 15:51:37 +00:00
parent 38e66e52e4
commit acaef1d250
2 changed files with 7 additions and 0 deletions

View File

@ -9,6 +9,8 @@ import sys
import signal import signal
from osc import oscerr from osc import oscerr
from urllib2 import URLError, HTTPError from urllib2 import URLError, HTTPError
# import as RPMError because the class "error" is too generic
from rpm import error as RPMError
# the good things are stolen from Matt Mackall's mercurial # the good things are stolen from Matt Mackall's mercurial
@ -127,3 +129,7 @@ def run(prg):
except AttributeError, e: except AttributeError, e:
print >>sys.stderr, e print >>sys.stderr, e
return 1 return 1
except RPMError, e:
print >>sys.stderr, e
return 1

View File

@ -3096,6 +3096,7 @@ def data_from_rpm(rpm_file, *rpmdata):
try: try:
import rpm import rpm
ts = rpm.TransactionSet() ts = rpm.TransactionSet()
ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
file = open(rpm_file, 'r') file = open(rpm_file, 'r')
header = ts.hdrFromFdno(file.fileno()) header = ts.hdrFromFdno(file.fileno())
file.close() file.close()