[MeeGo-dev] [MIC2][COMMIT] Correctly handle repo options --includepkgs and --excludepkgs

Yi Yang yi.y.yang at intel.com
Thu Nov 11 18:22:36 PST 2010


commit 564c4e323ec2bae26d46087b0bfc84055253d420
Author: Yi Yang <yi.y.yang at intel.com>
Date:   Mon Nov 8 14:08:27 2010 +0800

    Correctly handle repo options --includepkgs and --excludepkgs
    
    Note: fix bug #4808

diff --git a/mic/imgcreate/misc.py b/mic/imgcreate/misc.py
index 49295aa..044a646 100644
--- a/mic/imgcreate/misc.py
+++ b/mic/imgcreate/misc.py
@@ -458,6 +458,8 @@ def get_repostr(repo, siteconf = None):
                     url = item[len(subitems[0])+1:]
                 if subitems[0] in ("save", "debuginfo", "source"):
                     repostr += " --%s" % subitems[0]
+                elif subitems[0] in ("includepkgs", "excludepkgs"):
+                    repostr += " --%s=%s" % (subitems[0], item[len(subitems[0])+1:].replace(";", ","))
                 else:
                     repostr += " --%s=%s" % (subitems[0], item[len(subitems[0])+1:])
             else:
@@ -522,9 +524,9 @@ def get_repostrs_from_ks(ks):
         if hasattr(repodata, "mirrorlist") and repodata.mirrorlist:
             repostr += ",mirrorlist:" + repodata.mirrorlist
         if hasattr(repodata, "includepkgs") and repodata.includepkgs:
-            repostr += ",includepkgs:" + ".".join(repodata.includepkgs)
+            repostr += ",includepkgs:" + ";".join(repodata.includepkgs)
         if hasattr(repodata, "excludepkgs") and repodata.excludepkgs:
-            repostr += ",excludepkgs:" + ".".join(repodata.excludepkgs)
+            repostr += ",excludepkgs:" + ";".join(repodata.excludepkgs)
         if hasattr(repodata, "cost") and repodata.cost:
             repostr += ",cost:%d" % repodata.cost
         if hasattr(repodata, "save") and repodata.save:
@@ -564,9 +566,9 @@ def get_repostrs_from_siteconf(siteconf):
                 if siteconf.has_option(section, "mirrorlist") and siteconf.get(section, "mirrorlist"):
                     repostr += ",mirrorlist:%s" % siteconf.get(section, "mirrorlist")
                 if siteconf.has_option(section, "includepkgs") and siteconf.get(section, "includepkgs"):
-                    repostr += ",includepkgs:%s" % siteconf.get(section, "includepkgs")
+                    repostr += ",includepkgs:%s" % siteconf.get(section, "includepkgs").replace(",", ";")
                 if siteconf.has_option(section, "excludepkgs") and siteconf.get(section, "excludepkgs"):
-                    repostr += ",excludepkgs:%s" % siteconf.get(section, "excludepkgs")
+                    repostr += ",excludepkgs:%s" % siteconf.get(section, "excludepkgs").replace(",", ";")
                 if siteconf.has_option(section, "cost") and siteconf.get(section, "cost"):
                     repostr += ",cost:%s" % siteconf.get(section, "cost")
                 if siteconf.has_option(section, "save") and siteconf.get(section, "save"):
@@ -903,7 +905,7 @@ def get_pkglist_in_group(group, patterns):
 
 def is_statically_linked(binary):
     ret = False
-    dev_null = os.open("/dev/null", os.O_WRONLY);
+    dev_null = os.open("/dev/null", os.O_WRONLY)
     args = [ filecmd, binary ]
     file = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=dev_null)
     output = file.communicate()[0]


More information about the MeeGo-dev mailing list