summaryrefslogtreecommitdiffstats
path: root/lib/metas/perl
diff options
context:
space:
mode:
authorJustin Davis <jrcd83@gmail.com>2012-01-07 18:58:18 +0100
committerJustin Davis <jrcd83@gmail.com>2012-01-07 18:58:18 +0100
commit0fd17fd113f7e6ac696b574c7929444cfb88b52d (patch)
treeb9c24672f5d7c6dd6cbea236e35c3eee25e40759 /lib/metas/perl
parent23b61cc4ac925c0139c3456c4672dc2d306af7fe (diff)
parent65f503976340ea03c030b26af8691e2f373f1377 (diff)
downloadgenpkg-0fd17fd113f7e6ac696b574c7929444cfb88b52d.tar.gz
genpkg-0fd17fd113f7e6ac696b574c7929444cfb88b52d.tar.xz
Merge changed from other puter.
Fix return value snafus, etc.
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);