remfiles02.at 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2009-2023 Free Software Foundation, Inc.
  4. # This file is part of GNU tar.
  5. # GNU tar is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 3 of the License, or
  8. # (at your option) any later version.
  9. # GNU tar is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. # Description: When called with --create --remove-files and a compression
  16. # options tar (v. <= 1.22.90) would remove files even if it had failed
  17. # to store them in the archive.
  18. #
  19. # References: <[email protected]>
  20. # http://lists.gnu.org/archive/html/bug-tar/2009-10/msg00005.html
  21. AT_SETUP([remove-files with compression: grand-child])
  22. AT_KEYWORDS([create remove-files remfiles02 gzip])
  23. unset TAR_OPTIONS
  24. AT_CHECK([
  25. AT_GZIP_PREREQ
  26. AT_SORT_PREREQ
  27. mkdir dir
  28. cd dir
  29. mkdir a
  30. genfile --file b
  31. mkdir c
  32. tar -c -f a -z --remove-files b c 2>err
  33. EC=$?
  34. sed -n '/(child)/p' err >&2
  35. rm err
  36. find . | sort
  37. exit $EC
  38. ],
  39. [2],
  40. [.
  41. ./a
  42. ./b
  43. ./c
  44. ],
  45. [tar (child): a: Cannot open: Is a directory
  46. tar (child): Error is not recoverable: exiting now
  47. ])
  48. AT_CLEANUP