incr09.at 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2013-2023 Free Software Foundation, Inc.
  4. #
  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. #
  10. # GNU tar is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. # Description: For some intermediate versions of tar 1.26.90,
  18. # tar would fail to correctly canonicalize archive member names
  19. # in incremental mode if there was a -C options with an absolute path
  20. # on the command line without any archive members specified within that
  21. # directory. (In that case, the canonical name generated for
  22. # members specified after later -C options wouldn't correctly reflect the
  23. # previous absolute path.)
  24. AT_SETUP([incremental with alternating -C])
  25. AT_KEYWORDS([incremental create incr09 chdir])
  26. AT_TAR_CHECK([
  27. AT_CHECK_TIMESTAMP
  28. AT_SORT_PREREQ
  29. mkdir foo bar middle
  30. echo foo/foo_file > foo/foo_file
  31. echo bar/bar_file > bar/bar_file
  32. echo middle/file > middle/middle_file
  33. decho A
  34. tar -cvf foo.tar --incremental -C foo . -C `pwd` middle -C bar .
  35. rm foo.tar
  36. >toplevel_file
  37. decho B
  38. tar -cvf foo.tar --incremental -C foo . -C `pwd` toplevel_file -C bar .
  39. ],
  40. [0],
  41. [A
  42. ./
  43. ./
  44. middle/
  45. ./bar_file
  46. ./foo_file
  47. middle/middle_file
  48. B
  49. ./
  50. ./
  51. toplevel_file
  52. ./bar_file
  53. ./foo_file
  54. ],
  55. [A
  56. tar: .: Directory is new
  57. tar: middle: Directory is new
  58. tar: .: Directory is new
  59. B
  60. tar: .: Directory is new
  61. tar: .: Directory is new
  62. ],[],[],[gnu])
  63. AT_CLEANUP