multiv03.at 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright (C) 2004, 2005, 2006, 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: GNU multivolume archives are not able to continue on members
  17. # with filenames longer than 100 characters. Versions of tar <= 1.14
  18. # were not checking filename lengths and produced malformed multivolume
  19. # headers.
  20. # References: <[email protected]>
  21. # http://lists.gnu.org/archive/html/bug-tar/2004-08/msg00012.html
  22. # <[email protected]>
  23. #
  24. AT_SETUP([MV archive & long filenames])
  25. AT_KEYWORDS([multivolume multiv multiv03])
  26. AT_TAR_CHECK([
  27. AFILE=`awk 'BEGIN { for (i = 0; i < 100; i++) printf "a"; exit; }'`
  28. BFILE=`awk 'BEGIN { for (i = 0; i < 101; i++) printf "b"; exit; }'`
  29. cat > ../experr <<EOF
  30. tar: $BFILE: file name too long to be stored in a GNU multivolume header, truncated
  31. tar: \`$BFILE' is possibly continued on this volume: header contains truncated name
  32. EOF
  33. cat > ../expout <<EOF
  34. $AFILE
  35. separator-1
  36. separator-2
  37. EOF
  38. genfile --length 15360 --file $AFILE
  39. exec <&-
  40. tar -M -L 10 -c -f arch.1 -f arch.2 $AFILE || exit 1
  41. tar -tM -f arch.1 -f arch.2 || exit 1
  42. echo separator-1
  43. genfile --length 15360 --file $BFILE
  44. tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 1
  45. echo separator-2
  46. mv $BFILE bfile
  47. tar -M -x -f arch.1 -f arch.2 || exit 1
  48. cmp $BFILE bfile
  49. ],
  50. [0],
  51. [expout],
  52. [experr],
  53. [],[],[gnu, oldgnu])
  54. AT_CLEANUP