4
0

link01.at 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright (C) 2004, 2007 Free Software Foundation, Inc.
  4. # This program 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, or (at your option)
  7. # any later version.
  8. # This program 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, write to the Free Software
  14. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  15. # 02110-1301, USA.
  16. # Problem: If a member with link count > 2 was stored in the archive twice,
  17. # previous versions of tar were not able to extract it, since they
  18. # were trying to link the file to itself, which always failed and
  19. # lead to removing the already extracted copy. This script tests
  20. # the workaround by Paul Eggert that leaves the extracted copy
  21. # untouched.
  22. #
  23. # Reported by: Toby Peterson <[email protected]>
  24. #
  25. # References: <[email protected]>
  26. # http://lists.gnu.org/archive/html/bug-tar/2004-07/msg00009.html
  27. AT_SETUP([link count gt 2])
  28. AT_KEYWORDS([link01])
  29. AT_TAR_CHECK([
  30. mkdir directory
  31. mkdir directory/test1
  32. mkdir directory/test2
  33. echo TEST > directory/test1/test.txt
  34. ln directory/test1/test.txt directory/test2/test.txt || AT_SKIP_TEST
  35. tar cf archive directory/test1/test.txt directory/test1/test.txt
  36. rm -r directory
  37. tar xf archive
  38. ls directory/test1
  39. ],
  40. [0],
  41. [test.txt
  42. ])
  43. AT_CLEANUP