long01.at 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright (C) 2005 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 2, 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., 59 Temple Place - Suite 330, Boston, MA
  15. # 02111-1307, USA.
  16. # In GNU format, when extracting or listing a file member with a name
  17. # whose length is divisible by block size (512) tar used to read an
  18. # extra block of data. In consequence the following file was not extracted.
  19. # Reported by Josef Bauer
  20. # References: <[email protected]>
  21. #
  22. AT_SETUP([long file names divisible by block size])
  23. AT_KEYWORDS([long512])
  24. dnl Create a directory structure with maximum diractory name length 512-16
  25. m4_define([NAME],[0123456789abcde])
  26. m4_define([FULLNAME],NAME)
  27. m4_for([N],0,29,,[m4_define([FULLNAME],FULLNAME/NAME)])
  28. # Create a directory from [FULLNAME] with a file NAME at the deepest
  29. # level. The full length of the resulting file name is 512
  30. # NOTE: It is important to use a *file* in this test, since directory
  31. # names always receive a trailing slash in tar.
  32. mkhier() {
  33. (for name in `echo FULLNAME | tr '/' ' '`
  34. do
  35. mkdir $name
  36. cd $name
  37. done
  38. cat /dev/null > NAME)
  39. }
  40. AT_TAR_CHECK([
  41. mkhier
  42. echo test > endfile
  43. tar cf archive FULLNAME/NAME endfile
  44. tar tf archive],
  45. [0],
  46. [FULLNAME/NAME
  47. endfile
  48. ],
  49. [],[],[],[gnu,oldgnu])
  50. AT_CLEANUP