[yum-commits] 2 commits - plugins/auto-update-debuginfo yum-utils.spec

James Antill james at osuosl.org
Tue Feb 3 16:11:14 UTC 2009


 plugins/auto-update-debuginfo/auto-update-debuginfo.conf |    2 
 plugins/auto-update-debuginfo/auto-update-debuginfo.py   |   51 +++++++++++++++
 yum-utils.spec                                           |   23 ++++++
 3 files changed, 74 insertions(+), 2 deletions(-)

New commits:
commit ce873c479506dd4847e6c1c90c08516b2315d848
Author: James Antill <james at and.org>
Date:   Tue Feb 3 11:09:13 2009 -0500

    Add auto-update-debuginfo plugin, BZ 432806

diff --git a/plugins/auto-update-debuginfo/auto-update-debuginfo.conf b/plugins/auto-update-debuginfo/auto-update-debuginfo.conf
new file mode 100644
index 0000000..8e4d76c
--- /dev/null
+++ b/plugins/auto-update-debuginfo/auto-update-debuginfo.conf
@@ -0,0 +1,2 @@
+[main]
+enabled=1
diff --git a/plugins/auto-update-debuginfo/auto-update-debuginfo.py b/plugins/auto-update-debuginfo/auto-update-debuginfo.py
new file mode 100644
index 0000000..e1dfa21
--- /dev/null
+++ b/plugins/auto-update-debuginfo/auto-update-debuginfo.py
@@ -0,0 +1,51 @@
+#!/usr/bin/python
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# by James Antill <james at fedoraproject.org>
+#
+# This plugin enables the debuginfo repos. if you have a debuginfo rpm
+# installed.
+
+from yum.plugins import PluginYumExit, TYPE_CORE
+
+requires_api_version = '2.1'
+plugin_type = (TYPE_CORE,)
+
+def enable_debuginfo_repos(yb):
+    repos = set()
+    for repo in yb.repos.listEnabled():
+        repos.add(repo.id)
+    for repoid in repos:
+        di = '%s-debuginfo' % repoid
+        if di in repos:
+            continue
+        for r in yb.repos.findRepos(di):
+            print 'Enabling %s: %s' % (r.id, r.name)
+            r.enable()
+            yb.doRepoSetup(thisrepo=r.id)
+
+_done_plugin = False
+def postreposetup_hook(conduit):
+    global _done_plugin
+    if _done_plugin:
+        return
+    _done_plugin = True
+
+    yb = conduit._base
+    num = len(yb.rpmdb.returnPackages(patterns=['*-debuginfo']))
+    if num:
+        print "Found %d installed debuginfo package(s)" % num
+        enable_debuginfo_repos(yb)
diff --git a/yum-utils.spec b/yum-utils.spec
index 15cd0f5..05e9050 100644
--- a/yum-utils.spec
+++ b/yum-utils.spec
@@ -300,6 +300,16 @@ Requires: yum >= 3.2.19
 This plugin reads the rpmdb files into the system cache before accessing the
 rpmdb directly. In some cases this should speed up access to rpmdb information
 
+%package -n yum-plugin-auto-update-debuginfo
+Summary: Yum plugin to enable automatic updates to installed debuginfo packages
+Group: System Environment/Base
+Requires: yum >= 3.2.19
+
+%description -n yum-plugin-auto-update-debuginfo
+This plugin looks to see if any debuginfo packages are installed, and if there
+are it enables all debuginfo repositories that are "children" of enabled
+repositories.
+
 %prep
 %setup -q
 
@@ -335,6 +345,7 @@ plugins="\
  remove-with-leaves \
  post-transaction-actions \
  rpm-warm-cache \
+ auto-update-debuginfo \
 "
 
 mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ $RPM_BUILD_ROOT/usr/lib/yum-plugins/
@@ -545,8 +556,16 @@ fi
 /usr/lib/yum-plugins/rpm-warm-cache.*
 %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/rpm-warm-cache.conf
 
+%files -n yum-plugin-auto-update-debuginfo
+%defattr(-, root, root)
+/usr/lib/yum-plugins/auto-update-debuginfo.*
+%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/auto-update-debuginfo.conf
+
 
 %changelog
+* Tue Feb  3 2009 James Antill <james at fedoraproject.org>
+- add auto-update-debuginfo plugin
+
 * Wed Dec 17 2008 Tim Lauridsen <timlau at fedoraproject.org>
 - mark as 1.1.19
 
commit 5e42049b2c756c6d039f4e7237f18a50803c45ec
Author: James Antill <james at and.org>
Date:   Mon Feb 2 10:10:04 2009 -0500

    Fix stupid english grammar rules in spec file

diff --git a/yum-utils.spec b/yum-utils.spec
index 3101a7c..15cd0f5 100644
--- a/yum-utils.spec
+++ b/yum-utils.spec
@@ -286,10 +286,10 @@ Group: System Environment/Base
 Requires: yum >= 3.2.17
 
 %description -n yum-NetworkManager-dispatcher
-This plugin forces yum to check it's cache if/when a new network connection
+This plugin forces yum to check its cache if/when a new network connection
 happens in NetworkManager. Note that currently there is no checking of
 previous data, so if your WiFi keeps going up and down (or you suspend/resume
-a lot) yum will recheck it's cached data a lot.
+a lot) yum will recheck its cached data a lot.
 
 %package -n yum-rpm-warm-cache
 Summary: Yum plugin to access the rpmdb files early to warm up access to the db 


More information about the Yum-commits mailing list