chtype.at 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2006-2023 Free Software Foundation, Inc.
  4. # This file is part of GNU tar.
  5. # GNU tar 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 3 of the License, or
  8. # (at your option) any later version.
  9. # GNU tar is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. # Description: Incremental restore malfunctions if an archive member
  16. # changes type before restoration, e.g. from directory to file or vice
  17. # versa.
  18. # Reported by: Wolfram Kleff <[email protected]>
  19. # References: <[email protected]>
  20. AT_SETUP([changed file types in incrementals])
  21. AT_KEYWORDS([incremental listed chtype])
  22. AT_TAR_CHECK([
  23. AT_SORT_PREREQ
  24. AT_TAR_MKHIER([directory/b/c],[x])
  25. mkdir directory/a
  26. genfile --file directory/a/a
  27. echo First backup
  28. tar --create --file=archive.1 --listed-incremental=db.1 directory
  29. sleep 2
  30. # Remove directory b and create a file with this name.
  31. # Previous versions were not able to restore over this file.
  32. rm -r directory/b
  33. genfile --file directory/b
  34. genfile --file directory/a/b
  35. echo Second backup
  36. tar --create --file=archive.2 --listed-incremental=db.2 directory
  37. # Delete a
  38. rm -r directory
  39. echo Restore archive.1
  40. tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp
  41. echo Restore archive.2
  42. tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp
  43. find directory | sort
  44. ],
  45. [0],
  46. [First backup
  47. Second backup
  48. Restore archive.1
  49. Restore archive.2
  50. directory
  51. directory/a
  52. directory/a/a
  53. directory/a/b
  54. directory/b
  55. ],[],[],[],[gnu, oldgnu, posix])
  56. AT_CLEANUP
  57. # End of chtype.at