summaryrefslogtreecommitdiffstats
path: root/lib/metas/perl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/metas/perl')
-rwxr-xr-xlib/metas/perl12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/metas/perl b/lib/metas/perl
index adb3b08..961084d 100755
--- a/lib/metas/perl
+++ b/lib/metas/perl
@@ -25,7 +25,7 @@ sub matchdist
or err("$PROG: PKGVAR env variable is unset\n");
if(!-f "$var/cpandists" || -M "$var/cpandists" > 1) {
- print STDERR "Refreshing local CPAN distribution list...";
+ print STDERR "$PROG: Refreshing local CPAN data...";
my $cwd = getcwd();
chdir($var) or die "chdir: $!";
system('fetchcpan');
@@ -37,7 +37,8 @@ sub matchdist
open(DISTS, '<', "$var/cpandists") or err("$PROG: open: $!");
while(<DISTS>) {
my @f = split;
- next unless(lc($f[0]) eq lc($dist));
+ my $d = lc $f[0]; $d =~ tr/-_/--/s;
+ next unless($d eq lc($dist));
close(DISTS);
return ($f[0], $f[2]);
}
@@ -76,8 +77,11 @@ sub main
STDERR->autoflush(1);
my ($realname, $cpath) = matchdist($dist);
unless($realname){
- print STDERR "$PROG: failed to find perl dist similar to $dist\n";
- exit 1;
+ unless($forcechk){
+ ## Don't print errors unless perl- package was requested.
+ print STDERR qq{$PROG: failed to find perl dist similar to '$dist'\n};
+ }
+ return 2;
}
fetchdist($cpath);