abichecker: remove PkgCache usage and instead always download.
This commit is contained in:
parent
a4924ffb45
commit
7f873d810b
@ -32,7 +32,6 @@ except ImportError:
|
|||||||
|
|
||||||
import rpm
|
import rpm
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from osclib.pkgcache import PkgCache
|
|
||||||
from osclib.comments import CommentAPI
|
from osclib.comments import CommentAPI
|
||||||
|
|
||||||
from abichecker_common import CACHEDIR
|
from abichecker_common import CACHEDIR
|
||||||
@ -68,11 +67,7 @@ ARCH_WHITELIST = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Directory where download binary packages.
|
# Directory where download binary packages.
|
||||||
# TODO: move to CACHEDIR, just here for consistency with repochecker
|
DOWNLOADS = os.path.join(CACHEDIR, 'downloads')
|
||||||
BINCACHE = os.path.expanduser('~/co')
|
|
||||||
DOWNLOADS = os.path.join(BINCACHE, 'downloads')
|
|
||||||
|
|
||||||
# Where the cache files are stored
|
|
||||||
UNPACKDIR = os.path.join(CACHEDIR, 'unpacked')
|
UNPACKDIR = os.path.join(CACHEDIR, 'unpacked')
|
||||||
|
|
||||||
so_re = re.compile(r'^(?:/usr)?/lib(?:64)?/lib([^/]+)\.so(?:\.[^/]+)?')
|
so_re = re.compile(r'^(?:/usr)?/lib(?:64)?/lib([^/]+)\.so(?:\.[^/]+)?')
|
||||||
@ -181,8 +176,6 @@ class ABIChecker(ReviewBot.ReviewBot):
|
|||||||
self.ts = rpm.TransactionSet()
|
self.ts = rpm.TransactionSet()
|
||||||
self.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
|
self.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
|
||||||
|
|
||||||
self.pkgcache = PkgCache(BINCACHE)
|
|
||||||
|
|
||||||
# reports of source submission
|
# reports of source submission
|
||||||
self.reports = []
|
self.reports = []
|
||||||
# textual report summary for use in accept/decline message
|
# textual report summary for use in accept/decline message
|
||||||
@ -711,6 +704,7 @@ class ABIChecker(ReviewBot.ReviewBot):
|
|||||||
if r != 0:
|
if r != 0:
|
||||||
raise FetchError("failed to extract %s!"%fn)
|
raise FetchError("failed to extract %s!"%fn)
|
||||||
tmpfd.close()
|
tmpfd.close()
|
||||||
|
os.unlink(downloaded[fn])
|
||||||
cpio = CpioRead(tmpfile)
|
cpio = CpioRead(tmpfile)
|
||||||
cpio.read()
|
cpio.read()
|
||||||
for ch in cpio:
|
for ch in cpio:
|
||||||
@ -752,22 +746,12 @@ class ABIChecker(ReviewBot.ReviewBot):
|
|||||||
downloaded[fn] = t
|
downloaded[fn] = t
|
||||||
return downloaded
|
return downloaded
|
||||||
|
|
||||||
# XXX: from repochecker
|
|
||||||
def _get_binary_file(self, project, repository, arch, package, filename, target, mtime):
|
def _get_binary_file(self, project, repository, arch, package, filename, target, mtime):
|
||||||
"""Get a binary file from OBS."""
|
"""Get a binary file from OBS."""
|
||||||
# Check if the file is already there.
|
# Used to cache, but dropped as part of python3 migration.
|
||||||
key = (project, repository, arch, package, filename, mtime)
|
|
||||||
if key in self.pkgcache:
|
|
||||||
try:
|
|
||||||
os.unlink(target)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
self.pkgcache.linkto(key, target)
|
|
||||||
else:
|
|
||||||
osc.core.get_binary_file(self.apiurl, project, repository, arch,
|
osc.core.get_binary_file(self.apiurl, project, repository, arch,
|
||||||
filename, package=package,
|
filename, package=package,
|
||||||
target_filename=target)
|
target_filename=target)
|
||||||
self.pkgcache[key] = target
|
|
||||||
|
|
||||||
def readRpmHeaderFD(self, fd):
|
def readRpmHeaderFD(self, fd):
|
||||||
h = None
|
h = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user