rename02.at 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. 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 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
  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/bar: Directory is new
  81. tar: foo/bar/baz: Directory is new
  82. tar: foo/baz: Directory has been renamed from `foo/bar/baz'
  83. ],
  84. [],[],[gnu, oldgnu, posix])
  85. AT_CLEANUP
  86. # End of rename02.at