update04.at 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2016-2023 Free Software Foundation, Inc.
  4. #
  5. # This file is part of GNU tar.
  6. #
  7. # GNU tar is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 3 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # GNU tar is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. AT_SETUP([update with wildcards])
  20. AT_KEYWORDS([update update04 wildcards])
  21. AT_TAR_CHECK([
  22. genfile --file file.a
  23. genfile --file file.b
  24. genfile --file file.c
  25. echo Create
  26. tar cf archive ./file.*
  27. sleep 1
  28. echo "update" > file.b
  29. echo First update
  30. tar ufv archive --wildcards './file.*'
  31. echo "Second update"
  32. tar ufv archive --wildcards './file.*'
  33. echo "Non-matching pattern"
  34. tar ufv archive --wildcards './file.*' './foo.*'
  35. echo $?
  36. ],
  37. [0],
  38. [Create
  39. First update
  40. ./file.b
  41. Second update
  42. Non-matching pattern
  43. 2
  44. ],
  45. [tar: ./foo.*: Not found in archive
  46. tar: Exiting with failure status due to previous errors
  47. ])
  48. AT_CLEANUP