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:
parent
38e66e52e4
commit
acaef1d250
@ -9,6 +9,8 @@ import sys
|
||||
import signal
|
||||
from osc import oscerr
|
||||
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
|
||||
|
||||
@ -127,3 +129,7 @@ def run(prg):
|
||||
except AttributeError, e:
|
||||
print >>sys.stderr, e
|
||||
return 1
|
||||
|
||||
except RPMError, e:
|
||||
print >>sys.stderr, e
|
||||
return 1
|
||||
|
@ -3096,6 +3096,7 @@ def data_from_rpm(rpm_file, *rpmdata):
|
||||
try:
|
||||
import rpm
|
||||
ts = rpm.TransactionSet()
|
||||
ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
|
||||
file = open(rpm_file, 'r')
|
||||
header = ts.hdrFromFdno(file.fileno())
|
||||
file.close()
|
||||
|
Loading…
x
Reference in New Issue
Block a user