[yum-commits] plugins/local

James Antill james at osuosl.org
Tue Nov 24 23:53:05 UTC 2009


 plugins/local/local.conf |    2 ++
 plugins/local/local.py   |   16 ++++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

New commits:
commit 2a7a802659e3e8a63e6f0406d6818078422535b3
Author: James Antill <james at and.org>
Date:   Tue Nov 24 18:53:01 2009 -0500

    Make local not as verbose, unless requested

diff --git a/plugins/local/local.conf b/plugins/local/local.conf
index ca23ac1..a91f7d5 100644
--- a/plugins/local/local.conf
+++ b/plugins/local/local.conf
@@ -8,6 +8,8 @@ enabled=1
 # If you need to override the checksum with the --checksum option. Eg.
 # checksum = sha
 
+quiet = true
+verbose = false
 skip_stat = false
 unique_md_filenames = true
 update = true
diff --git a/plugins/local/local.py b/plugins/local/local.py
index b750b28..cda1ee5 100644
--- a/plugins/local/local.py
+++ b/plugins/local/local.py
@@ -69,13 +69,22 @@ def postdownload_hook(conduit):
     cache_dir = conduit.confString('createrepo', 'cachedir', default=None)
     checksum  = conduit.confString('createrepo', 'checksum', default=None)
 
+    quiet     = conduit.confBool('createrepo', 'quiet',     default=True)
+    verbose   = conduit.confBool('createrepo', 'verbose',   default=False)
     skip_stat = conduit.confBool('createrepo', 'skip_stat', default=False)
     unique_md = conduit.confBool('createrepo', 'unique_md_filenames',
                                  default=False)
     update = conduit.confBool('createrepo', 'update', default=True)
     databases = conduit.confBool('createrepo', 'databases', default=True)
 
+    if conduit._base.verbose_logger.isEnabledFor(yum.logginglevels.DEBUG_3):
+        quiet = False
+
     args = ["createrepo"]
+    if quiet:
+        args.append("--quiet")
+    if verbose:
+        args.append("--verbose")
     if databases:
         args.append("--database")
     if update:
@@ -91,9 +100,12 @@ def postdownload_hook(conduit):
         args.append("--cachedir")
         args.append(cache_dir)
     args.append(local_repo_dir)
-    conduit.info(2, "== Rebuilding _local repo. with %u new packages ==" % done)
+    if not quiet:
+        conduit.info(2, "== Rebuilding _local repo. with %u new packages ==" %
+                     done)
     os.spawnvp(os.P_WAIT, "createrepo", args)
-    conduit.info(2, "== Done rebuild of _local repo. ==")
+    if not quiet:
+        conduit.info(2, "== Done rebuild of _local repo. ==")
 
     lrepo = [repo for repo in conduit._base.repos.listEnabled()
              if repo.id == "_local"]


More information about the Yum-commits mailing list