exclude03.at 1.8 KB

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