[yum-git] yum/packageSack.py

Seth Vidal skvidal at linux.duke.edu
Tue Jun 10 21:05:08 UTC 2008


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

New commits:
commit 917be73d81ae30a5605376bdd653b7c335ea2abc
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Tue Jun 10 17:04:12 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 4aeccbb..ac1984d 100644
--- a/yum/packageSack.py
+++ b/yum/packageSack.py
@@ -352,14 +352,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