However, to get there I needed to apply a small patch based on my thoughts on 
using .discinfo on the mounted iso image.
Please find the rough patch attached that I thought I had sent yesterday evening.

All the best,

Gareth

--


--- action_import.py.orig	2009-05-08 17:36:31.000000000 +0200
+++ action_import.py	2009-05-12 17:49:05.000000000 +0200
@@ -944,20 +944,37 @@
        for producing predictable distro names (and profile names) from differing import sources
        """
        result = {}
-       # FIXME : this is called only once, should not be a walk      
-       os.path.walk(self.get_pkgdir(), self.arch_walker, result)      
-       # print _("- architectures found at %s: %s") % ( self.get_pkgdir(), result.keys() )
+       # FIXME : this is called only once, should not be a walk
+       arch = self.get_arch()
+       result[arch] = 1 
+       if not arch:
+           os.path.walk(self.get_pkgdir(), self.arch_walker, result)      
+       #os.path.walk(self.get_pkgdir(), self.arch_walker, result)      
+       print _("- architectures found at %s: %s") % ( self.get_pkgdir(), result.keys() )
        if result.pop("amd64",False):
            result["x86_64"] = 1
        if result.pop("i686",False):
            result["i386"] = 1
        return result.keys()
 
+   def get_discinfo(self):
+       """
+       Allows each breed to return its discinfo file contents
+       """
+       return None
+
    def get_datestamp(self):
        """
        Allows each breed to return its datetime stamp
        """
        return None
+
+   def get_arch(self):
+       """
+       Allows each breed to return its arch
+       """
+       return None
+
    # ===================================================================
 
    def __init__(self,(rootdir,pkgdir)):
@@ -1051,18 +1068,43 @@
        minor = float(accum[1])
        return (flavor, major, minor)
 
-   def get_datestamp(self):
+   def get_discinfo(self):
        """
-       Based on a RedHat tree find the creation timestamp
+       Based on a RedHat tree find the associated .discinfo file(s)
        """
        base = self.get_rootdir()
        if os.path.exists("%s/.discinfo" % base):
-           discinfo = open("%s/.discinfo" % base, "r")
-           datestamp = discinfo.read().split("\n")[0]
-           discinfo.close()
+           discinfo_file = open("%s/.discinfo" % base, "r")
+           discinfo = discinfo_file.read().split("\n")
+           discinfo_file.close()
        else:
            return 0
-       return float(datestamp)
+       return discinfo
+
+   def get_datestamp(self):
+       """
+       Based on a RedHat tree find the creation timestamp
+       """
+       return float(self.get_discinfo()[0])
+
+   def get_arch(self):
+       """
+       Based on a RedHat tree find the primary arch
+       """
+       return str(self.get_discinfo()[2])
+
+#  def get_datestamp(self):
+#      """
+#      Based on a RedHat tree find the creation timestamp
+#      """
+#      base = self.get_rootdir()
+#      if os.path.exists("%s/.discinfo" % base):
+#          discinfo = open("%s/.discinfo" % base, "r")
+#          datestamp = discinfo.read().split("\n")[0]
+#          discinfo.close()
+#      else:
+#          return 0
+#      return float(datestamp)
 
    def set_variance(self, flavor, major, minor, arch):
   
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler

Reply via email to