summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Davis <jrcd83@gmail.com>2012-04-15 20:25:05 +0200
committerJustin Davis <jrcd83@gmail.com>2012-04-15 20:25:05 +0200
commitf93da9060bb61ab0eb04360bfc617d1c4172927e (patch)
tree6976a4a00806cd2cac6c8714ff1a5515b792bf53
parentace24e04ec402a12873a7b9bfd4b050e9054347a (diff)
downloadgenpkg-f93da9060bb61ab0eb04360bfc617d1c4172927e.tar.gz
genpkg-f93da9060bb61ab0eb04360bfc617d1c4172927e.tar.xz
Switch metas back to printing to stdout.
-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;
}