From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 15 21:22:38 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id F25CB106566B; Mon, 15 Nov 2010 21:22:38 +0000 (UTC) Date: Mon, 15 Nov 2010 21:22:38 +0000 From: Alexander Best To: d@delphij.net Message-ID: <20101115212238.GA28376@freebsd.org> References: <20101115182409.GA97839@freebsd.org> <4CE19DDD.3070105@delphij.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4CE19DDD.3070105@delphij.net> Cc: freebsd-hackers@freebsd.org Subject: Re: changing gzip's symlink handling to be consistent with bzip2, xz and GNU gzip X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Nov 2010 21:22:39 -0000 On Mon Nov 15 10, Xin LI wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > Hi, > > On 11/15/10 10:24, Alexander Best wrote: > > hi there, > > > > any thoughts on this patch? it changes the semantics of gzip so that it is > > consistent with the semantics of bzip2, xz and for more important GNU gzip. > > Could you please elaborate more about the GNU gzip behavior? sure! ***START LINUX*** otaku% gzip --version gzip 1.4 Copyright (C) 2007 Free Software Foundation, Inc. Copyright (C) 1993 Jean-loup Gailly. This is free software. You may redistribute copies of it under the terms of the GNU General Public License . There is NO WARRANTY, to the extent permitted by law. Written by Jean-loup Gailly. otaku% echo "AAAAA" > FILE1 otaku% ln -s FILE1 FILE2 otaku% gzip FILE2 gzip: FILE2: Too many links otaku% gzip --force FILE2 otaku% file FILE2.gz FILE2.gz: gzip compressed data, was "FILE2", from Unix, last modified: Mon Nov 15 21:09:03 2010 ***END LINUX*** ***START BSD*** otaku% gzip --version FreeBSD gzip 20100407 otaku% echo "AAAAA" > FILE1 otaku% ln -s FILE1 FILE2 otaku% gzip FILE2 otaku% file FILE2.gz FILE2.gz: gzip compressed data, was "FILE2", from Unix, last modified: Mon Nov 15 22:12:21 2010 **END BSD*** ***START BSD WITH PATCH*** otaku% gzip --version FreeBSD gzip 20100407 otaku% echo "AAAAA" > FILE1 otaku% ln -s FILE1 FILE2 otaku% gzip FILE2 gzip: FILE2 is not a regular file otaku% gzip --force FILE2 otaku% file FILE2.gz FILE2.gz: gzip compressed data, was "FILE2", from Unix, last modified: Mon Nov 15 22:17:11 2010 **END BSD WITH PATCH*** > > By the way I also found some difference between BSD gzip and GNU gzip: > > touch foo > ln -s foo.nonexistent foo.gz > > gzip foo > gzip: could not create output: foo.gz: File exists > > /usr/local/bin/gzip foo > gzip: foo.gz already exists; do you wish to overwrite (y or n)? ^C > (case 1) > > echo | /usr/local/bin/gzip foo > gzip: foo.gz already exists; not overwritten > > gzip -f foo > gzip: could not create output: foo.gz: File exists > > /usr/local/bin/gzip -f foo > (succeeded; case 2). > > > Cheers, > - -- > Xin LI http://www.delphij.net/ > FreeBSD - The Power to Serve! Live free or die > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2.0.16 (FreeBSD) > > iQEcBAEBCAAGBQJM4Z3cAAoJEATO+BI/yjfBLGoIAKcvx+bH6L0pJqLSv34bii6G > 1FwXmPQqeIs+B5K8wNMmWblWLidJc2xkXxFCdJKsoZmgS6Hcakg6r1CzZ7tkjMAP > CqYMG3cgkCiqZpgZ8QY3E3tmdxMqYk3EyII+TUv2xSNvUp8A7TPvC2vwS1eD3GzO > OACbH/ULSJ30iMXi/A6nPkvEWesuExGplfpzzfJ0yCySKj/3HyXV87HxVw46LFYj > XsG3F7WWUkVrIzCFGLgaN0ULRZlz30Fq4ODnm4sAnUJQx0hzHGUDmYkgLxqh50t5 > AN81GC06I6XZttqIaM1FNm5Dp27Vh6uVfYd21lJ+g5ee5kXM6Fd03jSJOqZJiro= > =QEEo > -----END PGP SIGNATURE----- -- a13x