Hide Forgot
Description of problem: Currently its not possible to use Hawkey without setting an architecture. So if you are using Hawkey on a different platform to the repository you are inspecting you have to determine the architecture before hand to get the correct rpms back from query results using provides parameter. Which can be misleading if you have a requires that doesn't specify architecture such as "grep = 2.20-3.el6" opposed to "grep(ppc-64) = 2.20-3.el6" This functionality works within libsolv if you don't call pool_setarch, it will correctly find the rpm/package regardless of the architecture if it matches RelDep/requires string. How reproducible: 100% Steps to Reproduce: 1. Have ppc64 repository. 2. Be on any arch not ppc64(or ppc) with hawkey. 3. Query for rpms in repository using provides for rpm within repository. Actual results: Query will not return expected rpm even if it "provides" the non-arch specific requirement. Expected results: Ability to set hawkey.Sack(all_arch=True). To query repositories independent of system architecture or supplied architecture within Sack.__init__. Additional info: As we use hawkey in rpmdeplint to work out install/repo issues having it tied to the platform architecture produces incorrect results.
does `hawkey.Sack(arch="ppc")` work for you or you really need ALL (ANY) architectures?
Yeah in this circumstance hawkey.Sack(arch='ppc') would work, but as we use rpmdeplint (tool we work on) to determine whether a package can be installed without installing it on the host machine but based on repository constraints (which could have multiple arches in the repo). This means that we'd have to know all the possible architectures of the rpms within a repository before querying it. I tested a compile of hawkey without the set_poolarch used and it successfully works with libsolv.
Created attachment 1208690 [details] all_arch option for hawkey/libdnf sack with tests patch. Adding in a patch for the requested RFE. If you would like this submitted elsewhere I am more than happy to accommodate.
Made couple of fixes and submitted PR: https://github.com/rpm-software-management/libhif/pull/200