rename02.at 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright (C) 2006 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 2, 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. 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. echo "Creating base archive"
  29. tar -g incr -cf arch.1 -v foo
  30. mv foo/bar/baz foo
  31. echo "Creating incremental archive"
  32. tar -g incr -cf arch.2 -v foo
  33. mv foo old
  34. tar xfg arch.1 /dev/null 2>tmperr
  35. sort tmperr >&2
  36. echo "Begin directory listing 1"
  37. find foo | sort
  38. echo "End directory listing 1"
  39. tar xfgv arch.2 /dev/null
  40. echo Begin directory listing 2
  41. find foo | sort
  42. echo End directory listing 2
  43. ],
  44. [0],
  45. [Creating base archive
  46. foo/
  47. foo/bar/
  48. foo/bar/baz/
  49. foo/file1
  50. foo/file2
  51. foo/bar/file.r
  52. foo/bar/baz/file.z
  53. Creating incremental archive
  54. foo/
  55. foo/bar/
  56. foo/baz/
  57. Begin directory listing 1
  58. foo
  59. foo/bar
  60. foo/bar/baz
  61. foo/bar/baz/file.z
  62. foo/bar/file.r
  63. foo/file1
  64. foo/file2
  65. End directory listing 1
  66. foo/
  67. foo/bar/
  68. foo/baz/
  69. Begin directory listing 2
  70. foo
  71. foo/bar
  72. foo/bar/file.r
  73. foo/baz
  74. foo/baz/file.z
  75. foo/file1
  76. foo/file2
  77. End directory listing 2
  78. ],
  79. [tar: foo/bar: Directory is new
  80. tar: foo/bar/baz: Directory is new
  81. tar: foo/baz: Directory has been renamed from `foo/bar/baz'
  82. ],
  83. [],[],[gnu, oldgnu, posix])
  84. AT_CLEANUP
  85. # End of rename02.at