[yum-commits] Makefile yum-show-config.py yum-utils.spec

James Antill james at osuosl.org
Fri May 21 15:54:10 UTC 2010


 Makefile           |    2 +-
 yum-show-config.py |   36 ++++++++++++++++++++++++++++++++++++
 yum-utils.spec     |   10 ++++++----
 3 files changed, 43 insertions(+), 5 deletions(-)

New commits:
commit b576a0e0db7dfdfe3f3bcf0cacfc7ca38a247be1
Author: James Antill <james at and.org>
Date:   Fri May 21 11:52:37 2010 -0400

    Add yum-show-config command, to let people see the config. as yum sees it.

diff --git a/Makefile b/Makefile
index 8355153..5019520 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 SUBDIRS = docs
 PKGNAME = yum-utils
-UTILS = package-cleanup debuginfo-install repoclosure repomanage repoquery repo-graph repo-rss yumdownloader yum-builddep repotrack reposync repodiff yum-debug-dump yum-debug-restore verifytree yum-groups-manager find-repos-of-install needs-restarting
+UTILS = package-cleanup debuginfo-install repoclosure repomanage repoquery repo-graph repo-rss yumdownloader yum-builddep repotrack reposync repodiff yum-debug-dump yum-debug-restore verifytree yum-groups-manager find-repos-of-install needs-restarting yum-show-config
 UTILSROOT = yum-complete-transaction yumdb
 VERSION=$(shell awk '/Version:/ { print $$2 }' ${PKGNAME}.spec)
 RELEASE=$(shell awk -F%: '/Release:/ { print $$2 }' ${PKGNAME}.spec ')
diff --git a/yum-show-config.py b/yum-show-config.py
new file mode 100755
index 0000000..7d16016
--- /dev/null
+++ b/yum-show-config.py
@@ -0,0 +1,36 @@
+#!/usr/bin/python -tt
+
+import sys
+import yum
+sys.path.insert(0,'/usr/share/yum-cli')
+from utils import YumUtilBase
+import logging
+
+NAME = 'yum-show-config'
+VERSION = '1.0'
+USAGE = '"yum-show-config [options] [section]'
+
+yb = YumUtilBase(NAME, VERSION, USAGE)
+logger = logging.getLogger("yum.verbose.cli.yum-show-config")
+yb.preconf.debuglevel = 0
+yb.preconf.errorlevel = 0
+yb.optparser = yb.getOptionParser()
+try:
+    opts = yb.doUtilConfigSetup()
+except yum.Errors.RepoError, e:
+    logger.error(str(e))
+    sys.exit(50)
+
+args = set(sys.argv[1:])
+def _test_arg(x):
+    return not args or x in args
+        
+if _test_arg('main'):
+    print yb.fmtSection('main')
+    print yb.conf.dump()
+
+for repo in sorted(yb.repos.listEnabled()):
+    if not _test_arg(repo.id):
+        continue
+    print yb.fmtSection('repo: ' + repo.id)
+    print repo.dump()
diff --git a/yum-utils.spec b/yum-utils.spec
index d0dbcb8..e111fa6 100644
--- a/yum-utils.spec
+++ b/yum-utils.spec
@@ -8,16 +8,17 @@ Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz
 URL: http://yum.baseurl.org/download/yum-utils/
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch: noarch
-Requires: python >= 2.4 , yum >= 3.2.24
+Requires: python >= 2.4 , yum >= 3.2.27
 BuildRequires: python >= 2.4
 
 %description
 yum-utils is a collection of utilities and examples for the yum package
 manager. It includes utilities by different authors that make yum easier and
-more powerful to use. These tools include: debuginfo-install, package-cleanup,
-repoclosure, repodiff, repo-graph, repomanage, repoquery, repo-rss, reposync,
+more powerful to use. These tools include: debuginfo-install, 
+find-repos-of-install, needs-restarting, package-cleanup, repoclosure, 
+repodiff, repo-graph, repomanage, repoquery, repo-rss, reposync,
 repotrack, verifytree, yum-builddep, yum-complete-transaction, yumdownloader,
-yum-debug-dump, yum-debug-restore and yum-groups-manager.
+yum-debug-dump, yum-debug-restore, yum-groups-manager and yum-show-config.
 
 %package -n yum-updateonboot
 Summary: Run yum update on system boot
@@ -434,6 +435,7 @@ fi
 %{_bindir}/yum-debug-dump
 %{_bindir}/yum-groups-manager
 %{_bindir}/yum-debug-restore
+%{_bindir}/yum-show-config
 %{_sbindir}/yum-complete-transaction
 %{_sbindir}/yumdb
 %{_mandir}/man1/yum-utils.1.*


More information about the Yum-commits mailing list