rename02.at 2.3 KB

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