Bug 1325982

Summary: rpm -q --whatsuggests not consistent with --whatrequires
Product: [Fedora] Fedora Reporter: Michael Mráka <mmraka>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: jzeleny, lkardos, novyjindrich, packaging-team-maint, pknirsch
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-04-14 12:24:23 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 Michael Mráka 2016-04-11 14:08:12 UTC
Description of problem:
Querying rich dependencies with
  rpm -q --whatsuggests XXX
shows different output than what it outputs with
  rpm -q  --whatrequires XXX
for similarly defined requires.
And similarly for other weak dependencies - Recommends, Supplements, Enhances.

Version-Release number of selected component (if applicable):
rpm-4.13.0-0.rc1.12.fc23.x86_64

How reproducible:
always

Steps to Reproduce:
1. build a package with rich dependencies both in requires and Suggests:
grep -E 'Requires:|Suggests:' richdep.spec
Requires: A
Requires: B
Requires: (C and D)
Requires: (E or F)
Requires: (G if H else I)
Suggests: AS
Suggests: BS
Suggests: (CS and DS)
Suggests: (ES or FS)
Suggests: (GS if HS else IS)

2. for i in A B C D E F G H I ; do echo -n "$i: " ; rpm -q --whatrequires $i ; done
3. for i in AS BS CS DS ES FS GS HS IS ; do echo -n $i: ; rpm -q --whatsuggests $i ; done

Actual results:
A: richdep-1-1.fc23.noarch
B: richdep-1-1.fc23.noarch
C: richdep-1-1.fc23.noarch
D: richdep-1-1.fc23.noarch
E: richdep-1-1.fc23.noarch
F: richdep-1-1.fc23.noarch
G: richdep-1-1.fc23.noarch
H: no package requires H
I: richdep-1-1.fc23.noarch

AS: richdep-1-1.fc23.noarch
BS: richdep-1-1.fc23.noarch
CS: no package suggests CS
DS: no package suggests DS
ES: no package suggests ES
FS: no package suggests FS
GS: no package suggests GS
HS: no package suggests HS
IS: no package suggests IS


Expected results:
AS: richdep-1-1.fc23.noarch
BS: richdep-1-1.fc23.noarch
CS: richdep-1-1.fc23.noarch
DS: richdep-1-1.fc23.noarch
ES: richdep-1-1.fc23.noarch
FS: richdep-1-1.fc23.noarch
GS: richdep-1-1.fc23.noarch
HS: no package suggests HS
IS: richdep-1-1.fc23.noarch

Additional info:
Note that  rpm -q --whatrequires H has been fixed to return "richdep" in newer rpm so should rpm -q --whatsuggests H do.

See thread on http://lists.rpm.org/pipermail/rpm-ecosystem/2016-April/000336.html

Comment 1 Ľuboš Kardoš 2016-04-14 12:24:23 UTC
Fixed in rawhide in rpm-4.13.0-0.rc1.30.fc25. You need to rebuild rpmddb for this change to take effect.