Description of problem: perl.req is generating a erroneous Requires. It appears that this script can't parse here documents. Version-Release number of selected component (if applicable): rpm-build-4.0.4-7x.18 How reproducible: everytime Steps to Reproduce: 1. Run /usr/lib/rpm/perl.req on the attached file. Actual results: perl(strict) perl(the) Expected results: perl(strict) Additional info:
Created attachment 91069 [details] Perl source demonstrating bug This is a cut and paste of a section of code from mysql-3.23.54a/bin/mysqlaccess, which you can find in the tgz of MySQL here http://www.mysql.com/downloads/download.php?file=Downloads%2FMySQL-3.23%2Fmysql-3.23.56.tar.gz&mirror=http%3A%2F%2Fmysql.he.net%2F
Try the perl.req from rpm-4.1. I'm pretty sure this problem is fixed there.
Still broken. % cd /var/tmp % rpm -q redhat-release redhat-release-8.0-8 % rpm -qf /usr/lib/rpm/perl.req rpm-build-4.1-1.06 % wget -q -O test.pl \ "http://bugzilla.redhat.com/bugzilla/attachment.cgi?id=91069&action=view" % /usr/lib/rpm/perl.req test.pl perl(strict) perl(the) %
Then you will need to filter the offending dependencies manually. See many CPAN package, look for %__find_requires override in spec file. FWIW, there's also a replacement for perl.{prov,req} scripts in rp[m-4.1.1 and later.
This bug has nothign to do with CPAN. This is a bug when perl.req parses ANY here doc. In this case, it's scrwing up with parsing stuff in a mysql build. It'd be really helpful if you could send a url to one of those spec files. I'm sure it's in many modules, but there are many * 2 modules, so it's kinda like the old needle and haystack deal. Secondly, I am using 4.1.1 so I'm not sure what you mean about the replacement deal.
Look at perl-DBD-MySQL spec file from Red Hat 9. Don't worry, no one is using /usr/lib/rpm/perldeps.pl, also in rpm-4.1.1.
I started looking into the guts of "perl.req" and this regexp looks fairly wrong to me... (m/^(\s*) # we hope the inclusion starts the line (require|use)\s+(?!\{) # do not want 'do {' loops # quotes around name are always legal [\'\"]?([^\;\ \'\"\t]*)[\'\"]?[\t\;\ ] # the syntax for 'use' allows version requirements \s*([.0-9]*) /x) ) { my ($whitespace, $statement, $module, $version) = ($1, $2, $3,$4); For starters, it's allowing the ";" to appear prior to the version number ... and it doesn't seem like this regexp (or any of the other code after it) is enforcing that there must eventually be a ";" (after an optional LIST for the modules impot method). I also noticed this line... # skip if the phrase was "use of" -- shows up in gimp-perl, et al next if $module eq 'of'; which makes me wonder if perhaps this bug could be fixed quickly by changing that line to ... # skip if the phrase was "use of" -- shows up in gimp-perl, et al next if $module =~ /^(of|the)$/i; (which could later include any other common prepositions that show up in documentation) Lastly: I have to wonder if the best solution wouldn't be to strip "here docs" the same way that POD is striped?
Yup, perl.req (or new-fangled /usr/lib/rpm/perldeps.pl) is where final fix for an errant misfiring regex is gonna be needed. Getting consensus on the fix is harder, requires burn-in on an entire release cycle these days. Equivalently, rebuild 1500+ packages in distro to show equivalent automagic dependency generation.
Well, if redhat really plans to fix this, shouldn't the bug be left open? Or marked as a duplicate/dependency of a bug that tracks the acutal work? It'll be forgotten, or the same defect filed again if this stays closed. I'm not trying to be a jackass user, just trying to help redhat make a solid product. I don't want this to slip through the cracks. Separately, I want to see if /usr/lib/rpm/perldeps.pl has the same problems. Which rpm owns this file?
bash$ rpm -qf /usr/lib/rpm/perldeps.pl rpm-build-4.2-0.69 I'd love to fix, but correctly generating correct output for all possible perl scripts is not an easy problem. BTW, Requires: perl(strict) is a real dependency. bash$ rpm -q --provides perl | grep strict perl(strict)