from gbp.pkg import (UpstreamSource, compressor_opts, parse_archive_filename)
from gbp.rpm.policy import RpmPkgPolicy
from gbp.rpm.linkedlist import LinkedList
-from gbp.rpm.lib_rpm import librpm
+from gbp.rpm.lib_rpm import librpm, get_librpm_log
class NoSpecError(Exception):
librpm.spec(filtered.name)
return librpm.spec(filtered.name)
except ValueError as err:
- raise GbpError("RPM error while parsing %s: %s" %
- (self.specfile, err))
+ rpmlog = get_librpm_log()
+ gbp.log.debug("librpm log:\n %s" %
+ "\n ".join(rpmlog))
+ raise GbpError("RPM error while parsing %s: %s (%s)" %
+ (self.specfile, err, rpmlog[-1]))
@property
def version(self):
librpm.setLogFile(_rpmlogfd)
-def get_log(truncate=True):
+def get_librpm_log(truncate=True):
"""Get rpmlib log output"""
_rpmlogfd.seek(0)
log = [line.strip() for line in _rpmlogfd.readlines()]