before 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #! /bin/sh
  2. # Do common operations before a particular test.
  3. # This file is part of GNU tar testsuite.
  4. # Copyright (C) 2004 Free Software Foundation, Inc.
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  19. # 02111-1307, USA.
  20. case $# in
  21. 0) TAR_ARCHIVE_FORMATS="${TAR_ARCHIVE_FORMATS:-v7 oldgnu ustar posix gnu}"
  22. for format in $TAR_ARCHIVE_FORMATS
  23. do
  24. $0 $format
  25. R=$?
  26. test $R -eq 0 || exit $R
  27. done
  28. exit 0;;
  29. 1) if test "x$1" = xauto; then
  30. TAR_OPTIONS=
  31. else
  32. TAR_OPTIONS="--format=$1"
  33. fi;;
  34. *) echo "Too many arguments" >&2
  35. exit 2;;
  36. esac
  37. mkdir tmp-$$
  38. cd tmp-$$
  39. out=
  40. err=
  41. export TAR_OPTIONS
  42. #echo "$0 $1"
  43. echo "$0 $1" > checking
  44. exec 1> stdout
  45. exec 2> stderr