chtype.at 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright (C) 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. # Description: Incremental restore malfunctions if an archive member
  17. # changes type before restoration, e.g. from directory to file or vice
  18. # versa.
  19. # Reported by: Wolfram Kleff <[email protected]>
  20. # References: <[email protected]>
  21. AT_SETUP([changed file types in incrementals])
  22. AT_KEYWORDS([incremental chtype])
  23. AT_TAR_CHECK([
  24. AT_SORT_PREREQ
  25. AT_TAR_MKHIER([directory/b/c],[x])
  26. mkdir directory/a
  27. genfile --file directory/a/a
  28. echo First backup
  29. tar --create --file=archive.1 --listed-incremental=db.1 directory
  30. sleep 2
  31. # Remove directory b and create a file with this name.
  32. # Previous versions were not able to restore over this file.
  33. rm -r directory/b
  34. genfile --file directory/b
  35. genfile --file directory/a/b
  36. echo Second backup
  37. tar --create --file=archive.2 --listed-incremental=db.2 directory
  38. # Delete a
  39. rm -r directory
  40. echo Restore archive.1
  41. tar -xf archive.1 --listed-incremental=/dev/null
  42. echo Restore archive.2
  43. tar -xf archive.2 --listed-incremental=/dev/null
  44. find directory | sort
  45. ],
  46. [0],
  47. [First backup
  48. Second backup
  49. Restore archive.1
  50. Restore archive.2
  51. directory
  52. directory/a
  53. directory/a/a
  54. directory/a/b
  55. directory/b
  56. ],[],[],[],[gnu, oldgnu, posix])
  57. AT_CLEANUP
  58. # End of chtype.at