Bug 1328975

Summary: if multiple packages are added to sack, hawkey sets location to None
Product: [Fedora] Fedora Reporter: Daniel Mach <dmach>
Component: hawkeyAssignee: rpm-software-management
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: jmracek, mluscon, packaging-team-maint, RadekHolyPublic, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libdnf-0.7.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-10 10:52:16 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:

Description Daniel Mach 2016-04-20 19:12:52 UTC
If multiple packages are added to sack, hawkey sets location to None.


Reproducer:

d = dnf.base.Base(...)
d.fill_sack(load_system_repo=False, load_available_repos=False)

pkg = d.add_remote_rpm(<path>)
print pkg.location
> /path/to/rpm

pkg = d.add_remote_rpm(<path>)
print pkg.location
> None


Version:
python-hawkey-0.6.3-1.git.0.08f4354.fc23.x86_64
libsolv-0.6.20-1.fc23.x86_64
python2-dnf-1.1.8-1.git.0.3c4b0a3.fc23.noarch

Comment 1 Daniel Mach 2016-04-20 19:17:23 UTC
This also affects accessing pkg.header:

print pkg.header
Traceback (most recent call last):
...
  File "/usr/lib/python2.7/site-packages/dnf/package.py", line 78, in header
    return dnf.rpm.header(self.localPkg())
  File "/usr/lib/python2.7/site-packages/dnf/rpm/__init__.py", line 56, in header
    with open(path) as package:
TypeError: coercing to Unicode: need string or buffer, NoneType found

Comment 2 Honza Silhan 2016-04-25 11:37:09 UTC
we'll take a look

Comment 3 Michal Luscon 2016-05-03 17:36:07 UTC
Fixed in https://github.com/rpm-software-management/libhif/pull/115/commits

Comment 4 Fedora Admin XMLRPC Client 2016-07-08 09:24:24 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 5 Jan Kurik 2016-07-26 05:01:05 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle.
Changing version to '25'.

Comment 6 Jaroslav Mracek 2017-03-10 10:52:16 UTC
Fixed in libdnf-0.7.1-1 and released into rawhide