[Yum-devel] Test patch for 'deplist' command

seth vidal skvidal at phy.duke.edu
Tue May 10 03:53:50 UTC 2005


On Fri, 2005-04-22 at 23:16 -0400, Chip Turner wrote:
> seth vidal <skvidal at phy.duke.edu> writes:
> 
> >> 1) Is returnNevraPrintable the right way to get a printable package
> >>    name?  It seems to put a space before and after the dash between
> >>    the name and vrea of the package, which seems odd.
> >
> > not terribly. We just print the object if it is a simple need (print '%
> > s' % po) and that works b/c of the __str__ method in the object.
> > However,  it's probably best to restructure it based on how you want it
> > to look on the screen.
> 
> Well... I don't have a strong feeling on how the output should look :)
> Depends on what the folks who like the capability want it to look like
> for the problems they're trying to solve.
> 
> >> 5) Should deplist accept an NVREA or just N, and finding the latest
> >>    VRE for each arch?
> >
> > why not just have it accept any format like install, update, etc do?
> 
> Ahh, very good point.  Done.
> 
> Attached is a patch re-based against HEAD and removing it from the
> command line itself.  Sorry for the delay -- had to move across
> country and start a new job :) Should be more responsive to emails
> now.


So I'm looking through the patch and I found this:
--- yum/depsolve.py     26 Mar 2005 07:54:15 -0000      1.62
+++ yum/depsolve.py     23 Apr 2005 03:16:01 -0000
@@ -73,13 +73,17 @@
         pkgs = self.pkgSack.searchProvides(name)
         if flags == 0:
             flags = None
-        
-        (r_e, r_v, r_r) = rpmUtils.miscutils.stringToVersion(version)
+
+        if type(version) == type("") or version is None:
+            (r_e, r_v, r_r) =
rpmUtils.miscutils.stringToVersion(version)
+        elif type(version) in (type([]), type(())):
+            (r_e, r_v, r_r) = version
+
         defSack = ListPackageSack() # holder for items definitely
providing this dep
         
         for po in pkgs:
             self.log(5, 'Potential match for %s from %s' % (name, po))
-            if name[0] == '/' and version is None:
+            if name[0] == '/' and r_v is None:
                 # file dep add all matches to the defSack
                 defSack.addPackage(po)
                 continue

Why do you need this change? What're you trying to accomplish? 
Also its just my opinion but type("") is kinda icky.

Why do you need to make the change?

-sv





More information about the Yum-devel mailing list