4
0

exclude02.at 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Copyright 2009-2023 Free Software Foundation, Inc.
  3. # This file is part of GNU tar.
  4. # GNU tar 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 of the License, or
  7. # (at your option) any later version.
  8. # GNU tar 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, see <http://www.gnu.org/licenses/>.
  14. AT_SETUP([exclude: anchoring])
  15. AT_KEYWORDS([exclude exclude02])
  16. AT_TAR_CHECK([
  17. AT_SORT_PREREQ
  18. rm -rf testdir
  19. mkdir -p testdir
  20. touch file1.txt
  21. touch testdir/file1.txt
  22. touch testdir/file2
  23. tar cf archive --exclude="file1.txt" \
  24. testdir
  25. tar tf archive | sort
  26. echo "SUB 1"
  27. tar cf archive --no-anchored \
  28. --exclude="file1.txt" \
  29. testdir
  30. tar tf archive | sort
  31. echo "SUB 2"
  32. tar cf archive --anchored \
  33. --exclude="file1.txt" \
  34. testdir
  35. tar tf archive | sort
  36. echo "SUB 3"
  37. tar cf archive testdir file1.txt
  38. tar t "file1.txt" -f archive | sort
  39. echo "SUB 4"
  40. tar t --no-anchored "file1.txt" -f archive | sort
  41. echo "SUB 5"
  42. tar t --anchored "file1.txt" -f archive | sort
  43. rm -rf testdir file1.txt
  44. ],
  45. [0],
  46. [testdir/
  47. testdir/file2
  48. SUB 1
  49. testdir/
  50. testdir/file2
  51. SUB 2
  52. testdir/
  53. testdir/file1.txt
  54. testdir/file2
  55. SUB 3
  56. file1.txt
  57. SUB 4
  58. file1.txt
  59. testdir/file1.txt
  60. SUB 5
  61. file1.txt
  62. ])
  63. AT_CLEANUP