Bug 198033 - [patch]: tweak perl.req to cut down false Requires
[patch]: tweak perl.req to cut down false Requires
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Paul Nasrat
Mike McLean
Depends On:
Blocks: 198027
  Show dependency treegraph
Reported: 2006-07-08 07:47 EDT by J. Randall Owens
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-07-08 10:08:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
patch for /usr/lib/rpm/perl.req (3.14 KB, patch)
2006-07-08 07:47 EDT, J. Randall Owens
no flags Details | Diff
patch for /usr/lib/rpm/perl.req with debugging output (3.28 KB, patch)
2006-07-08 07:57 EDT, J. Randall Owens
no flags Details | Diff

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Bugzilla 198027 None None None Never

  None (edit)
Description J. Randall Owens 2006-07-08 07:47:56 EDT
Created attachment 132100 [details]
patch for /usr/lib/rpm/perl.req
Comment 1 J. Randall Owens 2006-07-08 07:47:56 EDT
Description of problem:
False requirements for many perl packages; the latest example that happened to
come to my attention while I was learning a bit of spec file work anyway was
/usr/lib/rpm/perl.req finds some lines that are actually quoted by q{} but have
"use..." at the beginning of a line. It interprets these as perl dependencies
(could happen for "require..." too, but that's not such a common word).

Version-Release number of selected component (if applicable):

How reproducible:
Try to install perl-Image-ExifTools, either from downloaded package or a
frontend that should find dependencies for you, e.g. yum or smart, or even from

Steps to Reproduce:
1. download perl-Image-ExifTools-6.26-1.fc5.noarch.rpm &
2. rpm -Uhv perl-Image-ExifTools-6.26-1.fc5.noarch.rpm
3. rpm -i perl-Image-ExifTools-6.26-1.fc5.src.rpm ; rpmbuild -ba
SPECS/perl-Image-ExifTool.spec ; rpm -Uhv
Actual results:
error: Failed dependencies:
        perl(the) is needed by perl-Image-ExifTool-6.26-1.fc5.noarch
Exit 1

Expected results:
Preparing...                ########################################### [100%]
   1:perl-Image-ExifTool    ########################################### [100%]

Additional info:

$ rpm -qp --requires perl-Image-ExifTool-6.26-1.fc5.noarch.rpm
perl >= 0:5.002
perl >= 0:5.004
perl(the)           <====- this is the one
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(VersionedDependencies) <= 3.0.3-1

I poked around in /usr/lib/rpm/perl.req, after a verbose rpmbuild showed me
that's what was finding those dependencies. I think I have an improvement that
will cut down on such things without missing too much. I have a patch for a
regular version, attached here, and then I'll do a second attachment with a
perl.req-test, which outputs the chunks that were skipped over by my bit, plus
the two characters it found and is looking for, for debugging (I'm sure my
regexp has room for improvement).
It's not perfect, but neither is what we have now. I think it's a little bit
better. I ran rpmbuild after setting %__perl_requires in my .rpmmacros, it
installed just fine, and a diff of the outputs of `rpm -qp --requires` on each
package shows that the only difference there is perl(the).
I'm adding the author whose email is in comments in perl.req as a Cc: to this,
since I'm not sure just who has the overall authority on the contents. I'm also
listing the perl-Image-ExifTool bug I'd already reported as an "external" bug
reference; I'm not sure just how that works, so please be forgiving if I
should've just skipped it.
Comment 2 J. Randall Owens 2006-07-08 07:57:07 EDT
Created attachment 132101 [details]
patch for /usr/lib/rpm/perl.req with debugging output

Extra patch with some debugging output.
Comment 3 J. Randall Owens 2006-07-08 08:20:40 EDT
Oh, and as an extra note, here are other related bugs I found while looking to
see whether my patch might best be attached to one of them:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=109934 (with a patch right
where mine goes)

There seems to be some debate on whether to go with perl.req or perldeps.pl
--requires, but here this is for what it's worth. No worries if it ends up on
the cutting room floor.
Comment 4 Jeff Johnson 2006-07-08 09:53:26 EDT
Yah, Requires: perl(the) comes back againa and again and again, everyone is dying to tell me about 
perl.req problems even if the real problem is the inability to upgrade rpm with a "fix" ;-)

The problem really needs to be approached per-distro release, not in rpm, since there are filters in 
pkgs as well as multiple versions of perl.req floating around.

Too bad that FC has insufficient QA clue to undertake running this rpm-4.4.3 command on an 
"everything" clean install:

    /usr/lib/rpm/rpmdeps --perl -vv

That command finds Provides: from all installed perl scripts, and matches against Requires: from 
packages, and prints out any unmatched dependencies.

The command is not perfect, mind you, there's an even better script on
but it also demonstrates how easy the QA pn perl(...) would be to do if anyone really cared.

Thanks for the patch.
Comment 5 Jeff Johnson 2006-07-08 10:08:14 EDT
Added to rpm cvs, will be in rpm-4.4.7-0.13 and later when built/released.
Comment 6 J. Randall Owens 2006-07-08 19:04:12 EDT
Oh, I forgot to mention, the patch also cleans up a few typos in comments, and
removes the irrelevant and probably cycle-wasting case-insensitive option on a
pair of regexps where it doesn't matter. Figured I might as well hit those while
I was at it.

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