[yum-commits] Branch 'yum-3_2_X' - 2 commits - cli.py yum/__init__.py

James Antill james at osuosl.org
Tue May 24 16:10:55 UTC 2011


 cli.py          |   22 ++++++++++++++--------
 yum/__init__.py |    4 +---
 2 files changed, 15 insertions(+), 11 deletions(-)

New commits:
commit 0f414949373d29735f69ed8e0287c5faba2eb21f
Author: James Antill <james at and.org>
Date:   Tue May 24 12:09:52 2011 -0400

    Sync. Installed provides return msg, with available provides return msg.

diff --git a/yum/__init__.py b/yum/__init__.py
index 0244e04..36c4077 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -2691,9 +2691,7 @@ class YumBase(depsolve.Depsolve):
                 where = self.returnInstalledPackagesByDep(arg)
                 usedDepString = True
                 for po in where:
-                    tmpvalues = []
-                    msg = _('Provides-match: %s') % to_unicode(arg)
-                    tmpvalues.append(msg)
+                    tmpvalues = [arg]
 
                     if len(tmpvalues) > 0:
                         if callback:
commit 6756b86f33f5173a035671ae748f61a1192eef1a
Author: James Antill <james at and.org>
Date:   Mon May 23 16:51:01 2011 -0400

    Make yum provides nicer for things like "matplotlib" or yum-config-manager.

diff --git a/cli.py b/cli.py
index 957c182..f4bd7b1 100644
--- a/cli.py
+++ b/cli.py
@@ -1143,17 +1143,23 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
         cb = self.matchcallback_verbose
         matching = self.searchPackageProvides(args, callback=cb,
                                               callback_has_matchfor=True)
-        self.conf.showdupesfromrepos = old_sdup
-        
         if len(matching) == 0:
+            #  Try to be a bit clever, for commands, and python modules.
+            # Maybe want something so we can do perl/etc. too?
+            paths = set(sys.path + os.environ['PATH'].split(':'))
+            nargs = []
             for arg in args:
-                if '*' in arg or (arg and arg[0] == '/'):
+                if yum.misc.re_filename(arg) or yum.misc.re_glob(arg):
                     continue
-                self.logger.warning(_('Warning: 3.0.x versions of yum would erroneously match against filenames.\n You can use "%s*/%s%s" and/or "%s*bin/%s%s" to get that behaviour'),
-                                    self.term.MODE['bold'], arg,
-                                    self.term.MODE['normal'],
-                                    self.term.MODE['bold'], arg,
-                                    self.term.MODE['normal'])
+                for path in paths:
+                    if not path:
+                        continue
+                    nargs.append("%s/%s" % (path, arg))
+            matching = self.searchPackageProvides(nargs, callback=cb,
+                                                  callback_has_matchfor=True)
+        self.conf.showdupesfromrepos = old_sdup
+
+        if len(matching) == 0:
             return 0, ['No Matches found']
         
         return 0, []


More information about the Yum-commits mailing list