Bug 1380597 - [RFE] Allow Sack arch option to be "any" or not set in libsolv.
Summary: [RFE] Allow Sack arch option to be "any" or not set in libsolv.
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: libdnf
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1378253
TreeView+ depends on / blocked
 
Reported: 2016-09-30 04:41 UTC by Tyrone Abdy
Modified: 2017-02-08 15:17 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-08 15:17:08 UTC
Type: Bug


Attachments (Terms of Use)
all_arch option for hawkey/libdnf sack with tests patch. (8.83 KB, patch)
2016-10-10 00:52 UTC, Tyrone Abdy
no flags Details | Diff

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


Note You need to log in before you can comment on or make changes to this bug.