4
0

rename01.at 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2006-2007, 2009, 2013-2014, 2016-2017 Free Software
  4. # Foundation, 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: Test basic handling of renamed directory in the incremental
  17. # archives.
  18. AT_SETUP([renamed dirs in incrementals])
  19. AT_KEYWORDS([incremental rename rename01])
  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
  27. echo "Creating base archive"
  28. tar -g incr -cf arch.1 -v foo
  29. mv foo/bar foo/baz
  30. echo "Creating incremental archive"
  31. tar -g incr -cf arch.2 -v foo
  32. mv foo old
  33. tar xfg arch.1 /dev/null
  34. echo "Begin directory listing 1"
  35. find foo | sort
  36. echo "End directory listing 1"
  37. tar xfg arch.2 /dev/null
  38. echo Begin directory listing 2
  39. find foo | sort
  40. echo End directory listing 2
  41. ],
  42. [0],
  43. [Creating base archive
  44. foo/
  45. foo/bar/
  46. foo/file1
  47. foo/file2
  48. foo/bar/file
  49. Creating incremental archive
  50. foo/
  51. foo/baz/
  52. Begin directory listing 1
  53. foo
  54. foo/bar
  55. foo/bar/file
  56. foo/file1
  57. foo/file2
  58. End directory listing 1
  59. Begin directory listing 2
  60. foo
  61. foo/baz
  62. foo/baz/file
  63. foo/file1
  64. foo/file2
  65. End directory listing 2
  66. ],
  67. [tar: foo: Directory is new
  68. tar: foo/bar: Directory is new
  69. tar: foo/baz: Directory has been renamed from 'foo/bar'
  70. ],
  71. [],[],[gnu, oldgnu, posix])
  72. AT_CLEANUP
  73. # End of rename01.at