1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-26 18:06:13 +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)
for i in buildinfo.deps:
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):
cached += 1
if i.hdrmd5: