remfiles02.at 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright (C) 2009 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, or (at your option)
  7. # 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, write to the Free Software
  14. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  15. # 02110-1301, USA.
  16. # Description: When called with --create --remove-files and a compression
  17. # options tar (v. <= 1.22.90) would remove files even if it had failed
  18. # to store them in the archive.
  19. #
  20. # References: <[email protected]>
  21. # http://lists.gnu.org/archive/html/bug-tar/2009-10/msg00005.html
  22. AT_SETUP([remove-files with compression: grand-child])
  23. AT_KEYWORDS([create remove-files remfiles02 gzip])
  24. unset TAR_OPTIONS
  25. AT_CHECK([
  26. AT_GZIP_PREREQ
  27. AT_SORT_PREREQ
  28. mkdir dir
  29. cd dir
  30. mkdir a
  31. genfile --file b
  32. mkdir c
  33. tar -c -f a -z --remove-files b c 2>err
  34. EC=$?
  35. sed -n '/(child)/p' err >&2
  36. rm err
  37. find . | sort
  38. exit $EC
  39. ],
  40. [2],
  41. [.
  42. ./a
  43. ./b
  44. ./c
  45. ],
  46. [tar (child): a: Cannot open: Is a directory
  47. tar (child): Error is not recoverable: exiting now
  48. ])
  49. AT_CLEANUP