4
0

rename02.at 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2006-2023 Free Software Foundation, Inc.
  4. # This file is part of GNU tar.
  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. # GNU tar is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. # Description: Incremental archives should be able to handle directories
  16. # moved between directory hierarchies.
  17. AT_SETUP([move between hierarchies])
  18. AT_KEYWORDS([incremental rename rename02])
  19. AT_TAR_CHECK([
  20. AT_SORT_PREREQ
  21. mkdir foo
  22. genfile --file foo/file1
  23. genfile --file foo/file2
  24. mkdir foo/bar
  25. genfile --file foo/bar/file.r
  26. mkdir foo/bar/baz
  27. genfile --file foo/bar/baz/file.z
  28. sleep 1
  29. echo "Creating base archive"
  30. tar -g incr -cf arch.1 -v foo
  31. mv foo/bar/baz foo
  32. echo "Creating incremental archive"
  33. tar -g incr -cf arch.2 -v foo
  34. mv foo old
  35. tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr
  36. sort tmperr >&2
  37. echo "Begin directory listing 1"
  38. find foo | sort
  39. echo "End directory listing 1"
  40. tar xfgv arch.2 /dev/null --warning=no-timestamp
  41. echo Begin directory listing 2
  42. find foo | sort
  43. echo End directory listing 2
  44. ],
  45. [0],
  46. [Creating base archive
  47. foo/
  48. foo/bar/
  49. foo/bar/baz/
  50. foo/file1
  51. foo/file2
  52. foo/bar/file.r
  53. foo/bar/baz/file.z
  54. Creating incremental archive
  55. foo/
  56. foo/bar/
  57. foo/baz/
  58. Begin directory listing 1
  59. foo
  60. foo/bar
  61. foo/bar/baz
  62. foo/bar/baz/file.z
  63. foo/bar/file.r
  64. foo/file1
  65. foo/file2
  66. End directory listing 1
  67. foo/
  68. foo/bar/
  69. foo/baz/
  70. Begin directory listing 2
  71. foo
  72. foo/bar
  73. foo/bar/file.r
  74. foo/baz
  75. foo/baz/file.z
  76. foo/file1
  77. foo/file2
  78. End directory listing 2
  79. ],
  80. [tar: foo: Directory is new
  81. tar: foo/bar: Directory is new
  82. tar: foo/bar/baz: Directory is new
  83. tar: foo/baz: Directory has been renamed from 'foo/bar/baz'
  84. ],
  85. [],[],[gnu, oldgnu, posix])
  86. AT_CLEANUP
  87. # End of rename02.at