| |
@@ -1571,6 +1571,15 @@
|
| |
fo = open(fn)
|
| |
else:
|
| |
raise GenericError("No access method for remote file: %s" % relpath)
|
| |
+ if relpath.endswith('.rpm'):
|
| |
+ # Do a initial sanity check on any RPM we opened.
|
| |
+ # This is basically to detect issues with RPMs before they break builds
|
| |
+ # in unknown ways.
|
| |
+ # Note that this does not always catch every possible issue, but it
|
| |
+ # will at least catch issues like when an RPM is only partly downloaded
|
| |
+ # (see issue #290).
|
| |
+ rpm.TransactionSet().hdrCheck(fo.read())
|
| |
+ fo.seek(0)
|
| |
return fo
|
| |
|
| |
|
| |
This should catch issues with downloading RPMs early, so as to not break
the build in unknown ways.
Fixes: #290
Signed-off-by: Patrick Uiterwijk puiterwijk@redhat.com