Created attachment 846516 [details] reproducer Current behaviour: query.filter(latest_per_arch=True) returns multiple packages per name and arch Expected behaviour: one package per name and arch is returned See attached reproducer for details.
Reproduced. 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) > Reproduced. > > 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: import dnf.package import dnf.sack from dnf.sack import Sack def build_sack(base): cachedir = base.conf.cachedir # create the dir ourselves so we have the permissions under control: dnf.util.ensure_dir(cachedir) return Sack(pkgcls=dnf.package.Package, pkginitval=base, cachedir=cachedir, 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. https://admin.fedoraproject.org/updates/hawkey-0.4.8-1.fc20
Package hawkey-0.4.8-1.fc20: * 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: https://admin.fedoraproject.org/updates/FEDORA-2014-1248/hawkey-0.4.8-1.fc20 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.