[yum-cvs] 3 commits - plugins/refresh-updatesd yum-utils.spec

James Bowes jbowes at linux.duke.edu
Mon Oct 1 00:44:00 UTC 2007


 plugins/refresh-updatesd/README              |   10 +++++-----
 plugins/refresh-updatesd/refresh-updatesd.py |   22 ++++++++--------------
 yum-utils.spec                               |    7 ++++---
 3 files changed, 17 insertions(+), 22 deletions(-)

New commits:
commit 88500dd5ab856fd30e102fe1ee4e4fcbd94cc6ab
Author: James Bowes <jbowes at redhat.com>
Date:   Sun Sep 30 20:38:35 2007 -0400

    refresh-updatesd: documentation updates

diff --git a/plugins/refresh-updatesd/README b/plugins/refresh-updatesd/README
index 58d2da6..25bfa27 100644
--- a/plugins/refresh-updatesd/README
+++ b/plugins/refresh-updatesd/README
@@ -1,8 +1,8 @@
 This is refresh-updatesd, a plugin for Yum.
 
-refresh-updatesd tells yum-updatesd to check for updates when yum exits.
-This way, if you run 'yum list updates' and yum says there's a new version
-of zsh available, puplet will almost instantly update itself to reflect this.
+refresh-updatesd tells yum-updatesd to check for updates when yum exits. This
+way, if you run 'yum update' and install all available updates, puplet will
+almost instantly update itself to reflect this.
 
-The plugin is very dumb, It should probably only send the message in
-certain cases.
+The plugin is very dumb, It should probably send a message when yum detects
+updated packages as well.
diff --git a/plugins/refresh-updatesd/refresh-updatesd.py b/plugins/refresh-updatesd/refresh-updatesd.py
index 2dd5d8c..c1dadc7 100644
--- a/plugins/refresh-updatesd/refresh-updatesd.py
+++ b/plugins/refresh-updatesd/refresh-updatesd.py
@@ -1,4 +1,4 @@
-# A plugin for yum which notifies yum-updatesd to refresh it's data
+# A plugin for yum which notifies yum-updatesd to refresh its data
 #
 # Written by James Bowes <jbowes at redhat.com>
 #
@@ -21,6 +21,9 @@ requires_api_version = '2.5'
 plugin_type = TYPE_CORE
 
 def posttrans_hook(conduit):
+    """
+    Tell yum-updatesd to refresh its state. Run only after an rpm transaction.
+    """
     try:
         bus = dbus.SystemBus()
     except dbus.DBusException:
diff --git a/yum-utils.spec b/yum-utils.spec
index f8b529f..99c6391 100644
--- a/yum-utils.spec
+++ b/yum-utils.spec
@@ -138,9 +138,8 @@ Requires: yum-updatesd
 
 %description -n yum-refresh-updatesd
 yum-refresh-updatesd tells yum-updatesd to check for updates when yum exits.
-This way, if you run 'yum list updates' and yum says there's a new version
-of (for example) zsh available, puplet will almost instantly update itself
-to reflect this.
+This way, if you run 'yum update' and install all available updates, puplet
+will almost instantly update itself to reflect this.
 
 %package -n yum-merge-conf
 Summary: Yum plugin to merge configuration changes when installing packages
@@ -335,6 +334,8 @@ fi
 
 
 %changelog
+* Sun Sep 30 2007 James Bowes <jbowes at redhat.com>
+- Update the yum-refresh-updatesd description
 
 * Mon Sep 14 2007 Tim Lauridsen <tla at rasmil.dk>
 - do not use wildcards for manpages in yum-utils files section to avoid duplicates
commit 718c0d50a2877de6a3c4a5da07c1b460553e6f68
Author: James Bowes <jbowes at redhat.com>
Date:   Sun Sep 30 20:38:06 2007 -0400

    refresh-updatesd: Remove repos_setup check.
    
    Since the plugin fires a dbus signal only on posttrans, it will only
    fire if yum is doing something. This is enough of a check in itself.

diff --git a/plugins/refresh-updatesd/refresh-updatesd.py b/plugins/refresh-updatesd/refresh-updatesd.py
index e3dc9db..2dd5d8c 100644
--- a/plugins/refresh-updatesd/refresh-updatesd.py
+++ b/plugins/refresh-updatesd/refresh-updatesd.py
@@ -12,7 +12,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
-# version 0.0.3
+# version 0.0.4
 
 import dbus
 from yum.plugins import TYPE_CORE
@@ -20,16 +20,7 @@ from yum.plugins import TYPE_CORE
 requires_api_version = '2.5'
 plugin_type = TYPE_CORE
 
-repos_setup = False
-
-def postreposetup_hook(conduit):
-    global repos_setup
-    repos_setup = True
-
 def posttrans_hook(conduit):
-    if not repos_setup:
-        return
-
     try:
         bus = dbus.SystemBus()
     except dbus.DBusException:
commit 36a78c774c4ced3bb379c2c4c180c727721b0b66
Author: Bill Nottingham <notting at redhat.com>
Date:   Fri Sep 28 11:20:56 2007 -0400

    refresh-updatesd: some tweaks
    
    1) Be less verbose, as yum-updatesd might not be running
    2) Run on posttrans, not close. This stops it continually firing off
       when I run repoqeury. (Perhaps repoquery shouldn't initialize
       plugins, but...)
    
    Bill

diff --git a/plugins/refresh-updatesd/refresh-updatesd.py b/plugins/refresh-updatesd/refresh-updatesd.py
index 430caaf..e3dc9db 100644
--- a/plugins/refresh-updatesd/refresh-updatesd.py
+++ b/plugins/refresh-updatesd/refresh-updatesd.py
@@ -26,18 +26,18 @@ def postreposetup_hook(conduit):
     global repos_setup
     repos_setup = True
 
-def close_hook(conduit):
+def posttrans_hook(conduit):
     if not repos_setup:
         return
 
     try:
         bus = dbus.SystemBus()
     except dbus.DBusException:
-        conduit.error(2, "Unable to connect to dbus")
+        conduit.info(2, "Unable to connect to dbus")
         return
     try:
         updatesd_proxy = bus.get_object('edu.duke.linux.yum', '/Updatesd')
         updatesd_iface = dbus.Interface(updatesd_proxy, 'edu.duke.linux.yum')
         updatesd_iface.CheckNow()
     except dbus.DBusException:
-        conduit.error(2, "Unable to send message to yum-updatesd")
+        conduit.info(2, "Unable to send message to yum-updatesd")



More information about the Yum-cvs-commits mailing list