exclude.at 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright (C) 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. # Test the functioning of --exclude-caches and --exclude-tag option families
  17. AT_SETUP([exclude])
  18. AT_KEYWORDS([exclude])
  19. AT_TAR_CHECK([
  20. AT_SORT_PREREQ
  21. mkdir dir
  22. echo blues > dir/blues
  23. echo jazz > dir/jazz
  24. mkdir dir/folk
  25. echo tagfile > dir/folk/tagfile
  26. echo sanjuan > dir/folk/sanjuan
  27. mkdir dir/rock
  28. echo "Signature: 8a477f597d28d172789f06886806bc55" > dir/rock/CACHEDIR.TAG
  29. echo "test" > dir/rock/file
  30. for option in exclude-caches exclude-caches-under exclude-caches-all
  31. do
  32. echo OPTION $option
  33. tar -cf archive.tar --$option -v dir 2>err | sort
  34. cat err
  35. echo ARCHIVE
  36. tar tf archive.tar | sort
  37. done
  38. for option in exclude-tag exclude-tag-under exclude-tag-all
  39. do
  40. echo OPTION $option
  41. tar -cf archive.tar --${option}=tagfile -v dir 2>err | sort
  42. cat err
  43. echo ARCHIVE
  44. tar tf archive.tar | sort
  45. done
  46. ],
  47. [0],
  48. [OPTION exclude-caches
  49. dir/
  50. dir/blues
  51. dir/folk/
  52. dir/folk/sanjuan
  53. dir/folk/tagfile
  54. dir/jazz
  55. dir/rock/
  56. dir/rock/CACHEDIR.TAG
  57. tar: dir/rock/: contains a cache directory tag CACHEDIR.TAG; contents not dumped
  58. ARCHIVE
  59. dir/
  60. dir/blues
  61. dir/folk/
  62. dir/folk/sanjuan
  63. dir/folk/tagfile
  64. dir/jazz
  65. dir/rock/
  66. dir/rock/CACHEDIR.TAG
  67. OPTION exclude-caches-under
  68. dir/
  69. dir/blues
  70. dir/folk/
  71. dir/folk/sanjuan
  72. dir/folk/tagfile
  73. dir/jazz
  74. dir/rock/
  75. tar: dir/rock/: contains a cache directory tag CACHEDIR.TAG; contents not dumped
  76. ARCHIVE
  77. dir/
  78. dir/blues
  79. dir/folk/
  80. dir/folk/sanjuan
  81. dir/folk/tagfile
  82. dir/jazz
  83. dir/rock/
  84. OPTION exclude-caches-all
  85. dir/
  86. dir/blues
  87. dir/folk/
  88. dir/folk/sanjuan
  89. dir/folk/tagfile
  90. dir/jazz
  91. tar: dir/rock/: contains a cache directory tag CACHEDIR.TAG; directory not dumped
  92. ARCHIVE
  93. dir/
  94. dir/blues
  95. dir/folk/
  96. dir/folk/sanjuan
  97. dir/folk/tagfile
  98. dir/jazz
  99. OPTION exclude-tag
  100. dir/
  101. dir/blues
  102. dir/folk/
  103. dir/folk/tagfile
  104. dir/jazz
  105. dir/rock/
  106. dir/rock/CACHEDIR.TAG
  107. dir/rock/file
  108. tar: dir/folk/: contains a cache directory tag tagfile; contents not dumped
  109. ARCHIVE
  110. dir/
  111. dir/blues
  112. dir/folk/
  113. dir/folk/tagfile
  114. dir/jazz
  115. dir/rock/
  116. dir/rock/CACHEDIR.TAG
  117. dir/rock/file
  118. OPTION exclude-tag-under
  119. dir/
  120. dir/blues
  121. dir/folk/
  122. dir/jazz
  123. dir/rock/
  124. dir/rock/CACHEDIR.TAG
  125. dir/rock/file
  126. tar: dir/folk/: contains a cache directory tag tagfile; contents not dumped
  127. ARCHIVE
  128. dir/
  129. dir/blues
  130. dir/folk/
  131. dir/jazz
  132. dir/rock/
  133. dir/rock/CACHEDIR.TAG
  134. dir/rock/file
  135. OPTION exclude-tag-all
  136. dir/
  137. dir/blues
  138. dir/jazz
  139. dir/rock/
  140. dir/rock/CACHEDIR.TAG
  141. dir/rock/file
  142. tar: dir/folk/: contains a cache directory tag tagfile; directory not dumped
  143. ARCHIVE
  144. dir/
  145. dir/blues
  146. dir/jazz
  147. dir/rock/
  148. dir/rock/CACHEDIR.TAG
  149. dir/rock/file
  150. ],
  151. [],[],[],[ustar])
  152. AT_CLEANUP