Bug 1469136 - Requires not handed correctly?
Requires not handed correctly?
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
26
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Igor Gnatenko
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-10 09:04 EDT by Ralf Corsepius
Modified: 2017-08-02 03:19 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-07-10 11:07:52 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ralf Corsepius 2017-07-10 09:04:55 EDT
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 09:06:33 EDT
dnf check?
Comment 2 Florian Festi 2017-07-10 09:09:52 EDT
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 09:38:36 EDT
(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 10:48:27 EDT
(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 11:07:52 EDT
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 13:07:53 EDT
(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 10:42:09 EDT
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 03:19:22 EDT
FWIW there's actually an RFE to make dnf take advantage of the fine-grained dependencies as they are implemented, see bug 1381332.

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