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

Seth Vidal skvidal at linux.duke.edu
Tue Jun 10 20:46:14 UTC 2008


 yum/packageSack.py |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit a7cda63766bfaa09e0abf84eedd5d92c25be50be
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Tue Jun 10 16:44:36 2008 -0400

    make sure the exceptions for 'no packages found' continue to be true

diff --git a/yum/packageSack.py b/yum/packageSack.py
index 975a39b..a2b32f5 100644
--- a/yum/packageSack.py
+++ b/yum/packageSack.py
@@ -368,14 +368,20 @@ class MetaSack(PackageSackBase):
            foo.i386 will be compared"""
         calr = self._computeAggregateListResult
         pkgs = calr("returnNewestByNameArch", naTup, patterns)
-        return packagesNewestByNameArch(pkgs)
-        
+        pkgs = packagesNewestByNameArch(pkgs)
+        if not pkgs:
+            raise Errors.PackageSackError, 'No Package Matching %s' % name          
+        return pkgs
+                
     def returnNewestByName(self, name=None):
         """return list of newest packages based on name matching
            this means(in name.arch form): foo.i386 and foo.noarch will
            be compared to each other for highest version"""
         pkgs = self._computeAggregateListResult("returnNewestByName", name)
-        return packagesNewestByName(pkgs)
+        pkgs = packagesNewestByName(pkgs)
+        if not pkgs:
+            raise Errors.PackageSackError, 'No Package Matching %s' % name        
+        return pkgs
         
     def simplePkgList(self, patterns=None):
         """returns a list of pkg tuples (n, a, e, v, r)"""



More information about the Yum-cvs-commits mailing list