From owner-freebsd-doc Sun Jan 5 19:20: 6 2003 Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ED1B837B401 for ; Sun, 5 Jan 2003 19:20:03 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8CDCC43EB2 for ; Sun, 5 Jan 2003 19:20:03 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h063K3NS005820 for ; Sun, 5 Jan 2003 19:20:03 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h063K33k005819; Sun, 5 Jan 2003 19:20:03 -0800 (PST) Date: Sun, 5 Jan 2003 19:20:03 -0800 (PST) Message-Id: <200301060320.h063K33k005819@freefall.freebsd.org> To: freebsd-doc@FreeBSD.org Cc: From: Giorgos Keramidas Subject: Re: docs/46787: compress(1) manpage missing BUGS; other cleanup. Reply-To: Giorgos Keramidas Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR docs/46787; it has been noted by GNATS. From: Giorgos Keramidas To: "Gary W. Swearingen" Cc: bug-followup@freebsd.org Subject: Re: docs/46787: compress(1) manpage missing BUGS; other cleanup. Date: Mon, 6 Jan 2003 05:13:51 +0200 On 2003-01-05 18:33, "Gary W. Swearingen" wrote: > Giorgos Keramidas writes: > > > @@ -72,38 +72,53 @@ > > > files by deleting the > > > .Dq .Z > > > extension. > > > +If a specified filename doesn't end with > > > +.Dq .Z , > > > +one will be assumed unless a file with the extended filename does not > > > +exist, in which case the named file will be removed (because of a bug). > > > > I am not sure I can understand the sentence above at all :( > > Whoops. "If a [command-line-]specified filename doesn't end > with a ".Z", one will be assumed [(by the command) to exist at the end > of the actual file's filename,] unless a file with the extended filename > [eg, xxx.Z] does not exist [on the disk], in which case the named file > [on the disk without any ".Z" at the end of its filename] will be > removed [as in gone, vanished, where'd my precious file go?]. :) > > How's this: > > If a specified filename does not end with ".Z", "compress" will assume > that the filename ends with ".Z". See BUGS section. Ah, much better! Now I can reproduce the bug, but it's not compress that is buggy. It's uncompress, and only if -f option is used: : giorgos@gothmog[04:57]/home/giorgos$ cd /tmp/ : giorgos@gothmog[04:57]/tmp$ mkdir foo : giorgos@gothmog[04:57]/tmp$ cd foo : giorgos@gothmog[04:57]/tmp/foo$ touch bar : giorgos@gothmog[04:57]/tmp/foo$ ls -l : total 0 : -rw-rw-r-- 1 giorgos wheel - 0 Jan 6 04:57 bar : giorgos@gothmog[04:57]/tmp/foo$ compress bar : giorgos@gothmog[04:57]/tmp/foo$ ls -l : total 0 : -rw-rw-r-- 1 giorgos wheel - 0 Jan 6 04:57 bar : giorgos@gothmog[04:57]/tmp/foo$ uncompress bar : overwrite bar? n : giorgos@gothmog[04:57]/tmp/foo$ ls -l : total 0 : -rw-rw-r-- 1 giorgos wheel - 0 Jan 6 04:57 bar : giorgos@gothmog[04:57]/tmp/foo$ uncompress -f bar : uncompress: bar.Z: No such file or directory : giorgos@gothmog[04:57]/tmp/foo$ ls -l : giorgos@gothmog[04:57]/tmp/foo$ How about something like this? +.Sh BUGS +When the +.Fl f +option is used and a specified +.Ar file +filename does not end with +.Dq .Z +but matches an existing file, the +.Nm uncompress +utility will assume that a compressed file with the +.Dq .Z +extension exists, and promptly overwrite the existing file. > > > reduction in size and file overwriting are not performed, the input file is > > > -not removed, and the attributes of the input file are not retained. > > > +not removed, and the attributes of the input file > > > +are not retained in the output. > > > > I'm not sure I like this for some reasons. It wraps the line to a > > very short length. Content changes shouldn't be mixed with whitespace > > changes if at all possible. The addition of "in the output" is ok > > though and I like that part of the change. > > If I'd noticed it, I would have made the two "+" lines of equal length. > It seems to me that once you've made a change to a line, you've forced > the reviewers to examine that line in full. The damage has been done. > Now you ought to prepare for the next change so it is less likely to > involve two lines because the old line is too long, etc., so you do two > things: If the changed line is longer than 80, you break it into two > lines of about equal length to provide equal room for changes. Hmmm, this doesn't sound too bad, but I always prefer to keep the diffs minimal and as close to the original as possible when making small changes. This makes it very easy on the translators to quickly spot the precise change that takes place. > For easiest example is to copy a plain text file to "xxx" and do > "ls xxx*; uncompress -f xxx"; ls xxx*. Gone. Try it again and also > copy a different size file to "xxx.Z". Gone. Try it once more but > ensure that "xxx.Z" is a real compressed file. Not gone, just > overwritten, as the manpage has always said. > > Thanks for your comments. So it's two bugs? Uhm. These are accidents waiting to happen!!! I think I should devote some time to try and find a fix for these, instead of documenting their existence :-( - Giorgos To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message