incr07.at 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2009, 2013-2014 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. AT_SETUP([incremental restores with -C])
  18. AT_KEYWORDS([incremental extract incr07])
  19. # Tar 1.26 had problems extracting from incremental restores when given
  20. # the -C option. The code in incremen.c:try_purge_directory and
  21. # misc.c:remove_any_file was using savedir(), which ignored eventual changes
  22. # in the current working directory and caused the malfunctioning.
  23. #
  24. # The problem was reported by Piotr Rotter on 2013-03-22.
  25. #
  26. # This testcase is based on scripts provided by Piotr Rotter and Nathan
  27. # Stratton Treadway.
  28. #
  29. # References: <[email protected]>,
  30. # http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00036.html,
  31. # <[email protected]>,
  32. # http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00042.html,
  33. # <[email protected]>,
  34. # http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00043.html,
  35. # <[email protected]>,
  36. # http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00044.html
  37. AT_TAR_CHECK([
  38. mkdir A
  39. echo 'a' > A/a
  40. echo 'a' > A/b
  41. decho C0
  42. tar -g test.snar -vcf test.0.tar A
  43. echo 'a' > A/c
  44. decho C1
  45. tar -g test.snar -vcf test.1.tar A
  46. rm -f A/a
  47. decho C2
  48. tar -g test.snar -vcf test.2.tar A
  49. mkdir ext
  50. rm -rf A
  51. decho E0
  52. tar -g test.snar -vxf test.0.tar -C ext/
  53. decho E1
  54. tar -g test.snar -vxf test.1.tar -C ext/
  55. decho E2
  56. tar -g test.snar -vxf test.2.tar -C ext/
  57. mkdir ext/A/B
  58. touch ext/A/B/file
  59. decho E3
  60. tar -g test.snar -vxf test.2.tar -C ext/
  61. echo FIN
  62. test -d A && echo >&2 "toplevel A exists"
  63. exit 0
  64. ],
  65. [0],
  66. [C0
  67. A/
  68. A/a
  69. A/b
  70. C1
  71. A/
  72. A/c
  73. C2
  74. A/
  75. E0
  76. A/
  77. A/a
  78. A/b
  79. E1
  80. A/
  81. A/c
  82. E2
  83. A/
  84. tar: Deleting 'A/a'
  85. E3
  86. A/
  87. tar: Deleting 'A/B'
  88. FIN
  89. ],
  90. [C0
  91. tar: A: Directory is new
  92. C1
  93. C2
  94. E0
  95. E1
  96. E2
  97. E3
  98. ],[],[],[gnu, oldgnu, posix])
  99. AT_CLEANUP