From f4424d02d18860902fedf865ea385ec70b1bc140 Mon Sep 17 00:00:00 2001 From: stevenpritchard Date: Mon, 5 May 2008 20:17:50 +0000 Subject: [PATCH] Try $] as-is and numeric when we use it with Module::CoreList. --- Changes | 2 +- cpanspec | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Changes b/Changes index 6a85a42..30bf31d 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,6 @@ 1.75 -* Make sure $] is numeric before we use it with Module::CoreList. +* Try $] as-is and numeric when we use it with Module::CoreList. * Switch from wget to curl in cpanget since wget is broken in Fedora 9. * The best README is probably the one with the shortest filename. diff --git a/cpanspec b/cpanspec index bc64d73..3188efd 100755 --- a/cpanspec +++ b/cpanspec @@ -10,7 +10,7 @@ # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# $Id: cpanspec,v 1.59 2008/05/05 18:39:21 stevenpritchard Exp $ +# $Id: cpanspec,v 1.60 2008/05/05 20:17:50 stevenpritchard Exp $ our $NAME="cpanspec"; our $VERSION='1.75'; @@ -561,10 +561,14 @@ if (!$packager or $packager eq "\%packager") { . " Please add or use --packager option.\n"; } -my $perl_version=$]+0; +my $perl_version=$]; -die "Module::CoreList does not support perl version $perl_version!\n" - if (!exists($Module::CoreList::version{$perl_version})); +if (!exists($Module::CoreList::version{$perl_version})) { + $perl_version+=0; + if (!exists($Module::CoreList::version{$perl_version})) { + die "Module::CoreList does not support perl version $perl_version!\n"; + } +} my @args=@ARGV; my @processed=(); @@ -969,7 +973,7 @@ END } for my $dep (sort(keys(%build_requires))) { - if (exists($Module::CoreList::version{$]}{$dep})) { + if (exists($Module::CoreList::version{$perl_version}{$dep})) { next if (!$compat and $dep ne "ExtUtils::MakeMaker"); } elsif ($follow) { if ($dep ne $module and !(grep { $_ eq $dep } @processed, @args)) { @@ -992,7 +996,7 @@ END } for my $dep (sort(keys(%requires))) { - next if (!$compat and exists($Module::CoreList::version{$]}{$dep})); + next if (!$compat and exists($Module::CoreList::version{$perl_version}{$dep})); printf $spec "%-16s%s", "Requires:", "perl($dep)"; print $spec (" >= " . $requires{$dep}) if ($requires{$dep}); print $spec "\n";