Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Mar 1995 07:56:34 -0800 (PST)
From:      Steven G Kargl  <kargl@troutmask.apl.washington.edu>
To:        bde@zeta.org.au (Bruce Evans)
Cc:        freebsd-hackers@freefall.cdrom.com, phk@freefall.cdrom.com
Subject:   Re: install compressed binary patch
Message-ID:  <199503141556.HAA17320@troutmask.apl.washington.edu>
In-Reply-To: <199503140400.OAA09807@godzilla.zeta.org.au> from "Bruce Evans" at Mar 14, 95 02:00:01 pm

next in thread | previous in thread | raw e-mail | index | archive | help
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          |---------------------|



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