From: Sergey Poznyakoff Date: Thu, 26 Jun 2008 06:32:25 +0000 (+0000) Subject: Bugfixes. X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=985637ab5a7448cf89e59ac433229a4fef2d265d;p=chaz%2Ftar Bugfixes. * src/buffer.c (try_new_volume): Print more information with error diagnostics. (_gnu_flush_write): Improve error checking. Adjust real_s_sizeleft before calling new_volume to avoid creating malformed multivolume headers. * tests/delete05.at, tests/gzip.at, tests/ignfail.at, tests/longv7.at, tests/lustar01.at, tests/lustar02.at, tests/shortfile.at: Update to match new diagnostic wording (see 2008-05-06). * NEWS: Update. --- diff --git a/ChangeLog b/ChangeLog index d7f1665..8948d43 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2008-06-26 Sergey Poznyakoff + + * src/buffer.c (try_new_volume): Print more information with error + diagnostics. + (_gnu_flush_write): Improve error checking. Adjust + real_s_sizeleft before calling new_volume to avoid creating + malformed multivolume headers. + * tests/delete05.at, tests/gzip.at, tests/ignfail.at, + tests/longv7.at, tests/lustar01.at, tests/lustar02.at, + tests/shortfile.at: Update to match new diagnostic wording + (see 2008-05-06). + + * NEWS: Update. + 2008-06-14 Sergey Poznyakoff * doc/tar.texi (exclude): Document support for new VCS. diff --git a/NEWS b/NEWS index 4fe021e..a9036d5 100644 --- a/NEWS +++ b/NEWS @@ -59,6 +59,10 @@ Names". The value of the blocking factor is made available to info and checkpoint scripts via environment variable TAR_BLOCKING_FACTOR. +* Incremental archives + +Improved (sped up) extracting from incremental archives. + * Bugfixes. ** Fix bug introduced in version 1.19: tar refused to update non-existing archives. diff --git a/lib/.cvsignore b/lib/.cvsignore index 0290a6e..eb46334 100644 --- a/lib/.cvsignore +++ b/lib/.cvsignore @@ -149,6 +149,8 @@ quote.c quote.h quotearg.c quotearg.h +rawmemchr.c +rawmemchr.valgrind readlink.c realloc.c ref-add.sed @@ -181,10 +183,12 @@ sleep.c snprintf.c stat-macros.h stat-time.h +stdarg.in.h stdbool.h stdbool.in.h stdint.h stdint.in.h +stdio-impl.h stdio.h stdio.in.h stdlib.h @@ -192,6 +196,7 @@ stdlib.in.h stpcpy.c strcasecmp.c strchrnul.c +strchrnul.valgrind strdup.c streq.h strerror.c diff --git a/src/buffer.c b/src/buffer.c index 8f8b43f..4286f67 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1224,7 +1224,15 @@ try_new_volume () if (real_s_totsize - real_s_sizeleft != continued_file_offset) { - WARN ((0, 0, _("This volume is out of sequence"))); + char totsizebuf[UINTMAX_STRSIZE_BOUND]; + char s1buf[UINTMAX_STRSIZE_BOUND]; + char s2buf[UINTMAX_STRSIZE_BOUND]; + + WARN ((0, 0, _("This volume is out of sequence (%s - %s != %s)"), + STRINGIFY_BIGINT (real_s_totsize, totsizebuf), + STRINGIFY_BIGINT (real_s_sizeleft, s1buf), + STRINGIFY_BIGINT (continued_file_offset, s2buf))); + return false; } } @@ -1581,11 +1589,18 @@ _gnu_flush_write (size_t buffer_level) return; } + if (status % BLOCKSIZE) + { + ERROR ((0, 0, _("write did not end on a block boundary"))); + archive_write_error (status); + } + /* In multi-volume mode. */ /* ENXIO is for the UNIX PC. */ if (status < 0 && errno != ENOSPC && errno != EIO && errno != ENXIO) archive_write_error (status); + real_s_sizeleft -= status; if (!new_volume (ACCESS_WRITE)) return; @@ -1597,6 +1612,7 @@ _gnu_flush_write (size_t buffer_level) copy_ptr = record_start->buffer + status; copy_size = buffer_level - status; + /* Switch to the next buffer */ record_index = !record_index; init_buffer (); diff --git a/tests/delete05.at b/tests/delete05.at index d4880b8..66c6367 100644 --- a/tests/delete05.at +++ b/tests/delete05.at @@ -42,7 +42,7 @@ tar tf archive to ], [tar: tre: Not found in archive -tar: Error exit delayed from previous errors +tar: Exiting with failure status due to previous errors ]) AT_CLEANUP diff --git a/tests/gzip.at b/tests/gzip.at index f3a4a86..eb43030 100644 --- a/tests/gzip.at +++ b/tests/gzip.at @@ -35,7 +35,7 @@ test $? = 2 || exit 1 [ gzip: stdin: unexpected end of file tar: Child returned status 1 -tar: Error exit delayed from previous errors +tar: Exiting with failure status due to previous errors ], [],[]) diff --git a/tests/ignfail.at b/tests/ignfail.at index f1d9d33..03f9045 100644 --- a/tests/ignfail.at +++ b/tests/ignfail.at @@ -64,12 +64,12 @@ test $status = 0 [ ----- tar: file: Cannot open: Permission denied -tar: Error exit delayed from previous errors +tar: Exiting with failure status due to previous errors ----- tar: file: Warning: Cannot open: Permission denied ----- tar: directory: Cannot open: Permission denied -tar: Error exit delayed from previous errors +tar: Exiting with failure status due to previous errors ----- tar: directory: Warning: Cannot open: Permission denied ]) diff --git a/tests/longv7.at b/tests/longv7.at index e8eae5a..9f03744 100644 --- a/tests/longv7.at +++ b/tests/longv7.at @@ -40,7 +40,7 @@ tar tf archive DIR/ ], [tar: DIR/FILE: file name is too long (max 99); not dumped -tar: Error exit delayed from previous errors +tar: Exiting with failure status due to previous errors ], [],[],[v7]) diff --git a/tests/lustar01.at b/tests/lustar01.at index f50a9ab..580aa85 100644 --- a/tests/lustar01.at +++ b/tests/lustar01.at @@ -31,7 +31,7 @@ tar cf archive LONGNAME [2], [], [tar: LONGNAME: file name is too long (cannot be split); not dumped -tar: Error exit delayed from previous errors +tar: Exiting with failure status due to previous errors ],[],[],[ustar]) AT_CLEANUP diff --git a/tests/lustar02.at b/tests/lustar02.at index 7f683d8..83e0b53 100644 --- a/tests/lustar02.at +++ b/tests/lustar02.at @@ -36,7 +36,7 @@ tar cf archive PREFIX_155 [2], [], [tar: PREFIX_155/: file name is too long (cannot be split); not dumped -tar: Error exit delayed from previous errors +tar: Exiting with failure status due to previous errors ],[],[],[ustar]) AT_CLEANUP diff --git a/tests/shortfile.at b/tests/shortfile.at index dbebc50..1c0b4dc 100644 --- a/tests/shortfile.at +++ b/tests/shortfile.at @@ -33,7 +33,7 @@ tar tf foo [2], [], [tar: This does not look like a tar archive -tar: Error exit delayed from previous errors +tar: Exiting with failure status due to previous errors ], [],[],[gnu])