From owner-freebsd-hackers Tue Mar 14 12:52:01 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id MAA00282 for hackers-outgoing; Tue, 14 Mar 1995 12:52:01 -0800 Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.97.216]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id MAA00273; Tue, 14 Mar 1995 12:51:58 -0800 Received: (from kargl@localhost) by troutmask.apl.washington.edu (8.6.10/8.6.9) id HAA17320; Tue, 14 Mar 1995 07:56:39 -0800 From: Steven G Kargl Message-Id: <199503141556.HAA17320@troutmask.apl.washington.edu> Subject: Re: install compressed binary patch To: bde@zeta.org.au (Bruce Evans) Date: Tue, 14 Mar 1995 07:56:34 -0800 (PST) Cc: freebsd-hackers@freefall.cdrom.com, phk@freefall.cdrom.com In-Reply-To: <199503140400.OAA09807@godzilla.zeta.org.au> from "Bruce Evans" at Mar 14, 95 02:00:01 pm X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 1933 Sender: hackers-owner@FreeBSD.org Precedence: bulk According to Bruce Evans: > > The gzip step should be done earlier, after the strip step. Otherwise > gzip may lose some of the file attributes. It _will_ lose special flags > (those set by fchflags()) and it will fail if an immutable flag is set. > gzip is a non-BSD4.4 program and doesn't understand the special flags. > I naively assumed that the gzip step would not effect any of the flags. After thinking about the install code, it seems to me that both strip and gzip can occur before any flags are set (including group and owner). I also think that strip and gzip can be carried out on the from_name target before it is moved or copied to name. I'll look closer at the details. > >*************** > >*** 317,322 **** > >--- 327,388 ---- > > } > > > > /* > >+ * gzip -- > >+ * use gzip(1) to compress target file, then create a sym link > >+ */ > >... > >+ case 0: > >+ execl(_PATH_GZIP, "gzip", "-f", to_name, NULL); > >+ err("%s: %s", _PATH_STRIP, strerror(errno)); > > The gzip step should look like the strip step, but not this much like > it :-). The strip step should look better. It doesn't handle errors > from strip(1) very well. > The code looks alike for a very simple reason (cut, paste, edit:-). My patch seems to be premature for release to -hackers, but it served my immediated needs. I'll see what I can do with improvement of error handling. > >+ */ > >+ if (strlen(to_name) < MAXPATHLEN - 3) > >+ strcpy(gz_name, to_name); > >+ strcat(gz_name, ".gz"); > >... > > I wish gzip handled this directly. `gzip -S suffix' requires a nonempty > suffix. Yes, I wish gzip handled it better, but I doubt I'll tackle gzip. -- Steven G. Kargl | Phone: 206-685-4677 | Applied Physics Laboratory | Fax: 206-543-6785 | University of Washington |---------------------| 1013 NE 40th St | FreeBSD 2.1-current | Seattle, WA 98105 |---------------------|