[yum-commits] 2 commits - docs/repoquery.1 repoquery.py yum-utils.spec

James Antill james at osuosl.org
Wed Sep 10 19:31:39 UTC 2014


 docs/repoquery.1 |    4 ++++
 repoquery.py     |    9 ++++++++-
 yum-utils.spec   |    4 ++++
 3 files changed, 16 insertions(+), 1 deletion(-)

New commits:
commit ff635fcd5af045a5a4063c1178079515d3fe3bf0
Author: James Antill <james at and.org>
Date:   Wed Sep 10 15:20:57 2014 -0400

    Add --nolock option to repoquery, so queries can be run in parallel.

diff --git a/docs/repoquery.1 b/docs/repoquery.1
index 85b0047..ead5a18 100644
--- a/docs/repoquery.1
+++ b/docs/repoquery.1
@@ -45,6 +45,10 @@ Produce verbose output.
 Tells repoquery to run entirely from YUM cache - does not download any metadata
 or update the cache. Queries in this mode can fail or give partial/incorrect
 results if the cache isn't fully populated beforehand with eg "yum makecache".
+.IP "\fB\-\-nolock\fP"
+Disable locking the yum cache. This is needed as any yum API caller can alter
+the repo. metadata cache, unless it is locked. This automatically enables the
+--cache and --tempcache options, to try to lower the riskiness.
 .IP "\fB\-\-tempcache\fP"
 Create and use a private cache instead of the main YUM cache. This is used
 by default when run as non-root user.
diff --git a/repoquery.py b/repoquery.py
index 2390e79..af70518 100755
--- a/repoquery.py
+++ b/repoquery.py
@@ -1257,6 +1257,8 @@ def main(args):
                       help="run from cache only")
     parser.add_option("--tempcache", action="store_true",
                       help="use private cache (default when used as non-root)")
+    parser.add_option("--nolock", action="store_true",
+                      help="disable locking (can only be used when running from cached tempcache)")
     parser.add_option("--querytags", action="store_true",
                       help="list available tags in queryformat queries")
     parser.add_option("-c", "--config", dest="conffile",
@@ -1465,6 +1467,11 @@ def main(args):
             repoq.repos.setProgressBar(TextMeter(fo=sys.stdout))
             repoq.repos.callback = output.CacheProgressCallback()
             repoq.repos.setFailureCallback(freport)
+
+    if opts.nolock and not opts.tempcache:
+        opts.tempcache = True
+    if opts.nolock and not opts.cache:
+        opts.cache = True
     
     if not repoq.setCacheDir(opts.tempcache):
         repoq.logger.error("Error: Could not make cachedir, exiting")
@@ -1507,7 +1514,7 @@ def main(args):
             for repo in repoq.repos.findRepos(repo_match):
                 repo.enable()
 
-    while True:
+    while not opts.nolock:
         try: repoq.doLock(); break
         except yum.Errors.LockError, e: pass
         repoq.logger.error(e)
commit 5e3b493cb9eff05430c31b1e8ac13693eb6a6c1c
Author: Alexander Todorov <atodorov at redhat.com>
Date:   Tue Mar 11 17:36:38 2014 +0200

    add %check section explaining how to execute yum-utils tests and why they can't run in a limited build environment

diff --git a/yum-utils.spec b/yum-utils.spec
index dd206b3..ff56353 100644
--- a/yum-utils.spec
+++ b/yum-utils.spec
@@ -421,6 +421,10 @@ install -m 644 versionlock/versionlock.list $RPM_BUILD_ROOT/%{_sysconfdir}/yum/p
 mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum.repos.d
 touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo
 
+%check
+# To execute: ./test/test-all
+# Tests are not suitable for running at build time
+# because they require networking and a populated /var/cache/yum
 
 %clean
 rm -rf $RPM_BUILD_ROOT


More information about the Yum-commits mailing list