Bug 1380597

Summary: [RFE] Allow Sack arch option to be "any" or not set in libsolv.
Product: [Fedora] Fedora Reporter: Tyrone Abdy <tabdy>
Component: libdnfAssignee: rpm-software-management
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jmracek, mluscon, packaging-team-maint, RadekHolyPublic, rpm-software-management, tabdy, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-08 15:17:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1378253    
Attachments:
Description Flags
all_arch option for hawkey/libdnf sack with tests patch. none

Description Tyrone Abdy 2016-09-30 04:41:51 UTC
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.

Comment 1 Igor Gnatenko 2016-10-03 11:19:30 UTC
does `hawkey.Sack(arch="ppc")` work for you or you really need ALL (ANY) architectures?

Comment 2 Tyrone Abdy 2016-10-03 22:16:47 UTC
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.

Comment 3 Tyrone Abdy 2016-10-10 00:52:51 UTC
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.

Comment 4 Igor Gnatenko 2016-10-10 06:20:45 UTC
Made couple of fixes and submitted PR: https://github.com/rpm-software-management/libhif/pull/200