From owner-cvs-all Thu Nov 14 16:25: 0 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 14A1F37B401; Thu, 14 Nov 2002 16:24:58 -0800 (PST) Received: from sccrmhc01.attbi.com (sccrmhc01.attbi.com [204.127.202.61]) by mx1.FreeBSD.org (Postfix) with ESMTP id C947D43E3B; Thu, 14 Nov 2002 16:24:56 -0800 (PST) (envelope-from bmah@employees.org) Received: from bmah.dyndns.org ([12.240.204.110]) by sccrmhc01.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20021115002450.GFAI2683.sccrmhc01.attbi.com@bmah.dyndns.org>; Fri, 15 Nov 2002 00:24:50 +0000 Received: from intruder.bmah.org (localhost [IPv6:::1]) by bmah.dyndns.org (8.12.6/8.12.6) with ESMTP id gAF0OoIQ066724; Thu, 14 Nov 2002 16:24:50 -0800 (PST) (envelope-from bmah@intruder.bmah.org) Received: (from bmah@localhost) by intruder.bmah.org (8.12.6/8.12.6/Submit) id gAF0Oo3A066723; Thu, 14 Nov 2002 16:24:50 -0800 (PST) Message-Id: <200211150024.gAF0Oo3A066723@intruder.bmah.org> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: John Baldwin Cc: "Bruce A. Mah" , cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: Re: cvs commit: src/usr.sbin/pkg_install/lib file.c In-Reply-To: References: Comments: In-reply-to John Baldwin message dated "Thu, 14 Nov 2002 18:42:06 -0500." From: "Bruce A. Mah" Reply-To: bmah@FreeBSD.org X-Face: g~c`.{#4q0"(V*b#g[i~rXgm*w;:nMfz%_RZLma)UgGN&=j`5vXoU^@n5v4:OO)c["!w)nD/!!~e4Sj7LiT'6*wZ83454H""lb{CC%T37O!!'S$S&D}sem7I[A 2V%N&+ X-Image-Url: http://www.employees.org/~bmah/Images/bmah-cisco-small.gif X-Url: http://www.employees.org/~bmah/ Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==_Exmh_951871696P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Date: Thu, 14 Nov 2002 16:24:50 -0800 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --==_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