summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/genpkg8
-rwxr-xr-xbin/makepkgmeta4
-rwxr-xr-xlib/metas/perl16
-rwxr-xr-xlib/metas/perl.d/perl-dist2
4 files changed, 22 insertions, 8 deletions
diff --git a/bin/genpkg b/bin/genpkg
index c933076..afd1f49 100755
--- a/bin/genpkg
+++ b/bin/genpkg
@@ -32,7 +32,6 @@ then
fi
cwd=$(pwd)
-set -e
for pkg
do
@@ -40,7 +39,12 @@ do
cd "$pkgd/$pkg"
METABIN=$libd/metas PKGVAR=$vard makepkgmeta "$pkg" >PKGMETA
- case $? in 1) rm PKGMETA ; exit 1 ;; esac
+ case $? in
+ 1) cd ..
+ rm -r "$pkgd/$pkg"
+ echo "$prog: aborting." 1>&2
+ exit 1
+ esac
echo "Generated $pkgd/$pkg/PKGMETA"
diff --git a/bin/makepkgmeta b/bin/makepkgmeta
index b6dfcff..82a7b1f 100755
--- a/bin/makepkgmeta
+++ b/bin/makepkgmeta
@@ -59,10 +59,12 @@ esac
for flav in "$METABIN"/*
do
[ -f "$flav" -a -x "$flav" ] || continue
- PATH="$PATH:$flav.d" "$flav" $1 | lazysource
+ PATH="$PATH:$flav.d" "$flav" $1 >PKGMETA.tmp
metaret=$?
case $metaret in
0) basicmeta $1
+ lazysource <PKGMETA.tmp
+ rm PKGMETA.tmp
exit 0 ;;
1) echo "makepkgmeta: $flav encountered an error" 1>&2
exit 1 ;;
diff --git a/lib/metas/perl b/lib/metas/perl
index df6fc9c..4d310a6 100755
--- a/lib/metas/perl
+++ b/lib/metas/perl
@@ -24,7 +24,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');
@@ -36,7 +36,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]);
}
@@ -67,12 +68,19 @@ sub main
my $pkg = shift or die "Usage: $PROG [package name]\n";
my $dist = $pkg;
- $dist = "app-$dist" if($dist =~ s/^perl-// == 0);
+ my $forcechk;
+ if($dist =~ s/^perl-// == 0){
+ $forcechk = 1;
+ $dist = "app-$dist";
+ }
STDERR->autoflush(1);
my ($realname, $cpath) = matchdist($dist);
unless($realname){
- print STDERR "$PROG: failed to find perl dist similar to $dist\n";
+ 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);
diff --git a/lib/metas/perl.d/perl-dist b/lib/metas/perl.d/perl-dist
index ee3f5ee..36a7b60 100755
--- a/lib/metas/perl.d/perl-dist
+++ b/lib/metas/perl.d/perl-dist
@@ -296,7 +296,7 @@ sub _distsofmods
for my $m (@lost){
print STDERR "$PROG: failed to find module $m\n";
}
- exit 2;
+ exit 1;
}
return %dists;