[Yum-devel] [PATCH] exit(1) when all reinstall args are bad. BZ 800285.

Zdeněk Pavlas zpavlas at redhat.com
Tue Mar 6 15:16:32 UTC 2012


---
 cli.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/cli.py b/cli.py
index b7511f1..9b71a0e 100755
--- a/cli.py
+++ b/cli.py
@@ -1094,6 +1094,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
 
         oldcount = len(self.tsInfo)
 
+        done = False
         for arg in userlist:
             if (arg.endswith('.rpm') and (yum.misc.re_remote_url(arg) or
                                           os.path.exists(arg))):
@@ -1120,11 +1121,15 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
                 assert False, "Shouldn't happen, but just in case"
                 self.verbose_logger.log(yum.logginglevels.INFO_2, e)
             else:
+                done = True
                 self._install_upgraded_requires(txmbrs)
 
         if len(self.tsInfo) > oldcount:
             change = len(self.tsInfo) - oldcount
             return 2, [P_('%d package to reinstall', '%d packages to reinstall', change) % change]
+
+        if not done:
+            return 1, [_('Nothing to do')]
         return 0, [_('Nothing to do')]
 
     def localInstall(self, filelist, updateonly=0):
-- 
1.7.4.4



More information about the Yum-devel mailing list