Created attachment 846516 [details]
query.filter(latest_per_arch=True) returns multiple packages per name and arch
one package per name and arch is returned
See attached reproducer for details.
Not a bug in latest_per_arch, but a feature of libsolv itself: it by default does not add available packages of incompatible architectures (I assume this was run on x86_64) to the whatprovides structures. The querying then can fail as a result.
Dan, you can use hawkey directly and specify a different architecture when creating the Sack:
sack = hawkey.Sack(arch=ppc64)
Michael, is there an option in libsolv to consider all packages in cases like this?
(In reply to Ales Kozumplik from comment #1)
> Not a bug in latest_per_arch, but a feature of libsolv itself: it by default
> does not add available packages of incompatible architectures (I assume this
> was run on x86_64) to the whatprovides structures. The querying then can
> fail as a result.
> Dan, you can use hawkey directly and specify a different architecture when
> creating the Sack:
> sack = hawkey.Sack(arch=ppc64)
I tried following hack and the test passed:
from dnf.sack import Sack
cachedir = base.conf.cachedir
# create the dir ourselves so we have the permissions under control:
return Sack(pkgcls=dnf.package.Package, pkginitval=base,
rootdir=base.conf.installroot, arch="ppc64") # added ppc64 arch
dnf.sack.build_sack = build_sack
> Michael, is there an option in libsolv to consider all packages in cases
> like this?
I think following scenarios should be supported:
1) default system arch
sack = hawkey.Sack()
2) user defined arch
sack = hawkey.Sack(arch="ppc64")
3) all arches in repo (consider repoquery and similar tools)
sack = hawkey.Sack(arch="ALL")
1) and 2) -- packages of incompatible arches should not be available in the sack
No, the whatprovides hash intentionally only contains "installable" packages.
I don't see why filter_latest really needs to use it, though. Just change the code to push all package ids in the "res" map onto the samename queue, then sort the queue by package name.
(that last comment was an answer to Ales question, of course)
If you want to implement arch="ALL", just don't call pool_setarch (or call it with a NULL arch.
Maybe do something like: http://paste.fedoraproject.org/66471/
Thank you for the analysis and the patch, Michael, I've submitted it to master in 522fb1c.
hawkey-0.4.8-1.fc20 has been submitted as an update for Fedora 20.
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing hawkey-0.4.8-1.fc20'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
hawkey-0.4.8-1.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.