exclude.at 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2007-2023 Free Software Foundation, Inc.
  4. # This file is part of GNU tar.
  5. # GNU tar is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 3 of the License, or
  8. # (at your option) any later version.
  9. # GNU tar is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. # Test the functioning of --exclude-caches and --exclude-tag option families
  16. AT_SETUP([exclude])
  17. AT_KEYWORDS([exclude])
  18. AT_TAR_CHECK([
  19. AT_SORT_PREREQ
  20. mkdir dir
  21. echo blues > dir/blues
  22. echo jazz > dir/jazz
  23. mkdir dir/folk
  24. echo tagfile > dir/folk/tagfile
  25. echo sanjuan > dir/folk/sanjuan
  26. mkdir dir/rock
  27. echo "Signature: 8a477f597d28d172789f06886806bc55" > dir/rock/CACHEDIR.TAG
  28. echo "test" > dir/rock/file
  29. for option in exclude-caches exclude-caches-under exclude-caches-all
  30. do
  31. echo OPTION $option
  32. tar -cf archive.tar --$option -v dir 2>err | sort
  33. cat err
  34. echo ARCHIVE
  35. tar tf archive.tar | sort
  36. done
  37. for option in exclude-tag exclude-tag-under exclude-tag-all
  38. do
  39. echo OPTION $option
  40. tar -cf archive.tar --${option}=tagfile -v dir 2>err | sort
  41. cat err
  42. echo ARCHIVE
  43. tar tf archive.tar | sort
  44. done
  45. ],
  46. [0],
  47. [OPTION exclude-caches
  48. dir/
  49. dir/blues
  50. dir/folk/
  51. dir/folk/sanjuan
  52. dir/folk/tagfile
  53. dir/jazz
  54. dir/rock/
  55. dir/rock/CACHEDIR.TAG
  56. tar: dir/rock/: contains a cache directory tag CACHEDIR.TAG; contents not dumped
  57. ARCHIVE
  58. dir/
  59. dir/blues
  60. dir/folk/
  61. dir/folk/sanjuan
  62. dir/folk/tagfile
  63. dir/jazz
  64. dir/rock/
  65. dir/rock/CACHEDIR.TAG
  66. OPTION exclude-caches-under
  67. dir/
  68. dir/blues
  69. dir/folk/
  70. dir/folk/sanjuan
  71. dir/folk/tagfile
  72. dir/jazz
  73. dir/rock/
  74. tar: dir/rock/: contains a cache directory tag CACHEDIR.TAG; contents not dumped
  75. ARCHIVE
  76. dir/
  77. dir/blues
  78. dir/folk/
  79. dir/folk/sanjuan
  80. dir/folk/tagfile
  81. dir/jazz
  82. dir/rock/
  83. OPTION exclude-caches-all
  84. dir/
  85. dir/blues
  86. dir/folk/
  87. dir/folk/sanjuan
  88. dir/folk/tagfile
  89. dir/jazz
  90. tar: dir/rock/: contains a cache directory tag CACHEDIR.TAG; directory not dumped
  91. ARCHIVE
  92. dir/
  93. dir/blues
  94. dir/folk/
  95. dir/folk/sanjuan
  96. dir/folk/tagfile
  97. dir/jazz
  98. OPTION exclude-tag
  99. dir/
  100. dir/blues
  101. dir/folk/
  102. dir/folk/tagfile
  103. dir/jazz
  104. dir/rock/
  105. dir/rock/CACHEDIR.TAG
  106. dir/rock/file
  107. tar: dir/folk/: contains a cache directory tag tagfile; contents not dumped
  108. ARCHIVE
  109. dir/
  110. dir/blues
  111. dir/folk/
  112. dir/folk/tagfile
  113. dir/jazz
  114. dir/rock/
  115. dir/rock/CACHEDIR.TAG
  116. dir/rock/file
  117. OPTION exclude-tag-under
  118. dir/
  119. dir/blues
  120. dir/folk/
  121. dir/jazz
  122. dir/rock/
  123. dir/rock/CACHEDIR.TAG
  124. dir/rock/file
  125. tar: dir/folk/: contains a cache directory tag tagfile; contents not dumped
  126. ARCHIVE
  127. dir/
  128. dir/blues
  129. dir/folk/
  130. dir/jazz
  131. dir/rock/
  132. dir/rock/CACHEDIR.TAG
  133. dir/rock/file
  134. OPTION exclude-tag-all
  135. dir/
  136. dir/blues
  137. dir/jazz
  138. dir/rock/
  139. dir/rock/CACHEDIR.TAG
  140. dir/rock/file
  141. tar: dir/folk/: contains a cache directory tag tagfile; directory not dumped
  142. ARCHIVE
  143. dir/
  144. dir/blues
  145. dir/jazz
  146. dir/rock/
  147. dir/rock/CACHEDIR.TAG
  148. dir/rock/file
  149. ],
  150. [],[],[],[ustar])
  151. AT_CLEANUP