rename06.at 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # Test suite for GNU tar.
  2. # Copyright 2020-2023 Free Software Foundation, Inc.
  3. #
  4. # This file is part of GNU tar.
  5. #
  6. # GNU tar is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # GNU tar is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. AT_SETUP([chained renames])
  19. AT_KEYWORDS([incremental rename06 rename])
  20. # Description: test whether chained renames are processed correctly
  21. # during the incremental archive creation. Tar 1.32.90 failed to
  22. # encode them.
  23. # Reported by: Deweloper <[email protected]>
  24. # References: <[email protected]>,
  25. # https://lists.gnu.org/archive/html/bug-tar/2020-02/msg00008.html
  26. AT_TAR_CHECK([
  27. AT_SORT_PREREQ
  28. decho Creating directory structure
  29. mkdir test test/d1 test/d2
  30. genfile --file test/d1/file1
  31. genfile --file test/d2/file2
  32. decho First dump
  33. tar -c -g 0.snar -C test -f backup0.tar .
  34. decho Altering directory structure
  35. genfile --file test/d2/file3
  36. mv test/d1 test/d3
  37. mv test/d2 test/d1
  38. decho Second dump
  39. cp 0.snar 1.snar
  40. tar -vc -g 1.snar -C test -f backup1.tar .
  41. mkdir test1
  42. decho First extract
  43. tar -C test1 -x -g /dev/null -f backup0.tar
  44. decho Second extract
  45. tar -C test1 -x -g /dev/null -f backup1.tar
  46. decho Resulting directory
  47. find test1 | sort
  48. ],
  49. [0],
  50. [Creating directory structure
  51. First dump
  52. Altering directory structure
  53. Second dump
  54. ./
  55. ./d1/
  56. ./d3/
  57. ./d1/file3
  58. First extract
  59. Second extract
  60. Resulting directory
  61. test1
  62. test1/d1
  63. test1/d1/file2
  64. test1/d1/file3
  65. test1/d3
  66. test1/d3/file1
  67. ],
  68. [Creating directory structure
  69. First dump
  70. Altering directory structure
  71. Second dump
  72. tar: ./d1: Directory has been renamed from './d2'
  73. tar: ./d3: Directory has been renamed from './d1'
  74. First extract
  75. Second extract
  76. Resulting directory
  77. ],[],[],[gnu, oldgnu, posix])
  78. AT_CLEANUP