Bug 58537 - /usr/lib/rpm/perl.req can create bogus requirements
/usr/lib/rpm/perl.req can create bogus requirements
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: rpm-build (Show other bugs)
7.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-01-18 18:51 EST by dharris
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-01-22 18:55:03 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch mentioned in previous comment. (1.17 KB, patch)
2002-01-22 18:54 EST, dharris
no flags Details | Diff

  None (edit)
Description dharris 2002-01-18 18:51:39 EST
Description of Problem:

/usr/lib/rpm/perl.req is overzealous in creating requirements based on "do" 
and "require" statements in perl.

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

rpm-devel-4.0.3-1.03

SHELL SESSION TRANSCRIPT WITH COMMENTARY THAT SHOWS BUG
------------------------------------------------------------------

/usr/lib/rpm/perl.req is simply overzealous in creating requirements based 
on "do" and "require" statements in perl.

Often times perl scripts use a "do" statement to include a configuration file. 
These should not be added as dependencies.

Here is a test perl script that contains a "do" statement to include a 
configuration file. I've seen stuff like this before in software. When you 
run /usr/lib/rpm/perl.req it comes up with a bogus dependency:

# cat  perl-req-test02.pl
#!/usr/bin/perl

do '/etc/mything/myconfigfile.pl';

print $greeting;

# find perl-req-test02.pl | /usr/lib/rpm/perl.req
perl(::etc/mything/myconfigfile.pl)

You can see that "perl(::etc/mything/myconfigfile.pl)" is a bogus dependency 
which no package is going to provide.

RECOMENDED FIX
----------------------------------------------------------

The /usr/lib/rpm/perl.req script needs to be more careful about creating 
requirements from "do" and "require" statements.

I think that /usr/lib/rpm/perl.req should only create requirements for "use" 
and "require" statements which have arguments that clearly look like package 
names.

It's better to err on the side of not creating a requirement than creating to 
many, IMHO.
Comment 1 dharris 2002-01-22 18:48:55 EST
After building a *bunch* of packages and checking out the requirements and 
dependency problems, I have found created a patch that gives the best 
requirement detection, IMHO.
Comment 2 dharris 2002-01-22 18:54:58 EST
Created attachment 43217 [details]
Patch mentioned in previous comment.
Comment 3 Jeff Johnson 2002-01-22 18:59:14 EST
Perfect, thanks for the patch. This should be in rpm-4.0.4-0.17
and later, as soon as I get a chance to build.

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