update03.at 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 chdir])
  20. AT_KEYWORDS([update update03 chdir])
  21. # Tar <=1.29 failed to chdir when -u was used with -C
  22. # Reported by: Ivan Kalvachev <[email protected]>
  23. # References: <CABA=pqfSq-4PJYp7W2ezGOz+fR2uh74AyA7kOeXJBzg2o-oQBA@mail.gmail.com>,
  24. # http://lists.gnu.org/archive/html/bug-tar/2016-08/msg00003.html
  25. AT_TAR_CHECK([
  26. mkdir dir1
  27. mkdir dir2
  28. mkdir dir1/subdir1 dir2/subdir2
  29. genfile --file dir1/subdir1/a
  30. genfile --file dir2/subdir2/a
  31. echo Create
  32. tar -vcf arc.tar -C dir1 subdir1 -C ../dir2 subdir2
  33. genfile --file dir1/subdir1/b
  34. genfile --file dir2/subdir2/c
  35. echo Update
  36. tar -vuf arc.tar -C dir1 subdir1 -C ../dir2 subdir2
  37. ],
  38. [0],
  39. [Create
  40. subdir1/
  41. subdir1/a
  42. subdir2/
  43. subdir2/a
  44. Update
  45. subdir1/b
  46. subdir2/c
  47. ])
  48. AT_CLEANUP