GNU bug report logs -
#32815
Corrective patch for GNU gzip
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 32815 in the body.
You can then email your comments to 32815 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gzip <at> gnu.org
:
bug#32815
; Package
gzip
.
(Sun, 23 Sep 2018 22:55:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Manfred Morgner <manfred.morgner <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gzip <at> gnu.org
.
(Sun, 23 Sep 2018 22:55:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello all,
the manual page of GNU gzip says:
------------------------------DIAGNOSTICS Exit status is normally 0; if an error occurs, exit status is 1. If a warning occurs, exit status is 2.------------------------------
This is not the case sind version >1.5 for the situation when the source file already ends with .gz
Test:
$ gzip 2018.gzgzip: 2018.gz already has .gz suffix -- unchanged$ echo $?0
Following the patch for it:
diff --git a/gzip.c b/gzip.cindex e6a7761..bf3eb0a 100644--- a/gzip.c+++ b/gzip.c@@ -1417,8 +1417,8 @@ local int make_ofname() /* Avoid annoying messages with -r (see treat_dir()) */ if (verbose || (!recursive && !quiet)) { /* Don't use WARN, as it affects exit status. */- fprintf (stderr, "%s: %s already has %s suffix -- unchanged\n",- program_name, ifname, suff);+ WARN ((stderr, "%s: %s already has %s suffix -- unchanged\n",+ program_name, ifname, suff)); } return WARNING; } else {
Test:
$ gzip 2018.gzgzip: 2018.gz already has .gz suffix -- unchanged$ echo $?2
Best regards,Manfred
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gzip <at> gnu.org
:
bug#32815
; Package
gzip
.
(Mon, 24 Sep 2018 01:43:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 32815 <at> debbugs.gnu.org (full text, mbox):
Manfred Morgner wrote:
> Hello all,
> the manual page of GNU gzip says:
> Exit status is normally 0; if an error occurs, exit status is 1. If a warning occurs, exit status is 2.
> This is not the case sind version >1.5 for the situation when the source file already ends with .gz
> Test:
> $ gzip 2018.gz
> gzip: 2018.gz already has .gz suffix -- unchanged
> $ echo $?
> 0
Why is this a bug? Arguably no error has occurred.
Information forwarded
to
bug-gzip <at> gnu.org
:
bug#32815
; Package
gzip
.
(Mon, 24 Sep 2018 08:31:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 32815 <at> debbugs.gnu.org (full text, mbox):
Manfred Morgner wrote:
> It schould return 2, as documented.
Only if the message "gzip: 2018.gz already has .gz suffix -- unchanged" is a
warning. Arguably that is merely an informative message, and is not warning
about anything, as nothing has gone wrong.
Information forwarded
to
bug-gzip <at> gnu.org
:
bug#32815
; Package
gzip
.
(Mon, 24 Sep 2018 15:12:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 32815 <at> debbugs.gnu.org (full text, mbox):
On 9/24/18 2:55 AM, Manfred Morgner wrote:
> It does not the expected action. It does not compress and it does not rename. But it Prints out a Text to inform about the Situation. I think this Situation needs a warning Return Code or the warning text should Go. Otherwise it‘s a bit inconsistent, isn’t it?
It depends on what the user expects. It's not clear to me that this is a
bug.
Gzip formerly behaved the way you are asking for, but this was changed
in gzip 1.3.6 (2006). Although I don't recall why, most likely this was
in response to another bug report where someone complained that gzip was
warning about a situation even though everything was already OK from
their point of view.
It all depends on what the user expects, and what the most common use
cases are. What's your use case and why is the current behavior a
problem for you?
Added tag(s) notabug.
Request was from
Paul Eggert <eggert <at> cs.ucla.edu>
to
control <at> debbugs.gnu.org
.
(Wed, 30 Mar 2022 00:24:02 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to
32815 <at> debbugs.gnu.org and Manfred Morgner <manfred.morgner <at> gmail.com>
Request was from
Paul Eggert <eggert <at> cs.ucla.edu>
to
control <at> debbugs.gnu.org
.
(Wed, 30 Mar 2022 00:24:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 27 Apr 2022 11:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 1 year and 364 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.