GZIP environment variable is deprecated と怒られた

GZIP environment variable is deprecated;

って怒られるようになったので調べてみました。

自分で設定した憶えはなかったのですが、実際 .zprofile にありました。

export GZIP='-v9N'

これはきっと遠い昔にUnix Userという雑誌についていた設定ですな。20年くらいまえの設定だ…。

この手の設定例は初心者には良かったのですが、今となって有害な設定も残っていたりするので、たまに見直すのが必要です。とは言え、そういうのはなかなかできないのですよね。

ちなみに各オプションの意味は以下の通りです:

-N –name

When  compressing, always save the original file name and timestamp;
this is the default. When decompressing, restore the  original  file
name  and  timestamp  if  present.  This option is useful on systems
which have a limit on file name length or  when  the  timestamp  has
been lost after a file transfer.

-v –verbose

Verbose. Display the name and percentage  reduction  for  each  file
compressed or decompressed.

-# –fast –best

 Regulate the speed of compression using the specified digit #, where
 -1 or --fast indicates the fastest compression method (less compres‐
 sion) and -9 or --best  indicates  the  slowest  compression  method
 (best  compression).   The default compression level is -6 (that is,
 biased towards high compression at expense of speed).

対策

対策として、aliasを設定しました。

alias gzip='gzip -v9N'

いつから変わったの?

gzipのNEWSにありました。割と最近ですね。でも2年経っている…。

 Noteworthy changes in release 1.7 (2016-03-27) [stable]

** Changes in behavior

  The GZIP environment variable is now obsolescent; gzip now warns if
  it is used, and rejects attempts to use dangerous options or operands.
  You can use an alias or script instead.

おまけ

Unix Userってオープンソースマガジンという名前に変わって休刊したのですね。

1998年から2-3年は読んでいました。モバイルギア向けFreeBSDとか話題の先取り感があった雑誌で良かったですね。

Adsense広告