Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Nov 2002 16:24:50 -0800
From:      "Bruce A. Mah" <bmah@FreeBSD.org>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        "Bruce A. Mah" <bmah@FreeBSD.org>, cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org
Subject:   Re: cvs commit: src/usr.sbin/pkg_install/lib file.c 
Message-ID:  <200211150024.gAF0Oo3A066723@intruder.bmah.org>
In-Reply-To: <XFMail.20021114184206.jhb@FreeBSD.org> 
References:  <XFMail.20021114184206.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--==_Exmh_951871696P
Content-Type: text/plain; charset=us-ascii

If memory serves me right, John Baldwin wrote:

> On 14-Nov-2002 Bruce A. Mah wrote:
> > bmah        2002/11/14 13:01:17 PST
> > 
> >   Modified files:
> >     usr.sbin/pkg_install/lib file.c 
> >   Log:
> >   Assume that packages passed on stdin are in bzip2 format, not gzip.
> >   (sysinstall depends on this feature for package addition.)
> >   
> >   Comment on hard-coded bzip2 usage in the spirit of rev. 1.58.
> 
> Ugh, can't we look at the file header and figure out based on that
> instead?

Hi John--

I don't like this either, but real autodetection is harder than I wanted
to tackle.  My goal was to get a snapshot build that can install
packages.

After having hacked on unpack() for a while, it's harder than I first
thought.  Looking at the first byte of the file is enough to distinguish
the two...if it's '\037', it's gzip; 'B' means bzip2, according to the
source code for file(1).

You need to peek at the first byte of the file and then put the byte
back (remember this is for a package on stdin).  I tried fgetc()/
ungetc()) for this.  I suspect that the character that I put back
doesn't get read by the forked-off gzip or bzip process.

You or anyone else is more than welcome to give it a shot...I'm ENOTIME 
for this for now.

Cheers,

Bruce.



--==_Exmh_951871696P
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.0 (FreeBSD)
Comment: Exmh version 2.5+ 20020506

iD8DBQE91D7S2MoxcVugUsMRAqVcAKCrPNWPP7hEKkDnp6onIElZiMHhewCghPHV
ItsEFB5JeTPy6TwoWRHpT/U=
=Q2G1
-----END PGP SIGNATURE-----

--==_Exmh_951871696P--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200211150024.gAF0Oo3A066723>