4
0

link03.at 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2009-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. # Make sure -l option works correctly in conjunction with --remove-files
  16. # See also link02.at
  17. AT_SETUP([working -l with --remove-files])
  18. AT_KEYWORDS([hardlinks link03])
  19. m4_pushdef([create_files],[
  20. genfile -l 64 -f file1
  21. ln file1 file2
  22. ln file2 file3
  23. ln file3 file4
  24. ])
  25. AT_TAR_CHECK([
  26. create_files
  27. echo archive.1
  28. tar -c -f archive.1 -l --remove-files file1 file2 file3 file4
  29. create_files
  30. echo archive.2
  31. tar -c -f archive.2 -l --remove-files file1 file2 file3
  32. echo testing archive.2
  33. tar tfv archive.2 | sed -n 's/.*file[[2-3]] link to //p'
  34. ],
  35. [0],
  36. [archive.1
  37. archive.2
  38. testing archive.2
  39. file1
  40. file1
  41. ],
  42. [tar: Missing links to 'file1'.
  43. ])
  44. m4_popdef([create_files])
  45. AT_CLEANUP