Bug 1469136

Summary: Requires not handed correctly?
Product: [Fedora] Fedora Reporter: Ralf Corsepius <rc040203>
Component: rpmAssignee: Igor Gnatenko <ignatenko>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: ffesti, ignatenko, kardos.lubos, mjw, packaging-team-maint, pmatilai, rc040203, vmukhame
Target Milestone: ---Keywords: Reopened
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-07-10 15:07:52 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 Ralf Corsepius 2017-07-10 13:04:55 UTC
Description of problem:

On fc26 I just encountered this:

Reinstalling/updating perl to perl-5.24.1-392.fc26 pulls in perl-macros:
# dnf reinstall perl
...
Reinstalling:
 perl          x86_64   4:5.24.1-392.fc26      updates   6.0 M
Installing dependencies:
 perl-macros   x86_64   4:5.24.1-392.fc26      updates    65 k
...

Verifying perl requires perl-macros:
# rpm -q --requires perl | grep macros
perl-macros

Now remove perl-macros:
# rpm -e perl-macros
No warning nor else.

Verifying perl-macros actually was removed:
# rpm -q perl-macros
package perl-macros is not installed


However:
1. perl still requires perl-macros:
# rpm -q --requires perl | grep macros
perl-macros

2. Nobody is providing it:
# rpm -q --whatprovides perl-macros
no package provides perl-macros

3. dnf also doesn't complain:
# dnf repoquery --unsatisfied 


=> I have an unsatisfied/broen "Requires" in my rpmdb, but the tools 
do not complain about it. WTH ?!?


Version-Release number of selected component (if applicable):
rpm-4.13.0.1-5.fc26.x86_64
dnf-2.5.1-1.fc26.noarch

How reproducible:
Always.

Steps to Reproduce:
see above.

Comment 1 Igor Gnatenko 2017-07-10 13:06:33 UTC
dnf check?

Comment 2 Florian Festi 2017-07-10 13:09:52 UTC
This behaviour is probably correct. Perl has

Requires(post): perl-macros

This means that perl-macro is only needed during installation and can be removed afterwards.

Comment 3 Igor Gnatenko 2017-07-10 13:38:36 UTC
(In reply to Florian Festi from comment #2)
> This behaviour is probably correct. Perl has
> 
> Requires(post): perl-macros
> 
> This means that perl-macro is only needed during installation and can be
> removed afterwards.

Thanks Florian for looking into it ;)

Comment 4 Ralf Corsepius 2017-07-10 14:48:27 UTC
(In reply to Florian Festi from comment #2)
> This behaviour is probably correct.
I disagree -> Reopening

# rpm -q --requires perl

still returns "perl-macros"

This means "rpm -q --requires" has been rendered pretty much useless and non-helpful => REGRESSION.


> Perl has
> 
> Requires(post): perl-macros
That's something I do not understand. It seem complete meaningless to me. I am inclined to consider this to be a packaging bug.

> This means that perl-macro is only needed during installation and can be
> removed afterwards.
I don't understand this.

Comment 5 Florian Festi 2017-07-10 15:07:52 UTC
For this being a regression there has to be a change in behaviour. Can you please point out between which versions of rpm the behaviour changed?

The fact that you do not understand something is not a bug in rpm. Please open a bug against the proper component. The same applies to the possible packaging issue in the perl package.

PS: You might want to try rpm -qv --requires

Comment 6 Ralf Corsepius 2017-07-10 17:07:53 UTC
(In reply to Florian Festi from comment #5)
> For this being a regression there has to be a change in behaviour. Can you
> please point out between which versions of rpm the behaviour changed?
I am sure, you understand the "friendlyness" you are communicating here :(

You are right insofar, as this bug is present in all Fedoras I have access to (back to f23). This of course don't mean much because are using rpm-4.13.x.

> The fact that you do not understand something is not a bug in rpm. 
Well, I do not understand rpm's behavior and perl's packaging.

I.e, I consider
a) rpm's way of handling "requires(post)" not to make any sense
b) perl.spec carrying Requires(post) to a packaging mistake.

I.e. I assume a packaging bug in perl.spec is triggering a bug in rpm/dnf.

Comment 7 Panu Matilainen 2017-07-31 14:42:09 UTC
This is expected behavior, unchanged all the way since rpm 4.0.1 (that'd be sometime during 2001, yes that old) where the fine-grained Requires(pre/post/etc) dependencies were originally introduced. See https://raw.githubusercontent.com/rpm-software-management/rpm/master/doc/manual/tsort for the original rationale.

Bottom line, it's a packaging bug, and not an entirely uncommon one at that.
"Requires(post): foo" states that the package requires "foo" to be present during execution of %post scriptlet. Nothing more, nothing less. If the package also requires "foo" for it's normal operation then there should be an additional "Requires: foo" for that.

Comment 8 Panu Matilainen 2017-08-02 07:19:22 UTC
FWIW there's actually an RFE to make dnf take advantage of the fine-grained dependencies as they are implemented, see bug 1381332.