Bug 214496
Summary: | perl.prov can miss $VERSION for packages defined in multiple blocks | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | James Ralston <ralston> | ||||
Component: | rpm | Assignee: | Panu Matilainen <pmatilai> | ||||
Status: | CLOSED RAWHIDE | QA Contact: | |||||
Severity: | low | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 7 | ||||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2007-08-28 11:04:58 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
James Ralston
2006-11-07 21:08:05 UTC
User pnasrat's account has been closed Reassigning to owner after bugzilla made a mess, sorry about the noise... Created attachment 172460 [details]
patch to correct perl.prov's behavior
Well, here's the problem:
$ grep -E '^\s*(package|\$VERSION)' /usr/lib/perl5/5.8.8/Getopt/Long.pm
package Getopt::Long;
$VERSION = 2.35;
package Getopt::Long::Parser;
package Getopt::Long;
The problem is, when /usr/lib/rpm/perl.prov sees a "package" statement, it
forgets about any previous $VERSION line it saw. In other words, perl.prov is
expecting this:
$ grep -E '^\s*(package|\$VERSION)' /usr/lib/perl5/5.8.8/Getopt/Long.pm
package Getopt::Long;
$VERSION = 2.35;
package Getopt::Long::Parser;
package Getopt::Long;
$VERSION = 2.35;
But from reading /usr/lib/perl5/5.8.8/Getopt/Long.pm, this is clearly wrong;
the second "package Getopt::Long" definition is concatenating with the first
one.
I think perl.prov should try to match perl's behavior. And we can test that:
$ cat native-perl-provides
#! /usr/bin/perl
use Getopt::Long;
use strict;
use warnings;
if (defined $Getopt::Long::VERSION) {
print "perl(Getopt::Long) = $Getopt::Long::VERSION\n";
} else {
print "perl(Getopt::Long)\n";
}
if (defined $Getopt::Long::Parser::VERSION) {
print "perl(Getopt::Long) = $Getopt::Long::Parser::VERSION\n";
} else {
print "perl(Getopt::Long::Parser)\n";
}
./native-perl-provides
perl(Getopt::Long) = 2.35
perl(Getopt::Long::Parser)
So, according to perl itself, Getopt::Long has a version, but
Getopt::Long::Parser does not. That means that successive definitions of the
same package should NOT stomp a previously-found $VERSION.
The attached patch implements this behavior.
Fixed in rpm 4.4.2.2(-rc1) in next rawhide push. 4.4.4.2 final should find it's way to F7 too eventually... Thanks for the patch! |