diff options
author | Justin Davis <jrcd83@gmail.com> | 2012-04-15 20:25:05 +0200 |
---|---|---|
committer | Justin Davis <jrcd83@gmail.com> | 2012-04-15 20:25:05 +0200 |
commit | f93da9060bb61ab0eb04360bfc617d1c4172927e (patch) | |
tree | 6976a4a00806cd2cac6c8714ff1a5515b792bf53 | |
parent | ace24e04ec402a12873a7b9bfd4b050e9054347a (diff) | |
download | genpkg-f93da9060bb61ab0eb04360bfc617d1c4172927e.tar.gz genpkg-f93da9060bb61ab0eb04360bfc617d1c4172927e.tar.xz |
Switch metas back to printing to stdout.
-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; } |