diff --git a/yum-HEAD.patch b/yum-HEAD.patch index 83ff577..8a56e43 100644 --- a/yum-HEAD.patch +++ b/yum-HEAD.patch @@ -16059,8 +16059,30 @@ index 8de7459..2707cac 100644 else: tmp = [] need_glob = False +diff --git a/yum/i18n.py b/yum/i18n.py +index 6b9eab5..9889bf6 100755 +--- a/yum/i18n.py ++++ b/yum/i18n.py +@@ -452,7 +452,16 @@ def to_str(obj): + obj = str(obj) + return obj + +- ++def str_eq(a, b): ++ """ convert between unicode and not and compare them, w/o warning or being annoying""" ++ if isinstance(a, unicode) == isinstance(b, unicode): ++ if a == b: # stupid python... ++ return True ++ elif to_utf8(a) == to_utf8(b): ++ return True ++ ++ return False ++ + try: + ''' + Setup the yum translation domain and make _() and P_() translation wrappers diff --git a/yum/misc.py b/yum/misc.py -index d63993b..70ccb0a 100644 +index d63993b..66b0653 100644 --- a/yum/misc.py +++ b/yum/misc.py @@ -11,6 +11,7 @@ import struct @@ -16079,7 +16101,16 @@ index d63993b..70ccb0a 100644 from stat import * try: import gpgme -@@ -628,7 +630,40 @@ def prco_tuple_to_string(prcoTuple): +@@ -77,6 +79,8 @@ def unshare_data(): + _re_compiled_glob_match = None + def re_glob(s): + """ Tests if a string is a shell wildcard. """ ++ # TODO/FIXME maybe consider checking if it is a stringsType before going on - otherwise ++ # returning None + global _re_compiled_glob_match + if _re_compiled_glob_match is None: + _re_compiled_glob_match = re.compile('[*?]|\[.+\]').search +@@ -628,7 +632,40 @@ def prco_tuple_to_string(prcoTuple): return name return '%s %s %s' % (name, flags[flag], version_tuple_to_string(evr)) @@ -16100,7 +16131,7 @@ index d63993b..70ccb0a 100644 + n, f, v = prco_split + # now we have 'n, f, v' where f and v could be None and None -+ if f is not None: ++ if f is not None and f not in constants.LETTERFLAGS: + if f not in constants.SYMBOLFLAGS: + try: + f = flagToString(int(f)) @@ -16204,6 +16235,39 @@ index 95b278a..6e986a4 100644 def returnObsoletes(self, newest=False): """returns a dict of obsoletes dict[obsoleting pkgtuple] = [list of obs]""" obs = {} +diff --git a/yum/packages.py b/yum/packages.py +index ba10136..c473ece 100644 +--- a/yum/packages.py ++++ b/yum/packages.py +@@ -23,6 +23,7 @@ import rpm + import os + import os.path + import misc ++import i18n + import re + import fnmatch + import stat +@@ -414,7 +415,7 @@ class RpmBase(object): + return self.inPrcoRange(prcotype, prcotuple) + else: + for (n, f, (e, v, r)) in self.returnPrco(prcotype): +- if reqn == n: ++ if i18n.str_eq(reqn, n): + return 1 + + return 0 +@@ -430,10 +431,7 @@ class RpmBase(object): + # find the named entry in pkgobj, do the comparsion + result = [] + for (n, f, (e, v, r)) in self.returnPrco(prcotype): +- if isinstance(reqn, unicode) == isinstance(n, unicode): +- if reqn != n: # stupid python... +- continue +- elif misc.to_utf8(reqn) != misc.to_utf8(n): ++ if not i18n.str_eq(reqn, n): + continue + + if f == '=': diff --git a/yum/pkgtag_db.py b/yum/pkgtag_db.py index eddf175..e72fd05 100644 --- a/yum/pkgtag_db.py @@ -16242,16 +16306,20 @@ index eddf175..e72fd05 100644 for (name, tag, score) in rows: if name not in res: diff --git a/yum/rpmsack.py b/yum/rpmsack.py -index b45f315..4ab20e9 100644 +index b45f315..83b684e 100644 --- a/yum/rpmsack.py +++ b/yum/rpmsack.py -@@ -282,18 +282,21 @@ class RPMDBPackageSack(PackageSackBase): +@@ -282,18 +282,28 @@ class RPMDBPackageSack(PackageSackBase): result = self._cache[prcotype].get(name) if result is not None: return result - + (n,f,(e,v,r)) = misc.string_to_prco_tuple(name) ++ glob = False + ++ if misc.re_glob(n): ++ glob = True ++ ts = self.readOnlyTS() result = {} tag = self.DEP_TABLE[prcotype][0] @@ -16262,8 +16330,11 @@ index b45f315..4ab20e9 100644 continue po = self._makePackageObject(hdr, mi.instance()) - result[po.pkgid] = po -+ if po.checkPrco(prcotype, (n, f, (e,v,r))): -+ result[po.pkgid] = po ++ if not glob: ++ if po.checkPrco(prcotype, (n, f, (e,v,r))): ++ result[po.pkgid] = po ++ else: ++ result[po.pkgid] = po del mi + @@ -16271,7 +16342,7 @@ index b45f315..4ab20e9 100644 if prcotype == 'provides' and name[0] == '/': fileresults = self.searchFiles(name) diff --git a/yum/sqlitesack.py b/yum/sqlitesack.py -index bf0cea9..6b9acfc 100644 +index bf0cea9..1d6c764 100644 --- a/yum/sqlitesack.py +++ b/yum/sqlitesack.py @@ -28,7 +28,7 @@ from packages import PackageObject, RpmBase, YumAvailablePackage, parsePackages @@ -16349,7 +16420,7 @@ index bf0cea9..6b9acfc 100644 sql="select pkgKey,1 AS cumul from packages where %s like '%%%s%%'%s " % (fields[0], s, esc) for f in fields[1:]: sql = "%s or %s like '%%%s%%'%s " % (sql, f, s, esc) -@@ -1289,38 +1263,58 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack): +@@ -1289,38 +1263,61 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack): @catchSqliteException def searchPrco(self, name, prcotype): @@ -16391,10 +16462,13 @@ index bf0cea9..6b9acfc 100644 + # file dep add all matches to the results + results.append(po) + continue -+ -+ if po.checkPrco(prcotype, (n, f, (e,v,r))): ++ ++ if not glob: ++ if po.checkPrco(prcotype, (n, f, (e,v,r))): ++ results.append(po) ++ else: ++ # if it is a glob we can't really get any closer to checking it + results.append(po) -+ # If it's not a provides or a filename, we are done if prcotype != "provides": return results @@ -16417,7 +16491,7 @@ index bf0cea9..6b9acfc 100644 return misc.unique(results) -@@ -1516,7 +1510,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack): +@@ -1516,7 +1513,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack): if len(patterns) > pat_max: patterns = [] if ignore_case: diff --git a/yum.spec b/yum.spec index 8c12e9d..419941f 100644 --- a/yum.spec +++ b/yum.spec @@ -3,7 +3,7 @@ Summary: RPM installer/updater Name: yum Version: 3.2.26 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://yum.baseurl.org/download/3.2/%{name}-%{version}.tar.gz @@ -110,6 +110,10 @@ rm -rf $RPM_BUILD_ROOT %dir /usr/lib/yum-plugins %changelog +* Wed Feb 17 2010 Seth Vidal - 3.2.26-4 +- new HEAD to fix the fix to the fix + + * Tue Feb 16 2010 Seth Vidal - 3.2.26-3 - latest head - including fixes to searchPrcos