incr07.at 2.6 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 dirA
  39. echo 'a' > dirA/a
  40. echo 'a' > dirA/b
  41. decho C0
  42. tar -g test.snar -vcf test.0.tar dirA
  43. echo 'a' > dirA/c
  44. decho C1
  45. tar -g test.snar -vcf test.1.tar dirA
  46. rm -f dirA/a
  47. decho C2
  48. tar -g test.snar -vcf test.2.tar dirA
  49. mkdir ext
  50. rm -rf dirA
  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/dirA/dirB
  58. touch ext/dirA/dirB/file
  59. decho E3
  60. tar -g test.snar -vxf test.2.tar -C ext/
  61. echo FIN
  62. test -d dirA && echo >&2 "toplevel dirA exists"
  63. exit 0
  64. ],
  65. [0],
  66. [C0
  67. dirA/
  68. dirA/a
  69. dirA/b
  70. C1
  71. dirA/
  72. dirA/c
  73. C2
  74. dirA/
  75. E0
  76. dirA/
  77. dirA/a
  78. dirA/b
  79. E1
  80. dirA/
  81. dirA/c
  82. E2
  83. dirA/
  84. tar: Deleting 'dirA/a'
  85. E3
  86. dirA/
  87. tar: Deleting 'dirA/dirB'
  88. FIN
  89. ],
  90. [C0
  91. tar: dirA: Directory is new
  92. C1
  93. C2
  94. E0
  95. E1
  96. E2
  97. E3
  98. ],[],[],[gnu, oldgnu, posix])
  99. AT_CLEANUP