rename02.at 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright (C) 2006, 2007 Free Software Foundation, Inc.
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 3, or (at your option)
  7. # any later version.
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. # You should have received a copy of the GNU General Public License
  13. # along with this program; if not, write to the Free Software
  14. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  15. # 02110-1301, USA.
  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 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
  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/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