xform-h.at 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2009-2010, 2013-2014, 2016-2017 Free Software Foundation,
  4. # Inc.
  5. # This file is part of GNU tar.
  6. # GNU tar is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 3 of the License, or
  9. # (at your option) any later version.
  10. # GNU tar is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. # When creating archives, tar 1.22 did not apply the --transform option
  17. # to hard links.
  18. #
  19. # Reported by: Jose Miguel Goncalves <[email protected]>
  20. # References:
  21. # <[email protected]>
  22. # http://lists.gnu.org/archive/html/bug-tar/2009-06/msg00017.html
  23. #
  24. AT_SETUP([transforming hard links on create])
  25. AT_KEYWORDS([transform xform xform-h])
  26. m4_pushdef([xformtest],[
  27. echo "$1"
  28. tar cf archive --transform="s,^basedir/,,$2" basedir/test basedir/test_link
  29. tar tvf archive | sed -n 's/.*test_link link to //p'
  30. ])
  31. AT_TAR_CHECK([
  32. mkdir basedir
  33. echo "hello" > basedir/test
  34. ln basedir/test basedir/test_link
  35. xformtest(Default transform scope)
  36. xformtest(Transforming hard links,h)
  37. xformtest(Not transforming hard links,H)
  38. ],
  39. [0],
  40. [Default transform scope
  41. test
  42. Transforming hard links
  43. test
  44. Not transforming hard links
  45. basedir/test
  46. ])
  47. m4_popdef([xformtest])
  48. AT_CLEANUP
  49. # End of xform-h.at