rename04.at 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. # Test suite for GNU tar.
  3. # Copyright 2008-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: Up to version 1.20, when storing a record for renamed
  16. # directory in an incremental archive, tar incorrectly flagged all its
  17. # subdirectories as renamed, which led to problems at archive extraction.
  18. # References: <[email protected]>
  19. # Reported by: Enric Hernandez <[email protected]>
  20. AT_SETUP([renamed directory containing subdirectories])
  21. AT_KEYWORDS([incremental rename04 rename])
  22. AT_TAR_CHECK([
  23. AT_SORT_PREREQ
  24. decho Creating directory structure
  25. mkdir directory
  26. mkdir directory/subdir
  27. genfile --file=directory/file
  28. decho Creating initial archive
  29. tar -cf archive.1 -g db.1 directory
  30. decho Renaming
  31. mv directory dir
  32. decho Creating incremental archive
  33. cp db.1 db.2
  34. tar -cf archive.2 -g db.2 dir
  35. mv dir orig
  36. decho First restore
  37. tar -xf archive.1 -g db.1
  38. find directory | sort
  39. decho Second restore
  40. tar -xf archive.2 -g db.2
  41. find dir | sort
  42. ],
  43. [0],
  44. [Creating directory structure
  45. Creating initial archive
  46. Renaming
  47. Creating incremental archive
  48. First restore
  49. directory
  50. directory/file
  51. directory/subdir
  52. Second restore
  53. dir
  54. dir/subdir
  55. ],
  56. [Creating directory structure
  57. Creating initial archive
  58. Renaming
  59. Creating incremental archive
  60. First restore
  61. Second restore
  62. ],[],[],[gnu, oldgnu, posix])
  63. AT_CLEANUP
  64. # End of rename04.at