Bug 1295059

Summary: dnf info <pkg> does not recognize that particular package is not installed from any repository
Product: [Fedora] Fedora Reporter: frantisek.reznicek <frantisek.reznicek>
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 22CC: jsilhan, mluscon, packaging-team-maint, pnemade, RadekHolyPublic, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-04 12:40:44 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:
Embargoed:

Description frantisek.reznicek 2016-01-01 14:24:31 UTC
Description of problem:

dnf info <pkg> does not recognize that particular package is not installed from any repository.

Scenario:
 1] buggy xorg-x11-drv-nouveau forced me to recompile if from FC23
    last official FC22 is xorg-x11-drv-nouveau-1.0.11-2.fc22
    my one installed via rpm is xorg-x11-drv-nouveau-1.0.12-1.fc22.x86_64

 2] yum-deprecated info xorg-x11-drv-nouveau says 
    Repo        : installed
 3] dnf info xorg-x11-drv-nouveau says
    Repo        : @System

DNF is mimmicking generally very well yum behavior but here you can see that additional check is missing whether particular package version is available.

Saying it simply, dnf performs xorg-x11-drv-nouveau package check in all repos but does not perform check whether xorg-x11-drv-nouveau-1.0.12-1.fc22.x86_64 exists in a repo.

Version-Release number of selected component (if applicable):
# rpm -q dnf-yum yum dnf
dnf-yum-1.1.4-2.fc22.noarch
yum-3.4.3-505.fc22.noarch
dnf-1.1.4-2.fc22.noarch


How reproducible:
100%

Steps to Reproduce:
1. recompile a package (rpmbuild --rebuild https://kojipkgs.fedoraproject.org//packages/.../xorg-x11-drv-nouveau-1.0.12-1.fc23.src.rpm)
2. install that new package (rpm -Uvh xorg-x11-drv-nouveau-1.0.12-1.fc23.x86_64.rpm)
3. yum[-deprecated] info xorg-x11-drv-nouveau | grep Repo
4. dnf info xorg-x11-drv-nouveau | grep Repo

Actual results:
DNF info <pkg> does not recognize that particular package is installed manually witout any repo
Expected results:
DNF info <pkg> should be more compatible with yum info including Repo property value

Additional info:
[root@localhost xorg-x11-drv-nouveau]# rpmbuild --rebuild <url>
[root@localhost xorg-x11-drv-nouveau]# rpm -Uvh xorg-x11-drv-nouveau-1.0.12-1.fc22.x86_64.rpm xorg-x11-drv-nouveau-debuginfo-1.0.12-1.fc22.x86_64.rpm
[root@localhost xorg-x11-drv-nouveau]# dnf info xorg-x11-drv-nouveau
Last metadata expiration check performed 3:03:27 ago on Fri Jan  1 12:07:25 2016.
Installed Packages
Name        : xorg-x11-drv-nouveau
Arch        : x86_64
Epoch       : 1
Version     : 1.0.12
Release     : 1.fc22
Size        : 217 k
Repo        : @System
Summary     : Xorg X11 nouveau video driver for NVIDIA graphics chipsets
URL         : http://www.x.org
License     : MIT
Description : X.Org X11 nouveau video driver.

[root@localhost xorg-x11-drv-nouveau]# /usr/bin/yum-deprecated info xorg-x11-drv-nouveau
Yum command has been deprecated, use dnf instead.
See 'man dnf' and 'man yum2dnf' for more information.

Installed Packages
Name        : xorg-x11-drv-nouveau
Arch        : x86_64
Epoch       : 1
Version     : 1.0.12
Release     : 1.fc22
Size        : 217 k
Repo        : installed
Summary     : Xorg X11 nouveau video driver for NVIDIA graphics chipsets
URL         : http://www.x.org
License     : MIT
Description : X.Org X11 nouveau video driver.

[root@localhost xorg-x11-drv-nouveau]# dnf info xorg-x11-drv-nouveau | grep Repo
Repo        : @System
[root@localhost xorg-x11-drv-nouveau]# yum-deprecated info xorg-x11-drv-nouveau | grep Repo
Repo        : installed

Comment 1 Honza Silhan 2016-01-04 12:40:44 UTC
There's a key "from repo" below "repo". I.e.:
...
Repo        : @System
From repo   : @commandline
...

This is shown when the package was installed from command line. When it's installed from repository, you will see the repository there instead.