exclude05.at 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Copyright 2009-2010, 2013-2014, 2016-2017 Free Software Foundation,
  3. # Inc.
  4. # This file is part of GNU tar.
  5. # GNU tar is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 3 of the License, or
  8. # (at your option) any later version.
  9. # GNU tar is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. # Test the functioning of many items in an exclude list (should run quickly)
  16. AT_SETUP([exclude: lots of excludes])
  17. AT_KEYWORDS([exclude exclude05])
  18. AT_TAR_CHECK([
  19. AT_SORT_PREREQ
  20. rm -rf testdir exclfile
  21. mkdir -p testdir
  22. awk 'BEGIN {for (i=9; i < 100; ++i ) { print "testdir/file" i; }}' < /dev/null | \
  23. while read name
  24. do
  25. genfile --file $name
  26. done
  27. awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print "testdir/file" i }}' < /dev/null > exclfile
  28. tar cf archive --anchored --exclude-from=exclfile \
  29. testdir
  30. tar tf archive | sort
  31. echo "NEXT"
  32. tar cf archive --exclude-from=exclfile \
  33. testdir
  34. tar tf archive | sort
  35. rm -rf testdir exclfile
  36. ],
  37. [0],
  38. [testdir/
  39. testdir/file10
  40. testdir/file11
  41. testdir/file9
  42. NEXT
  43. testdir/
  44. testdir/file10
  45. testdir/file11
  46. testdir/file9
  47. ])
  48. AT_CLEANUP