Commit Graph

801 Commits

Author SHA1 Message Date
Sergey Poznyakoff
15a607fc11 (struct tar_sparse_optab.sparse_member_p)
(struct tar_sparse_optab.fixup_header): New member
(tar_sparse_member_p): New function.
(tar_sparse_init): Return true if decode_header is not provided
(tar_sparse_fixup_header)
(sparse_member_p,sparse_fixup_header)
(sparse_skip_file)
(oldgnu_sparse_member_p,oldgnu_fixup_header,star_sparse_member_p)
(star_fixup_header, pax_sparse_member_p): New function
(pax_decode_header): Remove
2004-04-04 09:33:25 +00:00
Sergey Poznyakoff
1329cfe9f8 include "common.h" 2004-04-04 09:32:33 +00:00
Sergey Poznyakoff
3ff03c0c5e (decode_header): Use sparse_fixup_header to correct
the st_size value.
(print_header): Do not rely on GNUTYPE_SPARSE type.
Use st->stat.st_size to print real file size.
(skip_member): Assign stat_info.file_name to save_name. This fixes
bug reported by Mads Martin Joergensen <mmj@suse.de>
Use sparse_skip_file() to skip sparse members.
2004-04-04 09:31:44 +00:00
Sergey Poznyakoff
3030a247b1 (extract_archive): Use sparse_member_p instead of GNUTYPE_SPARSE. 2004-04-04 09:26:11 +00:00
Sergey Poznyakoff
22c2e2ab8a Removed unused variables 2004-04-04 09:25:48 +00:00
Sergey Poznyakoff
be48ff0699 (diff_archive): Use is_sparse member instead of GNUTYPE_SPARSE. 2004-04-04 09:25:30 +00:00
Sergey Poznyakoff
a1d15e7c89 Added missing prototypes 2004-04-04 09:25:01 +00:00
Sergey Poznyakoff
d8981440bb (write_long_name): Do not allow more than
NAME_FIELD_SIZE-1 characters in a file name for V7 format
archives.
2004-03-26 19:39:40 +00:00
Sergey Poznyakoff
106a24176e (open_archive): Clear read_full_records_option
if reading from a pipe.
(short_read): Display warning about the deduced record size
if version > 1
2004-03-22 11:59:35 +00:00
Sergey Poznyakoff
6bd7b64c78 (to_decimal): New function.
(xheader_format_name): Use to_decimal() instead of snprintf.
2004-03-22 09:17:18 +00:00
Sergey Poznyakoff
e5882c8220 (start_header): Check for GNU_FORMAT if incremental_option is set. 2004-03-22 09:16:49 +00:00
Sergey Poznyakoff
683390b02d (read_and): Stop processing the archive after
encountering a single zero record. Many old archives contain
arbitrary garbage after it.
The warning is issued anyway.
2004-03-12 10:38:46 +00:00
Sergey Poznyakoff
5282ef9709 (utf8_convert): Indentation fix. 2004-03-02 09:35:13 +00:00
Sergey Poznyakoff
9f14fd52de (rmt_lseek__,rmt_ioctl__): Bugfix. The
conversion buffer was not null terminated. Fix provided
by Leland Lucius <llucius@tiny.net>
2004-03-02 09:34:06 +00:00
Sergey Poznyakoff
7fb546943e (sys_child_open_for_uncompress): Minor stylistic fix. 2004-02-29 10:16:02 +00:00
Sergey Poznyakoff
37400fa94e (flush_read): Bugfix: the condition at line 714 included
|| (status > 0 && !read_full_records_option)

which is grossly wrong, since even if new_volume() below succeeds,
the subsequent call to rmtread will overwrite the chunk of data
already read in the buffer and thus spoil everything.
2004-02-29 10:15:45 +00:00
Sergey Poznyakoff
5a9174376b New options: --utc and keep-newer-files 2004-02-29 00:06:03 +00:00
Sergey Poznyakoff
cedd9d6e81 (tartime): Print UTC if --utc was given. 2004-02-29 00:05:31 +00:00
Sergey Poznyakoff
29584d69fd Handle --keep-newer-files option 2004-02-29 00:05:12 +00:00
Sergey Poznyakoff
236deef28e (utc_option): new global
(enum old_files.KEEP_NEWER_FILES): New element
2004-02-29 00:04:50 +00:00
Sergey Poznyakoff
d8b790047f (decode_header): Call xheader_decode before the assignment to current_stat_info.archive_file_size. 2004-02-24 15:27:54 +00:00
Sergey Poznyakoff
b8754a37c7 Use keywords from the global headers.
Correctly handle UTF-8 conversions.
(xheader_list_destroy): New function.
(xheader_set_single_keyword,xheader_set_keyword_equal): Added
missing gettext markers
(decode_record): Rewritten using caller-provided handler and
data closure.
2004-02-22 20:54:44 +00:00
Sergey Poznyakoff
fb766eefb4 Decode encountered global headers. 2004-02-22 20:54:04 +00:00
Sergey Poznyakoff
b1f33c8362 (write_header_name) In pax format, use "path" keyword if the file name is not ASCII 2004-02-22 20:53:27 +00:00
Sergey Poznyakoff
7a8bded5dd Added utf8.c 2004-02-22 20:52:56 +00:00
Sergey Poznyakoff
2de1477b3d Conversions to and from utf-8. 2004-02-22 20:52:34 +00:00
Sergey Poznyakoff
e8af2fec8a Minor stylistic fixes. 2004-02-21 09:35:10 +00:00
Sergey Poznyakoff
b960c38c4b (dump_file0): The conditional at line
1296 prevented incremental backups on individual files
from working, as reported by Andreas Schuldei
<andreas@schuldei.org>.

