[yum-git] Branch 'yum-3_2_X' - yum/misc.py

James Antill james at linux.duke.edu
Mon Aug 18 06:17:21 UTC 2008


 yum/misc.py |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 36a5ddc748ee305a6f1fca6c3707aaba8ee27216
Author: James Antill <james at and.org>
Date:   Mon Aug 18 02:17:17 2008 -0400

    Fix re_full_search_needed()

diff --git a/yum/misc.py b/yum/misc.py
index 2b96a68..5e58ebd 100644
--- a/yum/misc.py
+++ b/yum/misc.py
@@ -90,11 +90,15 @@ def re_primary_filename(filename):
 _re_compiled_full_match = None
 def re_full_search_needed(s):
     """ Tests if a string needs a full nevra match, instead of just name. """
-    # re.match('[\*\?].$', name)
     global _re_compiled_full_match
     if _re_compiled_full_match is None:
-        _re_compiled_full_match = re.compile('[-*?].*.$')
-    return _re_compiled_full_match.match(s)
+        one   = re.compile('.*[-\*\?].*.$') # Any wildcard or - seperator
+        two   = re.compile('^[0-9]')        # Any epoch, for envra
+        _re_compiled_full_match = (one, two)
+    for rec in _re_compiled_full_match:
+        if rec.match(s):
+            return True
+    return False
 
 ###########
 # Title: Remove duplicates from a sequence



More information about the Yum-cvs-commits mailing list