the sizes of the compressed/uncompressed data are wrong. i have tested gzip
and 'tar zcf' and the values are right, but using pkg_create fails.
$ sysctl hw.machine kern.version
hw.machine=i386
kern.version=OpenBSD 5.9-current (GENERIC) #0: Thu Apr 7 17:24:30 EDT 2016
build@node04:/usr/src/sys/arch/i386/compile/GENERIC
it's not just i386 specific though, since i tested the amd64 packages as well.
$ ftp ftp://ftp3.usa.openbsd.org/pub/OpenBSD/snapshots/packages/i386/bzip2...
...
Retrieving pub/OpenBSD/snapshots/packages/i386/bzip2-1.0.6p7.tgz
...
$ ls -l bzip2-1.0.6p7.tgz
-rw-r--r-- 1 user user 125979 Apr 23 12:19 bzip2-1.0.6p7.tgz
$ gzip -l bzip2-1.0.6p7.tgz
compressed uncompressed ratio uncompressed_name
322 7680 96.0% bzip2-1.0.6p7.tar
$ gzip -vd bzip2-1.0.6p7.tgz
bzip2-1.0.6p7.tgz: 96.0% -- replaced with bzip2-1.0.6p7.tar
322 bytes in, 7680 bytes out
$ ls -l bzip2-1.0.6p7.tar
-rw-r--r-- 1 user user 375808 Apr 23 12:19 bzip2-1.0.6p7.tar
$ gzip -v bzip2-1.0.6p7.tar
bzip2-1.0.6p7.tar: 66.6% -- replaced with bzip2-1.0.6p7.tar.gz
375808 bytes in, 125704 bytes out
$ gzip -l bzip2-1.0.6p7.tar.gz
compressed uncompressed ratio uncompressed_name
125704 375808 66.6% bzip2-1.0.6p7.tar
$ pkg_create -f /var/db/pkg/bzip2-1.0.6p7/+CONTENTS
$ ls -l bzip2-1.0.6p7.tgz
-rw-r--r-- 1 user user 125891 Apr 24 00:36 bzip2-1.0.6p7.tgz
$ gzip -l bzip2-1.0.6p7.tgz
compressed uncompressed ratio uncompressed_name
319 7680 96.1% bzip2-1.0.6p7.tar
$ tar zcf test.tgz -I list
and
$ tar cf - -I list | gzip -c >test.tgz
give the expected correct results.
i tried to track it a bit further
$ grep gzip /usr/src/usr.sbin/pkg_add/OpenBSD/*
/usr/src/usr.sbin/pkg_add/OpenBSD/Paths.pm:sub gzip() { '/usr/bin/gzip' }
/usr/src/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm: $state->say("Creating gzip'd
tar ball in '#1'", $wname)
but perl's not really my thing and so i really know where to go from here.