[virt-tools-list] [PATCH 4/7] urlfetcher: return repository information for Debian trees

Lubomir Rintel lkundrak at v3.sk
Fri Mar 23 09:17:03 UTC 2018


This recognizes the Debian repository trees in the form:

virt-install ... \
  --location http://ftp.us.debian.org/debian/dists/testing/
---
 virtinst/urlfetcher.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/virtinst/urlfetcher.py b/virtinst/urlfetcher.py
index 84555cfb6..d535bac86 100644
--- a/virtinst/urlfetcher.py
+++ b/virtinst/urlfetcher.py
@@ -1251,11 +1251,26 @@ class DebianDistro(Distro):
 
         return True
 
+    def _is_install_repo(self):
+        m = re.match("(.*/)dists/([^/]*)/*", self.fetcher.location)
+        if m is None:
+            return False
+
+        if not self.fetcher.hasFile("Release"):
+            return False
+
+        self._repo_type = 'deb'
+        self._repo_url = m.group(1)
+        self._repo_version = m.group(2)
+
+        return True
+
     def isValidStore(self):
         return any(check() for check in [
             self._is_regular_tree,
             self._is_daily_tree,
             self._is_install_cd,
+            self._is_install_repo,
             ])
 
 
-- 
2.14.3




More information about the virt-tools-list mailing list