Bug 58537 - /usr/lib/rpm/perl.req can create bogus requirements
Summary: /usr/lib/rpm/perl.req can create bogus requirements
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm-build
Version: 7.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-01-18 23:51 UTC by dharris
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2002-01-22 23:55:03 UTC
Embargoed:


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

Description dharris 2002-01-18 23:51:39 UTC
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 23:48:55 UTC
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 23:54:58 UTC
Created attachment 43217 [details]
Patch mentioned in previous comment.

Comment 3 Jeff Johnson 2002-01-22 23:59:14 UTC
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.