From 27e36f6c3d5d980f7b633a808ce9a006bdc5ef37 Mon Sep 17 00:00:00 2001 From: Gavin Carr Date: Mon, 7 Feb 2011 15:48:14 +0000 Subject: [PATCH] Make tarball directory version component optional. --- cpanspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpanspec b/cpanspec index 0cae552..5eaa63d 100755 --- a/cpanspec +++ b/cpanspec @@ -696,7 +696,7 @@ for my $file (@args) { for my $entry (list_files($archive, $type)) { next if ($type eq 'tar' and $entry eq 'pax_global_header'); - if ($entry !~ /^(?:.\/)?($name-(?:v\.?)?$version)(?:\/|$)/) { + if ($entry !~ /^(?:.\/)?($name(?:-(?:v\.?)?$version)?)(?:\/|$)/) { warn "BOGUS PATH DETECTED: $entry\n"; $bogus++; next; @@ -704,7 +704,7 @@ for my $file (@args) { $path=$1; } - $entry=~s,^(?:.\/)?$name-(?:v\.?)?$version/,,; + $entry =~ s,^(?:.\/)?$name(?:-(?:v\.?)?$version)?/,,; next if (!$entry); push(@files, $entry);