extrac05.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #! /bin/sh
  2. # This file is part of GNU tar testsuite.
  3. # Copyright (C) 2004 Free Software Foundation, Inc.
  4. #
  5. # This program 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 2, or (at your option)
  8. # any later version.
  9. #
  10. # This program 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. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  18. # 02111-1307, USA.
  19. # Problem: when extracting selected members from a PAX archive,
  20. # tar 1.14 incorrectly deemed all members to be sparse and
  21. # therefore was not able to properly skip them.
  22. #
  23. # Reported by: Luca Fibbi <fibbi@lamma.rete.toscana.it>
  24. #
  25. # References: <3.0.6.32.20040809113727.00a30e50@localhost>
  26. # http://lists.gnu.org/archive/html/bug-tar/2004-08/msg00008.html
  27. . ./preset
  28. TAR_ARCHIVE_FORMATS="posix"
  29. . $srcdir/before
  30. genfile --length 118 > jeden
  31. genfile --length 223 > dwa
  32. genfile --length 517 > trzy
  33. mksparse sparsefile 512 0 ABCD 1M EFGH 2000K IJKL
  34. genfile --length 110 > cztery
  35. tar cf archive jeden dwa trzy cztery
  36. cat > list <<EOF
  37. jeden
  38. cztery
  39. EOF
  40. mkdir dir
  41. cd dir
  42. tar xvfT ../archive ../list
  43. cd ..
  44. out="\
  45. jeden
  46. cztery
  47. "
  48. . $srcdir/after