summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/genpkg10
-rwxr-xr-xmetas/perl4
-rwxr-xr-xmetas/perl.d/perl-dist3
3 files changed, 5 insertions, 12 deletions
diff --git a/bin/genpkg b/bin/genpkg
index fcfa7cf..c1895ac 100755
--- a/bin/genpkg
+++ b/bin/genpkg
@@ -76,17 +76,15 @@ do
[ -d "$pkgd/$pkg" ] || mkdir "$pkgd/$pkg"
cd "$pkgd/$pkg"
- if [ -d PKGTREE ]
- then
- echo "$prog: warning: removing old PKGTREE" 1>&2
- rm -rf PKGTREE
- fi
+ [ -d PKGTREE ] && rm -rf PKGTREE
mkdir PKGTREE
- if METABIN="$metad" PKGVAR="$vard" mkpkgmeta "$pkg"
+ trap 'rm -f PKGDATA' 1 2 15
+ if METABIN="$metad" PKGVAR="$vard" mkpkgmeta "$pkg" > PKGDATA
then
echo "$pkgd/$pkg"
else
+ rm PKGDATA
exit "$?"
fi
diff --git a/metas/perl b/metas/perl
index e136090..23f4907 100755
--- a/metas/perl
+++ b/metas/perl
@@ -89,8 +89,7 @@ sub main
}
fetchdist($cpath);
- open my $fh, '>', 'PKGDATA' or die "open: $!";
- print $fh <<"END_META";
+ print <<"END_META";
url
https://metacpan.org/release/$realname
@@ -98,7 +97,6 @@ source
http://search.cpan.org/CPAN/authors/id/$cpath
END_META
- close $fh;
my $file = $cpath; $file =~ s{.*/}{};
system 'perl-dist' => $file;
diff --git a/metas/perl.d/perl-dist b/metas/perl.d/perl-dist
index 69f9317..4690a7e 100755
--- a/metas/perl.d/perl-dist
+++ b/metas/perl.d/perl-dist
@@ -430,10 +430,7 @@ sub main
return 1;
}
- close STDOUT;
- open STDOUT, '>', 'PKGDATA' or die "open PKGDATA: $!";
printdata(\%pbvars);
- close STDOUT or die "close PKGDATA: $!";
return 0;
}