[PATCH] Make unversioned satisfy everything in rangeCompare() also with flag=0

Ville Skyttä <[email protected]>
Newsgroups gmane.linux.rpm.yum
Message-ID <[email protected]>
Hello,

Retrieving provides from rpmdb gives unversioned ones to me with flags=0 
(Fedora 10, rpm 4.6.1), and rangeCompare() does not do the right thing with 
them - it has a special case for None only.  The attached patch fixes it for 
me.

_______________________________________________
Yum mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum
0005-Make-unversioned-satisfy-everything-in-rangeCompare.patch (text/x-patch, 773 B)
From bcad59f6a982458dd7f16238d57480400ae946f9 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Ville=20Skytt=C3=A4?= <[email protected]>
Date: Sun, 21 Jun 2009 23:14:23 +0300
Subject: [PATCH] Make unversioned satisfy everything in rangeCompare() also with flag=0.

---
 rpmUtils/miscutils.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/rpmUtils/miscutils.py b/rpmUtils/miscutils.py
index 9d94e06..11e910d 100644
--- a/rpmUtils/miscutils.py
+++ b/rpmUtils/miscutils.py
@@ -153,7 +153,8 @@ def rangeCompare(reqtuple, provtuple):
     if reqn != n:
         return 0
 
-    if f is None or reqf is None:
+    # unversioned satisfies everything
+    if not f or not reqf:
         return 1
 
     # and you thought we were done having fun
-- 
1.6.0.6
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.