Re: pkgorder patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday 29 January 2007 11:12, Jeremy Katz wrote:
> It probably makes more sense to instead to just pass the glob to
> printMatchingPkg() and have it handle the variations of where packages
> can be instead of callers (eg, where we do 3 different things for kernel
> packages)

Worked into a new patch.  Seems to work in the Fedora case.

-- 
Jesse Keating
Release Engineer: Fedora
--- ./pkgorder.jk	2007-01-27 11:17:08.000000000 -0500
+++ ./pkgorder	2007-01-30 17:19:42.000000000 -0500
@@ -79,13 +79,18 @@
     ds.ts.order()
     for (hdr, path) in ds.ts.ts.getKeys():
         fname = os.path.basename(path)
-        fpattern = "%s/%s*" % (toppath, fname.rsplit('.', 2)[0])
+        fpattern = "%s*" % fname.rsplit('.', 2)[0]
         printMatchingPkgs(fpattern)
 
 def printMatchingPkgs(fpattern):
     global processed
 
-    matches = glob.glob(fpattern)
+    if os.path.isdir("%s/%s/RPMS" % (toppath, product)):
+        matches = glob.glob("%s/%s/RPMS/%s" % (toppath, product, fpattern))
+    elif os.path.isdir("%s/%s" %(toppath, product)):
+        matches = glob.glob("%s/%s/%s" % (toppath, product, fpattern))
+    else:
+        matches = glob.glob("%s/%s" % (toppath, fpattern))
 
     for match in matches:
         mname = os.path.basename(match)
@@ -149,12 +154,7 @@
         arch = "i686"
 
     # print out kernel related packages first
-    if os.path.isdir("%s/%s/RPMS" % (toppath, product)):
-        printMatchingPkgs("%s/%s/RPMS/%s" % (toppath, product, "kernel-*"))
-    elif os.path.isdir("%s/%s" %(toppath, product)):
-        printMatchingPkgs("%s/%s/%s" % (toppath, product, "kernel-*"))
-    else:
-        printMatchingPkgs("%s/%s" % (toppath, "kernel-*"))        
+    printMatchingPkgs("kernel-*")        
 
     testpath = "/tmp/pkgorder-%d" %(os.getpid(),)
     os.system("mkdir -p %s/var/lib/rpm" %(testpath,))
@@ -165,12 +165,7 @@
     addGroups(ds, ["core", "base", "text-internet"])
 
     # hack, hack, hack... make sure iscsi ends up on disc1 (#208832)
-    if os.path.isdir("%s/%s/RPMS" % (toppath, product)):
-        printMatchingPkgs("%s/%s/RPMS/%s" % (toppath, product, "iscsi-*"))
-    elif os.path.isdir("%s/%s" %(toppath, product)):
-        printMatchingPkgs("%s/%s/%s" % (toppath, product, "iscsi-*"))
-    else:
-        printMatchingPkgs("%s/%s" % (toppath, "iscsi-*"))        
+    printMatchingPkgs("iscsi-*")        
 
     addGroups(ds, ["base-x", "dial-up",
                    "graphical-internet", "editors", 

Attachment: pgp1ow0V50VXr.pgp
Description: PGP signature


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux