T-recurse.at 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2015-2023 Free Software Foundation, 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. # Description: Test interaction of --recursion and --no-recursion options
  16. # together with --files-from option. This is complementary to recurs02.at test
  17. # case. References:
  18. # <[email protected]>
  19. # http://lists.gnu.org/archive/html/bug-tar/2015-06/msg00006.html
  20. AT_SETUP([files-from & recurse: toggle])
  21. AT_KEYWORDS([recurse T-recurse files-from])
  22. AT_TAR_CHECK([
  23. mkdir directory1 directory2
  24. touch directory1/file directory2/file
  25. AT_DATA([F1],[--no-recursion
  26. directory1/
  27. --recursion
  28. directory2/
  29. ])
  30. AT_DATA([F2A],[directory1/
  31. ])
  32. AT_DATA([F2B],[directory2/
  33. ])
  34. a=archive
  35. tar cf "$a" --files-from F1
  36. tar tf "$a"
  37. a=archive2
  38. tar cf "$a" --no-recursion -T F2A --recursion -T F2B
  39. tar tf "$a"
  40. ],
  41. [0],
  42. [directory1/
  43. directory2/
  44. directory2/file
  45. directory1/
  46. directory2/
  47. directory2/file
  48. ])
  49. AT_CLEANUP
  50. AT_SETUP([toggle --recursion (not) from -T])
  51. AT_KEYWORDS([recurse T-recurse T-recurse2 files-from])
  52. AT_TAR_CHECK([
  53. mkdir directory1 directory2
  54. touch directory1/file directory2/file
  55. AT_DATA([F1],[--no-recursion
  56. directory1/
  57. ])
  58. AT_DATA([F2],[directory2/
  59. ])
  60. tar cf archive -T F1 --recursion -T F2
  61. tar tf archive
  62. ],
  63. [0],
  64. [directory1/
  65. directory2/
  66. directory2/file
  67. ])
  68. AT_CLEANUP