gzip-env.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/sh
  2. # Test the obsolescent GZIP environment variable.
  3. # Copyright 2015-2016 Free Software Foundation, Inc.
  4. # This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation, either version 3 of the License, or
  7. # (at your option) any later version.
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. # You should have received a copy of the GNU General Public License
  13. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. # limit so don't run it by default.
  15. . "${srcdir=.}/init.sh"; path_prepend_ .
  16. #echo PATH=$PATH
  17. #gzip --version
  18. echo a >exp || framework_failure_
  19. gzip <exp >in || framework_failure_
  20. fail=0
  21. GZIP=-qv gzip -d <in >out 2>err || fail=1
  22. compare exp out || fail=1
  23. for badopt in -- -c --stdout -d --decompress -f --force -h --help -k --keep \
  24. -l --list -L --license -r --recursive -Sxxx --suffix=xxx '--suffix xxx' \
  25. -t --test -V --version
  26. do
  27. GZIP=$badopt gzip -d <in >out 2>err && fail=1
  28. done
  29. for goodopt in -n --no-name -N --name -q --quiet -v --verbose \
  30. -1 --fast -2 -3 -4 -5 -6 -7 -8 -9 --best
  31. do
  32. GZIP=$goodopt gzip -d <in >out 2>err || fail=1
  33. compare exp out || fail=1
  34. done
  35. Exit $fail