Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > 59b0d2a84cf1afdbf9b1df15a2149d65 > files > 1

python-virtinst-0.600.4-1.mga3.src.rpm

diff -up ./virtinst/OSDistro.py.tv ./virtinst/OSDistro.py
--- ./virtinst/OSDistro.py.tv	2013-03-30 19:49:02.980268273 +0100
+++ ./virtinst/OSDistro.py	2013-03-30 19:55:23.516402744 +0100
@@ -394,11 +394,11 @@ class GenericDistro(Distro):
     os_type = "linux"
     uses_treeinfo = True
 
-    _xen_paths = [ ("images/xen/vmlinuz",
-                    "images/xen/initrd.img"),           # Fedora
+    _xen_paths = [ ("isolinux/alt0/vmlinuz",
+                    "isolinux/alt0/all.rdz"),           # Mageia
                  ]
-    _hvm_paths = [ ("images/pxeboot/vmlinuz",
-                    "images/pxeboot/initrd.img"),       # Fedora
+    _hvm_paths = [ ("isolinux/alt0/vmlinuz",
+                    "isolinux/alt0/all.rdz"),           # Mageia
                  ]
     _iso_paths = [ "images/boot.iso",                   # RH/Fedora
                    "boot/boot.iso",                     # Suse
@@ -1011,6 +1011,29 @@ class MandrivaDistro(Distro):
 
 class MageiaDistro(MandrivaDistro):
     name = "Mageia"
+    os_type = "linux"
+    _boot_iso_paths = [ "install/images/boot.iso" ]
+    # Kernels for HVM: valid for releases 2007.1, 2008.*, 2009.0
+    _hvm_kernel_paths = [ ("isolinux/alt0/vmlinuz", "isolinux/alt0/all.rdz")]
+    _xen_kernel_paths = [ ("isolinux/alt0/vmlinuz", "isolinux/alt0/all.rdz")]
+
+    def isValidStore(self, fetcher, progresscb):
+        # Don't support any paravirt installs
+        if self.type is not None and self.type != "hvm":
+            return False
+
+        # Mandriva websites / media appear to have a VERSION
+        # file in top level which we can use as our 'magic'
+        # check for validity
+        if not fetcher.hasFile("VERSION"):
+            return False
+
+        if self._fetchAndMatchRegex(fetcher, progresscb, "VERSION",
+                                    ".*%s.*" % self.name):
+            logging.debug("Detected a %s distro", self.name)
+            return True
+
+        return False
 
 # Solaris and OpenSolaris distros
 class SunDistro(Distro):