Commit Graph

327 Commits

Author SHA1 Message Date
Paul Eggert
cf4065dfe9 (decode_options): Invalid dates are now treated as (time_t) -1.
Redo version message to conform to GNU standards.
1999-10-11 06:56:17 +00:00
Paul Eggert
29929863e8 (write_error): Read error is an error, not just a warning. 1999-09-25 05:47:17 +00:00
Paul Eggert
559eeb2b52 (to_chars): Fix base-256 output. 1999-09-25 05:47:17 +00:00
Paul Eggert
10f585ea2f (print_total_written): Use a format compatible with
Amanda 2.4.1p1.
1999-09-25 00:25:36 +00:00
Paul Eggert
e6d8e9279f (update_archive): Remove call to name_expand; had no effect.
Use chdir_do to change into directory.
Use deref_stat instead of stat.
Use add_avoided_name to mark names to be avoided; the old method of
setting a bit with the name caused all descendants of that name to
be avoided, in some circumstances.
1999-09-24 23:44:52 +00:00
Paul Eggert
825b72c52b (<time.h>): Include.
(time): Declare if not defined.
(confirm): Don't read past EOF.
(long_options, usage): Add --no-same-owner, --no-same-permissions.
(main): Use clock_gettime if available.
1999-09-24 23:44:52 +00:00
Paul Eggert
6e36ce5668 (name_next): Go back to using plain chdir.
(name_gather): Use chdir_arg to keep track of arguments to chdir.
(addname): Likewise.
(name_match): Use chdir_do to act on chdir args.
(merge_sort): Moved here from incremen.c.
(compare_names, add_hierarchy_to_namelist, collect_and_sort_names):
Likewise.
(name_expand): Remove.
(name_from_list): Skip fack names.
Use chdir_do to act on chdir args.
(struct avoided_name): New struct.
(avoided_names): New var.
(add_avoided_name, is_avoided_name): New functions.
1999-09-23 06:22:31 +00:00
Paul Eggert
a7002a034e (to_chars): Fix typo in decl.
Don't assign through char const *.
Rename name_expand back to collect_and_sort_names.
1999-09-22 06:14:23 +00:00
Paul Eggert
e4e624848b (time): Declare if not defined.
(base_64_digits): Moved here from create.c.
(base64_map): Use UCHAR_MAX for size, not less-clear (unsigned char) -1.
(read_and): Don't get time from header unless we need it now;
as getting time can cause duplicate diagnostics if bogus.
Remove "Hmm, " from diagnostic.
Use "Skipping to next header" uniformly.
(from_header): Renamed from from_chars.  All uses changed.
Allow different forms for unportable 2's complement numbers.
Don't check for extended forms when parsing checksums.
Parse base-256 output.
(gid_from_header): Renamed from gid_from_chars.  All uses changed.
(major_from_header): Renamed from major_from_chars.  All uses changed.
(minor_from_header): Renamed from minor_from_chars.  All uses changed.
(mode_from_header): Renamed from mode_from_chars.  All uses changed.
(off_from_header): Renamed from off_from_chars.  All uses changed.
(size_from_header): Renamed from size_from_chars.  All uses changed.
(time_from_header): Renamed from time_from_chars.  All uses changed.
Warn about future timestamps.
(uid_from_header): Renamed from uid_from_chars.  All uses changed.
(uintmax_from_header): Renamed from uintmax_from_chars.  All uses changed.
(tartime): New function, incorporating isotime.
(isotime): Delete.
(print_header): Use tartime.
1999-09-22 06:14:23 +00:00
Paul Eggert
d591c42003 (<time.h>): Remove; not used.
(time): Do not declare.
1999-09-22 06:14:23 +00:00
Paul Eggert
0d70f547f3 (struct link): Remove unused linkcount member.
(base_64_digits): Move to list.c.
(base_8_digits): Remove.
(to_octal): New function, with some of old contents of to_base.
(to_base): Remove.
(to_base256): New function.
(to_chars): Use base 256, not base 64, for huge values.
(mode_to_chars): Don't use two's complement in GNU format or POSIX format.
(dump_file): Interchange last two arguments.  If TOP_LEVEL is negative,
it means we have an incremental dump where we don't know whether this
is a top-level call.
Use deref_stat instead of statx / stat / lstat.
Cast result of alloca.
Check for dates if 0 < top_level, not if listed_incremental_option.
Move multiple-link check after directory check.
Do not dump avoided names.
Dump hard links to symbolic names as links, not as separate symbolic links.
start_header cannot return a null pointer, so don't test for it.
Likewise for find_next_block.
1999-09-21 15:13:33 +00:00
Paul Eggert
5ae88d8a13 (<time.h>): No need to include.
(time): No need to declare.
(now): Remove variable.
(extr_init): Don't initialize `now'.
Increment same_permissions_option and same_owner_option if we_are_root
is nonzero; this supports the new --no-same-owner option.
(set_stat): Use start_time instead of `now'.
1999-09-21 15:13:33 +00:00
Paul Eggert
17e0cd7065 (<human.h>): Include.
(print_total_written): Also print human-readable byte count, and bytes/s.
(open_archive, flush_write): Use start_time, not current time.
(flush_read): Report about garbage bytes ignored at end of archive,
but act on non-garbage bytes (instead of ignoring them).
(new_volume): Use WARN for warnings.
1999-09-20 06:28:45 +00:00
Paul Eggert
4732e8a4da (first_mangle, mangled_num): Remove. 1999-08-23 10:55:51 +00:00
Paul Eggert
edf0754a95 spelling fix 1999-08-23 09:55:55 +00:00
Paul Eggert
bd5bbd4f65 Remove lint.
(name_gather): Handle trailing -C option correctly.
(addname): use memcpy, not strncpy, to copy a string of known length.
(name_match): Handle trailing -C option correctly.
Propagate -C option to following files.
Simplify matching code.
(name_scan): Simplify matching code.
1999-08-23 09:55:55 +00:00
Paul Eggert
db16e89362 Remove lint.
(main): status is ssize_t, not long.
1999-08-23 09:55:55 +00:00
Paul Eggert
276d317d88 Remove lint.
(long_options, usage, main): -y is now -I (for --bzip).
(usage): Fix misspelling.
(OPTION_STRING): -y is now -I.
(decode_options): Use -1, not EOF, for getopt_long result.
Fix typo when invoking xstrtoumax: look for LONGINT_OK, not LONG_MAX.
Handle operands after any "--" argument.
(main): Report any output errors.
1999-08-23 09:55:55 +00:00
Paul Eggert
43085596a3 Remove lint. 1999-08-23 09:55:55 +00:00
Paul Eggert
cc9d6c88f9 Lint removal. 1999-08-23 09:55:55 +00:00
Paul Eggert
b8ae0938a4 Lint cleanup.
(open_archive): Use American spelling in diagnostic.
1999-08-23 09:55:55 +00:00
Paul Eggert
aeef457460 Lint cleanup.
(linklist): Now static.
(to_chars): Fix wording of message to match from_chars.
1999-08-23 09:55:55 +00:00
Paul Eggert
aa904fd8ec Lint cleanup.
(from_chars): Report out-of-range values more precisely.
(off_from_chars): Do not allow negative offsets.
(uid_from_chars): Allow negative uids.
1999-08-23 09:55:55 +00:00
Paul Eggert
c270f6f1b2 Lint cleanup. 1999-08-23 09:55:55 +00:00
Paul Eggert
984190dcc6 (time): Do not declare if defined.
(first_mangle, mangled_num): Now static.
1999-08-23 09:55:55 +00:00
Paul Eggert
f74aea3ae3 (name_next): Use chdir_from_initial_wd, not chdir.
(name_gather): Handle `-C x -C y' correctly.
Do not rely on addname to handle -C.
(addname): New CHANGE_DIR parameter.
Remove ugly calls to getcwd; no longer needed now that we have save-cwd.
(name_match): Use chdir_from_initial_wd, not chdir.
(name_from_list): Likewise.
1999-08-20 08:53:21 +00:00
Paul Eggert
2eaf29f3fb (decode_options): Adjust to addname's new signature. 1999-08-20 08:53:21 +00:00
Paul Eggert
2c3d0a2dcd (to_chars): Generate GNU base-64 representation if we are generating
an old or new GNU format tar file for a number that can't be represented
with the POSIX format.
1999-08-20 08:41:32 +00:00
Paul Eggert
6dccec3ba4 (max): New macro.
(isotime): Now takes time_t, not time_t *.  Report the decimal values
of times that can't be broken down.
(print_header): Don't assume that major and minor device numbers can
fit into uintmax_t.
1999-08-20 08:41:32 +00:00
Paul Eggert
22ee808ffe (from_chars): Skip only the initial null byte from buggy tars, so that
we don't complain about all-null fields.
1999-08-18 09:24:42 +00:00
Paul Eggert
f9d278ba35 Comment fix. 1999-08-18 07:52:26 +00:00
Paul Eggert
f5116dd1db (write_eot): Write at least two zero blocks. 1999-08-18 07:52:26 +00:00
Paul Eggert
c62fe41ec5 (read_and, list_archive): Simplify code.
(read_header): Fix computation of signed checksums on machines where
char is unsigned.
Do not consider a block to be zero unless all its bytes are zero,
even the checksum bytes.  Do not attempt to parse the checksum of
a zero block.  Fix memory leak with long names and links.
(from_chars): Accommodate a buggy tar that outputs leading NUL
if the previous field overflows.
(skip_extended_headers): Don't assume find_next_block yields nonnull.
1999-08-18 07:52:26 +00:00
Paul Eggert
72290b64a6 (extract_sparse_file, extract_archive): Don't assume find_next_block yields nonnull.
(extract_archive): Fix sparse array bug: we did not find end of array
correctly.
1999-08-18 07:52:26 +00:00
Paul Eggert
9939476576 Comment fix. 1999-08-18 07:49:49 +00:00
Paul Eggert
fcde5487eb Ghostscript 6.0 1999-08-17 19:59:28 +00:00
Paul Eggert
0357ce3365 indenting fixes. 1999-08-16 08:13:20 +00:00
Paul Eggert
14b1583256 indenting fixes 1999-08-16 08:13:20 +00:00
Paul Eggert
da82a07e93 Fix bugs when interpreting POSIX-compliant headers that do not
contain null bytes in the header or link names.
1999-08-16 08:13:20 +00:00
Paul Eggert
5e0e027651 (make_directories): Do not chown intermediate directories, even
if we are root.
1999-08-16 08:13:20 +00:00
Paul Eggert
981a4bf1ff -g now implies after_date_option = 1.
-g and -N are now incompatible options.
1999-08-14 07:10:19 +00:00
Paul Eggert
bda50f104b (time): Don't declare if defined.
(extr_init): Remove unneeded cast around 0 arg to time.
1999-08-14 07:10:19 +00:00
Paul Eggert
203dea13a4 (time): Don't declare if defined.
(child_open_for_compress): Undo previous change.
(close_archive): Use waitpid, POSIX-style, instead of old BSD style.
(new_volume): Likewise.
1999-08-14 07:10:19 +00:00
Paul Eggert
619a95af98 (start_header): Include text of ignored filesystem prefix in warning.
(create_archive): Check for excluded names when doing incremental
pass through directory.
(dump_file): Do not dump old files explicitly given on command line
when using --listed-incremental.  Do not strip ./ from front of file names.
1999-08-14 07:10:19 +00:00
Paul Eggert
eaef08322e (isotime): Report ??? if localtime returns null.
Don't assume years fit into four digits.
Don't append trailing newline.
(print_header): Report ??? if localtime returns null;
Don't assume years fit into four digits.
1999-08-14 07:10:19 +00:00
Paul Eggert
67f20a741a (read_header): Don't parse OLDGNU_FORMAT incremental headers
as POSIX prefixes.
1999-08-11 14:43:46 +00:00
Paul Eggert
9d68ac2e94 (update_archive): excluded_pathname -> excluded_name. 1999-08-11 13:43:15 +00:00
Paul Eggert
33a2b1fc06 (decode_options): Fix typo in invoking add_exclude_file. 1999-08-11 13:41:56 +00:00
Paul Eggert
cd47c9d597 (long_options, usage, OPTION_STRING, decode_options):
New -y or --bzip2 option.
(add_filtered_exclude): New function.
(decode_options): Put excluded patterns with / into excluded_with_slash,
and without / into excluded_without_slash.
Compare newer_mtime_option to its new initial value TYPE_MINIMUM (time_t)
when deciding whether more than one threshold date was specified.
1999-08-11 12:47:01 +00:00
Paul Eggert
c402183f88 (extract_archive): Open files with O_NONBLOCK instead of O_NDELAY. 1999-08-11 12:47:01 +00:00