git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: t5562: gzip -k is not portable

From
Torsten Bögershausen <tboegi@web.de>
Date
Jun 19, 2018, 20:40 UTC
Message-ID
<117d2657-067a-6fe6-3713-de7a5aa75a11@web.de>
In-Reply-To
<CAPig+cT2xkR=LbAJLCdeynGkiPysakbVna61cfrtgO3kKh85+g@mail.gmail.com>
On 06/19/2018 08:22 PM, Eric Sunshine wrote:
Show 6 quoted lines
> On Tue, Jun 19, 2018 at 2:06 PM Junio C Hamano <gitster@pobox.com> wrote:
>> Torsten Bögershausen <tboegi@web.de> writes:
>>> t5562 fails here under MacOS:
>>> "gzip -k"  is not portable.
> Very odd. Stock /usr/bin/gzip on my MacOS 10.12.6 _does_ recognize -k,
> and the test does pass.

This is the test box running Mac OS X 10.6 speaking. The -c seems to need even -f. But this doesn't work either:

gzip 1.3.12 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 <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law.

Written by Jean-loup Gailly.
prerequisite GZIP ok
expecting success:
     gzip -f -c fetch_body >fetch_body.gz &&
     test_copy_bytes 10 <fetch_body.gz >fetch_body.gz.trunc &&
     gzip -f -c push_body >push_body,gz &&
     test_copy_bytes 10 <push_body.gz >push_body.gz.trunc

./test-lib.sh: line 632: push_body.gz: No such file or directory not ok 2 - setup, compression related # #        gzip -f -c fetch_body >fetch_body.gz && #        test_copy_bytes 10 <fetch_body.gz >fetch_body.gz.trunc && #        gzip -f -c push_body >push_body,gz && #        test_copy_bytes 10 <push_body.gz >push_body.gz.trunc #

Show 14 quoted lines
>> Sigh.  Perhaps -c would help.  Or do BSD implementations also lack -c?
> MacOS and BSD do support -c, so this solution would also work (and is
> "cleaner" the the other proposal).
>
>> diff --git a/t/t5562-http-backend-content-length.sh b/t/t5562-http-backend-content-length.sh
>> @@ -61,9 +61,9 @@ test_expect_success 'setup' '
>>   test_expect_success GZIP 'setup, compression related' '
>> -       gzip -k fetch_body &&
>> +       gzip -c fetch_body >fetch_body.gz &&
>>          test_copy_bytes 10 <fetch_body.gz >fetch_body.gz.trunc &&
>> -       gzip -k push_body &&
>> +       gzip -c push_body >push_body.gz &&
>>          test_copy_bytes 10 <push_body.gz >push_body.gz.trunc
>>   '
Previous: Eric SunshineNext: Jeff King
Message 4 of 10 in “t5562: gzip -k is not portable”
  1. Torsten BögershausenJun 19, 2018
  2. Junio C HamanoJun 19, 2018
  3. Eric SunshineJun 19, 2018
  4. Torsten BögershausenJun 19, 2018
  5. Jeff KingJun 19, 2018
  6. Torsten BögershausenJun 20, 2018
  7. Jeff KingJun 20, 2018
  8. Torsten BögershausenJun 20, 2018
  9. Rodrigo CamposJun 19, 2018
  10. Rodrigo CamposJun 19, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.