Don't accidentally exit 1, when someone asks to update a non-existant pkg
authorJames Antill <james@and.org>
Fri, 28 Aug 2009 14:46:52 +0000 (10:46 -0400)
committerJames Antill <james@and.org>
Fri, 28 Aug 2009 18:05:09 +0000 (14:05 -0400)
 This got introduced in ef6f313d5f97aa7398ac3aa04c4637d8b9da7125 from
April, 2009. It's not indended behaviour.

yum/__init__.py

index 3f75528..faa4895 100644 (file)
@@ -2944,7 +2944,11 @@ class YumBase(depsolve.Depsolve):
             #  Always look for available packages, it doesn't seem to do any
             # harm (apart from some time). And it fixes weird edge cases where
             # "update a" (which requires a new b) is different from "update b"
-            m =self.pkgSack.returnNewestByNameArch(patterns=[kwargs['pattern']])
+            try:
+                pats = [kwargs['pattern']]
+                m = self.pkgSack.returnNewestByNameArch(patterns=pats)
+            except Errors.PackageSackError:
+                m = []
             availpkgs.extend(m)
 
             if not availpkgs and not instpkgs: