[PATCH] yum-cron: support download/install with update_messages==False. BZ 1018068

Zdenek Pavlas zpavlas at redhat.com
Tue Oct 22 12:49:40 UTC 2013


(download_updates or apply_updates) now implies that yum-cron should
do the updates processing, too.  The update_messages==False case is
then used to make yum-cron less chatty.
---
 yum-cron/yum-cron.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py
index 9f985f9..79c1907 100755
--- a/yum-cron/yum-cron.py
+++ b/yum-cron/yum-cron.py
@@ -998,7 +998,8 @@ class YumCronBase(yum.YumBase):
             self.emitUpdateFailed([str(err)])
             sys.exit(1)
 
-        self.emitInstalled()
+        if emit :
+            self.emitInstalled()
         self.emitMessages()
 
     def updatesCheck(self):
@@ -1019,8 +1020,8 @@ class YumCronBase(yum.YumBase):
         # Update the metadata
         self.populateUpdateMetadata()
 
-        # Exit if we don't need to send messages
-        if not self.opts.update_messages:
+        # Exit if we don't need to check for updates
+        if not (self.opts.update_messages or self.opts.download_updates or self.opts.apply_updates):
             sys.exit(0)
 
         # Check for updates in packages, or groups ... need to run both.
@@ -1048,7 +1049,7 @@ class YumCronBase(yum.YumBase):
             self.releaseLocks()
             sys.exit(0)
 
-        self.installUpdates(True)
+        self.installUpdates(self.opts.update_messages)
 
         self.releaseLocks()
         sys.exit(0)
-- 
1.7.11.7



More information about the Yum-devel mailing list