mirror of
https://git.savannah.gnu.org/git/tar.git
synced 2026-04-24 18:41:32 +00:00
Fix listing of volume labels (in particular in PAX archives).
* src/buffer.c (match_volume_label): Call set_volume_label. (check_label_pattern): Get label string as argument. (match_volume_label): Handle volume labels stored in global PAX headers. * src/common.c (print_header,read_header): Change signature. (read_header_primitive): Remove prototype. * src/list.c (recent_global_header): New static. (list_archive): Always print volume labels. (read_header_primitive): Remove. (read_header): Change the signature (all callers updated) Save the recent global header. (volume_label_printed): New static. (simple_print_header): New function (ex-print_header). (print_header): Change the signature (all callers updated). For POSIX formats, print first volume header (if set). * src/xheader.c (xheader_write_global): Write the data accumulated in xhdr->stk even if keyword_global_override_list is empty. (xheader_read): On unexpected EOF, report error instead of coredumping. (XHDR_PROTECTED, XHDR_GLOBAL): New defines. (struct xhdr_tab): Remove `protected' with `flags'. All uses updated. (decg): If XHDR_GLOBAL bit is set, call the keyword's decode method instead of adding it to `kwl'. * src/compare.c: Update calls to read_header. * src/create.c: Likewise. * src/delete.c: Likewise. * src/update.c: Likewise. * src/extract.c: Likewise. (extract_volhdr): Do not print "Reading <label>" statement, because it is inconsistent: it is not printed if the volume begins with a member continued from the previous volume. * tests/label01.at: New testcase. * tests/label02.at: New testcase. * tests/Makefile.am, tests/testsuite.at: Add new testcases.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/* Diff files from a tar archive.
|
||||
|
||||
Copyright (C) 1988, 1992, 1993, 1994, 1996, 1997, 1999, 2000, 2001,
|
||||
2003, 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
|
||||
2003, 2004, 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
|
||||
|
||||
Written by John Gilmore, on 1987-04-30.
|
||||
|
||||
@@ -460,7 +460,7 @@ diff_archive (void)
|
||||
{
|
||||
if (now_verifying)
|
||||
fprintf (stdlis, _("Verify "));
|
||||
print_header (¤t_stat_info, -1);
|
||||
print_header (¤t_stat_info, current_header, -1);
|
||||
}
|
||||
|
||||
switch (current_header->header.typeflag)
|
||||
@@ -578,7 +578,8 @@ verify_volume (void)
|
||||
flush_read ();
|
||||
while (1)
|
||||
{
|
||||
enum read_header status = read_header (false);
|
||||
enum read_header status = read_header (¤t_header,
|
||||
¤t_stat_info, false);
|
||||
|
||||
if (status == HEADER_FAILURE)
|
||||
{
|
||||
@@ -588,7 +589,8 @@ verify_volume (void)
|
||||
{
|
||||
counter++;
|
||||
set_next_block_after (current_header);
|
||||
status = read_header (false);
|
||||
status = read_header (¤t_header, ¤t_stat_info,
|
||||
false);
|
||||
}
|
||||
while (status == HEADER_FAILURE);
|
||||
|
||||
@@ -606,7 +608,7 @@ verify_volume (void)
|
||||
{
|
||||
char buf[UINTMAX_STRSIZE_BOUND];
|
||||
|
||||
status = read_header (false);
|
||||
status = read_header (¤t_header, ¤t_stat_info, false);
|
||||
if (status == HEADER_ZERO_BLOCK)
|
||||
break;
|
||||
WARNOPT (WARN_ALONE_ZERO_BLOCK,
|
||||
|
||||
Reference in New Issue
Block a user