[yum-git] 3 commits - docs/yum-updatesd.conf.5 etc/yum-updatesd.conf yum-updatesd yum-updatesd-helper

James Antill james at linux.duke.edu
Mon Aug 25 21:17:03 UTC 2008


 docs/yum-updatesd.conf.5 |    7 +++++++
 etc/yum-updatesd.conf    |    5 +++++
 yum-updatesd             |    8 +++++++-
 yum-updatesd-helper      |   10 ++++++++--
 4 files changed, 27 insertions(+), 3 deletions(-)

New commits:
commit ecefe7fbc7f1739e81a55cd162b090fce768783c
Author: James Antill <james at and.org>
Date:   Mon Aug 25 17:16:52 2008 -0400

    Add the explicit unlock on exit for pre. 3.2.19 yum's, bug 453037

diff --git a/yum-updatesd-helper b/yum-updatesd-helper
index 3859377..979937d 100755
--- a/yum-updatesd-helper
+++ b/yum-updatesd-helper
@@ -557,6 +557,7 @@ class UpdatesDaemon(yum.YumBase):
         return True
 
     def releaseLocks(self):
+        # This should "just work" as of 3.2.19, as YumBase.__del__ will do it
         self.closeRpmDB()
         self.doUnlock(YUM_PID_FILE)
 
@@ -681,6 +682,7 @@ def main(options = None):
     if not updd.installUpdates():
         sys.exit(1)
 
+    updd.releaseLocks()
     sys.exit(0)
 
 if __name__ == "__main__":
commit ff8d38790e05ceaaf44566ce7c4985e51173acdb
Merge: c98fca4... cc7d40e...
Author: James Antill <james at and.org>
Date:   Wed Jul 16 15:09:02 2008 -0400

    Merge branch 'master' of ssh://login.linux.duke.edu/home/groups/yum/git/yum-updatesd
    
    * 'master' of ssh://login.linux.duke.edu/home/groups/yum/git/yum-updatesd:
      Give more output via syslog for various cases (#455346)
      Try to avoid messages being flagged as spam (Pierre Ossman, #449313)

commit c98fca4f131357648bf5abb3fa3a5871c1cba68f
Author: James Antill <james at and.org>
Date:   Fri Jan 11 15:44:41 2008 -0500

    Add mdpolicy support to yum-updatesd

diff --git a/docs/yum-updatesd.conf.5 b/docs/yum-updatesd.conf.5
index 0978f3c..49aaa3d 100644
--- a/docs/yum-updatesd.conf.5
+++ b/docs/yum-updatesd.conf.5
@@ -42,6 +42,13 @@ automatically downloaded.  Defaults to False.
 Boolean option to automatically download dependencies of packages which need
 updating as well.  Defaults to False.
 
+.IP \fBmdpolicy\fR
+This is the same configuration option as mdpolicy from yum.conf, but also allows
+the option yum which means it should take the values used in yum. It overrides
+the values in yum with whatever is configured. Defaults to group:small. Note
+that if you use a version of yum without mdpolicy support this option will do
+nothing.
+
 .SH "MAIL OPTIONS"
 .IP \fBemail_to\fR
 List of email addresses to send update notification to.  Defaults to 
diff --git a/etc/yum-updatesd.conf b/etc/yum-updatesd.conf
index 9af82ee..599f94d 100644
--- a/etc/yum-updatesd.conf
+++ b/etc/yum-updatesd.conf
@@ -16,3 +16,8 @@ do_update = no
 do_download = no
 # automatically download deps of updates
 do_download_deps = no
+
+#  Uncomment to download the main metadata for enabled repos
+# mdpolicy = group:main
+# ...or the following if you just want yum-updatesd to do what yum does
+# mdpolicy = group:main
diff --git a/yum-updatesd b/yum-updatesd
index 69da1c1..e11539f 100755
--- a/yum-updatesd
+++ b/yum-updatesd
@@ -39,7 +39,7 @@ import gobject
 
 import gamin
 
-from yum.config import BaseConfig, Option, IntOption, ListOption, BoolOption
+from yum.config import BaseConfig, Option, IntOption, ListOption, BoolOption, SelectionOption
 try:
     from yum.config import SecondsOption
 except:
@@ -73,6 +73,9 @@ class UDConfig(BaseConfig):
     syslog_level = Option("WARN")
     syslog_ident = Option("yum-updatesd")
     yum_config = Option("/etc/yum/yum.conf")
+    mdpolicy = SelectionOption('group:small',
+                               ('yum', 'instant', 'group:all', 'group:main',
+                                'group:small', 'group:primary'))
     # added debugging
     debug = BoolOption(False)
 
@@ -179,6 +182,9 @@ def checkUpdates(opts, wait = False, limited=False):
     if opts.do_update:
         args.append("--apply")
 
+    if opts.mdpolicy != "group:small": # Matches with yum-updatesd-helper
+        args.append("--mdpolicy=%s" % opts.mdpolicy)
+
     # how should we send notifications?
     if "dbus" in opts.emit_via:
         args.append("--dbus")
diff --git a/yum-updatesd-helper b/yum-updatesd-helper
index 2a7c451..ead7a35 100755
--- a/yum-updatesd-helper
+++ b/yum-updatesd-helper
@@ -372,8 +372,9 @@ class UpdatesDaemon(yum.YumBase):
         # Override the metadata expire, because there's no point running 
         # yum-updatesd-helper if we use cached metadata
         for repo in self.repos.listEnabled():
-            repo.metadata_expire = 1
-
+            repo.metadata_expire = 0
+            if self.options.mdpolicy != "yum" and hasattr(repo, 'mdpolicy'):
+                repo.mdpolicy = self.options.mdpolicy
 
     def doLock(self):
         try:
@@ -387,6 +388,8 @@ class UpdatesDaemon(yum.YumBase):
         try:
             self.doRepoSetup()
             self.doSackSetup()
+            for repo in self.repos.listEnabled(): # Do the mdpolicy
+                repo.repoXML
             self.doTsSetup()
             self.doRpmDBSetup()
             self.doUpdateSetup()
@@ -584,6 +587,7 @@ def main(options = None):
         parser.add_option("-c", "--check", action="store_true", default=False, dest="check")
         parser.add_option("-d", "--download", action="store_true", default=False, dest="download")
         parser.add_option("", "--deps", action="store_true", default=False, dest="finddeps")        
+        parser.add_option("", "--mdpolicy", type="string", default="group:small", dest="mdpolicy")
         parser.add_option("-a", "--apply", action="store_true", default=False, dest="apply")
         parser.add_option("", "--network-fail", action="store_true", default=False, dest="netfail")        
         # debugging, different configs



More information about the Yum-cvs-commits mailing list