1.67 final.

- Complete .tgz support.
- Ignore path parts of file names.
This commit is contained in:
stevenpritchard committed 2006-07-13 21:57:16 +00:00
1 parent 4f51546ce6
commit 5f08bd26aa
2 files changed
+9 -6

No files matched your search

+2 -1
View File
@@ -1,8 +1,9 @@
1.67 1.67 2006-07-13
* Exclude NINJA. * Exclude NINJA.
* Do a case-insensitive match on the possible licenses. * Do a case-insensitive match on the possible licenses.
* Add a patch from Ian Burrell to support .tgz archives. * Add a patch from Ian Burrell to support .tgz archives.
* Handle files that aren't in the current directory properly.
1.66 2006-05-16 1.66 2006-05-16
+7 -5
View File
@@ -10,7 +10,7 @@
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# #
# $Id: cpanspec,v 1.30 2006/07/01 23:16:09 stevenpritchard Exp $ # $Id: cpanspec,v 1.31 2006/07/13 21:57:16 stevenpritchard Exp $
our $NAME="cpanspec"; our $NAME="cpanspec";
our $VERSION='1.67'; our $VERSION='1.67';
@@ -539,15 +539,15 @@ my @processed=();
for my $file (@args) { for my $file (@args) {
my ($name,$version,$type); my ($name,$version,$type);
if ($file =~ /^(.*)-([^-]+)\.(tar)\.gz$/) { if ($file =~ /^(?:.*\/)?(.*)-([^-]+)\.(tar)\.gz$/) {
$name=$1; $name=$1;
$version=$2; $version=$2;
$type=$3; $type=$3;
} elsif ($file =~ /^(.*)-([^-]+)\.tgz$/) { } elsif ($file =~ /^(?:.*\/)?(.*)-([^-]+)\.tgz$/) {
$name=$1; $name=$1;
$version=$2; $version=$2;
$type = 'tar'; $type = 'tar';
} elsif ($file =~ /^(.*)-([^-]+)\.(zip)$/) { } elsif ($file =~ /^(?:.*\/)?(.*)-([^-]+)\.(zip)$/) {
$name=$1; $name=$1;
$version=$2; $version=$2;
$type=$3; $type=$3;
@@ -567,6 +567,8 @@ for my $file (@args) {
$version=$d->version(); $version=$d->version();
if ($file =~ /\.(tar)\.gz$/) { if ($file =~ /\.(tar)\.gz$/) {
$type=$1; $type=$1;
} elsif ($file =~ /\.tgz$/) {
$type='tar';
} elsif ($file =~ /\.(zip)$/) { } elsif ($file =~ /\.(zip)$/) {
$type=$1; $type=$1;
} else { } else {
@@ -615,7 +617,7 @@ for my $file (@args) {
$source=$source || "http://www.cpan.org/modules/by-module/" $source=$source || "http://www.cpan.org/modules/by-module/"
. ($module=~/::/ ? (split "::", $module)[0] : (split "-", $name)[0]) . ($module=~/::/ ? (split "::", $module)[0] : (split "-", $name)[0])
. "/" . $file; . "/" . basename($file);
$source=~s/$version/\%{version}/; $source=~s/$version/\%{version}/;
my ($description,$summary)=get_description( my ($description,$summary)=get_description(