[yum-cvs] 3 commits - yum-updatesd yum-updatesd-helper

Jeremy Katz katzj at linux.duke.edu
Wed Aug 8 21:18:13 UTC 2007


 yum-updatesd        |    9 ++++++++-
 yum-updatesd-helper |   12 ++++++++----
 2 files changed, 16 insertions(+), 5 deletions(-)

New commits:
commit d45ee1171e4d0a1c8e9ac0dfac28b3bab0af0658
Author: Jeremy Katz <katzj at redhat.com>
Date:   Wed Aug 8 17:12:07 2007 -0400

    fix support for sending email about updates.   (rh#251196)
    
    Patch from Rich Fearn <redhat AT richardfearn DOT co DOT uk>

diff --git a/yum-updatesd b/yum-updatesd
index f228c3b..77dfa4f 100755
--- a/yum-updatesd
+++ b/yum-updatesd
@@ -162,7 +162,7 @@ def checkUpdates(opts, wait = False):
         args.append("--dbus")
     if "email" in opts.emit_via:
         args.extend(["--email", "--email-from=%s" %(opts.email_from,),
-                     "--email-to=%s" %(opts.email_to,),
+                     "--email-to=%s" %(string.join(opts.email_to, ","),),
                      "--smtp-server=%s" %(opts.smtp_server)])
     if "syslog" in opts.emit_via:
         args.extend(["--syslog", "--syslog-level=%s" %(opts.syslog_level,),
diff --git a/yum-updatesd-helper b/yum-updatesd-helper
index 149507e..52b498b 100755
--- a/yum-updatesd-helper
+++ b/yum-updatesd-helper
@@ -133,10 +133,10 @@ class SyslogUpdateEmitter(UpdateEmitter):
 
 
 class EmailUpdateEmitter(UpdateEmitter):
-    def __init__(self, sender, rcpt, smtp_server):
+    def __init__(self, sender, rcpts, smtp_server):
         UpdateEmitter.__init__(self)        
         self.sender = sender
-        self.rcpt = rcpt
+        self.rcpts = rcpts
         self.smtp_server = smtp_server
 
     def updatesAvailable(self, updateInfo):
@@ -156,13 +156,13 @@ class EmailUpdateEmitter(UpdateEmitter):
         msg = MIMEText(output)
         msg['Subject'] = "%d Updates Available" %(num,)
         msg['From'] = self.sender
-        msg['To'] = self.rcpt
+        msg['To'] = self.rcpts
         s = smtplib.SMTP()
         if self.smtp_server:
             s.connect(self.smtp_server)
         else:
             s.connect()
-        s.sendmail(self.sender, self.rcpt, msg.as_string())
+        s.sendmail(self.sender, self.rcpts.split(','), msg.as_string())
         s.close()
 
 class DbusUpdateEmitter(UpdateEmitter):
commit d9d05f229f58106a08c16c046551529ddcf0baa8
Author: Jeremy Katz <katzj at redhat.com>
Date:   Wed Aug 8 17:09:33 2007 -0400

    ensure that we update the group info too so that normal users accessing the
    cache have things that are current

diff --git a/yum-updatesd-helper b/yum-updatesd-helper
index 610d659..149507e 100755
--- a/yum-updatesd-helper
+++ b/yum-updatesd-helper
@@ -310,6 +310,10 @@ class UpdatesDaemon(yum.YumBase):
             self.doSackSetup()
             self.doTsSetup()
             self.doRpmDBSetup()
+            try:
+                self.doGroupSetup()
+            except yum.Errors.GroupError:
+                pass
         except Exception, e:
             syslog.syslog(syslog.LOG_WARNING,
                           "error getting update info: %s" %(e,))
commit ca6f80ec20bcf092a973a20b61368dd5a0f5f92e
Author: Jeremy Katz <katzj at redhat.com>
Date:   Wed Jul 25 17:45:56 2007 -0400

    don't check for updates unless we're online (#212732)

diff --git a/yum-updatesd b/yum-updatesd
index c1c0424..f228c3b 100755
--- a/yum-updatesd
+++ b/yum-updatesd
@@ -137,6 +137,13 @@ def checkUpdates(opts, wait = False):
     if helperProcess is not None:
         print >> sys.stderr, "Helper process already running"
         return True
+
+    bus = dbus.SystemBus()
+    o = bus.get_object("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager")
+    if o.state != 3:
+        print >> sys.stderr, "Not online; can't check for updates"
+        return True
+
     if os.path.exists("./yum-updatesd-helper") and opts.debug:
         args = ["./yum-updatesd-helper", "--check"]
     else:



More information about the Yum-cvs-commits mailing list