Red Hat Bugzilla – Bug 790715
contra-intuitive and likely broken behavior of rpmquery --archlist
Last modified: 2015-02-17 09:06:44 EST
Description of problem:
The man page for rpmquery --archlist says:
Limit the query to packages of given architecture(s).
This means that, given the option, one should get fewer results than without the option. However, I am observing the exactly opposite behavior.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. repoquery --repoid=rawhide-source --whatrequires gcc-plugin-devel
2. repoquery --repoid=rawhide-source --whatrequires gcc-plugin-devel --archlist=src
1. gives me an empty list
2. gives me gcc-python-plugin-0:0.9-1.fc17.src
2. should give less-or-equal items than 1. according to docs.
For "real" architectures, --archlist should behave like you expect it to, but source packages are a bit special as they're never included in queries unless explicitly enabled with --archlist.
This means the --archlist option is used for unrelated and undocumented purposes.
Note that source repositories are not enabled by default, so one would think that enabling them is enough to make repoquery use them. What is actually the purpose of this undocumented magic?
yum, repoquery etc have no idea whether a repository is "source" repository or not (and no, it's not really appropriate to decide by repository name), and in fact its possible to have both source- and binary packages in a single repo.
It's been a while, but IIRC --archlist override also allows showing binary packages that aren't considered compatible with the current arch which it normally wouldn't show, and the .src "arch" is just a special case of that. So your expectation of "2. should give less-or-equal items than 1." is not really valid generally.
I dont see anything explicit about "should always give less results" in the man page, apart from the term "limit" which can be interpreted that way. Probably just a matter of clarifying the behavior.
Although I am not a native speaker, this definition sounds clear to me:
Yes, and --archlist does fit the definition: it will not output packages with architectures outside the ones specified, ie it limits the output to packages matching the specified arch(s). The confusion comes from the default, implicit archlist which you never see (ie exclude .src and non-compatible archs), and assuming --archlist *further* limits the results.
Mind you I dont disagree at all with it being somewhat non-obvious, especially the .src support in repoquery and friends has always been a bit of a hack with strange quirks.
Nope, "to limit" means less-or-equal than default unless you specify what the limit applies to, or what the default actually is. Querying tools (like GNU find) usually defaults to match all results when no options are given.
If you insist on the behavior being correct (and enough user-friendly), the documentation needs to be clarified. Please have a look at the following wording, whether it describes the current behavior:
"Limit the query to packages of given architecture(s). If this option is not used, it defaults to exclude .src and non-compatible architectures. By using this option, you override the default, which allows you to query source repositories in particular."
The above should probably appear not only in the man page, but also in the output repoquery --help (perhaps in a compressed form?). The current documentation is actually worse than no documentation.
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.
(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)
More information and reason for this action is here:
This message is a notice that Fedora 19 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 19. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.
Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 19 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
Thank you for reporting this bug and we are sorry it could not be fixed.