exclude01.at 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Copyright (C) 2009 Free Software Foundation, Inc.
  3. # This program is free software; you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation; either version 3, or (at your option)
  6. # any later version.
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. # GNU General Public License for more details.
  11. # You should have received a copy of the GNU General Public License
  12. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. AT_SETUP([exclude wildcards])
  14. AT_KEYWORDS([exclude exclude01])
  15. AT_TAR_CHECK([
  16. AT_SORT_PREREQ
  17. rm -rf testdir
  18. mkdir -p testdir/dir1 testdir/dir2 testdir/dir3
  19. touch testdir/dir1/file1
  20. touch testdir/dir1/\*
  21. touch testdir/dir2/file2
  22. touch testdir/dir2/\*
  23. touch testdir/dir3/file3
  24. touch testdir/dir3/\*
  25. tar cf archive --exclude=testdir/dir1/\* \
  26. --no-wildcards \
  27. --exclude=testdir/dir2/\* \
  28. --wildcards \
  29. --exclude=testdir/dir3/\* \
  30. testdir
  31. tar tf archive | sort
  32. echo "NEXT"
  33. tar cf archive testdir
  34. tar t "testdir/dir1/*" -f archive | sort
  35. echo "NEXT"
  36. tar cf archive testdir/dir1
  37. tar t --no-wildcards "testdir/dir1/*" -f archive | sort
  38. echo "NEXT"
  39. tar cf archive testdir
  40. tar t --wildcards "testdir/dir1/*" -f archive | sort
  41. rm -rf testdir
  42. ],
  43. [0],
  44. [testdir/
  45. testdir/dir1/
  46. testdir/dir2/
  47. testdir/dir2/file2
  48. testdir/dir3/
  49. NEXT
  50. testdir/dir1/*
  51. NEXT
  52. testdir/dir1/*
  53. NEXT
  54. testdir/dir1/*
  55. testdir/dir1/file1
  56. ])
  57. AT_CLEANUP