exclude01.at 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 wildcards])
  15. AT_KEYWORDS([exclude exclude01])
  16. AT_TAR_CHECK([
  17. AT_SORT_PREREQ
  18. rm -rf testdir
  19. mkdir -p testdir/dir1 testdir/dir2 testdir/dir3
  20. touch testdir/dir1/file1
  21. touch testdir/dir1/\*
  22. touch testdir/dir2/file2
  23. touch testdir/dir2/\*
  24. touch testdir/dir3/file3
  25. touch testdir/dir3/\*
  26. tar cf archive --exclude=testdir/dir1/\* \
  27. --no-wildcards \
  28. --exclude=testdir/dir2/\* \
  29. --wildcards \
  30. --exclude=testdir/dir3/\* \
  31. testdir
  32. tar tf archive | sort
  33. echo "NEXT"
  34. tar cf archive testdir
  35. tar t "testdir/dir1/*" -f archive | sort
  36. echo "NEXT"
  37. tar cf archive testdir/dir1
  38. tar t --no-wildcards "testdir/dir1/*" -f archive | sort
  39. echo "NEXT"
  40. tar cf archive testdir
  41. tar t --wildcards "testdir/dir1/*" -f archive | sort
  42. rm -rf testdir
  43. ],
  44. [0],
  45. [testdir/
  46. testdir/dir1/
  47. testdir/dir2/
  48. testdir/dir2/file2
  49. testdir/dir3/
  50. NEXT
  51. testdir/dir1/*
  52. NEXT
  53. testdir/dir1/*
  54. NEXT
  55. testdir/dir1/*
  56. testdir/dir1/file1
  57. ])
  58. AT_CLEANUP