On Fri, Dec 11, 2009 at 11:59:05AM -0500, Lawrence Teo wrote:
> Recently I was working on my own project where I had to create a
> port that packs large binary files (20MB). I found that for some
> reason "make package" (or more likely pkg_create) would always fail,
> where it would not be able to create
> /usr/ports/packages/i386/all/port-1.0.0.tgz.
Nice bug indeed.
My bad. It's simply that gzip is too smart, and may decide not to write the
archive if it can't compress it further. I assume your files are random enough,
or already nicely compressed.
I'm going to commit the fix below.
Index: pkg_create
===================================================================
RCS file: /cvs/src/usr.sbin/pkg_add/pkg_create,v
retrieving revision 1.124
diff -u -p -r1.124 pkg_create
--- pkg_create 17 Nov 2009 10:16:41 -0000 1.124
+++ pkg_create 13 Dec 2009 08:51:43 -0000
@@ -720,7 +720,7 @@ if ($opt_n) {
local $SIG{'HUP'} = $h;
local $SIG{'KILL'} = $h;
local $SIG{'TERM'} = $h;
- open(my $fh, "|-", OpenBSD::Paths->gzip, "-o", $wname);
+ open(my $fh, "|-", OpenBSD::Paths->gzip, "-f", "-o", $wname);
my $wrarc = OpenBSD::Ustar->new($fh, $plist->infodir);
$plist->create_package($wrarc, $base, $opt_v);