summaryrefslogtreecommitdiff
path: root/rpm
diff options
context:
space:
mode:
authorrsiddall <rsiddall>2008-12-10 19:42:08 +0000
committerrsiddall <rsiddall>2008-12-10 19:42:08 +0000
commit86632ed893a928f1795a7fbf782701321056947e (patch)
tree01a937d210b1930caecda0a31d3586e26b362ef9 /rpm
parent292f858b3403986811a02b694b544ebf22becd26 (diff)
Further modifications to handle Perl RPM names and map them back to Perl module
names.
Diffstat (limited to 'rpm')
-rwxr-xr-xrpm/rpm2Bundle28
1 files changed, 20 insertions, 8 deletions
diff --git a/rpm/rpm2Bundle b/rpm/rpm2Bundle
index 469c27b0f..1bc877124 100755
--- a/rpm/rpm2Bundle
+++ b/rpm/rpm2Bundle
@@ -11,10 +11,16 @@ my $verbose = 0;
# These are Perl dependencies that should be ignored/suppressed
my %suppress;
-foreach (qw/strict subs vars FS/) {
+foreach (qw/strict subs vars base lib warnings FS/) {
$suppress{$_} = $_;
}
+# These are Perl modules corresponding to RPM names.
+# Add entries when the mapping isn't simply "remove leading 'perl-' and replace - with ::"
+my %rpm2mod=(
+ 'DBD-MySQL' => 'DBD::mysql',
+);
+
## These are root packages that shouldn't be cited multiple times
## Should figure this out with CPAN
#my %rootpkgs;
@@ -39,19 +45,25 @@ foreach my $rawrpm (@ARGV) {
my %mods;
foreach (@deps) {
- if (/^perl\((.*)\)\s*((>=|=|<=)\s+([\d\.]+))?$/
- || /^perl-(.*)\s*((>=|=|<=)\s+([\d\.]+))?$/) {
- next if exists($suppress{$1});
- my @parts = split /::/, $1;
+ if (/^perl\((.*?)\)\s*((>=|=|<=)\s+([\d\.]+))?$/
+ || /^perl-(.*?)\s*((>=|=|<=)\s+([\d\.]+))?$/) {
+ my ($mod, $rel, $ver) = ($1, $3, $4);
+ if (/^perl-/) {
+ print STDERR "\"$mod\"\n" if $verbose;
+ $mod = $rpm2mod{$mod} if exists($rpm2mod{$mod});
+ $mod =~ s/-/::/g
+ }
+ next if exists($suppress{$mod});
+ my @parts = split /::/, $mod;
if (scalar @parts > 1) {
next if exists($suppress{$parts[0]});
}
if ($verbose) {
- print STDERR "$1";
- print STDERR " $3 $4" if $4;
+ print STDERR "$mod";
+ print STDERR " $rel $ver" if $ver;
print STDERR "\n";
}
- $mods{$1} = $4 ? $4 : undef;
+ $mods{$mod} = $ver ? $ver : undef; # Should also save $rel
}
}