[yum-commits] docs/repoquery.1 repoquery.py
James Antill
james at osuosl.org
Fri Jun 18 15:40:07 UTC 2010
docs/repoquery.1 | 4 +++-
repoquery.py | 24 +++++++++++++-----------
2 files changed, 16 insertions(+), 12 deletions(-)
New commits:
commit 4ec698b388ca80cbb4531039285b0b2da2bf37ce
Author: James Antill <james at and.org>
Date: Fri Jun 18 11:39:59 2010 -0400
Have repoquery --archlist change preconf.arch too
diff --git a/docs/repoquery.1 b/docs/repoquery.1
index e2a6c63..3be6c7c 100644
--- a/docs/repoquery.1
+++ b/docs/repoquery.1
@@ -126,7 +126,9 @@ When used with --whatrequires, query packages recursively.
.IP "\fB\-\-archlist=ARCH1[,ARCH2...]\fP"
Limit the query to packages of given architecture(s). Valid values are all
architectures known to rpm/yum such as 'i386' and 'src' for
-source RPMS.
+source RPMS. Note that repoquery will now change yum's "arch" to the first
+value in the archlist. So "\-\-archlist=i386,i686" will change yum's canonical
+arch to i386, but allow packages of i386 and i686.
.IP "\fB\-\-pkgnarrow=WHAT\fP"
Limit what packages are considered for the query. Valid values for WHAT are:
installed, available, recent, updates, extras, all and repository (default).
diff --git a/repoquery.py b/repoquery.py
index 8d1d29b..e23d330 100755
--- a/repoquery.py
+++ b/repoquery.py
@@ -1062,11 +1062,24 @@ def main(args):
elif len(pkgops) == 0 and len(sackops) == 0:
pkgops.append("queryformat")
+ for exp in regexs:
+ if exp.endswith('.src'):
+ needsource = 1
+ break
+
+ if opts.archlist:
+ archlist = opts.archlist.split(',')
+ elif needsource:
+ archlist = getArchList()
+ archlist.append('src')
+
repoq = YumBaseQuery(pkgops, sackops, opts)
# silence initialisation junk from modules etc unless verbose mode
initnoise = (not opts.quiet) * 2
repoq.preconf.releasever = opts.releasever
+ if archlist:
+ repoq.preconf.arch = archlist[0]
if opts.conffile:
repoq.doConfigSetup(fn=opts.conffile, debuglevel=initnoise, init_plugins=opts.plugins)
else:
@@ -1138,17 +1151,6 @@ def main(args):
for repo in repoq.repos.findRepos(repo_match):
repo.enable()
- for exp in regexs:
- if exp.endswith('.src'):
- needsource = 1
- break
-
- if opts.archlist:
- archlist = opts.archlist.split(',')
- elif needsource:
- archlist = getArchList()
- archlist.append('src')
-
try:
if not hasattr(repoq, 'arch'):
repoq.doSackSetup(archlist=archlist)
More information about the Yum-commits
mailing list