This is due to the condition

  (0 < top_level || !incremental_option)

Removing it makes incremental backups work for individual
files as well as for directories. On the other hand, it does
not affect other functionality, as shown by the reasoning below:

To begin with, the two parts of this condition are mutually
superfluous, because

  1) when top_level < 0, incremental_option == 1
  so the condition yields false
  2) when top_level >= 0, incremental_option == 0
  so the condition yields true.

In other words, it is completely equivalent to

      (!incremental_option)

Now, let's consider the effect of its removal. There are two cases:

1) when incremental_option==1
This means incremental backup in progress. In this case dump_file
is invoked only for directories or for files marked with 'Y' by
get_directory_contents. The latter are those that did not meet the
condition in incremen.c:242, which is exactly the same condition
as this at create.c:1296. So, for these files the check
(!incremental_option) is useless, since the rest of the
conditional will yield false anyway. On the other hand, if
dump_file is invoked on a directory, the conditional will yield
false due to !S_ISDIR assertion, so these will be processed as usual.

Thus, for this case the extra condition (!incremental_option) is
irrelevant, and its removal won't alter the behavior of tar,
*except* that it will enable incremental backups on individual
files, which is the wanted effect.

2) when incremental_option==0
In this case the condition yields true and its removal does not
affect the functionality.
2004-02-21 09:33:58 +00:00
Sergey Poznyakoff
d46025b23c (sort_obstack): Fixed typo in the comment 2004-02-20 15:40:47 +00:00
Sergey Poznyakoff
72ac31581d (decode_header): Call xheader_decode unconditionally. 2004-02-20 15:39:45 +00:00
Sergey Poznyakoff
64cca92a1f (delete_archive_members): Call xheader_decode unconditionally. 2004-02-20 15:39:29 +00:00
Sergey Poznyakoff
f038194718 (xheader_format_name): Bugfix.
(xheader_xhdr_name): Changed the default extended header name
to '%d/PaxHeaders.%p/%f', as POSIX requires.
(xheader_ghdr_name): Removed unused argument.
(xheader_write,xheader_write_global): New function.
(xheader_decode): Modified to honor overrides whatever
the current archive format is.
2004-02-20 15:34:12 +00:00
Sergey Poznyakoff
eff25ef359 (update_archive): Write global extended header if constructed. 2004-02-20 15:33:12 +00:00
Sergey Poznyakoff
b3060eabaf (assert_format): Do not bail out if several
--format arguments are given. This is a common case when
TAR_OPTIONS are used.
(decode_options): New option --show-defaults displays the
compiled-in defaults.

Use POSIX format if no --format option was given and
--pax-option was specified.

Do not allow to use --pax-option unless the archive format is
set to POSIX (or reading subcommand is requested).
2004-02-20 15:32:56 +00:00
Sergey Poznyakoff
93a4273b66 (start_private_header): Removed static qualifier.
(write_extended): Removed superfluous last argument. Use
xheader_write()
(simple_finish_header): New function.
(finish_header): Use simple_finish_header() to break recursive
dependency between this function and write_extended().
2004-02-20 15:32:12 +00:00
Sergey Poznyakoff
17be45c834 (simple_finish_header,start_private_header): New
declarations
(xheader_ghdr_name): Changed declaration
2004-02-20 15:30:26 +00:00
Sergey Poznyakoff
b4e605a829 Added a comment 2004-02-20 11:45:15 +00:00
Sergey Poznyakoff
b58452bdbd Documented --pax-option 2004-02-20 11:44:46 +00:00
Sergey Poznyakoff
694e8376ab Minor fixes 2004-02-18 14:41:41 +00:00
Sergey Poznyakoff
440e65ef2c Implement pax -o option. Fixed misleading heading comment (introduced 2003-09-02). 2004-02-18 14:41:23 +00:00
Sergey Poznyakoff
d0eceef438 New option --pax-option (equivalent to -o option of pax). 2004-02-18 14:41:00 +00:00
Sergey Poznyakoff
434f2a22ba (write_extended): Call xheader_xhdr_name
instead of using hardcoded "././@PaxHeader" name.
2004-02-18 14:40:21 +00:00
Sergey Poznyakoff
0bfb6e136d (xheader_xhdr_name,xheader_ghdr_name): New functions 2004-02-18 14:39:36 +00:00
Sergey Poznyakoff
67d29a4d60 Minor changes 2004-02-17 13:33:14 +00:00
Sergey Poznyakoff
df7792b5d8 Removed accumulator stuff in favor of obstack.
get_directory_contents): Split into two functions
2004-02-17 13:32:41 +00:00
Paul Eggert
8b107d09e1 Fix Debian bug 230872, originally reported by Jeff King in
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=230872>.
2004-02-15 08:36:20 +00:00
Sergey Poznyakoff
bda7d59010 (time_to_start_writing): Changed data type. 2004-01-03 22:26:30 +00:00
Sergey Poznyakoff
463e7278f4 (decode_options): More option compatibility checks (moved from buffer.c) 2004-01-03 22:26:11 +00:00
Sergey Poznyakoff
829b1dc328 Updated assignment to write_archive_to_stdout 2004-01-03 22:25:41 +00:00
Sergey Poznyakoff
dd6094f6c0 Updated invocations of safer_name_suffix 2004-01-03 22:25:24 +00:00