exclude.at 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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 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. # Test the functioning of --exclude-caches and --exclude-tag option families
  17. AT_SETUP([exclude])
  18. AT_KEYWORDS([exclude])
  19. AT_TAR_CHECK([
  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
  33. cat err
  34. echo ARCHIVE
  35. tar tf archive.tar
  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
  41. cat err
  42. echo ARCHIVE
  43. tar tf archive.tar
  44. done
  45. ],
  46. [0],
  47. [OPTION exclude-caches
  48. dir/
  49. dir/blues
  50. dir/jazz
  51. dir/folk/
  52. dir/folk/tagfile
  53. dir/folk/sanjuan
  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/jazz
  61. dir/folk/
  62. dir/folk/tagfile
  63. dir/folk/sanjuan
  64. dir/rock/
  65. dir/rock/CACHEDIR.TAG
  66. OPTION exclude-caches-under
  67. dir/
  68. dir/blues
  69. dir/jazz
  70. dir/folk/
  71. dir/folk/tagfile
  72. dir/folk/sanjuan
  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/jazz
  79. dir/folk/
  80. dir/folk/tagfile
  81. dir/folk/sanjuan
  82. dir/rock/
  83. OPTION exclude-caches-all
  84. dir/
  85. dir/blues
  86. dir/jazz
  87. dir/folk/
  88. dir/folk/tagfile
  89. dir/folk/sanjuan
  90. tar: dir/rock/: contains a cache directory tag CACHEDIR.TAG; directory not dumped
  91. ARCHIVE
  92. dir/
  93. dir/blues
  94. dir/jazz
  95. dir/folk/
  96. dir/folk/tagfile
  97. dir/folk/sanjuan
  98. OPTION exclude-tag
  99. dir/
  100. dir/blues
  101. dir/jazz
  102. dir/folk/
  103. dir/folk/tagfile
  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/jazz
  112. dir/folk/
  113. dir/folk/tagfile
  114. dir/rock/
  115. dir/rock/CACHEDIR.TAG
  116. dir/rock/file
  117. OPTION exclude-tag-under
  118. dir/
  119. dir/blues
  120. dir/jazz
  121. dir/folk/
  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/jazz
  130. dir/folk/
  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