exclude05.at 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. # Test the functioning of many items in an exclude list (should run quickly)
  15. AT_SETUP([exclude: lots of excludes])
  16. AT_KEYWORDS([exclude exclude05])
  17. AT_TAR_CHECK([
  18. AT_SORT_PREREQ
  19. rm -rf testdir exclfile
  20. mkdir -p testdir
  21. awk 'BEGIN {for (i=9; i < 100; ++i ) { print "testdir/file" i; }}' < /dev/null | \
  22. while read name
  23. do
  24. genfile --file $name
  25. done
  26. awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print "testdir/file" i }}' < /dev/null > exclfile
  27. tar cf archive --anchored --exclude-from=exclfile \
  28. testdir
  29. tar tf archive | sort
  30. echo "NEXT"
  31. tar cf archive --exclude-from=exclfile \
  32. testdir
  33. tar tf archive | sort
  34. rm -rf testdir exclfile
  35. ],
  36. [0],
  37. [testdir/
  38. testdir/file10
  39. testdir/file11
  40. testdir/file9
  41. NEXT
  42. testdir/
  43. testdir/file10
  44. testdir/file11
  45. testdir/file9
  46. ])
  47. AT_CLEANUP