1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-27 02:16:12 +01:00

Container support: use multiple container extensions when checking the cache

The container may end in .tar.xz, .tar.gz, or .tar
This commit is contained in:
Michael Schroeder 2017-08-02 11:02:14 +02:00
parent c2fc655557
commit c3e0bbccb2

View File

@ -246,6 +246,13 @@ class Fetcher:
all = len(buildinfo.deps) all = len(buildinfo.deps)
for i in buildinfo.deps: for i in buildinfo.deps:
i.makeurls(self.cachedir, self.urllist) i.makeurls(self.cachedir, self.urllist)
# find container extension by looking in the cache
if i.name.startswith('container:') and i.fullfilename.endswith('.tar.xz'):
for ext in ['.tar.xz', '.tar.gz', '.tar']:
if os.path.exists(i.fullfilename[:-7] + ext):
i.canonname = i.canonname[:-7] + ext
i.makeurls(self.cachedir, self.urllist)
if os.path.exists(i.fullfilename): if os.path.exists(i.fullfilename):
cached += 1 cached += 1
if i.hdrmd5: if i.hdrmd5: