diff options
-rwxr-xr-x | bin/genpkg | 10 | ||||
-rwxr-xr-x | metas/perl | 4 | ||||
-rwxr-xr-x | metas/perl.d/perl-dist | 3 |
3 files changed, 5 insertions, 12 deletions
@@ -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 @@ -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; } |