xform-h.at 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. # When creating archives, tar 1.22 did not apply the --transform option
  16. # to hard links.
  17. #
  18. # Reported by: Jose Miguel Goncalves <[email protected]>
  19. # References:
  20. # <[email protected]>
  21. # http://lists.gnu.org/archive/html/bug-tar/2009-06/msg00017.html
  22. #
  23. AT_SETUP([transforming hard links on create])
  24. AT_KEYWORDS([transform xform xform-h])
  25. m4_pushdef([xformtest],[
  26. echo "$1"
  27. tar cf archive --transform="s,^basedir/,,$2" basedir/test basedir/test_link
  28. tar tvf archive | sed -n 's/.*test_link link to //p'
  29. ])
  30. AT_TAR_CHECK([
  31. mkdir basedir
  32. echo "hello" > basedir/test
  33. ln basedir/test basedir/test_link
  34. xformtest(Default transform scope)
  35. xformtest(Transforming hard links,h)
  36. xformtest(Not transforming hard links,H)
  37. ],
  38. [0],
  39. [Default transform scope
  40. test
  41. Transforming hard links
  42. test
  43. Not transforming hard links
  44. basedir/test
  45. ])
  46. m4_popdef([xformtest])
  47. AT_CLEANUP
  48. # End of xform-h.at