store cpio header for pkgcache
This commit is contained in:
parent
a20b1e92ff
commit
06f0f658c5
@ -75,15 +75,15 @@ class ABIChecker(ReviewBot.ReviewBot):
|
|||||||
headers = self._fetchcpioheaders(prj, pkg, repo, arch)
|
headers = self._fetchcpioheaders(prj, pkg, repo, arch)
|
||||||
missing_debuginfo = set()
|
missing_debuginfo = set()
|
||||||
lib_packages = dict() # pkgname -> set(lib file names)
|
lib_packages = dict() # pkgname -> set(lib file names)
|
||||||
pkgs = dict() # pkgname -> rpmhdr
|
pkgs = dict() # pkgname -> cpiohdr, rpmhdr
|
||||||
lib_aliases = dict()
|
lib_aliases = dict()
|
||||||
for h in headers:
|
for ch, h in headers:
|
||||||
# skip src rpm
|
# skip src rpm
|
||||||
if h['sourcepackage']:
|
if h['sourcepackage']:
|
||||||
continue
|
continue
|
||||||
pkgname = h['name']
|
pkgname = h['name']
|
||||||
self.logger.debug(pkgname)
|
self.logger.debug(pkgname)
|
||||||
pkgs[pkgname] = h
|
pkgs[pkgname] = (ch, h)
|
||||||
if debugpkg_re.match(pkgname):
|
if debugpkg_re.match(pkgname):
|
||||||
continue
|
continue
|
||||||
for fn, mode, lnk in zip(h['filenames'], h['filemodes'], h['filelinktos']):
|
for fn, mode, lnk in zip(h['filenames'], h['filemodes'], h['filelinktos']):
|
||||||
@ -111,7 +111,7 @@ class ABIChecker(ReviewBot.ReviewBot):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
# check file list of debuginfo package
|
# check file list of debuginfo package
|
||||||
h = pkgs[dpkgname]
|
ch, h = pkgs[dpkgname]
|
||||||
files = set (h['filenames'])
|
files = set (h['filenames'])
|
||||||
ok = True
|
ok = True
|
||||||
for lib in lib_packages[pkgname]:
|
for lib in lib_packages[pkgname]:
|
||||||
@ -120,8 +120,8 @@ class ABIChecker(ReviewBot.ReviewBot):
|
|||||||
missing_debuginfo.add((prj, pkg, repo, arch, pkgname, lib))
|
missing_debuginfo.add((prj, pkg, repo, arch, pkgname, lib))
|
||||||
ok = False
|
ok = False
|
||||||
if ok:
|
if ok:
|
||||||
fetchlist.add(pkgname)
|
fetchlist.add(pkgs[pkgname][0].filename)
|
||||||
fetchlist.add(dpkgname)
|
fetchlist.add(ch.filename)
|
||||||
liblist.add(lib)
|
liblist.add(lib)
|
||||||
|
|
||||||
if missing_debuginfo:
|
if missing_debuginfo:
|
||||||
@ -134,11 +134,11 @@ class ABIChecker(ReviewBot.ReviewBot):
|
|||||||
fetchlist_dst, liblist_dst, lib_aliases_dst = compute_fetchlist(dst_project, dst_package, mr.dstrepo, mr.arch)
|
fetchlist_dst, liblist_dst, lib_aliases_dst = compute_fetchlist(dst_project, dst_package, mr.dstrepo, mr.arch)
|
||||||
fetchlist_src, liblist_src, lib_aliases_src = compute_fetchlist(src_project, src_package, mr.srcrepo, mr.arch)
|
fetchlist_src, liblist_src, lib_aliases_src = compute_fetchlist(src_project, src_package, mr.srcrepo, mr.arch)
|
||||||
self.logger.debug(pformat(fetchlist_dst))
|
self.logger.debug(pformat(fetchlist_dst))
|
||||||
self.logger.debug(pformat(liblist_dst))
|
# self.logger.debug(pformat(liblist_dst))
|
||||||
self.logger.debug(pformat(lib_aliases_dst))
|
# self.logger.debug(pformat(lib_aliases_dst))
|
||||||
self.logger.debug(pformat(fetchlist_src))
|
self.logger.debug(pformat(fetchlist_src))
|
||||||
self.logger.debug(pformat(liblist_src))
|
# self.logger.debug(pformat(liblist_src))
|
||||||
self.logger.debug(pformat(lib_aliases_dst))
|
# self.logger.debug(pformat(lib_aliases_dst))
|
||||||
|
|
||||||
# fetch binary rpms
|
# fetch binary rpms
|
||||||
|
|
||||||
@ -167,7 +167,11 @@ class ABIChecker(ReviewBot.ReviewBot):
|
|||||||
|
|
||||||
u = osc.core.makeurl(self.apiurl, [ 'build', project, repo, arch, package ],
|
u = osc.core.makeurl(self.apiurl, [ 'build', project, repo, arch, package ],
|
||||||
[ 'view=cpioheaders' ])
|
[ 'view=cpioheaders' ])
|
||||||
r = osc.core.http_GET(u)
|
try:
|
||||||
|
r = osc.core.http_GET(u)
|
||||||
|
except urllib2.HTTPError, e:
|
||||||
|
self.logger.error('failed to fetch header information')
|
||||||
|
raise StopIteration
|
||||||
from tempfile import NamedTemporaryFile
|
from tempfile import NamedTemporaryFile
|
||||||
tmpfile = NamedTemporaryFile(prefix="cpio-", delete=False)
|
tmpfile = NamedTemporaryFile(prefix="cpio-", delete=False)
|
||||||
for chunk in r:
|
for chunk in r:
|
||||||
@ -187,7 +191,7 @@ class ABIChecker(ReviewBot.ReviewBot):
|
|||||||
if h is None:
|
if h is None:
|
||||||
self.logger.warn("failed to read rpm header for %s"%ch.filename)
|
self.logger.warn("failed to read rpm header for %s"%ch.filename)
|
||||||
else:
|
else:
|
||||||
yield h
|
yield ch, h
|
||||||
os.unlink(tmpfile.name)
|
os.unlink(tmpfile.name)
|
||||||
|
|
||||||
def findrepos(self, src_project, dst_project):
|
def findrepos(self, src_project, dst_project):
|
||||||
@ -250,6 +254,11 @@ class CommandLineInterface(ReviewBot.CommandLineInterface):
|
|||||||
user = user, \
|
user = user, \
|
||||||
logger = self.logger)
|
logger = self.logger)
|
||||||
|
|
||||||
|
@cmdln.option('-r', '--revision', metavar="number", type="int", help="revision number")
|
||||||
|
def do_diff(self, subcmd, opts, src_project, src_package, dst_project, dst_package):
|
||||||
|
src_rev = opts.revision
|
||||||
|
print self.checker.check_source_submission(src_project, src_package, src_rev, dst_project, dst_package)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app = CommandLineInterface()
|
app = CommandLineInterface()
|
||||||
sys.exit( app.main() )
|
sys.exit( app.main() )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user