xform-h.at 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright (C) 2009 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. # 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_define([xform],[
  27. echo "$1"
  28. tar cf archive --transform="s,^basedir/,,$2" basedir
  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. xform(Default transform scope)
  36. xform(Transforming hard links,h)
  37. xform(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. AT_CLEANUP
  48. # End of xform-h.at