Bug 198033 - [patch]: tweak perl.req to cut down false Requires
Summary: [patch]: tweak perl.req to cut down false Requires
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 5
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Paul Nasrat
QA Contact: Mike McLean
Depends On:
Blocks: 198027
TreeView+ depends on / blocked
Reported: 2006-07-08 11:47 UTC by J. Randall Owens
Modified: 2007-11-30 22:11 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2006-07-08 14:08:14 UTC
Type: ---

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

System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 198027 0 medium CLOSED false RPM Requires "perl(the)" 2021-02-22 00:41:40 UTC

Internal Links: 198027

Description J. Randall Owens 2006-07-08 11:47:56 UTC
Created attachment 132100 [details]
patch for /usr/lib/rpm/perl.req

Comment 1 J. Randall Owens 2006-07-08 11:47:56 UTC
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 11:57:07 UTC
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 12:20:40 UTC
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 13:53:26 UTC
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 14:08:14 UTC
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 23:04:12 UTC
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.