James Bowes wrote:
Some comments on the patch:

Florian Festi wrote:
------------------------------------------------------------------------

? anaconda.prof.0
Index: rpmUtils/miscutils.py
===================================================================
RCS file: /cvsroot/yum/cvs/yum/rpmUtils/miscutils.py,v
retrieving revision 1.21
diff -u -r1.21 miscutils.py
--- rpmUtils/miscutils.py       7 Apr 2007 18:23:15 -0000       1.21
+++ rpmUtils/miscutils.py       25 Apr 2007 16:16:29 -0000
@@ -155,6 +155,68 @@
             return 1
     return 0
+def rangeCompare(reqtuple, provtuple):

Could this share any code with the existing rangeCheck?

rangeCheck could just call rangeCompare with EQ as insted of the unused arch. The question is if rangeCheck should be used at all or all uses should be changed to rangeCompare. Especially the unused arch param is confusing as it suggests that it is possible to have arch depended requirements with not true (Yes, I know there is this (64bit) thing but thats not an arch)

===================================================================
RCS file: /cvsroot/yum/cvs/yum/yum/sqlitesack.py,v
retrieving revision 1.96
diff -u -r1.96 sqlitesack.py
--- yum/sqlitesack.py   24 Apr 2007 21:13:06 -0000      1.96
+++ yum/sqlitesack.py   25 Apr 2007 16:16:30 -0000
@@ -413,6 +414,62 @@
                 pkgs.append(ob)
return pkgs
+
+
+    def _search(self, prcotype, name, flags, version):
+        if flags == 0:
+            flags = None
+        if type(version) in (str, type(None), unicode):
+            req = (name, flags, rpmUtils.miscutils.stringToVersion(
+                version))
+        elif type(version) in (tuple, list): # would this ever be a list?
+            req = (name, flags, version)
+
+        result = [ ]
+ + for (rep,cache) in self.primarydb.items():
+            cur = cache.cursor()
+            executeSQL(cur, "select packages.*, %s.name as n, %s.flags as f, "
+                       "%s.epoch as e, %s.version as v, %s.release as r "
+                       "from %s,packages "
+                       "where %s.name = ? and "
+                       "%s.pkgKey=packages.pkgKey" %
+                       ((prcotype,) * 8),
+                       (name,))
+            for x in cur:
+                val = (x[-5], x[-4], x[-3:])
+                if rpmUtils.miscutils.rangeCompare(req, val):
+                    result.append(self.pc(rep,x))

I think there is a missing check for if self._excluded here.

Ehmm, yes ...
Feel free to either apply the patch and add the checks yourself or requesting an enhanced patch.

It would also be neat if _search and searchPrco could share some code, too.

It could also just call rangeCompare. I didn't do those cleanups yet to keep the patch smaller.

Florian
_______________________________________________
Yum-devel mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel

Reply via email to