From c3e0bbccb2c18a3552fe83540690e9d553779ec8 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Wed, 2 Aug 2017 11:02:14 +0200 Subject: [PATCH] Container support: use multiple container extensions when checking the cache The container may end in .tar.xz, .tar.gz, or .tar --- osc/fetch.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/osc/fetch.py b/osc/fetch.py index 9e6d878f..b96d1aec 100644 --- a/osc/fetch.py +++ b/osc/fetch.py @@ -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: