remfiles01.at 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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])
  23. AT_KEYWORDS([create remove-files remfiles01 gzip])
  24. unset TAR_OPTIONS
  25. AT_CHECK([
  26. AT_GZIP_PREREQ
  27. AT_SORT_PREREQ
  28. mkdir dir
  29. cd dir
  30. genfile --file a --length 0
  31. chmod 0 a
  32. genfile --file b
  33. mkdir c
  34. tar -c -f a -z --remove-files b c
  35. find . | sort
  36. ],
  37. [0],
  38. [.
  39. ./a
  40. ./b
  41. ./c
  42. ],
  43. [tar (child): a: Cannot open: Permission denied
  44. tar (child): Error is not recoverable: exiting now
  45. ])
  46. AT_CLEANUP