append05.at 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # Process this file with autom4te to create testsuite. -*- Autotest -*-
  2. #
  3. # Test suite for GNU tar.
  4. # Copyright 2016-2023 Free Software Foundation, Inc.
  5. #
  6. # This file is part of GNU tar.
  7. #
  8. # GNU tar is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 3 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # GNU tar is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. # Adding files to an archive with a blocking factor different from the one
  21. # used when creating it would produce a malformed archive.
  22. #
  23. # Last-Affected-Version: 1.28.90 (da7845c6563e7337bf3e8364046a7989091f190e)
  24. # Reported-by: Initial report by Renate Pyhel <[email protected]>. Explained
  25. # in detail by Tim Kientzle. This test case is based on his posting.
  26. # References: <CALyyU7QJRQEQWMqZ=J=ppu-nwOH6R58Ci2ZkV32+CeZKsWsz7Q@mail.gmail.com>,
  27. # <[email protected]>,
  28. # http://lists.gnu.org/archive/html/bug-tar/2016-03/msg00002.html,
  29. # http://lists.gnu.org/archive/html/bug-tar/2016-03/msg00004.html
  30. AT_SETUP([append after changed blocking])
  31. AT_KEYWORDS([append append05 blocking])
  32. AT_TAR_CHECK([
  33. for f in a b c d e f g h i
  34. do
  35. echo $f > $f
  36. done
  37. decho 'creating archive'
  38. tar -cf archive -b1 a b c
  39. tar tf archive
  40. decho 'adding d e f'
  41. tar -vrf archive -b3 d e f
  42. echo ==
  43. tar tf archive
  44. decho 'adding g h i'
  45. tar -vrf archive -b5 g h i
  46. decho 'resulting archive'
  47. tar tf archive
  48. ],
  49. [0],
  50. [creating archive
  51. a
  52. b
  53. c
  54. adding d e f
  55. d
  56. e
  57. f
  58. ==
  59. a
  60. b
  61. c
  62. d
  63. e
  64. f
  65. adding g h i
  66. g
  67. h
  68. i
  69. resulting archive
  70. a
  71. b
  72. c
  73. d
  74. e
  75. f
  76. g
  77. h
  78. i
  79. ],
  80. [creating archive
  81. adding d e f
  82. adding g h i
  83. resulting archive
  84. ])
  85. AT_CLEANUP