Imported Upstream version 1.25
[debian/tar] / ChangeLog
1 2010-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>
2
3         Version 1.25
4         * configure.ac: Version 1.25
5         * NEWS: Describe the changes.
6
7 2010-11-05  Sergey Poznyakoff  <gray@gnu.org.ua>
8
9         Run alternative decompression programs if the principal one is
10         not available.
11         Some compression programs are able to handle various compression
12         formats
13         (e.g. `gzip' can decompress files created by `compress', `xz'
14         is able
15         to handle lzma, etc.)  Tar tries to use such programs for
16         decompression
17         if the principal decompressor cannot be started.
18
19         * src/buffer.c (compress_type): Swap ct_none and ct_tar.
20         (archive_compression_type): New static variable.
21         (zip_magic): Remove program and option fields.
22         (zip_program): New structure and static.
23         (compress_program): Remove macro.
24         (find_zip_program): New static function.
25         (first_decompress_program,next_decompress_program): New functions.
26         (open_compressed_archive): Set archive_compression_type instead of
27         use_compress_program_option.
28         * src/common.h (first_decompress_program)
29         (next_decompress_program): New functions.
30         (WARN_DECOMPRESS_PROGRAM): New flag.
31         (WARN_VERBOSE_WARNINGS): Include WARN_DECOMPRESS_PROGRAM.
32         * src/warning.c (warning_args): Add "decompress-program".
33         (warning_types): Add WARN_DECOMPRESS_PROGRAM.
34         * src/system.c (run_decompress_program): New function.
35         (sys_child_open_for_uncompress): Use run_decompress_program
36         instead of calling execlp directly.
37
38 2010-11-02  Paul Eggert  <eggert@cs.ucla.edu>
39
40         tests: fix some issues with signals, timestamps, "test" typo
41         * tests/extrac17.at: Add --warning=no-timestamp, to avoid
42         bogus warning due to NFS clock skew.
43         * tests/remfiles01.at: Discard diagnostics that some shells
44         generate about broken pipes.
45         * tests/sigpipe.at: Likewise.
46         * tests/remfiles01.at: Fix typo: "test $EC" was written where
47         "test $EC -ne 0" was intended.
48
49 2010-11-01  Sergey Poznyakoff  <gray@gnu.org.ua>
50
51         Fix extraction of device nodes.
52         * src/extract.c (extract_node): Do not mask out node type.
53         The bug was introduced in commit ea964cce.
54
55 2010-10-28  Paul Eggert  <eggert@cs.ucla.edu>
56
57         tar: don't cross struct member boundaries with OLDGNU_MAGIC
58         * src/create.c (write_gnu_long_link, start_header): Access
59         header->buffer + offsetof (struct posix_header, magic), instead of
60         header->header.magic, when reading or writing the OLDGNU_MAGIC
61         pattern.  The code violates the C standard without this change,
62         and GCC warns about this if fortify checking is enabled.  It's not
63         a bug on traditional (i.e., non-debugging) platforms, but it does
64         violate the C standard so it should be fixed.  Problem originally
65         reported by John Emil Karlson in
66         <http://lists.gnu.org/archive/html/bug-tar/2010-04/msg00023.html>.
67         * src/list.c (decode_header): Likewise.
68
69         tests: port to sh variants that squirrel away file descriptors
70         OpenBSD /bin/sh, and some other sh variants, squirrel away file
71         descriptors before closing them.  For example, for "cat 3<&-" they
72         first dup file descriptor 3 to a fd that is 10 or greater, then
73         close 3 (because if "cat" had been a builtin command like ":" then
74         they would have wanted to avoid the fork and restore the fd after
75         ":" finished); and they treat ordinary (forking) commands the same
76         as builtin commands.  This approach fails after "ulimit -n 10".
77         Work around this deficiency by closing the file descriptors before
78         invoking ulimit.  Problem reported by Christian Weisgerber in
79         <http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00041.html>;
80         solution suggested by Jilles Tjoelker in
81         <http://article.gmane.org/gmane.comp.shells.dash/415>.
82
83         * tests/extrac11.at (scarce file descriptors): Close file
84         descriptors before invoking ulimit -n.
85
86 2010-10-27  Sergey Poznyakoff  <gray@gnu.org.ua>
87
88         Transform file names when updating and appendig to archives.
89         This complements 28e91b48.
90
91         * src/common.h (transform_stat_info): New prototype.
92         * src/list.c (transform_stat_info): Remove static qualifier.
93         * src/update.c (update_archive): Call transform_stat_info.
94         * tests/Makefile.am (TESTSUITE_AT): Add append03.at
95         * tests/testsuite.at: Include append03.at
96
97 2010-10-27  Paul Eggert  <eggert@cs.ucla.edu>
98
99         tests: port to Solaris diff
100         * tests/extrac13.at: Don't assume that "diff -c" outputs nothing
101         when there are no differences.  This is not true on Solaris,
102         where it outputs "No differences encounted".
103
104         tar: fix -x --overwrite bug (no --dereference, ! O_NOFOLLOW)
105         This bug was discovered on Solaris 8.  On older hosts lacking
106         O_NOFOLLOW, tar -x --overwrite (without --dereference) follows
107         symbolic links, causing the "extract over symlinks" test to fail.
108
109         * src/extract.c (open_output_file): If O_NOFOLLOW is needed but
110         does not work, check for a symlink separately.
111
112         tar: don't use "((" in shell scripts
113         * tests/extrac11.at: Replace "((" with "( (" in shell scripts, as
114         "((" is not portable to the Korn shell, and POSIX 1003.1-2008 says
115         that "((" is not portable.
116
117 2010-10-26  Sergey Poznyakoff  <gray@gnu.org.ua>
118
119         Make sure name matching occurs before name transformation.
120         The commit 9c194c99 altered that order.
121
122         * src/list.c (transform_stat_info): New function.  Split off from
123         decode_header.
124         (read_and): Call transform_stat_info right before do_something,
125         and after deciding if we should proceed with this member name,
126         so that name matching occurs before name transformation.
127
128         * tests/extrac17.at: New file.
129         * tests/Makefile.am (TESTSUITE_AT): Add extrac17.at
130         * tests/testsuite.at: Include extrac17.at.
131
132 2010-10-26  Paul Eggert  <eggert@cs.ucla.edu>
133
134         tar: don't assume stdin is open when testing fd limits
135         * tests/extrac11.at: Redirect stdin from /dev/null, in case
136         the parent 'make' is running with stdin closed.
137
138 2010-10-26  Sergey Poznyakoff  <gray@gnu.org.ua>
139
140         Further fixes in bootstrap.
141         * bootstrap: Restore the default for gnulib_path
142         (symlink_to_dir): Re-apply 67cad07.
143
144 2010-10-26  Paul Eggert  <eggert@cs.ucla.edu>
145
146         tar: fix bug with -C and extracting directories
147         Problem reported by Denis Excoffier in
148         <http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00034.html>.
149
150         * src/extract.c (extract_dir): Use mkdirat, not mkdir.
151         * tests/extrac16.at: New file, to test for this bug.
152         * tests/Makefile.am (TESTSUITE_AT): Add it.
153         * tests/testsuite.at: Include it.
154
155         This file is a placeholder. It will be replaced with the actual
156         ChangeLog
157         by make dist.  Run make ChangeLog if you wish to create it
158         earlier.
159
160 2010-10-25  Sergey Poznyakoff  <gray@gnu.org.ua>
161
162         Version 1.24
163         * configure.ac, NEWS: Version 1.24
164         * bootstrap: Restore tar-specific code lost during last
165         sync from gnulib (241b72ffad).
166         * src/misc.c (chdir_do): Remove unused automatic variable.
167
168 2010-10-16  Paul Eggert  <eggert@cs.ucla.edu>
169
170         tar: use more-accurate diagnostic when intermediate mkdir fails
171         Without this change, if tar tried to extract a file A/B/C, noticed
172         that A/B didn't exist, attempted to mkdir A/B, and the mkdir
173         failed, it did not diagnose the mkdir failure, but simply reported
174         the failure to open A/B/C.  This sometimes led to confusion
175         because it wasn't clear what tar was trying to do, in particular
176         that tar tried to mkdir A/B.  With this patch, tar issues two
177         diagnostics in this case: one for A/B and the other for A/B/C.
178         Problem reported by Hauke Laging in
179         <http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00020.html>.
180         * gnulib.modules: Remove faccessat.
181         * src/extract.c (make_directories): New arg INTERDIR_MADE.
182         Diagnose mkdir failure.  Return 0 on success, nonzero on failure,
183         as opposed to nonzero iff some directory was created.  All callers
184         changed.  Simplify the code when mkdir fails, by checking whether
185         the desired file exists unless errno==EEXIST: this is more robust.
186         * tests/extrac15.at: New test, to check this.
187         * tests/Makefile.am (TESTSUITE_AT): Add it.
188         * tests/testsuite.at: Include it.
189
190         tests: port to NFS file servers with clock skew
191         Several of the tests assumed that a newly created file cannot
192         have a time stamp dated in the future.  This assumption is not
193         true when files are served by a remote host whose clock is
194         slightly in advance of ours.  Fix the problems that I observed
195         when running "make check" a couple of times on such a server.
196
197         * tests/backup01.at: Use --warning=no-timestamp to suppress
198         clock-skew warnings.
199         * tests/chtype.at, tests/comprec.at, tests/exclude06.at:
200         * tests/extrac01.at, tests/extrac03.at, tests/extrac05.at:
201         * tests/extrac06.at, tests/extrac08.at, tests/extrac13.at:
202         * tests/extrac14.at, tests/incr01.at, tests/incr03.at,
203         tests/link01.at:
204         * tests/multiv01.at, tests/multiv02.at, tests/multiv03.at:
205         * tests/pipe.at, tests/rename02.at, tests/rename03.at:
206         * tests/rename05.at, tests/same-order01.at, tests/same-order02.at:
207         * tests/sparse01.at:
208         Likewise.
209
210 2010-10-12  Paul Eggert  <eggert@cs.ucla.edu>
211
212         gnulib: sync from latest gnulib, notably bootstrap and
213         parse-datetime
214         * bootstrap: Sync from gnulib.
215         * doc/.gitignore: Rename getdate.texi to parse-datetime.texi.
216         * doc/Makefile.am (tar_TEXINFOS): Likewise.
217         * doc/tar.texi (Top): Adjust to renaming of getdate to
218         parse-datetime.
219         * gnulib.modules: Likewise.  Also, remove ftruncate (now
220         obsolete).
221         And add inttostr (we missed this dependency).
222         * src/tar.c: Include parse-datetime.h, not getdate.h.  All calls
223         to get_date replaced with parse_datetime.
224
225 2010-09-24  Paul Eggert  <eggert@cs.ucla.edu>
226
227         tar: -x -C symlink fix
228         * src/misc.c (chdir_do): Don't use O_NOFOLLOW when opening the
229         argument to -C.  This is for consistency with "tar -c -C FOO", and
230         matches the new documentation.
231         * tests/extrac14.at: New file.
232         * tests/Makefile.am (TESTSUITE_AT): Add it.
233         * tests/testsuite.at: Include it.
234
235         tar: --dereference consistency
236         This closes another race condition, that occurs when overwriting a
237         symlink with a regular file.
238         * NEWS (--dereference consistency): New section.
239         * doc/tar.texi (Option Summary): Describe new --deference
240         behavior.
241         (dereference): Likewise.  Remove discussion that I didn't follow,
242         even before --dereference was changed.
243         * src/common.h (deref_stat, set_file_atime): Adjust signatures.
244         * src/compare.c (diff_file, diff_multivol): Respect
245         open_read_flags
246         instead of rolling our own flags.  This implements the new
247         behavior
248         for --dereference.
249         (diff_file, diff_dumpdir): Likewise, for fstatat_flags.
250         * src/create.c: Adjust to set_file_atime signature change.
251         * src/extract.c (mark_after_links, file_newer_p, extract_dir):
252         Likewise.
253         * src/incremen.c (try_purge_directory): Likewise.
254         * src/misc.c (maybe_backup_file): Likewise.
255         * src/extract.c (file_newer_p): New arg STP.  All callers changed.
256         (maybe_recoverable): New arg REGULAR.  All callers changed.
257         Handle the case of overwriting a symlink with a regular file,
258         when --overwrite is specified but --dereference is not.
259         (open_output_file): Add O_CLOEXEC, O_NOCTTY, O_NONBLOCK for
260         consistency with file creation.  Add O_NOFOLLOW if
261         overwriting_old_files && ! dereference_option.
262         * src/incremen.c (update_parent_directory): Use fstat, not
263         fstatat;
264         there's less to go wrong.
265         * src/misc.c (deref_stat): Remove DEREF arg.  All callers changed.
266         Instead, use fstatat_flags.
267         (set_file_atime): Remove ATFLAG arg.  All callers changed.
268         Instead, use fstatat_flags.
269         * src/names.c, src/update.c: Adjust to deref_stat signature
270         change.
271         * src/tar.c (get_date_or_file): Use stat, not deref_stat, as this
272         is not a file to be archived.
273         * tests/Makefile.am (TESTSUITE_AT): Add extrac13.at.
274         * tests/extrac13.at: New file.
275         * tests/testsuite.at: Include it.
276
277 2010-09-20  Paul Eggert  <eggert@cs.ucla.edu>
278
279         tar: do not crash with --listed-incremental
280         Problem reported by Frantisek Hanzlik in
281         <https://bugzilla.redhat.com/635318> via Kamil Dudka in
282         <http://lists.gnu.org/archive/html/bug-tar/2010-09/msg00066.html>.
283         I don't understand this code either, but Sergey can take a look at
284         this patch, and perhaps install a better one, when he has
285         the time.
286         * src/incremen.c (append_incremental_renames): Don't actually
287         append
288         anything to DIR if DIR is null.
289
290 2010-09-19  Paul Eggert  <eggert@cs.ucla.edu>
291
292         tar: prefer openat-style functions
293         This change replaces traditional functions like 'open' with the
294         POSIX.1-2008 functions like 'openat'.  Mostly this is an internal
295         refactoring change, in preparation for further changes to close
296         some races.
297         * gnulib.modules: Add faccessat, linkat, mkfifoat, renameat,
298         symlinkat.
299         Remove save-cwd.
300         * src/Makefile.am (tar_LDADD): Add $(LIB_EACCESS).
301         * tests/Makefile.am (LDADD): Likewise.
302         * src/common.h (chdir_fd): New extern var.
303         * src/compare.c (diff_file, diff_multivol): Use openat instead
304         of open.
305         * src/create.c (create_archive, restore_parent_fd): Likewise.
306         * src/extract.c (create_placeholder_file): Likewise.
307         * src/names.c (collect_and_sort_names): Likewise.
308         * src/update.c (append_file): Likewise.
309         * src/compare.c (diff_symlink): Use readlinkat instead of
310         readlink.
311         * src/compare.c (diff_file): Use chdir_fd instead of AT_FDCWD.
312         * src/create.c (subfile_open, dump_file0): Likewise.
313         * src/extract.c (fd_chmod, fd_chown, fd_stat, set_stat):
314         (repair_delayed_set_stat, apply_nonancestor_delayed_set_stat):
315         Likewise.
316         * src/extract.c (mark_after_links, file_newer_p, extract_dir):
317         (extract_link, apply_delayed_links):
318         Use fstatat rather than stat or lstat.
319         * src/misc.c (maybe_backup_file, deref_stat): Likewise.
320         * src/extract.c (make_directories): Use mkdirat rather than mkdir.
321         Use faccessat rather than access.  This fixes a minor permissions
322         bug when tar is running setuid (who would want to do that?!).
323         (open_output_file): Use openat rather than open.
324         In the process, this removes support for Masscomp's O_CTG files,
325         which aren't compatible with openat's signature.  Masscomp!  Wow!
326         That's a blast from the past.  As far as I know, that operating
327         system hasn't been supported for more than 20 years.
328         (extract_link, apply_delayed_links):
329         Use linkat rather than link.
330         (extract_symlink, apply_delayed_links):
331         Use symlinkat rather than symlink.
332         (extract_node): Use mknodat rather than mknod.
333         (extract_fifo): Use mkfifoat rather than mkfifo.
334         (apply_delayed_links): Use unlinkat rather than unlink or rmdir.
335         * src/misc.c (safer_rmdir, remove_any_file): Likewise.
336         * src/unlink.c (flush_deferred_unlinks): Likewise.
337         * src/extract.c (rename_directory): Use renameat rather than
338         rename.
339         * src/misc.c (maybe_backup_file, undo_last_backup): Likewise.
340         * src/misc.c: Don't include <save-cwd.h>; no longer needed now
341         that we're using openat etc.
342         (struct wd): Add member fd.  Remove members err and fd.  All uses
343         changed.
344         (CHDIR_CACHE_SIZE): New constant.
345         (wdcache, wdcache_count, chdir_fd): New vars.
346         (chdir_do): Use openat rather than save_cwd.  Keep the cache up
347         to date.  This code won't scale well, but is good enough for now.
348         * src/update.c (update_archive): Use openat + fdopendir +
349         streamsavedir rather than savedir.
350
351         This file is a placeholder. It will be replaced with the actual
352         ChangeLog
353         by make dist.  Run make ChangeLog if you wish to create it
354         earlier.
355
356 2010-09-18  Paul Eggert  <eggert@cs.ucla.edu>
357
358         tar: add utimens.h includes
359         * src/extract.c: Include <utimens.h>, needed for fdutimens
360         prototype.
361         * src/misc.c: Likewise.
362
363         tar: switch to gnulib fdutimensat module
364         * gnulib.modules: Add fdutimensat.
365         * src/common.h (fd_utimensat): Remove decl.
366         * src/extract.c (set_stat): Call fdutimensat, not fd_utimensat.
367         * src/misc.c (set_file_atime): Likewise.
368         (fd_utimensat): Remove.
369
370 2010-09-17  Paul Eggert  <eggert@cs.ucla.edu>
371
372         tar: extract permissions for . last
373         * src/common.h (must_be_dot_or_slash): New decl.
374         * src/extract.c (mark_after_links): New function, taking code
375         that used to be in create_placeholder_file.
376         (create_placeholder_file): Use it.
377         (delay_set_stat): Always delay setting status for . and /.
378         * src/misc.c (must_be_dot_or_slash): Now extern.
379         * tests/extrac12.at: New file.
380         * tests/Makefile.am (TESTSUITE_AT): Add it.
381         * tests/testsuite.at: Likewise.
382
383         tar: don't check for getdtablesize; use AC_CHECK_FUNCS_ONCE
384         * configure.ac: Don't check for getdtablesize; no longer needed.
385         Use AC_CHECK_FUNCS_ONCE rather than AC_CHECK_FUNCS, for
386         efficiency.
387
388         tar: extract symlink attributes, close some symlink-related races
389         * NEWS: Describe symlink-extraction improvements.
390         * src/extract.c (enum permstatus): Remove.
391         (fchmod, fchown): Define dummy replacement macros if the system
392         does not supply them.
393         (implemented): New function.
394         (struct delayed_set_stat): Remove members invert_permissions,
395         permstatus.  They were too confusing, and tried to do too much
396         in too-little space.  Instead, add members current_mode,
397         current_mode_mask, interdir, atflag.  All users changed.
398         (struct delayed_link): Add members mode, atime, mtime, to support
399         platforms such as BSD where symlinks have these attributes.
400         All users changed.
401         (fd_chmod): Renamed from fdchmod.  New argument atflag.  Check for
402         operation not supported at run-time, not at configure-time.  Put
403         fd argument first.  All callers changed.
404         (fd_chown): Likewise, renaming from fdchown.
405         (fd_stat): Likewise, renaming from fdstat.
406         (set_mode): Remove args stat_info, cur_info, invert_permissions,
407         permstatus.  Add args mode, mode_mask, current_mode,
408         current_mode_mask,
409         atflag.  All callers changed.  Close some races.  Use an easier-to
410         understand method for computing permissions.  Work around POSIX
411         incompatibility in Linux fchmodat.  Support extraction of symlink
412         modes, if the OS allows it.
413         (set_stat): Remove args cur_info, invert_permissions, permstatus.
414         Add args current_mode, current_mode_mask, interdir, atflag.
415         All callers changed.  Close some races.  Support extraction of
416         attributes on symlinks, if the OS allows it.
417         (delay_set_stat): Remove args invert_permissions, permstatus.
418         Add args current_mode, current_mode_mask, mode, atflag.
419         The ST arg can be null now, indicating that it's an intermediate
420         directory.  All callers changed.
421         (repair_delayed_set_stat, apply_nonancestor_delayed_set_stat):
422         Close some races.
423         (extract_dir): Also be paranoid if only --same-permissions, due
424         to semantics of setgid and setuid directories on some hosts.
425         This closes a race on those hosts.  Simplify calculation of
426         delay_set_stat arguments; the old code was truly strange and
427         probably wrong in some border cases.
428         (extract_dir, extract_file, extract_node, extract_fifo): Don't
429         rely on
430         unspecified behavior in mode arg of open, mknod, etc.  Instead,
431         mask out those bits when creating the file, and add them later via
432         fchmod or chmodat.
433         (open_output_file): file_name is now const.  Add arg current_mode,
434         current_mode_mask.  All callers changed.  When overwriting
435         old files,
436         refuse to overwrite something that is not a regular file, since
437         we're extracting a regular file.
438         (extract_file): Remove the FIXME comment.  Whatever the protection
439         issues were, they should be fixed now.  As a result of all
440         the other
441         API changes, we now use fchmod etc. rather than chmod etc.,
442         closing
443         some races.
444         (create_placeholder_file, apply_delayed_links): Record desired
445         mode and times for symlinks, for OSes that support that.
446
447 2010-09-16  Paul Eggert  <eggert@cs.ucla.edu>
448
449         tar: tar -x without --incremental no longer sets atime again
450         * src/extract.c (set_stat): Use UTIME_OMIT rather than UTIME_NOW.
451         The UTIME_NOW was there only to emulate the previous behavior of
452         using the current time, and the previous behavior was there only
453         because before we started assuming POSIX.1-2008 there was no
454         portable way to get the effect of UTIME_NOW.
455
456         tar: another --atime-preserve race fix
457         * src/common.h (set_file_atime): Add parentfd arg.
458         * src/compare.c (diff_file): Use it.
459         * src/create.c (dump_file0): Likewise.  This closes yet another
460         race condition with symbolic links.
461         * src/misc.c (set_file_atime): Add parentfd arg.
462
463         tar: --atime-preserve fixes for races etc.
464         This patch fixes a race condition in the --atime-preserve=replace
465         option, which might cause tar to improperly follow a symbolic
466         link.
467
468         It also drops the use of the _FIOSATIME ioctl of Solaris 2.x
469         and later, which loses resolution on time stamps.  Modern Solaris
470         systems support full-resolution time stamps in the kernel, and
471         it's not worth the hassle of testing this call, useful only in
472         no-longer-supported Solaris variants.
473
474         Also, it undoes a change I recently introduced to the --compare
475         option, which caused it to not follow symbolic links unless the
476         --dereference option was also used.  Quite possibly this change is
477         a good idea, but the old behavior was documented and the change
478         should not have been installed casually.
479
480         * configure.ac: Don't check for stropts.h and sys/filio.h.
481         * gnulib.modules: Add futimens, utimensat.  Remove futimens.
482         * src/common.h (fd_utimensat): New decl.
483         * src/compare.c (diff_file, diff_multivol):
484         Don't use open_read_flags: those are for --create only.
485         * src/create.c (dump_file0): Adjust to set_file_atime changes.
486         Pass fstatat_flags to set_file_atime, so that symbolic links are
487         not followed inadvertantly.
488         * src/extract.c: Don't include utimens.h.
489         (set_stat): Use fd_utimensat ant UTIME_NOW rather than fdutimens.
490         * src/misc.c: Don't include utimens.h, stropts.h, sys/filio.h.
491         (fd_utimensat): New function.
492         (set_file_atime): Use it.  New arg atflag, controlling symlink
493         handling.  All callers changed.
494
495 2010-09-14  Paul Eggert  <eggert@cs.ucla.edu>
496
497         * configure.ac: tar: close some race conditions when extracting
498         * configure.ac: Check for fchmod and fchown.  Don't check
499         for utimes.
500         * src/extract.c (fdchmod, fdchown, fdstat): New functions.
501         (set_mode, set_stat): New arg FD.  All callers changed.
502         This avoids some race conditions between closing a regular file
503         and setting its metadata, and it's a bit faster.
504
505 2010-09-13  Paul Eggert  <eggert@cs.ucla.edu>
506
507         tar: don't worry about fdopendir closing its argument
508         * NEWS: Don't mention dirfd; no longer needed.
509         * gnulib.modules: Remove dirfd.
510         * src/create.c (get_directory_entries): Remove the code dealing
511         with dirfd failures, as the new fdopendir replacement doesn't
512         close its argument so we don't need to call dirfd.  See
513         <http://lists.gnu.org/archive/html/bug-gnulib/2010-09/msg00208.html>
514         and gnulib commit 970c9038e4cca46e1b037ae0a6d574dfae6a7327.
515
516         * NEWS: Fix wording typo in previous change.
517         Reported by Jim Meyering.
518
519         tar: live within system-supplied limits on file descriptors
520         * NEWS: Note the change.  Mention dirfd and fdopendir.
521         * gnulib.modules: Add dirfd and fdopendir.  The code was already
522         using fdopendir; dirfd is a new need.
523         * src/common.h (open_searchdir_flags, get_directory_entries):
524         (subfile_open, restore_parent_fd, tar_stat_close): New decls.
525         (check_exclusion_tags): Adjust signature to match code change.
526         * src/create.c (IMPOSTOR_ERRNO): New constant.
527         (check_exclusion_tags): First arg is now a struct tar_stat_info
528         const *, not an fd.  All callers changed.
529         (dump_regular_file, dump_file0): A zero fd represents an unused
530         slot, so play it safe if the fd member is zero here.  A negative
531         fd represents the negation of an errno value, so play it safe and
532         do not assign -1 to fd merely because an open fails.
533         (open_failure_recover, get_directory_entries, restore_parent_fd):
534         (subfile_open): New functions.  These help to recover from file
535         descriptor exhaustion.
536         (dump_dir, dump_file0): Use them.
537         (dump_file0): Use tar_stat_close instead of rolling our own close.
538         * src/incremen.c (scan_directory): Use get_directory_entries,
539         subfile_open, etc., to recover from file descriptor exhaustion.
540         * src/names.c (add_hierarchy_to_namelist): Likewise.
541         (collect_and_sort_names): A negative fd represents the negation
542         of an errno value, so play it safe and do not assign -1 to fd.
543         * src/tar.c (decode_options): Set open_searchdir_flags.
544         Add O_CLOEXEC to all the open flags.
545         (tar_stat_close): New function, which knows how to deal with
546         new convention for directory streams and file descriptors.
547         Diagnose 'close' failures.
548         (tar_stat_destroy): Use it.
549         * src/tar.h (struct tar_stat_info): New member dirstream.
550         fd now has the negative of an errno value, not merely -1, if
551         the file could not be opened, so that failures to reopen
552         directories
553         are better-diagnosed later.
554         * tests/Makefile.am (TESTSUITE_AT): Add extrac11.at.
555         * tests/testsuite.at: Likewise.
556         * tests/extrac11.at: New file.
557
558 2010-09-08  Paul Eggert  <eggert@cs.ucla.edu>
559
560         tar: improve documentation of reliability and security issues
561         * doc/tar.texi (Reliability and security, Reliability):
562         (Permissions problems, Data corruption and repair, Race
563         conditions):
564         (Security, Privacy, Integrity, Live untrusted data):
565         (Security rules of thumb): New nodes.
566
567 2010-09-06  Paul Eggert  <eggert@cs.ucla.edu>
568
569         tar: more reliable directory traversal when creating archives
570         * NEWS: Document this.
571         * gnulib.modules: Add openat, readlinkat.
572         * src/common.h (open_read_flags, fstatat_flags): New global
573         variables.
574         (cachedir_file_p, dump_file, check_exclusion_tags,
575         scan_directory):
576         Adjust to new signatures, described below.
577         (name_fill_directory): Remove.
578         * src/compare.c (diff_file, diff_multivol): Use open_read_flags.
579         * src/create.c (struct exclusion_tag): Exclusion predicates
580         now take
581         a file descriptor, not a file name.
582         (add_exclusion_tag): Likewise.  All uses changed.
583         (cachedir_file_p): Likewise.
584         (check_exclusion_tags): The directory is now a file descriptor,
585         not a file name.  All uses changed.  Use openat for better
586         traversal.
587         (file_dumpable_p): Arg is now a struct stat, not a struct
588         tar_stat_info.  All uses changed.  Check the arg's file types too.
589         (dump_dir0, dump_dir, dump_file0, dump_file): Omit top_level and
590         parent_device args, since st->parent tells us that now.  All uses
591         changed.
592         (dump_dir): Likewise.  Also, omit fd arg for similar reasons.
593         Apply fdsavedir to a dup of the file descriptor, since we need a
594         file descriptor for openat etc. as well, and fdsavedir (perhaps
595         unwisely) consumes its file descriptor when successful.
596         Do not consume st->fd when successful; this simplifies the caller.
597         (create_archive): Allocate a file descriptor when retraversing
598         a directory, during incremental dumps.
599         (dump_file0): Use fstatat, openat, and readlinkat for better
600         traversal.
601         When opening a file, use the result of fstat on the file
602         descriptor
603         rather than the fstatat on the directory entry, to avoid some race
604         conditions.  No need to reopen the directory since we now
605         no longer
606         close it.  Change "did we open the file?" test from 0 <= fd to
607         0 < fd since fd == 0 now represents uninitialized.
608         (dump_file): Now accepts struct tar_stat_info describing parent,
609         not parent_device.  Also, accept basename and fullname of entry.
610         All uses changed.
611         * src/incremen.c (update_parent_directory): Accept struct
612         tar_stat_info for parent, not name.  All callers changed.
613         Use fstatat for safer directory traversal.
614         (procdir): Accept struct tar_stat_info, not struct stat and
615         dev_t, for info about directory.  All callers changed.
616         (scan_directory): Accept struct tar_stat_info, not name,
617         device, and cmdline, for info about directory.  All callers
618         changed.  Do not consume the file descriptor, since caller
619         might need it.  Use fstatat and openat for safer directory
620         traversal; also, use fstat after opening to double-check.
621         (name_fill_directory): Remove.
622         * src/names.c (add_hierarchy_to_namelist): Accept struct
623         tar_stat_info instead of device and cmdline.  All callers changed.
624         When descending into a subdirectory, use openat and fstat for
625         safer directory traversal.
626         (collect_and_sort_names): Use open and fstat for safer directory
627         traversal.  Set up struct tar_stat_info for callee's new API.
628         * src/tar.c (decode_options): Initialize open_read_flags
629         and fstatat_flags.
630         (tar_stat_destroy): Close st->fd if it is positive (not zero!).
631         * src/tar.h (struct tar_stat_info): New members parent, fd.
632         * src/update.c (update_archive): Adjust to dump_file's API change.
633         * tests/filerem02.at: Ignore stderr since its contents now depend
634         on the file system implementation.
635
636 2010-09-05  Paul Eggert  <eggert@cs.ucla.edu>
637
638         tar: remove lint discovered by Sun C compiler
639         * src/common.h (WARN_ALL): Don't mask with 0xffffffff; on a 32-bit
640         host, 0xffffffff is of type 'unsigned int', which makes WARN_ALL
641         an unsigned int value that is too large to fit into an int, and
642         the C standard says that this has undefined behavior.  The mask is
643         not needed, so omit it.
644
645 2010-09-04  Paul Eggert  <eggert@cs.ucla.edu>
646
647         tar: restore macros that are used in some cases
648         * src/tar.c (LOW_DENSITY_NUM, MID_DENSITY_NUM, HIGH_DENSITY_NUM):
649         Restore these macros, undoing the previous change to this file.
650         The macros are used after all, in some cases.  Sorry about that.
651
652 2010-09-03  Paul Eggert  <eggert@cs.ucla.edu>
653
654         tar: remove unused macros
655         * src/create.c (UINTMAX_TO_CHARS): Remove; no longer used.
656         * src/tar.c (LOW_DENSITY_NUM, MID_DENSITY_NUM, HIGH_DENSITY_NUM):
657         Likewise.
658         * src/incremen.c (DIR_IS_NEW): Comment out; not used.
659         Mark this with a FIXME, since it looks like it should be used.
660
661 2010-08-27  Sergey Poznyakoff  <gray@gnu.org.ua>
662
663         Fix --remove-files in update/append mode.
664         * src/update.c (update_archive): Call finish_deferred_unlinks when
665         done.
666
667 2010-08-26  Paul Eggert  <eggert@cs.ucla.edu>
668
669         tar: avoid assumptions about root access and chmod -w in test
670         cases
671         * tests/extrac07.at, tests/extrac09.at, tests/listed03.at: Use
672         AT_UNPRIVILEGED_PREREQ, since this test requires non-root
673         privileges.
674         * tests/extrac07.at: Don't use "chmod -w", as POSIX says it's not
675         portable to start a chmod permissions-list with "-" as it may be
676         confused with an option.  Use "chmod a-w" instead.
677
678         tar: fix bug with -C and delayed setting of metadata
679         * src/common.h (chdir_current): New decl.
680         * src/extract.c (struct delayed_set_stat, struct delayed_link):
681         New member change_dir.
682         (delay_set_stat, create_placeholder_file): Set it.
683         (apply_nonancestor_delayed_set_stat, apply_delayed_links): Use it.
684         (extract_link): Check that the links are all relative to the same
685         directory.
686         (extract_archive): Restore the current directory after
687         apply_nonancestor_delayed_set_stat has possibly changed it.
688         * src/misc.c (chdir_current): New external var; this used to
689         be the private static variable 'previous' inside chdir_dir.
690         All uses changed.
691         * tests/Makefile.am (TESTSUITE_AT): New test extrac10.at.
692         * tests/extrac10.at: New file.
693         * tests/testsuite.at: Include it.
694
695 2010-08-25  Sergey Poznyakoff  <gray@gnu.org.ua>
696
697         Don't apply file transformations to volume names.
698         * src/list.c (decode_header): Don't apply file transformations
699         to volume names.
700         * tests/xform01.at: New testcase.
701         * tests/xform-h.at (xform): Rename macro to xformtest. Use
702         pushdef/popdef.
703         * tests/Makefile.am, tests/testsuite.at: Add xform01.at
704
705 2010-08-25  Paul Eggert  <eggert@cs.ucla.edu>
706
707         tar: optimize -c --sparse when file is entirely sparse
708         * src/sparse.c (sparse_scan_file): If the file is entirely sparse,
709         that is, if ST_NBLOCKS is zero, don't bother scanning for nonzero
710         blocks.  Idea by Kit Westneat, communicated by Bernd Schubert in
711         <http://lists.gnu.org/archive/html/bug-tar/2010-08/msg00038.html>.
712         Also, omit unnecessary lseek at start of file.
713
714         tar: don't assume size of a sparse file chunk fits in size_t
715         * src/tar.h (struct sp_array): Change numbytes from size_t
716         to off_t.
717         All uses changed.
718         * scripts/xsparse.c (struct sp_array): Likewise.
719         Include <stdint.h>, for SIZE_MAX.
720         (expand_sparse): Don't try to allocate a buffer bigger than
721         SIZE_MAX bytes.
722         * src/common.h (SIZE_TO_CHARS, size_to_chars, SIZE_FROM_HEADER):
723         (size_from_header): Remove decls.
724         * src/create.c (size_to_chars): Remove.
725         * src/list.c (size_from_header): Remove.
726         * src/sparse.c (sparse_extract_region, check_data_region):
727         (oldgnu_add_sparse, oldgnu_store_sparse_info, pax_decode_header):
728         Don't assume chunk sizes fit in size_t.
729         (oldgnu_add_sparse): Check for off_t overflow.
730         * src/xheader.c (sparse_numbytes_decoder, sparse_map_decoder):
731         Likewise.
732
733         tar: use ctime, not mtime, when checking placeholders
734         * src/extract.c (struct delayed_link): Rename member mtime
735         to ctime.
736         All uses changed to use ctime rather than mtime.
737
738 2010-08-24  Paul Eggert  <eggert@cs.ucla.edu>
739
740         tar: add comment to link04.at test
741         * tests/link04.at: Add explanatory comment at head.
742
743         tar: fix 1.23 Solaris regression related to PRIV_SYS_LINKDIR
744         The idea was suggested by Petr Sumbera in the thread starting
745         here:
746         http://lists.gnu.org/archive/html/bug-tar/2010-08/msg00000.html
747         * src/extract.c (set_mode): Save the errno of the chmod that
748         failed, for the benefit of chmod_error_details.  Do not bother
749         retrying chmod unless the mode suggests setuid is the issue.
750         (extract_archive): Remove redundant call to
751         priv_set_remove_linkdir.
752         * src/system.c: Include priv-set.h.
753         (sys_spawn_shell, sys_child_open_for_compress):
754         (sys_child_open_for_uncompress, sys_exec_command):
755         (sys_exec_info_script, sys_exec_checkpoint_script):
756         Invoke priv_set_restore_linkdir before execv or execlp, so that
757         the subprocess has the same privileges that tar originally did.
758
759         tar: handle files that occur multiple times but have link count 1
760         This patch was inspired by the following patch that addressed a
761         similar problem in GNU coreutils du:
762         http://git.savannah.gnu.org/gitweb/?p=coreutils.git;h=efe53cc72b599979ea292754ecfe8abf7c839d22
763         * src/common.h (name_count): New decl.
764         * src/create.c (trivial_link_count): New static var.
765         (create_archive): Initialize it.
766         (dump_hard_link, file_count_links): Use it, so that files with
767         link count 1 are handled correctly when they are found multiple
768         times.
769         * src/names.c (allocated_entries): Renamed from allocated_names,
770         since the identifier's name was misleading.  All uses changed.
771         (entries): Renamed from names.  All uses changed.
772         (scanned): Renamed from name_index.  All uses changed.
773         (name_count): New var.
774         (name_add_name): Increment it.
775         * tests/link04.at: New file.
776         * tests/testsuite.at: Add it.
777         * tests/Makefile.am (TESTSUITE_AT): Likewise.
778
779 2010-08-23  Paul Eggert  <eggert@cs.ucla.edu>
780
781         tar: use nlink_t for link counts
782         * src/create.c (struct link): nlink is now of type nlink_t,
783         not size_t.
784
785         tar: don't export names that aren't used elsewhere
786         * src/common.h (file_dumpable_p, gid_to_chars, major_to_chars):
787         (minor_to_chars, mode_to_chars, uid_to_chars, uintmax_to_chars):
788         (string_to_chars, dumpdir_creat0, dumpdir_create, dumpdir_free):
789         (dumpdir_locate, dumpdir_next, dumpdir_first, gid_from_header):
790         (major_from_header, minor_from_header, mode_from_header):
791         (time_from_header, uid_from_header, quote_copy_string,
792         request_stdin):
793         (xheader_init, transform_header_name):
794         Remove declarations; these are no longer exported from their
795         modules.
796         (GID_TO_CHARS, MAJOR_TO_CHARS, MINOR_TO_CHARS, MODE_TO_CHARS):
797         (UID_TO_CHARS, UINTMAX_TO_CHARS, UNAME_TO_CHARS, GNAME_TO_CHARS):
798         Move to src/create.c, since no other module uses these.
799         (GID_FROM_HEADER, MAJOR_FROM_HEADER, MINOR_FROM_HEADER):
800         (MODE_FROM_HEADER, TIME_FROM_HEADER, UID_FROM_HEADER):
801         Move to src/extract.c, since no other module uses these.
802         (dumpdir_t, dumpdir_iter_t): Remove; no longer used.
803         * src/create.c (gid_to_chars, major_to_chars, minor_to_chars):
804         (mode_to_chars, uid_to_chars, uintmax_to_chars, string_to_chars):
805         (file_dumpable_p): Now static.
806         * src/incremen.c (dumpdir_create0, dumpdir_create, dumpdir_free):
807         (dumpdir_locate, dumpdir_next, dumpdir_first): Now static.
808         (scan_directory, write_directory_file_entry):
809         Use struct dumpdir_iter * rather than dumpdir_iter_t.
810         * src/list.c (gid_from_header, major_from_header,
811         minor_from_header):
812         (mode_from_header, time_from_header, uid_from_header):
813         (transform_member_name): Now static.
814         * src/misc.c (quote_copy_string): #if 0 out, as it's not used
815         anywhere.
816         * src/system.c (wait_for_grandchild): Now static.
817         * src/tar.c (request_stdin): Now static.
818         * src/xheader.c (xheader_init): Now static.
819
820         tar: fix misspelled identifier "set_comression_program_by_suffix"
821         * src/suffix.c (set_compression_program_by_suffix): Renamed from
822         set_comression_program_by_suffix.
823         * src/buffer.c, src/common.h, src/tar.c: All uses changed.
824
825 2010-08-20  Paul Eggert  <eggert@cs.ucla.edu>
826
827         tar: change interdir_made from int to bool
828         * src/extract.c (maybe_recoverable, create_placeholder_file):
829         Change interdir_made from int * to bool *, since the flag has just
830         two values 0 and 1.  All uses changed.  This does not affect tar's
831         behavior.
832
833         tar: remove trailing white space from source files
834         * ChangeLog.1, ChangeLog.CVS, Makefile.am, NEWS, README:
835         * README-hacking, directory, doc/Makefile.am, doc/dumpdir.texi:
836         * doc/gendocs_template, doc/intern.texi, doc/mastermenu.el:
837         * doc/snapshot.texi, doc/sparse.texi, doc/tar-snapshot-edit.texi:
838         * doc/value.texi, lib/Makefile.am, scripts/backup-specs:
839         * scripts/dump-remind.in, scripts/tar-snapshot-edit,
840         scripts/tarcat:
841         * scripts/xsparse.c, src/arith.h, src/buffer.c, src/compare.c:
842         * src/create.c, src/delete.c, src/exit.c, src/suffix.c, src/tar.c:
843         * src/tar.h, src/update.c, src/warning.c, src/xheader.c:
844         * tests/append01.at, tests/append02.at, tests/atlocal.in:
845         * tests/delete03.at, tests/exclude.at, tests/exclude06.at:
846         * tests/extrac04.at, tests/extrac05.at, tests/extrac06.at:
847         * tests/extrac07.at, tests/filerem01.at, tests/filerem02.at:
848         * tests/incr01.at, tests/incr02.at, tests/incr03.at,
849         tests/incr06.at:
850         * tests/label02.at, tests/label03.at, tests/label04.at:
851         * tests/label05.at, tests/link02.at, tests/link03.at:
852         * tests/listed01.at, tests/listed02.at, tests/long01.at:
853         * tests/longv7.at, tests/multiv01.at, tests/multiv02.at:
854         * tests/multiv03.at, tests/multiv05.at, tests/multiv06.at:
855         * tests/multiv07.at, tests/multiv08.at, tests/options.at:
856         * tests/options02.at, tests/remfiles03.at, tests/rename01.at:
857         * tests/rename02.at, tests/rename03.at, tests/rename04.at:
858         * tests/rename05.at, tests/same-order01.at, tests/same-order02.at:
859         * tests/shortfile.at, tests/shortupd.at, tests/sparse01.at:
860         * tests/sparse02.at, tests/sparsemv.at, tests/sparsemvp.at:
861         * tests/star/README, tests/star/gtarfail2.at:
862         * tests/star/multi-fail.at:
863         * tests/star/pax-big-10g.at, tests/star/quicktest.sh:
864         * tests/star/ustar-big-2g.at, tests/star/ustar-big-8g.at:
865         * tests/update01.at, tests/update02.at, tests/volsize.at:
866         * tests/volume.at:
867         Remove trailing spaces and tabs from lines, and remove
868         trailing empty lines from files.  This makes it a bit easier
869         to share code among coreutils and other projects that do this.
870
871 2010-08-19  Paul Eggert  <eggert@cs.ucla.edu>
872
873         tar: update licenses to latest versions from www.gnu.org
874         * COPYING: Update to latest version; this is just minor
875         formatting.
876         * doc/fdl.texi: Update from GFDL 1.2 to 1.3.
877         * doc/tar.texi: Adjust to new format of fdl.texi.  Omit trailing
878         white space.
879
880 2010-07-18  Paul Eggert  <eggert@cs.ucla.edu>
881
882         * src/misc.c (struct wd): Fix comment to match code.
883
884 2010-07-18  Paul R. Eggert  <eggert@cs.ucla.edu>
885
886         tar: no need to report getcwd error if never using the result
887         * src/misc.c (struct wd): Rename 'saved' to 'err', with new
888         semantics.
889         (chdir_arg, chdir_do): Adjust to new semantics.  Do not report an
890         error merely because save_cwd fails; report an error only if
891         save_cwd's result is needed later.
892         * tests/extrac09.at: New file, to test for bug that was fixed.
893         * tests/testsuite.at: Include it.
894         * tests/Makefile.am (TESTSUITE_AT): Add it.
895
896         tar: go back to absolutifying filenames in normalize_filename
897         for now
898         * src/misc.c (normalize_filename): For now, go back to making
899         filenames absolute, even though this causes 'tar' to fail when
900         getcwd fails.  However, do not attempt to resolve ".." as this
901         does not work with symlinks.  Also, do the right thing with
902         leading file system prefixes and on hosts where // != /.
903
904 2010-07-17  Sergey Poznyakoff  <gray@gnu.org.ua>
905
906         Allow for size suffixes in -L and --record-size options.
907         * src/tar.c (TAR_SIZE_SUFFIXES): New define.
908         (parse_opt): Allow for size suffixes in arguments to
909         -L and --record-size options.
910         * NEWS, doc/tar.texi: Update.
911
912 2010-07-15  Paul R. Eggert  <eggert@cs.ucla.edu>
913
914         tar: don't crash if getcwd fails
915         * src/extract.c: Don't include xgetcwd.h.
916         (extract_dir): stat "." rather than statting getcwd's output.
917         * src/misc.c (normalize_filename_x): Rewrite so as not to resolve
918         /../, which can't be done reliably in the presence of symlinks.
919         Don't reject valid names such as ".".
920         (normalize_filename): Don't make it absolute; that way, we don't
921         have to invoke xgetcwd which might fail.  Don't bother to realloc
922         at the end, since that uses time and now saves little space.
923         (chdir_do): Don't crash if xgetcwd fails.
924         * tests/Makefile.am (TESTSUITE_AT): Add listed03.at.
925         * tests/listed03.at: New file.
926         * tests/testsuite.at: Include listed03.at.
927
928 2010-07-11  Sergey Poznyakoff  <gray@gnu.org.ua>
929
930         Keep a detailed map of archive members stored in the record
931         buffer.
932         A separate map (bufmap) provides information for creating
933         multi-volume continuation headers.
934
935         * src/buffer.c (bufmap): New struct.
936         (bufmap_head, bufmap_tail, inhibit_map): New variables.
937         (mv_begin_write): New function.
938         (mv_begin): Rename to mv_begin_read. Rewrite using mv_begin_write.
939         All callers changed.
940         (mv_total_size): Remove.
941         (bufmap_locate, bufmap_free, bufmap_reset): New functions.
942         (_flush_write): Update bufmap.
943         (close_archive): Free bufmap.
944         (add_chunk_header): Take a bufmap argument.
945         (gnu_add_multi_volume_header): Likewise.
946         (add_multi_volume_header): Likewise.
947         (_gnu_flush_write): Rewrite using bufmap.
948         (real_s_name, real_s_totsize)
949         (real_s_sizeleft)
950         (save_name, save_totsize, save_sizeleft): Removed. All
951         uses updated.
952         (mv_size_left): Update bufmap_head.
953         (mv_end): Rewrite.
954         (multi_volume_sync): Remove.
955
956         * src/common.h (mv_begin_write): New prototype.
957         (mv_begin): Rename to mv_begin_read.
958         * src/create.c: Use mv_begin_write instead of mv_begin.
959         Remove calls to mv_size_left and mv_end.
960         * src/sparse.c: Likewise.
961
962         * tests/multiv07.at: Close stdin.
963         * tests/spmvp00.at: Update AT_KEYWORDS.
964         * tests/spmvp10.at: Likewise.
965
966         * tests/multiv08.at: New testcase.
967         * tests/Makefile.am, tests/testsuite.at: Add multiv08.at.
968
969         Version 1.23.90
970         * NEWS, configure.ac: Version 1.23.90
971         * doc/tar.texi: Document the use of lbzip2.
972
973 2010-06-28  Sergey Poznyakoff  <gray@gnu.org.ua>
974
975         Fix exclusion of long file names when extracting from pax format
976         archives.
977         * src/list.c (read_and): Call decode_header before attempting
978         name_match.
979         (list_archive): Remove call to decode_header.
980
981         * src/compare.c (diff_archive): Remove call to decode_header.
982         * src/extract.c (extract_archive): Likewise.
983
984         * test/exclude06.at: New test case.
985         * tests/testsuite.at: Include exclude06.at.
986         * tests/Makefile.am (TESTSUITE_AT): Add exclude06.at.
987
988         Minor fix.
989         * src/buffer.c (magic): Split the character constant to help
990         cc recognize character boundaries (7 is a valid hex character).
991
992 2010-06-27  Sergey Poznyakoff  <gray@gnu.org.ua>
993
994         Minor fix.
995         * src/buffer.c (magic): Fix xz magic.
996
997 2010-06-16  Paul Eggert  <eggert@cs.ucla.edu>
998
999         Remove some lint, found by gcc -W etc.
1000         * src/common.h (label_notfound): New decl.
1001         * src/buffer.c (set_volume_start_time, compress_type):
1002         (guess_seekable_archive, open_compressed_archive, init_buffer):
1003         (_flush_write, archive_is-dev, increase_volume_number):
1004         (change_tape_menu, try_new_volume, add_chunk_header):
1005         (multi_volume_sync):
1006         Declare as 'static' if it's not exported.
1007         Use function prototype (void) rather than old-style ().
1008         * src/checkpoint.c (expand_checkpoint_string): Likewise.
1009         * src/incremen.c (dirlist_replace_prefix, makedumpdir,
1010         read_incr_db_2):
1011         Likewise.
1012         * src/list.c (print_volume_label): Likewise.
1013         * src/misc.c (normalize_filename_x): Likewise.
1014         * src/names.c (make_name, free_name, check_name_alloc,
1015         name_next_elt):
1016         Likewise.
1017         * src/tar.c (tar_list_quoting_style, add_exclude_array):
1018         (set_stat_signal): Likewise.
1019         * src/transform.c (new_transform,
1020         _single_transform_name_to_obstack):
1021         (_transform_name_to_obstack): Likewise.
1022         * src/unlink.c (dunlink_alloc): Likewise.
1023
1024         * src/buffer.c (struct zip_magic): Use const when appropriate.
1025         * src/incremen.c (obstack_code_rename,
1026         write_directory_file_entry):
1027         Likewise.
1028         * src/sparse.c (COPY_STRING): Likewise.
1029         * src/system.c (dec_to_env, time_to_env, oct_to_env, str_to_env):
1030         (chr_to_env): Likewise.
1031         * src/tar.c (tar_list_quoting_style, set_stat_signal): Likewise.
1032
1033         * src/extract.c (extract_node): Don't return garbage.
1034
1035         * src/names.c: Remove old-style declarations of getgrnam etc.
1036         All modern systems declare these, and it's not worth the hassle
1037         of ignoring the warnings on modern systems for old-style decls.
1038
1039 2010-05-17  Sergey Poznyakoff  <gray@gnu.org.ua>
1040
1041         Bugfix.
1042         * src/incremen.c (make_directory): Retain the slash if it is the
1043         only character in a filename.
1044
1045 2010-04-02  Sergey Poznyakoff  <gray@gnu.org.ua>
1046
1047         Recode NEWS back to UTF-8
1048
1049 2010-04-01  Sergey Poznyakoff  <gray@gnu.org.ua>
1050
1051         Fix the gzip.at test case.
1052         * tests/gzip.at: Suppress gzip error output, as it can differ
1053         depending on its version etc. Bug reported by Ludovic Courtès.
1054
1055 2010-03-28  Sergey Poznyakoff  <gray@gnu.org.ua>
1056
1057         New option --full-time.
1058         * src/common.h (full_time_option): New global.
1059         * src/tar.c (FULL_TIME_OPTION): New constant.
1060         (options): New option --full-time.
1061         (parse_opt): Handle the --full-time option.
1062         * src/list.c (simple_print_header): Pass full_time_option
1063         as the 2nd argument to tartime.
1064         * doc/tar.texi: Update.
1065         * NEWS: Update.
1066
1067 2010-03-27  Sergey Poznyakoff  <gray@gnu.org.ua>
1068
1069         Minor fixes in the testsuite.
1070         * tests/extrac07.at: Fix a typo (invalid number
1071         of arguments before format list).
1072         * tests/link02.at: Use `ln' instead of `link'.
1073         * tests/link03.at: Likewise.
1074
1075         Fix coredump.
1076         * src/names.c (collect_and_sort_names): Remove
1077         entry from the table before freeing it.
1078
1079         Fix dead loop on extracting existing symlinks with the -k option.
1080         * src/extract.c (create_placeholder_file)
1081         (extract_link, extract_symlink)
1082         (extract_node, extract_fifo): Handle all possible
1083         return values from maybe_recoverable. This complements
1084         8f390db92fc. Reported by Ico Doornekamp <bug-tar@zevv.nl>.
1085         * NEWS: Update.
1086
1087 2010-03-20  Sergey Poznyakoff  <gray@gnu.org.ua>
1088
1089         Fix undesired error exit on receiving SIGPIPE.
1090         * src/tar.c: Do not ignore SIGPIPE.
1091         * tests/sigpipe.at: New testcase.
1092         * tests/Makefile.am, tests/testsuite.at: Add sigpipe.at
1093         * tests/remfiles01.at: Fix error code expectation.
1094         * NEWS: Update.
1095
1096 2010-03-17  Sergey Poznyakoff  <gray@gnu.org.ua>
1097
1098         Fix --remove-files.
1099         Tar --remove-files relied on canonicalize_file_name,
1100         which replaces symlinks in file name components with
1101         the directories they point to. Due to this, tar
1102         effectively ignored existence of symbolic links and
1103         was unable to remove a directory that contained any
1104         (Alexander Kozlov <akozlov@nada.kth.se>, 2010-03-15).
1105
1106         * gnulib.modules: Remove canonicalize.
1107         * src/misc.c (normalize_filename): Rewrite
1108         from scratch. The function operates only on
1109         its input string, it makes no attempt to test
1110         components for existence or to resolve symbolic
1111         links.
1112         * tests/Makefile.am (TESTSUITE_AT): Add remfiles03.at.
1113         * tests/testsuite.at: Likewise.
1114         * tests/remfiles03.at: New test case.
1115         * NEWS: Update.
1116
1117 2010-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>
1118
1119         Bugfixes.
1120         * src/buffer.c (check_label_pattern): Initialize result.
1121         * tests/remfiles01.at: Skip if run with root privileges.
1122
1123 2010-03-11  Sergey Poznyakoff  <gray@gnu.org.ua>
1124
1125         Fix `--test-label' and `--label -r' behavior.
1126         * doc/tar.texi (Including a Label in the Archive): Revise
1127         the section.
1128         * NEWS: Update
1129
1130         * src/buffer.c (open_archive): Check volume label on
1131         ACCESS_UPDATE as well.
1132         * src/list.c (test_archive_label): Rewrite to match the
1133         documentation.
1134         * src/names.c (regex_usage_warning): Return int.
1135         (names_notfound): Rewrite the conditional.
1136         (label_notfound): New function.
1137
1138         * tests/label03.at: New testcase.
1139         * tests/label04.at: New testcase.
1140         * tests/label05.at: New testcase.
1141         * tests/Makefile.am: Add new testcases.
1142         * tests/testsuite.at: Likewise.
1143
1144         Doc fixes.
1145         * doc/tar.texi: Consistently use lowercase `see' within sentences.
1146         More fixes spotted by Denis Excoffier.
1147         * THANKS: Update.
1148
1149         Shut up a gcc warning message.
1150         * src/tar.c (tar_help_filter): Use a separate const
1151         variable to hold returns from gettext. Reported by
1152         Peter Breitenlohner.
1153
1154         Bugfix.
1155         * src/names.c (collect_and_sort_names): Initialize prev_name.
1156         Reported by Dmitry V. Levin.
1157
1158 2010-03-10  Sergey Poznyakoff  <gray@gnu.org.ua>
1159
1160         Version 1.23
1161         * configure.ac, NEWS: Update version number.
1162
1163         Doc changes.
1164         * NEWS: Update.
1165         * THANKS: Update.
1166         * doc/snapshot.texi, doc/snapshot.texi,
1167         doc/sparse.texi, doc/tar-snapshot-edit.texi,
1168         doc/tar.texi: Spellchecked and proof-read. Thanks
1169         to Denis Excoffier.
1170         * gnulib.modules: Remove utime.
1171
1172 2010-03-08  Kamil Dudka  <kdudka@redhat.com>
1173
1174         Fix possible overflow in code_timespec (tiny change)
1175         * src/misc.c (code_timespec): ignore invalid values of ns
1176
1177 2010-03-08  Sergey Poznyakoff  <gray@gnu.org.ua>
1178
1179         Minor fix in the testsuite.
1180         * tests/extrac05.at: Skip test if creating
1181         sparse file fails.
1182
1183         Fix eventual memory override and fd exhaustion in create.c
1184         Both bugs reported by Kamil Dudka.
1185
1186         * src/create.c (check_exclusion_tags): Do not keep
1187         pointer to a location within tagname: it may change
1188         after xrealloc. Use byte offset instead.
1189         (dump_file0): Close fd before returning without
1190         dumping the directory.
1191
1192 2010-03-02  Sergey Poznyakoff  <gray@gnu.org.ua>
1193
1194         Minor change.
1195         * doc/tar.texi: Improve some wording.
1196
1197 2010-03-02  Antonio Diaz Diaz  <ant_diaz@teleline.es>
1198
1199         Add Lzip support
1200         * configure.ac: Add TAR_COMPR_PROGRAM(lzip)
1201         * doc/tar.texi: Reflect lzip support.
1202         * src/buffer.c (compress_type) <ct_lzip>: New constant.
1203         (magic): Add magic for lzip.
1204         * src/suffix.c (compression_suffixes): Add lz.
1205         * src/tar.c: New option --lzip.
1206
1207 2010-03-02  Sergey Poznyakoff  <gray@gnu.org.ua>
1208
1209         Minor fix.
1210         * tests/exclude05.at: Rewrite awk invocation to avoid
1211         overflowing awk's file table on Solaris.
1212
1213 2010-03-02  Eric Blake  <ebb9@byu.net>
1214
1215         Fix large file support.
1216         * scripts/xsparse.c (read_map): Use fseeko.
1217         * src/incremen.c (write_directory_file): Likewise.
1218
1219 2010-03-02  Sergey Poznyakoff  <gray@gnu.org.ua>
1220
1221         Bugfix
1222         * src/buffer.c (seek_archive): Rewrite size computation
1223         to prevent it from reaching negative values. Based on
1224         report by Denis Excoffier <Denis.Excoffier@free.fr>.
1225
1226 2010-02-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1227
1228         Supply more information to the --to-command script.
1229         * src/system.c (stat_to_env): Pass information about the current
1230         volume in variables TAR_ARCHIVE, TAR_VOLUME, TAR_BLOCKING_FACTOR,
1231         TAR_FORMAT.
1232         * doc/tar.texi: Document new environment variables.
1233         * NEWS: Likewise.
1234         * configure.ac: Version number 1.22.91.
1235
1236 2010-02-17  Sergey Poznyakoff  <gray@gnu.org.ua>
1237
1238         Minor change.
1239         * src/names.c (regex_usage_warning): Fix warning message.
1240
1241 2010-02-05  Sergey Poznyakoff  <gray@gnu.org.ua>
1242
1243         Update THANKS
1244
1245 2010-02-05  OndÅ™ej Vašík  <ovasik@redhat.com>
1246
1247         Bugfix (tiny change)
1248         * src/xheader.c (xheader_read): Remove unnecessary call
1249         to xheader_init.
1250
1251 2010-01-26  Sergey Poznyakoff  <gray@gnu.org.ua>
1252
1253         Enable silent build mode.
1254         * configure.ac: Require automake 1.11, autoconf 2.63. Enable
1255         silent rules.
1256         * NEWS: Update.
1257         * lib/Makefile.am (rmt-command.h): Silent the rule.
1258
1259 2010-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1260
1261         Read POSIX multivolume archives split at the header boundary.
1262         * src/common.h (read_header_mode): New enum.
1263         (read_header): Change type of the 3rd argument.
1264         * src/list.c (read_header): Change type of the 3rd argument.
1265         All callers updated.
1266         * src/buffer.c (try_new_volume): Allow for volumes split at the
1267         extended/ustar header boundary. This is against POSIX specs, but
1268         we must be able to read such archives anyway.
1269
1270         * tests/multiv07.at: New test case.
1271         * tests/Makefile.am: Add multiv07.at
1272         * tests/testsuite.at: Likewise.
1273
1274         * src/compare.c: Update calls to read_header.
1275         * src/delete.c: Likewise.
1276         * src/update.c: Likewise.
1277
1278 2010-01-24  Sergey Poznyakoff  <gray@gnu.org.ua>
1279
1280         Minor change.
1281         * NEWS: Update.
1282         * doc/tar.texi: Update.
1283         * src/create.c (finish_header): Minor change.
1284
1285 2010-01-24  Rob Vermaas  <rob.vermaas@gmail.com>
1286
1287         Bugfix (tiny change).
1288         * src/tar.c (format_default_settings)[REMOTE_SHELL]: Fix
1289         misplaced comma.
1290
1291 2010-01-24  Sergey Poznyakoff  <gray@gnu.org.ua>
1292
1293         Minor fix.
1294         * src/incremen.c (read_incr_db_01)
1295         (read_directory_file): Initialize bufsize to 0.
1296         Suggested by noordsij@cs.helsinki.fi.
1297
1298         Improve handling of --test-label.
1299         * src/list.c (print_volume_label): New function.
1300         (print_header): Call print_volume_label.
1301         (test_archive_label): New function.
1302         * src/buffer.c (VOLUME_LABEL_APPEND): Remove.
1303         (VOLUME_TEXT, VOLUME_TEXT_LEN): New macros
1304         (drop_volume_label_suffix): New function.
1305         (check_label_pattern): Use drop_volume_label_suffix.
1306         * src/common.h (subcommand): New constant TEST_LABEL_SUBCOMMAND.
1307         (test_label_option): Remove.
1308         (drop_volume_label_suffix): New proto.
1309         (test_archive_label): New proto.
1310         * src/names.c (all_names_found): Remove test for
1311         test_label_option.
1312         * src/tar.c (subcommand_string): Handle TEST_LABEL_SUBCOMMAND.
1313         (set_subcommand_option): Improve diagnostics.
1314         (parse_opt): Set subcommand if --test-label is given.
1315         (main): Handle TEST_LABEL_SUBCOMMAND.
1316
1317         Fix listing of volume labels (in particular in PAX archives).
1318         * src/buffer.c (match_volume_label): Call set_volume_label.
1319         (check_label_pattern): Get label string
1320         as argument.
1321         (match_volume_label): Handle volume labels stored in
1322         global PAX headers.
1323         * src/common.c (print_header,read_header): Change signature.
1324         (read_header_primitive): Remove prototype.
1325         * src/list.c (recent_global_header): New static.
1326         (list_archive): Always print volume labels.
1327         (read_header_primitive): Remove.
1328         (read_header): Change the signature (all callers updated)
1329         Save the recent global header.
1330         (volume_label_printed): New static.
1331         (simple_print_header): New function (ex-print_header).
1332         (print_header): Change the signature (all callers updated).
1333         For POSIX formats, print first volume header (if set).
1334         * src/xheader.c (xheader_write_global): Write the data
1335         accumulated in xhdr->stk even if keyword_global_override_list
1336         is empty.
1337         (xheader_read): On unexpected EOF, report error instead of
1338         coredumping.
1339         (XHDR_PROTECTED, XHDR_GLOBAL): New defines.
1340         (struct xhdr_tab): Remove `protected' with `flags'. All uses
1341         updated.
1342         (decg): If XHDR_GLOBAL bit is set, call the keyword's decode
1343         method instead of adding it to `kwl'.
1344
1345         * src/compare.c: Update calls to read_header.
1346         * src/create.c: Likewise.
1347         * src/delete.c: Likewise.
1348         * src/update.c: Likewise.
1349         * src/extract.c: Likewise.
1350         (extract_volhdr): Do not print "Reading <label>" statement,
1351         because
1352         it is inconsistent: it is not printed if the volume begins with a
1353         member continued from the previous volume.
1354
1355         * tests/label01.at: New testcase.
1356         * tests/label02.at: New testcase.
1357         * tests/Makefile.am, tests/testsuite.at: Add new testcases.
1358
1359 2010-01-22  Sergey Poznyakoff  <gray@gnu.org.ua>
1360
1361         Fix prefix length calculation in ustar mode.
1362         * src/create.c (split_long_name): Fix prefix length
1363         calculation.
1364         (write_ustar_long_name): Improve ustar mode compatibility
1365         with the Sun version.
1366
1367 2009-10-14  Sergey Poznyakoff  <gray@gnu.org.ua>
1368
1369         Rewrite update algorithm.
1370         * src/common.h (namebuf_t): New typedef.
1371         (namebuf_create, namebuf_free)
1372         (namebuf_name): New prototypes.
1373         (remname): New prototype.
1374         * src/misc.c (struct namebuf): New structure.
1375         (namebuf_create, namebuf_free)
1376         (namebuf_name): New functions.
1377         * src/create.c (dup_dir0): Remove is_avoided_name
1378         checks. This is taken care of in update_archive.
1379         * src/incremen.c (scan_directory): Use namebuf
1380         to produce full file names.
1381         * src/names.c (nametail): Remove extra level of
1382         indirection. All uses updated.
1383         (avoided_name_table, add_avoided_name)
1384         (is_avoided_name): Remove.
1385         * src/update.c (update_archive): Change algorithm.
1386         Instead of adding unmodified files to the avoided_name
1387         table, create namelist so that it contains only
1388         modified files.
1389
1390         * tests/Makefile.am: Add update01.at, update02.at
1391         * tests/testsuite.at: Likewise.
1392         * tests/update.at (AT_KEYWORDS): Add update00.
1393
1394         Minor changes.
1395         * src/tar.c (main): Ignore SIGPIPE.
1396         * src/system.c (sys_child_open_for_compress)
1397         (sys_child_open_for_uncompress): Reset SIGPIPE
1398         in child to default.
1399         * tests/remfiles01.at: Avoid race conditions.
1400         * tests/remfiles02.at: Likewise.
1401
1402         Bugfix.
1403         * src/buffer.c (_open_archive): Call guess_seekable_archive
1404         only if the call to open_compressed_archive succeeded.
1405
1406 2009-10-10  Sergey Poznyakoff  <gray@gnu.org.ua>
1407
1408         Improve previous changes.
1409         * acinclude.m4: Fix typos.
1410         * gnulib.modules: Add xvasprintf.
1411         * src/common.h: Include xvasprintf.h.
1412         * src/tar.c (options): Remove docstrings for --gzip, --bzip2,
1413         --compress, --lzop, --lzma and --xz.
1414         (tar_help_filter): Generate these using actual values of
1415         *_PROGRAM constants.
1416         (format_default_settings): Use xasprintf.
1417         (parse_opt): Use *_PROGRAM defines instead of hardcoded
1418         program names.
1419
1420         Allow installers to specify alternative program names for
1421         compression programs.
1422         This adds --with-gzip, --with-bzip2 etc. switches to the
1423         configure, so that
1424         one can do, e.g. ./configure --with-bzip2=lbzip2 and have
1425         lbzip2 executed
1426         whenever user calls `tar --bzip2'.
1427
1428         * acinclude.m4: New file.
1429         * configure.ac: Add TAR_COMPR_PROGRAM invocations for
1430         the supported compressors.
1431         * src/buffer.c (magic): Use *_COMPRESSOR defines instead
1432         of hardcoded program names.
1433         * src/suffix.c (compression_suffixes): Likewise.
1434
1435 2009-10-09  Sergey Poznyakoff  <gray@gnu.org.ua>
1436
1437         Minor fix.
1438         * src/buffer.c (magic): Fix `xz' entry: add the name of the
1439         program.
1440         * src/suffix.c (compression_suffixes, nsuffixes): Mark as static.
1441
1442 2009-10-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1443
1444         Provide a way to explicitly set mtime for extended header
1445         ustar blocks.
1446         * src/tar.c (struct textual_date): ts is a copy of the structure,
1447         not a pointer to it. Date is a copy as well, hence the `const' is
1448         taken away.
1449         (get_date_or_file): Return 0/1 depending on success/failure.
1450         Copy timestamp to the `ts' member. Store a copy of the string
1451         in `date'.
1452         (report_textual_dates): Report only if verbose_option is set,
1453         but always free the list.
1454         (expand_pax_option): New function.
1455         (parse_opt): Preprocess the argument to xheader_set_option with
1456         expand_pax_option.
1457         (decode_options): Call report_textual_dates unconditionally.
1458         * src/xheader.c (exthdr_mtime_option, exthdr_mtime)
1459         (globexthdr_mtime_option, globexthdr_mtime): New statics.
1460         (xheader_set_keyword_equal): handle exthdr.mtime and
1461         globexthdr.mtime.
1462         (xheader_write): Override `t' argument if a corresponding
1463         exthdr.mtime or globexthdr.mtime option is set.
1464         * NEWS: Update
1465         * doc/tar.texi: Document the changes.
1466
1467         Use file's mtime as mtime for its extended header.
1468         This makes two pax archives binary equivalent if they
1469         have the same contents and care is taken to make extended
1470         headers otherwise reproducible, e.g. by using:
1471
1472           --pax-option=exthdr.name=%d/PaxHeaders/%f,atime:=0
1473
1474         Proposed by Michael D. Adams <mdmkolbe@gmail.com>.
1475
1476         * src/common.h (start_private_header): Take time_t as 3rd param.
1477         (xheader_write): Likewise.
1478         * src/create.c (start_private_header): Take time_t as 3rd param.
1479         All callers updated.
1480         (write_extended): Use file's mtime as mtime for its extended
1481         header,
1482         Use current time stamp as mtime for global headers.
1483         (xheader_write): Take time_t as 3rd param.
1484
1485         Fix bugs in handling the --remove-files option.
1486         Make sure the files are deleted only if they were succesfully
1487         stored
1488         to the archive.
1489
1490         * src/exit.c: New file.
1491         * src/unlink.c: New file.
1492         * src/Makefile.am (tar_SOURCES): Add exit.c and unlink.c.
1493         * src/common.h: Include progname.h
1494         (program_name): Remove global.
1495         (records_written): New extern.
1496         (queue_deferred_unlink, finish_deferred_unlinks): New prototypes.
1497         (fatal_exit_hook): New extern.
1498         * src/create.c (create_archive): Call finish_deferred_unlinks.
1499         (dump_hard_link, dump_file0): Don't actually unlink the file,
1500         queue it to deferred_unlinks instead.
1501         * src/delete.c (records_written): Remove extern: declared in
1502         common.h.
1503         * src/extract.c (extract_archive): Set fatal_exit_hook.
1504         (fatal_exit, xalloc_die): Move to exit.c
1505         * src/system.c (sys_wait_for_child): Exit immediately
1506         if the child dies or exits with a non-zero status.
1507         (sys_child_open_for_compress)
1508         (sys_child_open_for_uncompress): Use set_program_name,
1509         instead of setting program_name directly.
1510         * src/tar.c (main): Use set_program_name,
1511         instead of setting program_name directly.
1512
1513         * tests/Makefile.am (TESTSUITE_AT): Add remfiles01.at
1514         and remfiles02.at.
1515         * tests/testsuite.at: Likewise.
1516         * tests/gzip.at: Reflect the above changes.
1517
1518 2009-10-04  Sergey Poznyakoff  <gray@gnu.org.ua>
1519
1520         Fix bug in OLDGNU format creation.
1521         See tests/append02.at for a detailed description
1522
1523         * src/common.h (MODE_FROM_HEADER): Take additional argument.
1524         (mode_from_header): Likewise.
1525         * src/create.c (mode_to_chars): Store all mode bits if
1526         using OLDGNU_FORMAT. This reverses f4e4adea80a.
1527         * src/list.c (decode_header): Use header mode field
1528         to discern between GNU and OLDGNU formats.
1529         (mode_from_header): Store unrecognized mode bits (from 10th up)
1530         in the location pointed to by the third parameter.
1531         * tests/append02.at: Update documentation and references.
1532
1533 2009-09-16  Sergey Poznyakoff  <gray@gnu.org.ua>
1534
1535         Restore extra help output.
1536         * src/tar.c (tar_list_quoting_styles): Change first argument to
1537         struct obstack.
1538         (format_default_settings): New function.
1539         (show_default_settings)
1540         (show_default_settings_fs): Removed.
1541         (tar_help): Removed.
1542         (tar_help_filter): New function.
1543         (argp): Set help_filter.
1544         (parse_opt): Fix error message.
1545
1546 2009-09-08  Sergey Poznyakoff  <gray@gnu.org.ua>
1547
1548         Improve command line option handling.
1549         * gnulib.modules: Add argp-version-etc and progname,
1550         use getopt-gnu instead of getopt.
1551         * src/tar.c (HANG_OPTION, USAGE_OPTION)
1552         (VERSION_OPTION): Remove.
1553         (options): Remove corresponding options. Let argp
1554         handle them.
1555         (parse_opt): Likewise.
1556         (_argp_hang): Removed.
1557         (tar_authors): New variable.
1558         (decode_options): Call argp_version_setup.
1559         Do not use ARGP_NO_HELP flag in the call to argp_parse.
1560
1561         Avoid overwriting exit_status with a value indicating less
1562         important condition.
1563         * src/tar.c (set_exit_status): New function.
1564         * src/common.h (set_exit_status): New prototype.
1565         * src/compare.c: Use set_exit_status instead of
1566         exit_status assignments.
1567         * src/create.c: Likewise.
1568         * src/misc.c: Likewise.
1569
1570         * src/system.c (wait_for_grandchild): Use auto variable
1571         instead of the global exit_status.
1572         * src/incremen.c (scan_directory): Use file_removed_diag
1573         instead of stat_diag.
1574
1575         Automatic detection of seekable archives.
1576         * src/buffer.c (guess_seekable_archive): New function.
1577         (_open_archive): Call guess_seekable_archive for archives
1578         open for reading.
1579         (new_volume): Likewise.
1580         * src/common.h (seek_option): New global.
1581         * src/tar.c (options): New option --no-seek.
1582         (parse_opt): --seek and --no-seek set seek_option,
1583         not seekable_archive.
1584         (decode_options): Initialize seek_option to -1.
1585
1586         * NEWS: Update.
1587         * doc/tar.texi: Update.
1588
1589 2009-08-27  Sergey Poznyakoff  <gray@gnu.org.ua>
1590
1591         Fix testcases.
1592         * tests/extrac08.at: Ensure a predictable umask value.
1593         * tests/xform-h.at (xform): do not depend on file name
1594         ordering.
1595
1596 2009-08-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1597
1598         Fix interaction between --listed-incremental and -C
1599         * src/incremen.c (read_directory_file): Execute eventual -C dir
1600         after opening the snapshot file.
1601         (collect_and_sort_names): Remove call to chdir_do
1602         * tests/incr05.at, tests/incr06.at: Use relative file names for
1603         snapshot files.
1604
1605 2009-08-12  Sergey Poznyakoff  <gray@gnu.org.ua>
1606
1607         Update for new exclude module from gnulib. Add testcases by
1608         Phil Proudman.
1609         * src/names.c (is_pattern): Remove.
1610         (regex_usage_warning): Use fnmatch_pattern_has_wildcards
1611         instead of
1612         is_pattern.
1613         * src/tar.c: New option --exclude-backups.
1614         (vcs_file_table, backup_file_table): New globals.
1615         (add_exclude_array): New function.
1616         * tests/exclude01.at, tests/exclude02.at,
1617         tests/exclude03.at, tests/exclude04.at,
1618         tests/exclude05.at: New testcases. Supplied by Phil Proudman.
1619         * tests/Makefile.am (TESTSUITE_AT): Add new tests.
1620         * tests/testsuite.at: Add new tests.
1621         * THANKS: Update.
1622
1623 2009-08-10  Sergey Poznyakoff  <gray@gnu.org.ua>
1624
1625         Remove src/version.c (reappeared after migration to Git)
1626
1627 2009-08-09  Sergey Poznyakoff  <gray@gnu.org.ua>
1628
1629         Minor fixes.
1630         * src/misc.c (file_removed_diag): Set exit code to
1631         TAREXIT_DIFFERS.
1632
1633 2009-08-08  Sergey Poznyakoff  <gray@gnu.org.ua>
1634
1635         Minor fixes
1636
1637         Fix handling of files removed during incremental dumps.
1638         Changes to src/create.c and src/incremen.c are partially
1639         based on patch from Alexander Peslyak <solar at openwall.com>.
1640
1641         The new testcases require paxutils commit f653a2b or later.
1642
1643         * src/common.h (struct name): New member `cmdline'.
1644         (dump_file): Change type of the 2nd argument to bool.
1645         (file_removed_diag, dir_removed_diag): New prototypes.
1646         (addname): New argument `cmdline'.
1647         (name_from_list): Change return value.
1648         * src/create.c (dump_dir0, dump_dir): top_level is bool.
1649         (create_archive): Update calls to name_from_list.
1650         Take advantage of the name->cmdline to set top_level argument
1651         during incremental backups.
1652         (dump_file0): top_level is bool.
1653         Do not bail out if a no-top-level file disappears during
1654         incremental
1655         backup, use file_removed_diag instead.
1656         (dump_filed): top_level is bool.
1657         * src/incremen.c (update_parent_directory): Silently ignore
1658         ENOENT.  It should have already been reported elsewhere.
1659         (scan_directory): Use dir_removed_diag to report missing
1660         directories.
1661         * src/misc.c (file_removed_diag, dir_removed_diag): New functions.
1662         * src/names.c (name_gather): Set ->cmdname.
1663         (addname): Likewise. All uses updated.
1664         (name_from_list): Return struct name const *. All uses updated.
1665
1666         * tests/filerem01.at: New testcase.
1667         * tests/filerem02.at: New testcase.
1668         * tests/Makefile.am, tests/testsuite.at: Add filerem01.at,
1669         filerem02.at
1670         * tests/grow.at, test/truncate.at: Use new syntax for genfile
1671         --run.
1672
1673         * NEWS: Update.
1674         * doc/tar.texi: Minor fix.
1675
1676         Optimize searches for directory structures by keeping a pointer
1677         to struct directory in struct name.
1678         * src/common.h (struct name): New member `directory' replaces
1679         dir_contents. Rearrange members.
1680         (rebase_directory): Change signature.
1681         (scan_directory): Change signature.
1682         (name_fill_directory)
1683         (directory_contents, safe_directory_contents): New prototypes.
1684         (append_incremental_renames): Change signature.
1685         (replace_prefix): New proto.
1686         * src/compare.c (diff_dumpdir): Use directory_contents +
1687         scan_directory.
1688         * src/create.c
1689         * src/incremen.c (replace_prefix): Move to misc.c
1690         (rebase_directory): Rewrite.
1691         (scan_directory): Return pointer to struct directory.
1692         (directory_contents, safe_directory_contents): New functions.
1693         (get_directory_contents): Remove.
1694         (name_fill_directory): New function.
1695         (append_incremental_renames): Rewrite. This also fixes a memory
1696         leak.
1697         * src/names.c (name_gather, addname): Reflect changes in struct
1698         name.
1699         (add_hierarchy_to_namelist): Rewrite using name_fill_directory and
1700         directory_contents.
1701         (rebase_child_list): Update call to rebase_directory.
1702         (collect_and_sort_names): Optimize
1703
1704         * src/misc.c (replace_prefix): New function.
1705         * src/names.c (add_hierarchy_to_namelist): Use new
1706         get_directory_contents.
1707
1708         * tests/incr05.at: New test case.
1709         * tests/incr06.at: New test case.
1710         * tests/Makefile.am, test/testsuite.at: Add incr05.at and
1711         incr06.at.
1712
1713         * doc/Makefile.am (check-options): Improve rule.
1714         * doc/tar.texi, NEWS: Update.
1715
1716 2009-08-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1717
1718         Minor fixes.
1719         * src/common.h (rebase_directory): New prototype.
1720         * src/incremen.c (rebase_directory): Use replace_prefix.
1721         * src/names.c (collect_and_sort_names): Abort if
1722         hash_insert fails.
1723
1724         Improve listed incremental dumps.
1725         The modified algorithm tries to avoid dumping the same
1726         directory twice and ensures the order of the directories
1727         in the resulting archive is the same, whatever their order
1728         on the command line.  It also fixes the operation of
1729         --listed-incremental -C.
1730
1731         * gnulib.modules: Add canonicalize
1732         * src/common.h (incremental_level): New global.
1733         (check_exclusion_tags): first argument is const.
1734         (get_directory_contents): Add third argument.
1735         (zap_slashes, normalize_filename): New prototypes.
1736         (chdir_count): New prototype.
1737         (WARN_VERBOSE_WARNINGS): New define.
1738         (WARN_ALL): Exclude WARN_VERBOSE_WARNINGS.
1739         * src/compare.c (diff_dumpdir): Update the call to
1740         get_directory_contents.
1741         * src/create.c (check_exclusion_tags): First argument is const.
1742         Use ISSLASH and DIRECTORY_SEPARATOR instead of referring to '/'.
1743
1744         * src/incremen.c (struct directory): New member `caname'.
1745         (hash_directory_name): Rename to
1746         hash_directory_canonical_name. Operate
1747         on the canonical name.
1748         (compare_directory_names): Rename to
1749         compare_directory_canonical_names.
1750         Operate on the canonical name.
1751         (make_directory): Take two arguments.
1752         (free_directory): Free caname.
1753         (attach_directory): Create caname.
1754         (find_directory): Use caname for lookups.
1755         (PD_VERBOSE): Remove.
1756         (PD_FORCE_INIT): New define.
1757         (procdir): First argument is const.
1758         Reinitialize directory if PD_FORCE_INIT bit is set.
1759         Do not use PD_VERBOSE or verbose_option for issuing warnings.
1760         Rely on WARNOPT instead.
1761         Always set *entry.
1762         (scan_directory): Take three arguments. The third one is a boolean
1763         which is true if the directory is explicitly mentioned on
1764         the command
1765         line.
1766         (get_directory_contents): Remove.  Use scan_directory instead.
1767         All callers updated.
1768         (read_directory_file): Truncate the file if --level=0 is given.
1769         * src/misc.c: Include canonicalize.h
1770         (zap_slashes, normalize_filename): New functions.
1771         (chdir_count): New function.
1772         * src/names.c (add_hierarchy_to_namelist): Take three arguments,
1773         as
1774         get_directory_contents and scan_directory.
1775         (collect_and_sort_names): Allow at most one -C, before file name
1776         arguments.
1777         Read directory file after eventual changing to another directory.
1778         Avoid adding the same directory under different pathnames to
1779         the list.
1780         * src/tar.c: New option --level.
1781
1782         * tests/incr03.at, tests/incr04.at, tests/listed01.at,
1783         tests/listed02.at, tests/rename01.at, tests/rename02.at,
1784         tests/rename03.at: Update for new tar behavior.
1785         * tests/multiv01.at: Do not use --listed-incremental.
1786
1787 2009-08-05  Sergey Poznyakoff  <gray@gnu.org.ua>
1788
1789         Forgotten to push src/warning.c
1790
1791         Implement the --warning option.
1792         * src/warning.c: New file.
1793         * src/Makefile.am: Add warning.c
1794         * src/common.h: Provide definitions for warning classes.
1795         (warning_option): New global.
1796         (WARNOPT): New define.
1797         (set_warning_option): New prototype.
1798         * src/tar.c: New option `--warning'.
1799         * src/compare.c: When applicable WARNOPT instead of WARN.
1800         * src/create.c: Likewise.
1801         * src/extract.c: Likewise.
1802         * src/incremen.c: Likewise.
1803         * src/list.c: Likewise.
1804
1805         * NEWS, doc/tar.texi: Update.
1806
1807 2009-08-05  Carl Worth  <cworth@cworth.org>
1808
1809         Fix descriptions of some options (tiny change)
1810
1811 2009-08-05  Sergey Poznyakoff  <gray@gnu.org.ua>
1812
1813         Fix backup handling and restoring file modes of existing
1814         directories
1815         * NEWS, THANKS: Update
1816         * src/extract.c (extract_dir): reset status to 0 if the
1817         directory already exists.
1818         * src/misc.c (maybe_backup_file): Assign before_backup_name
1819         and clear after_backup_name before checking if we really need
1820         to backup the file.
1821         * tests/backup01.at: New testcase.
1822         * tests/extrac08.at: New testcase.
1823         * tests/Makefile.am, tests/testsuite.at: Add extrac08.at and
1824         backup01.at
1825
1826 2009-07-30  Sergey Poznyakoff  <gray@gnu.org.ua>
1827
1828         Fix hard links recognition with -c --remove-files
1829         * src/create.c (dump_hard_link): Always look up in the link table
1830         if remove_files_option is set. Patch suggested by Theodore Ts'o
1831         <tytso@mit.edu>.
1832         (check_links): Remove extra newline from the warning message.
1833         * tests/link02.at, tests/link03.at: New testcases.
1834         * tests/Makefile.am (TESTSUITE_AT): Add link02.at and link03.at
1835         * tests/testsuite.at: Include link02.at and link03.at
1836
1837         Fix handling of hard link targets by -c --transform
1838         * src/create.c (file_count_links): Transform link target
1839         before the look up.
1840         * tests/xform-h.at: New test case.
1841         * tests/Makefile.am (TESTSUITE_AT): Add xform-h.at.
1842         * tests/testsuite.at: Add xform-h.at
1843
1844 2009-06-23  Sergey Poznyakoff  <gray@gnu.org.ua>
1845
1846         Minor fix.
1847         * src/extract.c (file_newer_p): Do not report error on ENOENT
1848
1849 2009-06-19  Sergey Poznyakoff  <gray@gnu.org.ua>
1850
1851         Remove rebox.el (reappeared after migration to Git)
1852
1853 2009-06-18  Sergey Poznyakoff  <gray@gnu.org.ua>
1854
1855         Remove files that were removed in CVS, but reappeared after
1856         migration to Git
1857
1858 2009-06-18  David Bartley  <dtbartle@csclub.uwaterloo.ca>
1859
1860         Fix Solaris bug where chmod fails if we don't have
1861         PRIV_SYS_LINKDIR
1862         * gnulib.modules: Add priv-set.
1863         * src/extract.c (set_mode, extract_archive): Restore
1864         PRIV_SYS_LINKDIR on chmod failure.
1865         * src/tar.c (main): Drop PRIV_SYS_LINKDIR on startup.
1866
1867 2009-06-18  Sergey Poznyakoff  <gray@gnu.org.ua>
1868
1869         Ensure default behavior for SIGPIPE
1870         * src/tar.c (main): Install default handler for SIGPIPE.
1871         Proposed by Bastian Blank.
1872
1873 2009-06-18  Eric Blake  <ebb9@byu.net>
1874
1875         Follow autoconf recommendation for TESTSUITEFLAGS.
1876         * tests/Makefile.am (check-local, installcheck-local): Honor
1877         TESTSUITEFLAGS.
1878
1879 2009-06-18  Sergey Poznyakoff  <gray@gnu.org.ua>
1880
1881         Fix handling of sub-subprocess returns.
1882         * src/system.c (wait_for_grandchild): New function.
1883         (sys_child_open_for_compress)
1884         (sys_child_open_for_uncompress): Use wait_for_grandchild
1885         to manage grandchild return.
1886
1887 2009-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1888
1889         Report record size only if the archive refers to a device.
1890         * Makefile.am (INCLUDES): Add ../lib, for rmt-command.h
1891         * src/buffer.c (short_read): Report the actual record size
1892         only if the archive descriptor refers to a device.
1893         * tests/pipe.at, tests/shortrec.at,
1894         tests/sparsemvp.at: Reflect the above change.
1895         * NEWS, configure.ac: Version 1.22.90
1896
1897 2009-05-14  Sergey Poznyakoff  <gray@gnu.org.ua>
1898
1899         Do not issue errors on existing files when given the -k option
1900         * Makefile.am (dist-hook): Fix rule.
1901         * src/extract.c (maybe_recoverable): Return three-state value.
1902         (extract_dir): Skip extraction if maybe_recoverable indicates so.
1903         (extract_file): Likewise.
1904
1905 2009-05-12  Eric Blake  <ebb9@byu.net>
1906
1907         Avoid undefined behavior
1908         * src/xheader.c (xheader_set_keyword_equal): Pass correct type to
1909         ctype macros.
1910         * src/transform.c (run_case_conv): Likewise.
1911
1912 2009-05-12  Sergey Poznyakoff  <gray@gnu.org.ua>
1913
1914         Remove src/Makefile.in
1915
1916 2009-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>
1917
1918         Bugfixes.
1919         * bootstrap (symlink_to_dir): Fix symlink calculation.
1920         * doc/tar.texi: Minor fixes by Victor Villa and Stepan Kasal.
1921
1922 2009-03-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1923
1924         Remove Makefile.in
1925
1926         Migrate to Git
1927
1928 2009-03-05  Sergey Poznyakoff  <gray@gnu.org.ua>
1929
1930         * src/incremen.c: --no-recursive works with --incremental.
1931
1932 2009-03-04  Sergey Poznyakoff  <gray@gnu.org.ua>
1933
1934         Add xz support.
1935
1936         * src/buffer.c, src/suffix.c: Add support for xz compression.
1937         * src/tar.c: New option --xz, for compression/decompression using xz.
1938         Re-assign -J as a short equivalent of --xz.
1939
1940 2009-01-19  Sergey Poznyakoff  <gray@gnu.org.ua>
1941
1942         * doc/tar.texi: Fix typo.
1943
1944 2008-12-29  Sergey Poznyakoff  <gray@gnu.org.ua>
1945
1946         * bootstrap.conf: Include size_max.
1947         * gnulib.modules: Remove memset, rmdir. Replace strdup with
1948         strdup-posix. Patch by Eric Blake.
1949         * src/tar.c: Implement -I as a shorthand for --use-compress-program.
1950         * doc/tar.texi: Document -I.
1951         * tests/pipe.at, tests/shortrec.at: Account for eventual 'Record
1952         size' output.
1953         * tests/testsuite.at (AT_TAR_CHECK_HOOK): New define
1954         (AT_TAR_WITH_HOOK, TAR_IGNREC_HOOK): New macros.
1955
1956 2008-11-30  Sergey Poznyakoff  <gray@gnu.org.ua>
1957
1958         * src/xheader.c: Remove duplicate inclusion of fnmatch.h. Reported
1959         by Jim Meyering.
1960
1961 2008-11-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1962
1963         Do not try to drain the input pipe before closing the
1964         archive.
1965
1966         * src/buffer.c (close_archive): Remove call to
1967         sys_drain_input_pipe. Pass hit_eof as the second
1968         argument to sys_wait_for_child.
1969         * src/common.h (sys_drain_input_pipe): Remove
1970         (sys_wait_for_child): Declare second argument.
1971         * src/system.c (sys_drain_input_pipe): Remove.
1972         (sys_wait_for_child): Take two arguments. The second one helps to
1973         decide whether to tolerate child termination on SIGPIPE.
1974
1975 2008-11-03  Sergey Poznyakoff  <gray@gnu.org.ua>
1976
1977         * src/buffer.c (_write_volume_label): Fix typo, which prevented
1978         `-V label -M' from working.
1979
1980 2008-10-30  Sergey Poznyakoff  <gray@gnu.org.ua>
1981
1982         * NEWS, configure.ac: Version 1.20.91
1983         * doc/tar.texi: Document transformation scope flags.
1984         * src/common.h (transform_symlinks_option): Remove in favor of
1985         transformation scope flags.
1986         (XFORM_REGFILE, XFORM_LINK, XFORM_SYMLINK, XFORM_ALL): New macros.
1987         (transform_name, transform_member_name, transform_name_fp): Take
1988         an additional argument, specifying scope flags.
1989         * src/create.c: Reflect changes to transform_name.
1990         * src/extract.c (extract_link, extract_symlink): Remove calls to
1991         transform_member_name. It is done in read_header.
1992         * src/list.c (decode_xform): Reflect change in data type of 2nd
1993         argument.
1994         (transform_member_name): 2nd arg is int.
1995         (decode_header): Transform file name and link target names.
1996         * src/tar.c: Remove --transform-symlinks.
1997         * src/transform.c (struct transform): New member `flags'.
1998         (transform_flags): New variable.
1999         (parse_transform_expr): Parse transformation scope flags. Allow to
2000         set global flags using `flags=' syntax.
2001         (_transform_name_to_obstack, transform_name_fp)
2002         (transform_name): Take an additional argument, specifying scope
2003         flags.
2004
2005 2008-10-19  Sergey Poznyakoff  <gray@gnu.org.ua>
2006
2007         * THANKS: Add Ed Leaver.
2008         * src/buffer.c (short_read): Remove !read_full_records condition,
2009         which was always false on a first record and thus disabled record
2010         size autodetection.  Thanks Ed Leaver for the patch.
2011         (_gnu_flush_read): Handle blocking_factor == 1.
2012         * tests/sparsemv.at: Reflect changes to buffer.c.
2013         * tests/sparsemvp.at: Likewise.
2014         * tests/volsize.at: Likewise.
2015         * NEWS: Update.
2016
2017 2008-10-16  Sergey Poznyakoff  <gray@gnu.org.ua>
2018
2019         * src/common.h (transform_symlinks_option): New global.
2020         * src/create.c (dump_file0): Transform symlink targets only if
2021         explicitly required.  Thanks Cyril Strejc for reporting the
2022         problem.
2023         * src/tar.c (parse_opt): New options --transform-symlinks and
2024         --no-transform-symlinks. New alias --xform to the --transform
2025         option.
2026         * doc/tar.texi: Document --transform-symlinks
2027         * NEWS: Update.
2028         * THANKS: Update.
2029
2030         * src/names.c (name_gather): Use xzalloc.
2031         * src/buffer.c (short_read): Move record size detection before
2032         the loop.
2033
2034 2008-10-07  Sergey Poznyakoff  <gray@gnu.org.ua>
2035
2036         * src/tar.c (options): Add --lzop option.
2037
2038 2008-10-05  Xavier Hienne <xavier.hienne@free.fr> (tiny change)
2039
2040         * src/checkpoint.c (checkpoint_compile_action): Add missing
2041         `else'.
2042
2043 2008-09-24  Sergey Poznyakoff  <gray@gnu.org.ua>
2044
2045         * NEWS: Update.
2046         * doc/tar.texi: Update.
2047         * src/tar.c: New option --no-null.
2048
2049 2008-09-23  Sergey Poznyakoff  <gray@gnu.org.ua>
2050
2051         * src/common.h (filename_terminator): Remove global.
2052         * src/tar.c (filename_terminator): New static.
2053         * src/names.c (name_next_elt): Do not depend on
2054         filename_terminator, this was a leftover from 1.13.
2055
2056 2008-09-18  Sergey Poznyakoff  <gray@gnu.org.ua>
2057
2058         * doc/tar.texi: Remove incorrect example.
2059
2060 2008-09-07  Sergey Poznyakoff  <gray@gnu.org.ua>
2061
2062         * src/incremen.c (dumpdir_create0): Eliminate gcc warning.
2063         (attach_directory): Bugfix - add missing return statement.
2064         * THANKS: Add Enric Hernandez
2065
2066 2008-07-31  Sergey Poznyakoff  <gray@gnu.org.ua>
2067
2068         * src/incremen.c (struct directory): New member `next'.  Change
2069         type of `name'.
2070         (dirhead, dirtail): New statics.
2071         (make_directory): Reflect changes to struct directory.
2072         (free_directory, attach_directory): New functions.
2073         (dirlist_replace_prefix): New function.
2074         (note_directory): Use attach_directory, instead of make_directory,
2075         (find_directory, find_directory_meta): Use free_directory.
2076         (procdir): Replace directory prefixes in directory list to avoid
2077         marking subdirectories as renamed after renaming their parent
2078         directory.
2079         (append_incremental_renames): Iterate over directory list, not
2080         hash table, to preserve logical ordering of renames.
2081         * tests/rename04.at, tests/rename05.at: New test cases.
2082         * tests/Makefile.am, tests/testsuite.at: Add rename04.at and
2083         rename05.at.
2084         * tests/atlocal.in (decho): New function.
2085         * tests/multiv06.at: Use decho instead of echo2.
2086         * tests/incremental.at: Raise wait interval to 2 seconds.
2087
2088 2008-07-24  Sergey Poznyakoff  <gray@gnu.org.ua>
2089
2090         * src/tar.c (decode_options): Do not allow volume length less
2091         than record size.
2092         * src/buffer.c (_gnu_flush_write): Compensate for the effect
2093         of eventual flush_archive occurring in the middle of buffer
2094         move.
2095         Increment records_written only if _flush_write was able to write
2096         something.
2097         * tests/multiv06.at: New testcase.
2098         * tests/Makefile.am, test/testsuite.at: Add tests/multiv06.at
2099
2100 2008-06-26  Sergey Poznyakoff  <gray@gnu.org.ua>
2101
2102         * configure.ac, NEWS: Version 1.20.90
2103         * doc/tar.texi: Document -J, --no-auto-compress, etc.
2104         * src/buffer.c (ct_tar): New constant.
2105         (magic): Add lzop support.  Proposed by Kevin Day
2106         <thekevinday@gmail.com>.
2107         (check_compressed_archive): Do not use autodetect if the
2108         compression program was specified explicitly.
2109         Fall back to analyzing archive name, if the autodetection fails.
2110         * src/suffix.c: Add .lzo
2111         * src/tar.c: New options --lzop and --no-auto-compress.
2112         New short option -J (alias for --lzma).
2113
2114         * src/buffer.c (try_new_volume): Print more information with error
2115         diagnostics.
2116         (_gnu_flush_write): Improve error checking.  Adjust
2117         real_s_sizeleft before calling new_volume to avoid creating
2118         malformed multivolume headers.
2119         * tests/delete05.at, tests/gzip.at, tests/ignfail.at,
2120         tests/longv7.at, tests/lustar01.at, tests/lustar02.at,
2121         tests/shortfile.at: Update to match new diagnostic wording
2122         (see 2008-05-06).
2123
2124         * NEWS: Update.
2125
2126 2008-06-14  Sergey Poznyakoff  <gray@gnu.org.ua>
2127
2128         * doc/tar.texi (exclude): Document support for new VCS.
2129         * THANKS: Update.
2130         * NEWS: Update.
2131         * tests/multiv05.at: Fix typos.
2132         * tests/volsize.at: Remove a TZ dependency.
2133
2134 2008-06-14  Dan Drake <dan@dandrake.org> (tiny change)
2135
2136         * src/tar.c (exclude_vcs_files): Support for Bazaar, Mercurial and
2137         Darcs.
2138
2139 2008-05-06  Sergey Poznyakoff  <gray@gnu.org.ua>
2140
2141         * src/tar.c (main): Reword the "delayed error" message. New
2142         wording proposed by Karl Berry.
2143
2144 2008-02-20  Sergey Poznyakoff  <gray@gnu.org.ua>
2145
2146         * configure.ac: Raise version number to 1.20
2147         * src/compare.c (diff_dumpdir): const.
2148         * src/common.h (dumpdir_t,dumpdir_iter_t): New data types.
2149         (dumpdir_create0,dumpdir_create,dumpdir_free,dumpdir_locate)
2150         (dumpdir_first,dumpdir_next): New functions.
2151         * src/incremen.c (dumpdir_create0,dumpdir_create,dumpdir_free)
2152         (dumpdir_first,dumpdir_next): New functions.
2153         (dumpdir_locate): Rewrite using binary search.
2154         (struct directory): Change members char *contents, *icontents to
2155         struct dumpdir *dump, *idump. All references updated.
2156         (note_directory): Last arg is const.
2157         * src/names.c (add_hierarchy_to_namelist): buffer is const.
2158         * tests/incr03.at, tests/incr04.at, tests/rename02.at,
2159         tests/rename03.at: Insert calls to sleep between creation of files
2160         and adding them to the archive.
2161
2162 2008-03-31  Sergey Poznyakoff  <gray@gnu.org.ua>
2163
2164         * src/create.c (dump_file0): Count links only for actually dumped
2165         files.
2166
2167 2008-03-27  Sergey Poznyakoff  <gray@gnu.org.ua>
2168
2169         * NEWS: Document --no-check-device and --check-device.
2170         * doc/rendition.texi: Change the way FIXME-*refs are handled in
2171         !PROOF.
2172         * doc/intern.texi, doc/tar.texi: Update.
2173         * doc/untabify.el: New file.
2174         * doc/Makefile.am (EXTRA_DIST): Add untabify.el
2175         (untabify, final, check-format, check-refs, check-fixmes)
2176         (check-unrevised, all-check-docs, check-docs): New rules.
2177
2178         * src/common.h (check_device_option): New global.
2179         * src/incremen.c (procdir): Use boolean and instead of bitwise
2180         one. Patch by Jean-Louis Martineau.
2181         Compare device numbers only if check_device_option is set.
2182         * src/tar.c: New command line options --no-check-device and
2183         --check-device. Proposed by Jean-Louis Martineau.
2184         (parse_opt): Hanlde new options.
2185         (decode_options): Initialize check_device_option to true.
2186
2187         * THANKS: Update
2188
2189 2008-03-06  Sergey Poznyakoff  <gray@gnu.org.ua>
2190
2191         * bootstrap: Use rsync to get translations.
2192         * doc/tar.texi: Minor change.
2193         * lib/.cvsignore: Update
2194         * po/.cvsignore: Update
2195         * src/system.c: Remove include setenv.h.
2196         * tests/atlocal.in (STAR_DATA_URL): Update.
2197         * tests/star/README: Update URL.
2198
2199 2008-02-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2200
2201         * doc/tar.texi: Fix a typo. Reported by Denis Excoffier.
2202
2203 2008-02-08  Sergey Poznyakoff  <gray@gnu.org.ua>
2204
2205         * NEWS: Update.
2206         * configure.ac: Version 1.19.90
2207         * po/POTFILES.in: Add missing files.
2208         * src/compare.c (verify_volume): Honor --ignore-zeros.
2209         Proposed by Jan-Benedict Glaw.
2210         * tests/shortfile.at (AT_KEYWORDS): Add shortfile0.
2211
2212 2008-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
2213
2214         * NEWS: Update.
2215         * src/create.c (dump_file0): Apply transform_name to symlink
2216         targets.
2217
2218 2008-02-04  Sergey Poznyakoff  <gray@gnu.org.ua>
2219
2220         * src/transform.c: Support multiple --transform options. Support
2221         semicolon-separated lists of replace expressions.
2222         * NEWS, tar.texi: Document changes to the --transform option.
2223
2224 2008-01-30  Paul Eggert  <eggert@cs.ucla.edu>
2225
2226         * doc/tar.texi: Update Back-Cover text to reflect new GNU wording.
2227
2228 2007-12-17  Paul Eggert  <eggert@cs.ucla.edu>
2229
2230         Exit with nonzero status if a close fails on an archive.
2231         Problem (and initial trivial fix)
2232         * src/buffer.c (close_archive, new_volume): close_error, not
2233         close_warn.
2234
2235 2007-12-05  Sergey Poznyakoff  <gray@gnu.org.ua>
2236
2237         * src/buffer.c (check_compressed_archive): Do not bail out if the
2238         file is too short, set boolean flag, passed as an argument
2239         instead.  This fixes a bug introduced on 2007-08-24. See also
2240         tests/shortupd.at.
2241
2242         * tests/Makefile.am, tests/testsuite.at: Add shortupd.at.
2243         * tests/shortupd.at: New test.
2244
2245 2007-11-12  Jim Meyering  <meyering@redhat.com>
2246
2247         Don't read from name[-1].
2248         * src/incremen.c (make_directory): Handle namelen == 0, since
2249         find_directory_meta calls make_directory ("").
2250
2251 2007-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>
2252
2253         * bootstrap (checkout): Use URL of the gnulib CVS mirror.
2254         * gnulib.modules: Add fseeko and snprintf.
2255
2256 2007-10-31  Sergey Poznyakoff  <gray@gnu.org.ua>
2257
2258         * src/checkpoint.c: New actions: bell and ttyout
2259         * src/system.c (sys_exec_info_script)
2260         (sys_exec_checkpoint_script): pass the current blocking factor in
2261         TAR_BLOCKING_FACTOR environment variable.
2262         * doc/tar.texi: Update
2263         * NEWS: Update
2264
2265 2007-10-30  Sergey Poznyakoff  <gray@gnu.org.ua>
2266
2267         * doc/Makefile.am: Use texi2html and the CVS version of gendocs.sh
2268         to create HTML versions of the manual.
2269         * doc/gendocs_template: Likewise.
2270         * doc/tar.texi: Document --hard-dereference and
2271         --checkpoint-action options. Improve documentation of
2272         --check-links.
2273
2274 2007-10-29  Sergey Poznyakoff  <gray@gnu.org.ua>
2275
2276         * NEWS: Update
2277         * configure.ac: Version 1.19.1
2278         * po/POTFILES.in: Add src/checkpoint.c
2279         * src/Makefile.am (tar_SOURCES): add checkpoint.c
2280         * src/checkpoint.c: New file - checkpoint handling.
2281         * src/buffer.c (checkpoint, do_checkpoint): Remove.
2282         (_flush_write, simple_flush_read, _gnu_flush_read): Use
2283         checkpoint_run.
2284         * src/common.h (enum checkpoint_style): Remove.
2285         (checkpoint_style): Remove.
2286         (DEFAULT_CHECKPOINT): New define.
2287         (hard_dereference_option): New variable.
2288         (sys_exec_checkpoint_script): New declaration.
2289         * src/create.c (file_count_links): do nothing if
2290         hard_dereference_option is set.
2291         * src/system.c (sys_exec_checkpoint_script): New function.
2292         (sys_exec_info_script): Restore SIGPIPE handler.
2293         * src/tar.c: (parse_opt): New options --hard-dereference,
2294         --checkpoint-action.
2295         (decode_options): Call checkpoint_finish_compile.
2296
2297         * src/system.c (sys_exec_info_script): Initialize buf. Problem
2298         reported by Bengt-Arne Fjellner.
2299
2300 2007-10-18  Jim Meyering  <jim@meyering.net>
2301
2302         Avoid compiler warnings.
2303         * src/list.c (read_header_primitive): Define two locals, to
2304         avoid incorrect "may be used uninitialized" warnings.
2305         * src/incremen.c (procdir): Remove decl of unused local, "len".
2306
2307 2007-10-18  Sergey Poznyakoff  <gray@gnu.org.ua>
2308
2309         * doc/tar.texi (gzip): Remove compression patent
2310         warning. According to Brett Smith, the patent is
2311         expired.
2312
2313 2007-10-17  Sergey Poznyakoff  <gray@gnu.org.ua>
2314
2315         * src/suffix.c: New file. Compress format detection by archive
2316         suffix (when creating). Suggested by Jean-Pierre Demailly.
2317         * src/Makefile.am: Add suffix.c
2318         * src/buffer.c (magic): Add an entry for new lzma format. Proposed
2319         by Lasse Collin.
2320         * src/common.h (set_comression_program_by_suffix): New prototype.
2321         * src/tar.c: New options --auto-compress (-a) and --lzma
2322         * THANKS: Add Lasse Collin and Jean-Pierre Demailly.
2323         * NEWS: Update
2324         * doc/tar.texi: Update
2325
2326 2007-10-12  Paul Eggert  <eggert@cs.ucla.edu>
2327
2328         * src/utf8.c (string_ascii_p): Recode to avoid bogus GCC 4.2.1
2329         warning about "comparison is always true due to limited range of
2330         data type" when char is unsigned.
2331
2332 2007-10-11  Paul Eggert  <eggert@cs.ucla.edu>
2333
2334         Adjust to recent gnulib changes.
2335         * configure.ac: Dont' check for strerror, since gnulib now does this.
2336         * .cvsignore: Add m4, tar-[0-9]*.
2337         * lib/.cvsignore: Adjust to various gnulib file name changes.
2338         Add .deps, rmt-command.h.
2339
2340 2007-10-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2341
2342         * configure.ac, NEWS: Raise version number to 1.19
2343         * tests/star/README: Update
2344
2345 2007-10-05  Sergey Poznyakoff  <gray@gnu.org.ua>
2346
2347         * src/create.c (dump_regular_file): Fix file padding in case of
2348         truncation to zero size.
2349         * NEWS: Update
2350
2351 2007-10-04  Sergey Poznyakoff  <gray@gnu.org.ua>
2352
2353         * tests/T-null.at: Use AT_DATA for sample output.
2354
2355 2007-10-03  Sergey Poznyakoff  <gray@gnu.org.ua>
2356
2357         * src/incremen.c (try_purge_directory): Ensure that arguments to T
2358         and R are safe.
2359
2360 2007-09-29  Sergey Poznyakoff  <gray@gnu.org.ua>
2361
2362         * src/incremen.c (obstack_code_rename): Apply safer_name_suffix to
2363         name arguments before storing them in T and R records. Reported by
2364         Nicholas Cole.
2365
2366 2007-09-27  Sergey Poznyakoff  <gray@gnu.org.ua>
2367
2368         * configure.ac: Raise version number to 1.18.90
2369         * NEWS: Likewise
2370
2371         * doc/snapshot.texi: Document version 2.
2372         * doc/dumpdir.texi: Update.
2373
2374         Implement --exclude-tag* and --exclude-cache* options for listed
2375         incremental archives.
2376         New option --exclude-vcs to exclude VCS-specific files and
2377         directories.
2378
2379         * NEWS: Update
2380         * doc/tar.texi: Document --exclude-vcs option
2381         * src/common.h (exclusion_tag_warning, check_exclusion_tags): New
2382         prototypes.
2383         * src/create.c (exclusion_tag_warning, check_exclusion_tags):
2384         Remove static qualifier.
2385         (check_exclusion_tags): account for dirname without terminating
2386         slash.
2387         (dump_dir0): exclusion_tag_all is handled elsewhere.
2388         * src/incremen.c (struct directory): New member tagfile
2389         (make_directory): Initialize tagfile to NULL
2390         (procdir): New argument: entry
2391         Hanlde exclusion tags.
2392         (makedumpdir): Take into account directory->tagfile.
2393         (scan_directory): Hanlde exclusion tags.
2394         * src/tar.c: New option --exclude-vcs
2395         (exclude_vcs_files): New function
2396
2397 2007-09-14  Paul Eggert  <eggert@cs.ucla.edu>
2398
2399         * AUTHORS: Remove unnecessary information.  Just list the
2400         principal authors.
2401         * THANKS: Remove info duplicated from AUTHORS.
2402
2403 2007-08-25  Jim Meyering  <jim@meyering.net>
2404
2405         Don't include <getline.h>.  No longer needed.
2406         * src/incremen.c: Don't include <getline.h>.  No longer needed.
2407         * src/buffer.c: Likewise.
2408         * src/system.c: Likewise.
2409         * src/tar.c: Likewise.
2410
2411         Avoid shadowing and unused-variable warnings.
2412         * src/create.c (check_exclusion_tags): Remove declaration of unused
2413         local, "ret".
2414         * src/compare.c (diff_dumpdir): Rename stat->stat_data to avoid
2415         shadowing the syscall.
2416         * src/buffer.c (do_checkpoint): Don't shadow the write syscall.
2417         (try_new_volume): Avoid shadowing "access".
2418         * src/tar.c (decode_options): Rename index->idx to avoid shadowing.
2419         (find_argp_option): Rename option->o to avoid shadowing.
2420         * src/incremen.c (scan_directory): Rename local, dir_name->dir,
2421         to avoid shadowing the function.
2422         (get_directory_contents): Likewise.
2423         * src/system.c (global_pid): Rename from "pid", to avoid being
2424         shadowed by locals.
2425         * src/extract.c (apply_nonancestor_delayed_set_stat):
2426         Rename st->sb to avoid shadowing another local.
2427
2428 2007-08-24  Sergey Poznyakoff  <gray@gnu.org.ua>
2429
2430         * configure.ac, NEWS: Raise version number to 1.18.1
2431
2432         * src/buffer.c (check_compressed_archive): Detect files smaller
2433         than 512 bytes.
2434         * tests/shortfile.at: New test case for the above change.
2435         * tests/testsuite.at, tests/Makefile.am: Add shortfile.at
2436
2437 2007-08-19  Sergey Poznyakoff  <gray@gnu.org.ua>
2438
2439         * bootstrap: Gnulib initialization destroyed paxutils m4 files.
2440         Initialize paxutils structure after that of gnulib.
2441
2442 2007-08-12  Sergey Poznyakoff  <gray@gnu.org.ua>
2443
2444         * src/names.c (contains_dot_dot): Fix double-dot recognition in
2445         case of duplicate /. Patch by Dmitry V. Levin.
2446
2447         * bootstrap (symlink_to_gnulib): Make sure the target directory
2448         exists and create it if it does not.
2449
2450         * doc/tar.texi: Fix a typo.
2451
2452 2007-06-28  Sergey Poznyakoff  <gray@gnu.org.ua>
2453
2454         * bootstrap: Update for the change of the TP URL
2455
2456 2007-06-27  Sergey Poznyakoff  <gray@gnu.org.ua>
2457
2458         Relicense under GPLv3
2459
2460 2007-06-21  Sergey Poznyakoff  <gray@gnu.org.ua>
2461
2462         * tests/testsuite.at (AT_TAR_MKHIER): Skip test if genfile is
2463         unable to create the file
2464         * tests/lustar01.at: Likewise
2465
2466 2007-06-21  Eric Blake  <ebb9@byu.net>
2467
2468         Resolve testsuite failures 40-42 on cygwin.
2469         * tests/testsuite.at (AT_TAR_MKHIER): Skip tests when long
2470         file names cannot be created.
2471
2472 2007-06-16  Sergey Poznyakoff  <gray@gnu.org.ua>
2473
2474         * doc/Makefile.am (tar_TEXINFOS): Add tar-snapshot-edit.texi
2475         * doc/tar-snapshot-edit.texi: New file
2476         * doc/tar.texi (Fixing Snapshot Files): New appendix
2477
2478         * scripts/tar-snapshot-edit: New file
2479         * tests/extrac07.at: Add back write permissions on dir
2480
2481 2007-06-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2482
2483         * tests/exclude.at: Sort the output.
2484
2485 2007-06-08  Sergey Poznyakoff  <gray@gnu.org.ua>
2486
2487         * configure.ac, NEWS: Raise version number to 1.17
2488
2489         * doc/tar.texi, doc/intern.texi: Replace: s/filename/file name/;
2490         s/(ASCII|ID|BSD)/@acronym{&}/;s/"[^"]+"/``&''/
2491         Use `path' only when it refers to search paths, use
2492         `file name' otherwise.
2493         Fix various errors (based on patch by Benno Schulenberg)
2494
2495         * doc/tar.texi (Operation Summary): Restore alphabetical order of
2496         the options.
2497
2498 2007-06-02  Sergey Poznyakoff  <gray@gnu.org.ua>
2499
2500         Fix bug, introduced on 2007-03-30.
2501
2502         * src/common.h (xform_type): New data type
2503         (transform_member_name): Last argument is of xform_type type
2504         All callers updated
2505
2506         * src/extract.c: Update calls to transform_member_name
2507         * src/list.c (decode_xform): Exempt symbolic links from component
2508         stripping and name suffix normalization.
2509
2510         * tests/extrac07.at: Update
2511
2512 2007-05-30  Sergey Poznyakoff  <gray@gnu.org.ua>
2513
2514         * src/xheader.c (decx): Unknown pax keywords produce a warning,
2515         not error.
2516
2517 2007-05-29  Paul Eggert  <eggert@cs.ucla.edu>
2518
2519         * src/misc.c (set_file_atime): Use gl_futimens, not futimens,
2520         due to gnulib change.
2521
2522 2007-05-19  Sergey Poznyakoff  <gray@gnu.org.ua>
2523
2524         * src/common.h (buffer_write_global_xheader): New function
2525         (struct xheader): Move definition to tar.h
2526         (extended_header): Remove global
2527         (xheader_init): New function
2528         (xheader_decode_global,xheader_store,xheader_read)
2529         (xheader_write_global,xheader_write,xheader_string_begin)
2530         (xheader_string_add,xheader_string_end): Take xhdr as first
2531         argument.
2532         * src/tar.h (struct xheader): New definition
2533         (struct tar_stat_info): New member xhdr (extended header).
2534
2535         * src/xheader.c (xheader_init): New function
2536         (xheader_decode_global,xheader_store,xheader_read)
2537         (xheader_write_global,xheader_write,xheader_string_begin)
2538         (xheader_string_add,xheader_string_end): Take xhdr as first
2539         argument.
2540
2541         * src/buffer.c (buffer_write_global_xheader): New function
2542         Update to use new xheader calls.
2543
2544         * src/compare.c, src/create.c, src/delete.c, src/list.c,
2545         src/sparse.c, src/tar.c, src/update.c: Global extended_header
2546         removed, use new xheader calls instead.
2547
2548         * tests/T-null.at: Minor fix
2549         * tests/atlocal.in (tarball_prereq): Discard eventual md5sum
2550         output.
2551
2552 2007-05-18  Sergey Poznyakoff  <gray@gnu.org.ua>
2553
2554         * src/create.c (dump_file0): Original ctime cannot be used as a
2555         directory change indicator if --remove-files is given.
2556
2557 2007-04-12  Paul Eggert  <eggert@cs.ucla.edu>
2558
2559         Adjust to latest Gnulib.
2560         * lib/.cvsignore: Add dirfd.c, dirfd.h, float+.h, mbscasecmp.c,
2561         stdio.h, stdio_.h, stdlib.h, stdlib_.h, time.h, time_.h, unistd.h.
2562         Remove exit.h, getcwd.h, mempcpy.h, memrchr.h, mkdtemp.h, stpcpy.h,
2563         strcase.h, strchrnul.h, strdup.h, strndup.h, strnlen.h, time_r.h,
2564         vsnprintf.h.
2565         * m4/.cvsignore: Remove localedir.h.  Sort.
2566
2567 2007-04-03  Paul Eggert  <eggert@cs.ucla.edu>
2568
2569         * src/common.h (closeopen): Remove decl.
2570         * src/misc.c: Don't include <sys/time.h>, <sys/resource.h>; no longer
2571         needed.
2572         (get_max_open_files, closeopen): Remove.  All callers removed.
2573         (chdir_dir): Use a different technique, which doesn't rely on closing
2574         all open files.
2575         * src/tar.c (main): Don't call closeopen.
2576
2577 2007-04-04  Sergey Poznyakoff  <gray@gnu.org.ua>
2578
2579         * NEWS: Update
2580         * doc/tar.texi: Update
2581         * src/system.c (sys_exec_info_script): Store the
2582         inter-communication fd in the environment variable TAR_FD
2583
2584 2007-04-03  Sergey Poznyakoff  <gray@gnu.org.ua>
2585
2586         * src/tar.c (main): Move closeopen after decode_options to
2587         allow shell process substitution to work.
2588         * tests/extrac07.at: Expect a warning on stderr.
2589
2590 2007-03-30  Sergey Poznyakoff  <gray@gnu.org.ua>
2591
2592         * src/common.h (transform_name_fp): Change signature
2593         (transform_member_name): New function
2594         * src/extract.c (extract_link, extract_symlink): Use
2595         transform_member_name instead of safer_name_suffix so that
2596         --transform and --strip-components affect links as well.
2597         * src/list.c (transform_member_name): New function
2598         (decode_header): Use transform_member_name
2599         * src/names.c (all_names_found): Remove check for matching_flags.
2600         * NEWS: Update
2601
2602         * TODO: Update
2603         * bootstrap (slurp): Remove any occurrences of $bt from the
2604         generated gnulib.mk
2605         * src/incremen.c: Do not include mkdtemp.h
2606
2607 2007-01-26  Paul Eggert  <eggert@cs.ucla.edu>
2608
2609         Adjust to recent gnulib changes.
2610         * lib/.cvsignore: Add fchownat.c, rmt-command.h, strerror.c, string.h,
2611         string_.h, sys, sys_time_.h, unistd_.h, wchar_.h, wctype_.h.
2612         Remove localedir.h, size_max.h, xsize.h.
2613         * src/xheader.c: Don't include stpcpy.h; no longer needed, now that
2614         gnulib string.h defines stpcpy on all platforms.
2615
2616 2007-01-23  Sergey Poznyakoff  <gray@gnu.org.ua>
2617
2618         * doc/tar.texi: Document --exclude-caches* and --exclude-tag*
2619         options.
2620         * src/common.h (exclude_caches_option): Remove
2621         (enum exclusion_tag_type): New data type
2622         (add_exclude_tag): Rename to add_exclusion_tag
2623         (cachedir_file_p): New prototype
2624         * src/create.c (struct exclude_tag): rename to exclusion_tag
2625         (check_exclusion_tags): New function
2626         (cachedir_file_p): New function (from check_cache_directory)
2627         (dump_dir0,dump_file0): Use check_exclusion_tags
2628         * src/tar.c: New options --exclude-caches-all,
2629         --exclude-caches-under, --exclude-tag-all, --exclude-tag-under
2630         * tests/exclude.at: New file
2631         * tests/Makefile.am (TESTSUITE_AT): Add exclude.at
2632         * tests/testsuite.at: Add exclude.at
2633
2634 2007-01-19  Sergey Poznyakoff  <gray@gnu.org.ua>
2635
2636         * gnulib.modules: Require strerror
2637         * doc/gendocs_template: Fix typos
2638         * scripts/xsparse.c (expand_sparse): use ftruncate to handle the
2639         trailing hole
2640         * src/sparse.c (sparse_skip_file,pax_dump_header_1)
2641         (pax_decode_header): Keep track of the number of bytes
2642         written.
2643         * configure.ac: Version 1.16.2
2644         * NEWS: Update
2645
2646 2007-01-04  Sergey Poznyakoff  <gray@gnu.org.ua>
2647
2648         * src/compare.c (diff_dumpdir): Compare directory contents using
2649         dumpdir_cmp.  Do not free dumpdir_buffer, it will leave the
2650         incremental directory table in the inconsistent state and trigger
2651         full dump.
2652         (read_and_process): Process dumpdirs no matter what the archive
2653         format.
2654         * src/incremen.c (list_dumpdir): Minor fixes.
2655
2656         * src/compare.c (read_and_process): Fix type of "size"
2657
2658 2006-12-13  Sergey Poznyakoff  <gray@gnu.org.ua>
2659
2660         * tests/T-null.at: Skip the test if genfile is not able to create
2661         the filename with an embedded newline.
2662
2663 2006-12-12  Paul Eggert  <eggert@cs.ucla.edu>
2664
2665         Port to Forte Developer 7 C 5.4 and C99.
2666         * src/common.h (add_exclude_tag): Add decl; C99 requires this
2667         and Forte warns about it.
2668         * src/incremen.c: Include <mkdtemp.h> for mkdtemp prototype,
2669         for same reason.
2670         * src/misc.c (get_max_open_files): Rewrite to avoid code that
2671         Forte C complains about as being unreachable.
2672         * src/xheader.c (mtime_code): Rewrite to avoid Forte error
2673         reported by Trond Hasle Amundsen.
2674
2675         * src/incremen.c (compare_dirnames): Rewrite to avoid casts.
2676         * src/utf8.c (string_ascii_p): Likewise.
2677         * src/xheader.c (mtime_coder, volume_size_coder, volume_offset_coder):
2678         Likewise.
2679
2680 2006-12-08  Sergey Poznyakoff  <gray@gnu.org.ua>
2681
2682         * bootstrap: Add paxutils files to dot_ignore.
2683
2684         * configure.ac: Raise version number to 1.16.1
2685         * bootstrap (slurp): Create .(cvs|git)ignore if not present
2686         * po/.cvsignore, m4/.cvsignore: Remove automatically generated
2687         files.
2688
2689 2006-12-07  Sergey Poznyakoff  <gray@gnu.org.ua>
2690
2691         * NEWS: Update
2692         * Makefile.am (distclean-local): Fixed
2693         * doc/tar.texi: Update documentation of --exclude-tag
2694         * src/create.c (dump_dir0): Move checks for exclude tags to
2695         dump_file0.
2696         (dump_dir): Move calls to ensure_slash to dump_file0
2697         * src/extract.c (extract_file): Call skip_member if open fails.
2698         Patch proposed by Jan-Benedict Glaw <jbglaw@lug-owl.de>
2699         * tests/truncate.at: Use genfile instead of dd, because on some
2700         systems /dev/zero is not available.
2701
2702 2006-12-04  Paul Eggert  <eggert@cs.ucla.edu>
2703
2704         * NEWS: Fix some race conditions with tar -x --same-owner.
2705         * src/extract.c (ARCHIVED_PERMSTATS): Add a comment saying that
2706         S_IRWXG | S_IRWXO might be masked out.
2707         (set_mode): Set the mode if some bits were masked out originally.
2708         (set_stat): Don't chmod before chown, as that might temporarily
2709         grant permissions that we don't want to grant.  The chmod was
2710         there only to work around broken hosts, so add a comment advising
2711         users not to use those broken hosts instead.
2712         (repair_delayed_set_stat, extract_dir):
2713         Remember to mask out current umask before inverting permissions.
2714         (extract_dir): If the owner might change, or if the mode has
2715         special bits, create the directory 700 at first, but restore it later.
2716         (open_output_file): New arg mode; all uses changed.
2717         (extract_file, extract_node, extract_fifo): If the owner might
2718         change, omit group and other bits at first, but restore them after
2719         changing the owner.
2720
2721 2006-12-04  Jim Meyering  <jim@meyering.net>
2722
2723         * doc/tar.texi (Long Options): Remove doubled word.
2724
2725 2006-11-30  Sergey Poznyakoff  <gray@gnu.org.ua>
2726
2727         * src/xheader.c (xheader_read): Remove unused variable
2728
2729         * po/POTFILES.in: Remove src/mangle.c
2730
2731         * bootstrap: Implement --update-po and .bootstrap
2732
2733         * src/create.c (dump_dir0): Implement --exclude-tag option
2734         * src/tar.c: Likewise
2735         * doc/tar.texi (exclude): Document --exclude-tag
2736
2737 2006-11-29  Paul Eggert  <eggert@cs.ucla.edu>
2738
2739         * NEWS: Remove support for mangled names.
2740         * doc/tar.texi (verbose tutorial): Likewise.
2741         * src/Makefile.am (tar_SOURCES): Remove mangle.c.
2742         * src/common.h (extract_mangle): Remove decl.
2743         * src/extract.c (extract_mangle_wrapper): Remove.
2744         (prepare_to_extract): Remove support for mangled names.
2745         * src/list.c (read_and, print_header): Likewise.
2746         * src/mangle.c: Remove.
2747         * src/tar.h (GNUTYPE_NAMES): Remove.
2748
2749         Port to latest gnulib.  There were a lot of changes, so the
2750         simplest way to get this up and running was to switch to coreutils
2751         bootstrap procedure.  I noticed one feature missing after this
2752         merge: the ability to update a single .po file.  I can add that
2753         later if need be.
2754         * README-cvs, bootstrap.conf: New files.
2755         * lib/.cvsignore: Remove Makefile.am, printf-parse.c, vasnprintf.c.
2756         Add fstatat.c, gnulib.mk, openat-proc.c, same-inode.h, stat_.h,
2757         tempname.c, tempname.h, uinttostr.c.
2758         * lib/printf-parse.c, lib/vasnprintf.c: New files, from coreutils,
2759         to override gnulib, so that we don't need xsize.h.
2760         * bootstrap: Replace with coreutils bootstrap, except add support
2761         for paxutils.
2762         * configure.ac (gl_USE_SYSTEM_EXTENSIONS): Remove, as gl_EARLY now
2763         does this.
2764         (gl_EARLY, gl_INIT): Add.
2765         (tar_GNULIB): Remove.
2766         * gnulib.modules: Add configmake.
2767         * lib/Makefile.tmpl: Remove, replacing with....
2768         * lib/Makefile.am: New file.
2769         * src/Makefile.am (tar.o): Remove dependency: Automake does this
2770         for us.
2771         * src/tar.c: Include <configmake.h> and <rmt-command.h>, not
2772         <localedir.h>.
2773
2774 2006-11-13  Sergey Poznyakoff  <gray@gnu.org.ua>
2775
2776         * src/xheader.c (mtime_coder): Treat non-null data as a pointer to
2777         struct timespec, overriding st->mtime
2778         * src/create.c (start_header): Pass mtime as a call-specific data
2779         to xheader_store.
2780
2781         * tests/truncate.at: Do not use 'k' modifier in dd options.
2782         * tests/append02.at: Do not depend on command timing.
2783
2784 2006-11-01  Sergey Poznyakoff  <gray@gnu.org.ua>
2785
2786         * src/tar.c (enum read_file_list_state.file_list_skip): New value
2787         (read_name_from_file): Skip zero-length entries
2788
2789         * tests/T-empty.at: New test case
2790         * tests/T-null.at: New test case
2791         * tests/extrac07.at: New test case
2792         * tests/Makefile.am: Add new test cases.
2793         * tests/testsuite.at: Add new test cases.
2794         * tests/extrac02.at: Add more keywords
2795         * tests/extrac04.at: Likewise
2796         * tests/extrac06.at: Likewise
2797         * tests/shortrec.at: Do not assume tar's default archive is stdout
2798
2799 2006-10-31  Sergey Poznyakoff  <gray@gnu.org.ua>
2800
2801         * src/extract.c, src/xheader.c: Call last_component instead of
2802         base_name. The latter returns a malloced string since 2006-03-11.
2803
2804 2006-10-21  Sergey Poznyakoff  <gray@gnu.org.ua>
2805
2806         * NEWS, configure.ac: Version 1.16
2807         * Makefile.am (distclean-local): New rule
2808
2809 2006-10-17  Sergey Poznyakoff  <gray@gnu.org.ua>
2810
2811         * src/tar.c: Fix help output formatting.  Thanks Benno
2812         Schulenberg.
2813
2814 2006-10-16  Sergey Poznyakoff  <gray@gnu.org.ua>
2815
2816         * Makefile.am (dist-hook): Create a cpio archive.
2817         * NEWS: Update
2818
2819 2006-10-14  Sergey Poznyakoff  <gray@gnu.org.ua>
2820
2821         * doc/tar.texi (Synopsis): Document tar exit codes.
2822         * src/create.c (dump_regular_file,dump_file0): Set exit_status to
2823         TAREXIT_DIFFERS if the file being dumped was truncated or
2824         otherwise changed.
2825         * src/tar.c: Do not attempt to close stderr after call to
2826         close_stdout.
2827         * tests/grow.at: New test case
2828         * tests/Makefile.am: New test grow.at
2829         * tests/testsuite.at: Likewise
2830         * tests/truncate.at (AT_KEYWORDS): Keyword `filechange'
2831         Test tar exit status.
2832
2833         * src/buffer.c (_open_archive): Make sure stdlis is set to stderr
2834         when we are writing archive to stdout (unless --index-file is
2835         used). Bug introduced on 2006-07-06.
2836         * tests/Makefile.am: New test verbose.at
2837         * tests/testsuite.at: Likewise
2838         * tests/indexfile.at (AT_KEYWORDS): Add stdout keyword
2839         * tests/verbose.at: New test case
2840
2841 2006-10-02  Sergey Poznyakoff  <gray@gnu.org.ua>
2842
2843         * THANKS: Add Joerg Weilbier
2844         * src/buffer.c (new_volume): Initialize current_block
2845         * src/xheader.c (xheader_string_end): Fix diagnostic message.
2846         * tests/multiv05.at: New testcase.
2847         * tests/Makefile.am, tests/testsuite.at: Add multiv05.at
2848
2849 2006-09-27  Sergey Poznyakoff  <gray@gnu.org.ua>
2850
2851         * bootstrap: Use ${package} instead of hardcoding package name
2852         * doc/tar.texi: Minor fix
2853         * src/tar.c (doc0, doc1, initialize_argp_doc): Removed.  Rely on
2854         the new argp method instead.
2855
2856 2006-09-12  Sergey Poznyakoff  <gray@gnu.org.ua>
2857
2858         * README: Fix a typo
2859
2860 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
2861
2862         Adjust to latest gnulib.
2863         * lib/.cvsignore: Add at-func.c, configmake.h, fchmodat.c,
2864         fcntl.h, fcntl_.h, inttypes_.h, lstat.c, lstat.h.
2865         * tests/testsuite.at (AT_TAR_MKHIER): Use install-sh -d
2866         rather than the no-longer-included mkinstalldirs.
2867
2868 2006-09-08  Sergey Poznyakoff  <gray@gnu.org.ua>
2869
2870         * src/incremen.c (try_purge_directory): Initialize struct st.  Fix
2871         condition for selecting candidates for removal.
2872         * README-alpha: List texinfo among build prerequisites for the CVS
2873         version.
2874
2875         * bootstrap (intl_files_to_remove): Do not remove m4/inttypes-h.m4
2876         and m4/inttypes-pri.m4
2877
2878 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
2879
2880         * bootstrap: Set XGETTEXT_OPTIONS to flag our printf-format functions,
2881         so that translators are warned about strings that are formats but
2882         don't look like formats.  This might help prevent core dumps.
2883         * configure.ac (AM_GNU_GETTEXT): Upgrade to need-formatstring-macros.
2884         Suggested by Eric Blake to avoid problems like
2885         <http://lists.gnu.org/archive/html/bug-coreutils/2006-07/msg00087.html>.
2886         (AM_GNU_GETTEXT_VERSION): Upgrade from 0.12.1 to 0.15.  The gettext
2887         manual says we should use the version number normally expected of
2888         maintainers, neither more nor less.
2889
2890         * bootstrap (get_translations):
2891         Don't exclude ky.po; it is working again.
2892
2893 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
2894
2895         * bootstrap (get_translations):
2896         Don't exclude ja.po; it is working again.
2897         Don't remove all old .po files if we're merely updating one.
2898         * po/.cvsignore: Add Makevars.
2899
2900 2006-08-07  Paul Eggert  <eggert@cs.ucla.edu>
2901
2902         * src/tar.c: Work around limitation imposed by gettext 0.15
2903         by concatenating strings with "\v" after translation.
2904         (doc): Remove, splitting into:
2905         (doc0, doc1): New constants.
2906         (argp): Don't use doc; just initialize to NULL.
2907         (initialize_argp_doc): New function.
2908         (decode_options): Use it.
2909
2910         * bootstrap: Redo po file retrieval to match Bison's method,
2911         since the translation project changed its index format.
2912         Don't use --assume-autoconf; it's now replaced
2913         by looking in configure.ac.
2914         (m4/codeset.m4, m4/intdiv.m4, m4/inttypes-pri.m4, m4/isc-posix.m4):
2915         (m4/lcmessage.m4, m4/onceonly_2_57.m4, m4/gettext.m4, m4/glibc21.m4):
2916         (m4/inttypes_h.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4):
2917         (m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4):
2918         Don't rename to ..._gl.m4, as this is no longer needed.
2919         (m4/geteext.m4): Patch to remove the need for intl/*.
2920         Use autopoint manually, then remove the intl files,
2921         then undo changes to gnulib files that autoreconf made,
2922         and then run aclocal/autoconf/autoheader/automake.
2923         This makes our bootstrap procedure closer to Bison's.
2924         (po/Makevars): Generate automatically.
2925         * configure.ac (AC_PREREQ): Update from 2.59 to 2.60.
2926         (gl_AC_TYPE_INTMAX_T, jm_AC_TYPE_UINTMAX_T): Remove.
2927         * gnulib.modules: Add inttypes, stdint.
2928         * lib/.cvsignore: Add close-stream.c, close-stream.h,
2929         stdint.h, stdint_.h.
2930         * po/Makefile: Remove; now automatically generated.
2931
2932         * src/incremen.c (read_incr_db_01): Check input strings more
2933         carefully.  Do not pass arbitrary char values to isspace, as
2934         this has undefined behavior.  Likewise for assigning arbitrary
2935         uintmax_t values to other types.
2936         (read_negative_num, read_unsigned_num, read_timespec):
2937         New functions, to check input values a bit more carefuly.
2938         (read_num): Use read_unsigned_num.  New arg MAX_VAL;
2939         all callers changed.
2940         (read_incr_db_2): Use these new functions.
2941         Use a consistent diagnostic for unexpected EOF.
2942         (read_directory_file): Do not assign arbitrary uintmax_t value
2943         to int.
2944         (read_timespec, write_directory_file_entry, write_directory_file):
2945         Handle negative time_t values correctly.  We don't bother to do
2946         this with pre-2 formats, since presumably the time stamps were
2947         output incorrectly.
2948
2949         * src/tar.c (doc): Don't use \v in an argument to gettext;
2950         gettext 0.15 rejects this.
2951
2952 2006-07-24  Sergey Poznyakoff  <gray@gnu.org.ua>
2953
2954         * src/tar.c (decode_options): Do not require -L with -M -Hpax.
2955         It could be needed in future, but currently it is not.
2956         * src/create.c (to_chars_subst): Update comment regarding OLDGNU
2957         vs. GNU format differences.
2958         (mode_to_chars): Treat OLDGNU_FORMAT same as GNU_FORMAT. Fixes bug
2959         reported by TAMUKI Shoichi <tamuki@linet.gr.jp>, which caused
2960         equivalent `tar cf ...' and `tar rf ...' commands to produce
2961         different archives.
2962
2963         * tests/append02.at: New test case
2964         * tests/Makefile.am, tests/testsuite.at: Add append02.at
2965
2966 2006-07-20  Paul Eggert  <eggert@cs.ucla.edu>
2967
2968         * bootstrap: Adjust to today's change to gnulib-tool by invoking
2969         it with --assume-autoconf='latest-stable'.
2970
2971 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
2972
2973         Adjust to recent gnulib changes.
2974         * lib/.cvsignore: Remove atexit.c, exit.c, getndelim2.c, getndelim2.h,
2975         pathmax.h, paxconvert.c, paxerror.h, xstrdup.c.
2976         Add inttypes.h, mktime.c, wcwidth.h, xstrndup.c, xstrndup.h.
2977         * src/create.c (start_header): Adjust to API change to mode_adjust.
2978
2979 2006-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2980
2981         * THANKS: Add Ralf Wildenhues
2982         * NEWS: Update
2983
2984 2006-07-09  Ralf Wildenhues   <Ralf.Wildenhues@gmx.de>
2985
2986         * doc/dumpdir.texi, doc/snapshot.texi, doc/sparse.texi,
2987         doc/tar.texi: Fix some typos.
2988
2989 2006-07-06  Sergey Poznyakoff  <gray@gnu.org.ua>
2990
2991         tar --index-file=FILE --file=- sent the archive to FILE, and
2992         the listing to stderr. Bug reported by Marcin Gryszkalis
2993         <mg@fork.pl>
2994
2995         * src/buffer.c (_open_archive): Remove stdlis initialization
2996         * src/tar.c (decode_options): Initialize stdlis
2997         * tests/indexfile.at: New test case
2998         * tests/testsuite.at: Include indexfile.at
2999         * tests/Makefile.am (TESTSUITE_AT): Add indexfile.at
3000
3001 2006-07-05  Sergey Poznyakoff  <gray@gnu.org.ua>
3002
3003         * doc/Makefile.am (manual): Fix TEXINPUTS
3004         * doc/rendition.texi (FIXME): Do not use deprecated @quote-args.
3005         Do not use @allow-recursion. In its current form the macro is not
3006         recursive.
3007
3008 2006-07-03  Sergey Poznyakoff  <gray@gnu.org.ua>
3009
3010         * bootstrap (update_po): Fix single translation update
3011
3012 2006-07-03  Sergey Poznyakoff  <gray@gnu.org.ua>
3013
3014         * configure.ac (AC_CHECK_FUNCS): Check for getdtablesize
3015         * src/common.h (closeopen): New function
3016         * src/misc.c (chdir_arg): Use x2nrealloc to reallocate wd.
3017         (get_max_open_files,closeopen): New functions
3018         (chdir_do): Do not use save_cwd if it was already used more than
3019         max_open_files-4 times to avoid running off the file
3020         descriptors.
3021         * src/tar.c (main): Call closeopen
3022         * doc/tar.texi: Update --directory description
3023         * NEWS: Update
3024
3025 2006-06-26  Sergey Poznyakoff  <gray@gnu.org.ua>
3026
3027         * doc/tar.texi: Update. Add cross-references.
3028         * doc/sparse.texi: Add cross-references.
3029
3030 2006-06-25  Sergey Poznyakoff  <gray@gnu.org.ua>
3031
3032         * scripts/xsparse.c: A sample utility to expand sparse files
3033         extracted by third-party tars. It is not meant to be installed nor
3034         to be included in the distribution. It is here, so that it can be
3035         obtained either from CVS or from the tar web site.
3036         * doc/Makefile.am (tar_TEXINFOS): Sorted
3037         * doc/tar.texi (Other Tars): New node describing how to extract
3038         GNU-specific member formats using third-party tars.
3039         * src/common.h (sparse_file_p): Remove
3040         * src/sparse.c: Likewise
3041         * src/create.c: Use ST_IS_SPARSE instead of sparse_file_p (update
3042         paxutils first)
3043         * src/tar.c: --sparse-version turns on --sparse
3044
3045 2006-06-24  Sergey Poznyakoff  <gray@gnu.org.ua>
3046
3047         * src/buffer.c (print_total_stats): Add default case.
3048         * src/common.h (name_init): New prototype.
3049         (xheader_string_end): Return bool.
3050         * src/extract.c (extract_volhdr): Add missing return
3051         * src/incremen.c: Remove not used variables
3052         * src/sparse.c (pax_dump_header_0): Return false if
3053         xheader_string_end fails (for 0.1 formats).
3054         (pax_dump_header): Return meaningful value
3055         * src/transform.c (segm_count): Change type to size_t
3056         * src/xheader.c (xhdr_tab.decoder): pass keyword as a second
3057         argument. All callers changed.
3058         (decode_record): Check for numeric overflow
3059         (xheader_string_end): Return boolean value. Check for possible
3060         numeric overflow
3061
3062 2006-06-23  Sergey Poznyakoff  <gray@gnu.org.ua>
3063
3064         * doc/sparse.texi: New file
3065         * doc/Makefile.am (tar_TEXINFOS): Add sparse.texi
3066         * doc/intern.texi (Sparse Formats): New node
3067         * doc/tar.texi: Update master menu
3068
3069         * src/common.h (tar_sparse_major,tar_sparse_minor): New globals.
3070         * src/sparse.c: Implement sparse format versioning. Implement new
3071         version (1.0) of PAX sparse format.
3072         (pax_sparse_member_p): Fix condition
3073         (pax_dump_header): A dispatcher function
3074         (pax_dump_header_0,pax_dump_header_1): New functions.
3075         (pax_optab): Update
3076         (oldgnu_dump_header): Minor fix: make sure
3077         sparse_header.isextended is set before calling
3078         set_next_block_after
3079         * src/tar.c: New option --sparse-version
3080         * src/tar.h (struct tar_stat_info.sparse_major,sparse_minor): New
3081         members.
3082         * src/xheader.c: Implement new keywords: GNU.sparse.name,
3083         GNU.sparse.major, GNU.sparse.minor, GNU.sparse.realsize
3084
3085         * tests/spmpv00.at, tests/spmvp01.at, tests/spmvp10.at: New
3086         testcases.
3087
3088         * tests/Makefile.am: Add spmvp00.at, spmpv01.at, spmpv10.at
3089         * tests/shortrec.at: Explicitely give `-f -' to the tar invocation
3090         * tests/sparsemvp.at: Rewritten as an include file.
3091         (TAR_MVP_TEST): New macro
3092         * tests/testsuite.at: Include sparsemvp.at, spmvp00.at,
3093         spmvp01.at, spmvp10.at
3094
3095 2006-06-21  Sergey Poznyakoff  <gray@gnu.org.ua>
3096
3097         * doc/tar.texi (Overriding File Metadata): New node
3098         Document --mtime option.
3099         * src/common.h (set_mtime_option,mtime_option): New globals
3100         * src/create.c (start_header): Override mtime if requested
3101         * src/tar.c: Implement new option, --mtime, allowing to set
3102         modification times for all archive members during creation.
3103         (struct tar_args): textual_date_option replaced with a linked list
3104         textual_date. All references updated.
3105         (get_date_or_file,report_textual_dates): New functions.
3106         * configure.ac: Raise version number to 1.15.92
3107         * NEWS: Update
3108
3109 2006-06-20  Sergey Poznyakoff  <gray@gnu.org.ua>
3110
3111         * src/common.h (struct name.explicit): Remove
3112         Use variable names in all declarations
3113         (name_scan): Remove second argument
3114         * src/delete.c: Remove second argument from calls to name_scan
3115         * src/update.c: Likewise
3116         * src/incremen.c (procdir): Use is_individual_file to check for
3117         files explicitely specified in the command line. Fixes bug
3118         reported by Dat Head on 19 Jun 2006 (descending into mountpoints
3119         with --one-file-system in use)
3120         * src/misc.c (maybe_backup_file): Second argument is bool
3121         * src/names.c (name_next_elt): Call register_individual_file
3122         (namelist_match): Remove third argument
3123         (name_match): Change return type to bool
3124         (name_scan): Remove second argument
3125         * src/sparse.c (pax_dump_header): Store original sparse file name
3126         in GNU.sparse.name variable. The name field in the ustar header
3127         now contains generated name (%d/GNUSparseFile.%p/%f), so that
3128         non-pax-aware tars won't extract the file under the original
3129         filename.
3130         * src/xheader.c (GNU.sparse.name): New variable for storing sparse
3131         file name.
3132
3133 2006-06-13  Sergey Poznyakoff  <gray@gnu.org.ua>
3134
3135         * doc/Makefile.am (check-options): Expand macros before grepping
3136         in $(info_TEXINFOS)
3137         * doc/rendition.texi (FIXME) [!PROOF_FOOTNOTED]: Enclose in a
3138         cartouche
3139         * doc/tar.texi: Define op as codeindex. Use special macros to
3140         populate it
3141         Consequently prefer @dfn{long options} over @dfn{mnemonic
3142         options}.
3143         Document --unquote, --no-unquote
3144         (Short Option Summary): Build a table of cross-references to the
3145         corresponding long options.
3146         (Using Multiple Tapes,Multi-Volume Archives): Rewritten
3147
3148         * doc/value.texi (xopindex,opsummary): New macros
3149
3150         * doc/Makefile.am (check-options): New goal
3151         * doc/tar.texi: Update
3152         * src/tar.c: Implement --overwrite-dir option (long ago
3153         documented).
3154
3155 2006-06-12  Sergey Poznyakoff  <gray@gnu.org.ua>
3156
3157         * doc/tar.texi: Document better the --totals option
3158         * NEWS: Update
3159         * src/buffer.c (total_blocks_deleted): New variable
3160         (set_start_time): Set volume_start_time and last_stat_time as well
3161         (set_volume_start_time): New function
3162         (compute_duration): Do not call set_start_time, update
3163         last_stat_time instead. Use it in calculation instead of
3164         start_time, which is now set only once, upon startup.
3165         (print_total_written): Removed.
3166         (print_total_stats): New function for printing byte/speed statistics.
3167         (_open_archive): Detect attempts to update compressed archives.
3168         (_gnu_flush_write): Always update prev_written.
3169         (open_archive): Call set_volume_start_time.
3170         * src/common.h (volume_start_time,last_stat_time): New globals
3171         (print_total_written): Replaced with:
3172         (print_total_stats): New function
3173         * src/delete.c (records_skipped): Remove static qualifier, the
3174         variable is used by print_total_stats in buffer.c
3175         * src/extract.c (check_time): Use volume_start_time when checking
3176         for timestamp plausability.
3177         * src/tar.c: (options, parse_opt): Allow for optional argument to
3178         the --totals option, which specifies a signal upon delivery of which
3179         the statistics must be output.
3180         (main): Call print_total_stats if total_option is set.
3181
3182 2006-06-11  Sergey Poznyakoff  <gray@gnu.org.ua>
3183
3184         * src/xheader.c (xheader_set_single_keyword): Fix typo.
3185         (decode_time): Avoid using gotos.
3186
3187         * doc/mastermenu.el: New file
3188         * doc/Makefile.am (master-menu): New goal
3189         * doc/tar.texi: Update master menu
3190
3191 2006-06-10  Sergey Poznyakoff  <gray@gnu.org.ua>
3192
3193         * doc/tar.texi: Remove leftover include
3194
3195 2006-06-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3196
3197         * doc/Makefile.am (tar_TEXINFOS): Add intern.texi
3198         (EXTRA_DIST): Remove convtexi.pl, add texify.sed
3199         * doc/intern.texi: New file
3200         * doc/convtexi.pl: Remove
3201         * doc/texify.sed: Auxiliary script to convert ../src/tar.h to
3202         header.texi
3203         * doc/rendition.texi: Fix typo
3204         * doc/tar.texi: Update
3205         * src/tar.h: Fix indentation, introduce end-of-format marker for
3206         texify.sed
3207
3208         * THANKS: Add Jason Armistead
3209         * doc/tar.texi: Update
3210         * NEWS: Update
3211         * src/buffer.c: Implement more flexible checkpoint style
3212         * src/common.h (checkpoint_option): Change type to unsigned
3213         (checkpoint_style): New variable.
3214         * src/tar.c: --checkpoint takes an optional argument specifying
3215         number of records between two successive checkpoints (proposed
3216         by Jason Armistead on 2004-06-22).  Optional dot starting the
3217         argument means "print dots instead of textual checkpoints".
3218         (tar_help): New function
3219         * src/transform.c: Minor fixes.
3220
3221 2006-06-08  Sergey Poznyakoff  <gray@gnu.org.ua>
3222
3223         * gnulib.modules: Add mkdtemp
3224         * doc/dumpdir.texi: New file
3225         * doc/Makefile.am (tar_TEXINFOS): Add dumpdir.texi
3226         * doc/tar.texi: Document dumpdir format
3227         * src/incremen.c (dumpdir_locate,obstack_code_rename):
3228         (purge_directory): Re-implement renaming. Introduce
3229         'X' control code.
3230         (make_tmp_dir_name): Remove
3231
3232         * src/transform.c (set_transform_expr,_transform_name_to_obstack):
3233         Implement NUMBER flag.
3234         (add_char_segment): Fix length assignement
3235
3236         * doc/tar.texi: Update
3237
3238 2006-06-07  Sergey Poznyakoff  <gray@gnu.org.ua>
3239
3240         * src/transform.c (transform_name_fp): Run fun even if
3241         _transform_name_to_obstack returns false.
3242         (_transform_name_to_obstack,set_transform_expr): Implement GNU
3243         extension case conversion operations.
3244
3245         * doc/tar.texi (transform): Document the option.
3246
3247 2006-06-02  Sergey Poznyakoff  <gray@gnu.org.ua>
3248
3249         * NEWS: Update
3250         * src/common.h (set_transform_expr): New function
3251         * tests/Makefile.am: Add incr04.at
3252         * tests/testsuite.at: Likewise
3253         * tests/incr04.at: New test case
3254         * tests/long01.at: Fix typo in the comment
3255         * tests/multiv04.at: Use genfile --files-from
3256
3257         (Above changes need new genfile.c from paxutils)
3258
3259         * TODO: Update
3260         * NEWS: Update
3261         * doc/tar.texi: Update
3262         * src/transform.c: New file
3263         * src/Makefile.am (tar_SOURCES): New module transform.c
3264         * src/common.h (transform_name, transform_name_fp): New functions
3265         (show_stored_names_option): Renamed to
3266         show_transformed_names_option. All uses changed
3267         * src/create.c (dump_file0): Transform file name
3268         * src/extract.c (extract_archive): safer_name_suffix and
3269         stripped_prefix_len are now called by decode_header
3270         * src/list.c (print_header): Update displayable name selection.
3271         * src/tar.c: New option --transform
3272         New option --show-transformed-names generalizes
3273         --show-stored-names. The latter is retained as an alias.
3274
3275 2006-05-31  Sergey Poznyakoff  <gray@gnu.org.ua>
3276
3277         * src/incremen.c (make_directory): Fix initialization of struct
3278         directory.
3279
3280 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
3281
3282         * doc/tar.texi: Document use of globbing patterns.
3283         * src/tar.c (parse_opt): Add comment before --preserve case.
3284
3285 2006-05-24  Sergey Poznyakoff  <gray@gnu.org.ua>
3286
3287         * NEWS: Update
3288         * doc/tar.texi: Update
3289         * configure.ac (AM_INIT_AUTOMAKE): Use tar-ustar option. Raise
3290         version requirement to 1.9
3291         * src/common.h (struct name): Refactured
3292         (warn_regex_usage): New variable.
3293         (dump_file): First argument is const char*.
3294         (name_init,name_add): Removed
3295         (name_add_name,name_add_dir): New functions
3296         (name_next): Return const char*.
3297         * src/create.c: (dump_file,dump_file0): First argument is const
3298         char*. All callers updated.
3299         * src/names.c: Rewritten handling of member names in the command
3300         line. Tar no longer attempts to guess globbing patterns, instead
3301         it relies on --wildcard option.
3302         (init_names): Removed.
3303         (struct name_elt): New structure.
3304         (name_array): Change type to struct name_elt. All references updated
3305         (name_add_name,name_add_dir): New functions
3306         (name_next_elt): New function
3307         (name_next): Rewritten using name_next_elt.
3308         (namelist_match): Rewritten pattern matching using
3309         exclude_fnmatch.
3310         (names_notfound): Warn if globbing patterns were used without
3311         --wildcards option
3312         * src/tar.c (options): Move globbing-related options into a
3313         separate group. Set -l as an alias to --check-links, as required
3314         by UNIX98
3315         (struct tar_args): New fields
3316         wildcards,matching_flags,include_anchored
3317         (MAKE_EXCL_OPTIONS,MAKE_INCL_OPTIONS): New macros
3318         (parse_opt): Use x2nrealloc to grow archive_name_array.
3319         Use MAKE_EXCL_OPTIONS,MAKE_INCL_OPTIONS to create appropriate
3320         fnmatch options, and name_add_name,name_add_dir to handle member
3321         name and -C arguments.
3322         (decode_options): Likewise
3323         (main): Remove call to init_names.
3324
3325         * tests/append.at, tests/append01.at, tests/extrac01.at,
3326         tests/options.at, tests/options02.at, tests/same-order01.at,
3327         tests/same-order02.at: Make AT_SETUP more readable.
3328
3329 2006-05-23  Sergey Poznyakoff  <gray@gnu.org.ua>
3330
3331         * src/buffer.c (change_tape_menu): Fix typo (uninitialized
3332         variable) introduced yesterday.
3333
3334 2006-05-22  Sergey Poznyakoff  <gray@gnu.org.ua>
3335
3336         * doc/tar.texi: Use @var{file_name} instead of @var{file name}
3337         * src/buffer.c (change_tape_menu): Break the loop after obtaining
3338         new archive name. Check for empty input line.
3339
3340 2006-05-15  Sergey Poznyakoff  <gray@gnu.org.ua>
3341
3342         * tests/atlocal.in (XFAILFILE): New variable
3343         * tests/version.at: Create $XFAILFILE on failure
3344         * tests/testsuite.at (AT_TAR_CHECK): Declare expected failure if
3345         $XFAILFILE exists.
3346
3347 2006-05-13  Sergey Poznyakoff  <gray@gnu.org.ua>
3348
3349         * THANKS: Update
3350         * src/buffer.c (read_header0): Use read_header_primitive to avoid
3351         clubbering current_tar_info. All callers updated.
3352         * src/common.h (read_header_primitive): New function
3353         * src/extract.c (extract_volhdr): New function
3354         (prepare_to_extract): Use extract_volhdr as extractor for volume
3355         names.
3356         * src/list.c (read_header_primitive): New function
3357         (read_header): Front end for read_header_primitive
3358         * tests/chtype.at: New file
3359         * tests/volsize.at: New file
3360         * tests/Makefile.am (TESTSUITE_AT): Add chtype.at, volsize.at
3361         (check-full): New target.
3362         * tests/atlocal.in (TEST_DATA_URL,STAR_DATA_URL)
3363         (STAR_TESTSCRIPTS): Provide default values.
3364         (tarball_prereq): New function
3365         * tests/testsuite.at (AT_TARBALL_PREREQ): New defun
3366         (AT_STAR_PREREQ): Rewrite using tarball_prereq
3367         Include chtype.at and volsize.at
3368         * tests/volume.at: Add keywords.
3369
3370         * tests/star/gtarfail.at, tests/star/gtarfail2.at,
3371         tests/star/multi-fail.at, tests/star/pax-big-10g.at,
3372         tests/star/ustar-big-2g.at, tests/star/ustar-big-8g.at
3373         (AT_STAR_PREREQ): Provide md5 sum.
3374
3375         * lib/.cvsignore: Update
3376
3377 2006-05-08  Sergey Poznyakoff  <gray@gnu.org.ua>
3378
3379         * tests/testsuite.at (AT_SORT_PREREQ, AT_UNPRIVILEGED_PREREQ): New
3380         defines
3381
3382         * tests/extrac04.at, tests/incr03.at, tests/listed02.at,
3383         tests/pipe.at, tests/rename01.at, tests/rename02.at,
3384         tests/rename03.at, tests/same-order01.at: Call
3385         AT_SORT_PREREQ. Remove fd 2 redirection after calls to sort
3386         * ignfail.at: Call AT_UNPRIVILEGED_PREREQ
3387
3388 2006-05-08  Sergey Poznyakoff  <gray@gnu.org.ua>
3389
3390         Listed incremental backups: keep more information about
3391         directories. Handle renamed directories more effectively
3392         (initial implementation, more updates to follow).
3393         Source tree before this point is tagged
3394         alpha_1_15_90_incremental_1.
3395
3396         * NEWS: Update
3397         * configure.ac: Raise version number to 1.15.91
3398         * src/common.h (rename_directory,append_incremental_renames): New
3399         functions.
3400         * src/extract.c (rename_directory): New function
3401         * src/incremen.c (struct directory.contents, flags): New members
3402         (nfs,found,new): Remove. Replaced by appropriate bitmask values in
3403         `flags' field. All uses updated.
3404         (directory_meta_table): New table.
3405         (hash_directory): Rename to hash_directory_name
3406         (compare_directories): Rename to compare_directory_names
3407         (hash_directory_meta,compare_directory_meta,find_directory_meta):
3408         New functions
3409         (compare_dirents): Removed
3410         (note_directory): Get 7th argument: directory contents.
3411         All callers updated
3412         (dumpdir_locate,makedumpdir): New functions
3413         (scan_directory): Rewritten. Use makedumpdir to create a sorted
3414         dumpdir array. This makes the obstack argument unnecessary. Besides,
3415         ALL_CHILDREN flag is set only for new directories.
3416         (procdir): Change return type to struct directory. Return
3417         immediately if the directory was already initialized. Discover
3418         directory renames using directory_meta_table.
3419         (append_incremental_renames): New function.
3420         (read_directory_file, write_directory_file): Use new snapshot file
3421         format.
3422         * src/names.c (collect_and_sort_names): Update dir_contents of the
3423         first non-fake name entry when in listed incremental mode.
3424
3425         * tests/incr03.at: New testcase
3426         * tests/rename01.at: New testcase
3427         * tests/rename02.at: New testcase
3428         * tests/rename03.at: New testcase
3429         * tests/Makefile.am: Add
3430         incr03.at,rename01.at,rename02.at,rename03.at
3431         * tests/testsuite.at: Likewise.
3432         * tests/listed02.at: Update for the new behavior
3433         * tests/multiv04.at (AT_KEYWORDS): Add missing incremental kw.
3434
3435 2006-05-02  Sergey Poznyakoff  <gray@gnu.org.ua>
3436
3437         * src/buffer.c (try_new_volume): Attempt to continue if the name
3438         is apparently truncated in a GNU format volume.
3439
3440         * tests/comprec.at, tests/delete01.at, tests/delete02.at,
3441         tests/delete04.at, tests/delete05.at, tests/extrac05.at,
3442         tests/listed01.at, tests/multiv01.at, tests/multiv02.at,
3443         tests/pipe.at, tests/same-order01.at, tests/same-order02.at,
3444         tests/sparse01.at, tests/sparse03.at: Always use genfile --file,
3445         this enables extra error checking.
3446
3447         * tests/multiv03.at: Attempt to extract a member with truncated
3448         file name from the archive.
3449
3450         * src/buffer.c (_open_archive): Remove unnecessary argument to
3451         check_compressed_archive.
3452
3453 2006-04-25  Sergey Poznyakoff  <gray@gnu.org.ua>
3454
3455         * tests/sparse01.at, tests/sparse02.at, tests/sparse03.at,
3456         tests/sparsemv.at, tests/sparsemvp.at: Skip the test if the file
3457         system does not support sparse files.
3458         * doc/tar.texi (@copying): Remove the reference to not existing
3459         invariant section.
3460
3461 2006-04-11  Sergey Poznyakoff  <gray@gnu.org.ua>
3462
3463         * src/extract.c (extract_dir): Fix toggling existing directory
3464         permissions (Debian bug #361077). Use parts of patch provided by
3465         Ian Jackson <iwj@ubuntu.com>.
3466         * src/compare.c: Minor changes
3467         * src/incremen.c (directory.new): New member
3468         (note_directory,find_directory: Use make_directory to create
3469         struct directory entries
3470         (procdir): Avoid duplicating  directories in the incremental
3471         backup map.
3472         * tests/Makefile.am (TESTSUITE_AT): Add extrac06.at
3473         * tests/testsuite.at: Include extrac06.at
3474
3475 2006-03-18  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de> (trivial change)
3476
3477         * tests/atlocal.in (PATH): Add build-aux from the source tree,
3478         not the build tree.
3479
3480 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
3481
3482         * THANKS: Add Benno Schulenberg
3483
3484 2006-03-13  Jim Meyering <jim@meyering.net>
3485
3486         * tests/listed02.at:  Sort the two lines of stderr from the
3487         first `tar -v --listed-incremental'.  They would come out
3488         reversed and provoke a test failure on a tmpfs
3489         file system.
3490
3491 2006-03-13  Benno Schulenberg <benno@nietvergeten.nl>
3492
3493         * doc/tar.texi: Minor fixes.
3494         * src/tar.c (options): Consistently begin help messages with a
3495         lowercase letter.
3496
3497 2006-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>
3498
3499         * tests/Makefile.am (AM_CPPFLAGS): Define LOCALEDIR
3500
3501 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
3502
3503         * src/buffer.c (record_buffer_aligned): New var.
3504         (init_buffer): Use it to ensure that the buffer is aligned.
3505         This doesn't result in any measurable performance improvement
3506         on my host (Debian GNU/Linux 3.1 stable, with default block size),
3507         but I assume it does help on some hosts.
3508
3509         * lib/.cvsignore: Sort.
3510
3511 2006-03-04  Sergey Poznyakoff  <gray@gnu.org.ua>
3512
3513         * tests/shortrec.at: Use -f - to read from stdin.
3514
3515 2006-02-21  Sergey Poznyakoff  <gray@gnu.org.ua>
3516
3517         * doc/tar.texi: Fix typo: --to-command instead of --to-program
3518
3519 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
3520
3521         * tests/multiv04.at (split directory members in a MV archive):
3522         Don't use %X in an awk printf format; this doesn't work with
3523         Solaris 10 /usr/bin/awk.  Use %x instead.
3524
3525 2006-02-20  Sergey Poznyakoff  <gray@gnu.org.ua>
3526
3527         * src/create.c (split_long_name): Fix maximum length estimation.
3528         Patch by Jim Lowe.
3529         * tests/Makefile.am (lustar01.at,lustar02.at,lustar03.at): New
3530         tests.
3531         * tests/atlocal.in: Add build-aux to the PATH
3532         * tests/long01.at: Remove mkhier, use AT_TAR_MKHIER instead
3533         * tests/longv7.at: Reword test title
3534         * tests/lustar01.at: New test
3535         * tests/lustar02.at: New test
3536         * tests/lustar03.at: New test
3537         * tests/testsuite.at (AT_TAR_MKHIER): New macro
3538         (lustar01.at,lustar02.at,lustar03.at): New tests.
3539
3540 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
3541
3542         * bootstrap: Don't claim lib/Makefile.am is generated automatically
3543         from itself.
3544
3545         Avoid installation glitches on Solaris 8 with Sun C 5.4.
3546         * lib/.cvsignore: Add system-ioctl.h.
3547         * lib/Makefile.tmpl (noinst_HEADERS): Add system-ioctl.h.
3548         * src/buffer.c: Include system-ioctl.h.
3549         * src/compare.c: Likewise.
3550         * src/delete.c: Likewise.
3551         * src/system.c: Include <getline.h>, <setenv.h>.
3552         * src/tar.c: Include <getline.h>.
3553
3554 2006-02-19  Sergey Poznyakoff  <gray@gnu.org.ua>
3555
3556         * src/buffer.c (add_chunk_header): Free st.orig_file_name after
3557         calling finish_header().
3558         (new_volume): Prompt the user for archive name if unable to open
3559         next archive.
3560
3561         * src/create.c (dump_file0): Restore file_count_links,
3562         accidentally removed on 2005-11-29.
3563         * configure.ac: Raise version number to 1.15.90
3564         * NEWS: Likewise.
3565
3566 2006-02-08  Sergey Poznyakoff  <gray@gnu.org.ua>
3567
3568         * src/tar.c (tar_set_quoting_style): Provide second argument to
3569         the format spec: program_invocation_short_name. Reported by Jim
3570         Meyering.
3571
3572 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
3573
3574         * gnulib.modules: Add closeout, exitfial.
3575         * lib/.cvsignore: Add __fpending.c, __fpending.h, closeout.c,
3576         closeout.h.
3577         * src/buffer.c: Incluse closeout.h.
3578         (_open_archive): Use freopen rather than fopen, so
3579         that stdlis is always either stdout or stderr.  Use
3580         close_stdout_set_file_name to report its name.
3581         * src/tar.c: Include closeout.h and exitfail.h.
3582         (parse_opt, usage): Call close_stdout as appropriate, to check for
3583         write errors.
3584         (decode_options): Exit with status TAREXIT_FAILURE, not 1.
3585         (main): Set exit_failure, to exit with proper status on memory
3586         allocation failure and the like.
3587         Use close_stdout rather than rolling our own test.
3588
3589         * NEWS: --version now outputs copyright etc., to conform to the
3590         GNU coding standards.  Remove --license.
3591         * gnulib.modules: Add version-etc-fsf.
3592         * doc/tar.texi: Document the change.
3593         * lib/.cvsignore: Add version-etc-fsf.c, version-etc.c, version-etc.h.
3594         * scripts/Makefile.am (SED_CMD): Update PAKCAGE_NAME, not PACKAGE.
3595         * scripts/backup.in: Remove --license.  Change --version to conform
3596         to GCS.
3597         * scripts/restore.in: Likewise.
3598         * scripts/backup.sh.in (license): Output briefer license in the
3599         style of coreutils, for consistency with other changes.
3600         * src/tar.c: Include <version-etc.h>.
3601         (LICENSE_OPTION): Remove.
3602         (options): Remove --license.
3603         (license): Remove.
3604         (parse_opt): Use version_etc instead of rolling it ourselves.
3605         Remove --license.
3606         * tests/version.at (tar --version): Check only the first line of
3607         output.
3608
3609         * ChangeLog, NEWS, src/common.h, src/extract.c, src/incremen.c:
3610         * src/list.c, src/names.c, src/tar.h, src/xheader.c:
3611         Update copyright year to 2006.
3612
3613 2006-02-07  Jim Meyering  <jim@meyering.net>
3614
3615         * src/xheader.c (sparse_map_decoder): Fix misleading diagnostic.
3616
3617 2006-01-31  Sergey Poznyakoff  <gray@gnu.org.ua>
3618
3619         * src/common.h (get_gnu_dumpdir): Remove prototype
3620         (is_dumpdir): New function
3621         * src/extract.c (prepare_to_extract): Use is_dumpdir member to
3622         check for dumpdirs.
3623         * src/incremen.c (get_gnu_dumpdir): Static
3624         (is_dumpdir): New function
3625         (purge_directory): Use is_dumpdir
3626         * src/list.c (list_archive): Use is_dumpdir
3627         Do not wrap skip_member in mv_begin/mv_end, the function itself
3628         takes care of it.
3629         (decode_header): Set stat_info->is_dumpdir
3630         (skip_member): Do nothing if skipped is true
3631         * src/tar.h (struct tar_stat_info): New members is_dumpdir and skipped.
3632
3633 2006-01-22  Sergey Poznyakoff  <gray@gnu.org.ua>
3634
3635         * src/tar.c (decode_options): Refuse using --delete with
3636         compression options.
3637
3638 2006-01-18  Sergey Poznyakoff  <gray@gnu.org.ua>
3639
3640         * NEWS: Updated.
3641         * configure.ac (DEFAULT_QUOTING_STYLE): New configuration variable
3642         * doc/tar.texi: Initial documentation for --quoting-style,
3643         --quote-chars and --no-quote-chars option.
3644         * src/tar.c: Implement new options --quoting-style, --quote-chars
3645         and --no-quote-chars.
3646
3647 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
3648
3649         * bootstrap: Default to pserver, and switch to cvs.sv.gnu.org,
3650         to accommodate recent changes to the GNU CVS server.
3651         * lib/.cvsignore: Add argp-pin.c, mkdirat.c, openat-priv.h.
3652
3653 2005-12-14  Sergey Poznyakoff  <gray@gnu.org.ua>
3654
3655         * src/names.c (name_scan): Take an additional argument requesting
3656         exact matching.
3657         * src/common.h (name_scan): Change prototype.
3658         * src/delete.c, src/incremen.c, src/update.c: Update invocations
3659         of name_scan.
3660
3661 2005-12-13  Sergey Poznyakoff  <gray@gnu.org.ua>
3662
3663         * src/common.h (struct name): New member `explicit'. Remove unused
3664         member `isdir'.
3665         * src/incremen.c (procdir): If name_scan() returns something,
3666         check if it was explicitely given in the command line
3667         * src/names.c (addname,add_hierarchy_to_namelist): Initialize
3668         explicit member appropriately.
3669
3670         * src/incremen.c (procdir): If --one-file-system is given and a
3671         directory is found to be on another device, *and* this directory
3672         is explicitely given in the command line, then do not omit it.
3673
3674 2005-12-11  Sergey Poznyakoff  <gray@gnu.org.ua>
3675
3676         * NEWS: Update
3677         * doc/tar.texi: Document --delay-directory-restore option.
3678         (Configuring Help Summary): Document usage of ARGP_HELP_FMT
3679         variable to customize help output.
3680         * src/common.h (delay_directory_restore_option): New global.
3681         * src/extract.c (directories_first): Replaced by
3682         delay_directory_restore_option. All uses changed.
3683         * src/tar.c (options,parse_opt): New options
3684         --delay-directory-restore and --no-delay-directory-restore
3685
3686 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3687
3688         * src/buffer.c (open_archive): Add default case to shut up gcc.
3689         * src/common.h (set_file_atime): Add prototype.
3690         * src/create.c (to_chars_subst): Remove unused variable
3691         Make sure useful result code is returned.
3692         * src/incremen.c (read_directory_file): Fix format string
3693         Thanks Eric Blake for reporting.
3694
3695 2005-12-08  Sergey Poznyakoff  <gray@gnu.org.ua>
3696
3697         * doc/tar.texi (Current status): Renamed to 'Changes' and moved to
3698         appendices.
3699         (Large or Negative Values): Rewritten
3700         * src/common.h (gid_to_chars, major_to_chars, minor_to_chars)
3701         (mode_to_chars, off_to_chars, size_to_chars, time_to_chars)
3702         (uid_to_chars, uintmax_to_chars): Return bool
3703         * src/create.c (gid_to_chars, major_to_chars, minor_to_chars)
3704         (mode_to_chars, off_to_chars, size_to_chars, time_to_chars)
3705         (uid_to_chars, uintmax_to_chars): Return bool
3706         (to_chars): Return bool
3707         (start_header): Check return values of convertion routines. Fail
3708         if unable to store data in the header.
3709
3710 2005-12-07  Sergey Poznyakoff  <gray@gnu.org.ua>
3711
3712         * doc/tar.texi: Following the discussion with Karl Berry,
3713         discontinue using @value{} substitutions for Texinfo commands.
3714         Properly index all long options. Print a
3715         separate long option index.
3716         * doc/value.texi: Remove @set's
3717
3718         * doc/tar.texi: Update --info-script documentation
3719         Resolve some more FIXMEs.
3720         * scripts/dump-remind.in: Use TAR_VOLUME instead of reading volno
3721         file.
3722         * src/buffer.c (new_volume): Update invocation
3723         (change_tape_menu): New function. Disable '!' command if given
3724         --restrict option.
3725         * src/common.h (sys_exec_info_script): Update declaration
3726         (restrict_option): New global
3727         * src/system.c (sys_exec_info_script): The script can supply new
3728         archive name to use by writing it to file descriptor 3.
3729         * src/tar.c (options): Add --restrict option. Use macros for
3730         option grouping.
3731         (license): Print full list of copyright years
3732         * NEWS: Update
3733
3734 2005-12-06  Eric Blake  <ebb9@byu.net> (trivial changes)
3735
3736         * configure.ac (DENSITY_LETTER): Fix m4 overquoting.
3737         * .cvsignore: Ignore .bootstrap.
3738
3739 2005-12-06  Sergey Poznyakoff  <gray@gnu.org.ua>
3740
3741         * doc/tar.texi: Document --to-command and --info-script
3742         options. Add missing xrefs.
3743         * src/buffer.c (new_volume): Use sys_exec_info_script() instead of
3744         system().
3745         * src/common.h (archive_format_string,subcommand_string)
3746         (sys_exec_info_script): New prototypes.
3747         * src/system.c (sys_exec_info_script): New function.
3748         * src/tar.c (archive_format_string): Remove static qualifier.
3749         (subcommand_string): New function.
3750
3751 2005-12-01  Sergey Poznyakoff  <gray@gnu.org.ua>
3752
3753         * src/extract.c: Fix restoring of directory timestamps from
3754         incremental archives.
3755         (directories_first): New variable.
3756         (prepare_to_extract): Set directories_first
3757         (extract_archive): Call apply_nonancestor_delayed_set_stat() only
3758         if not extracting from an incremental archive
3759         (extract_dir): Obtain root_device here, to make sure it works
3760         correctly with -C.
3761
3762         * src/incremen.c (purge_directory): Skip the member and return if
3763         the archive is not in incremental format.
3764         * tests/incr02.at: New testcase
3765         * tests/Makefile.am: Add incr02.at
3766         * tests/testsuite.at: Likewise
3767
3768         * THANKS: Add Guerkan Karaman.
3769         * NEWS: Update
3770
3771 2005-11-30  Paul Eggert  <eggert@cs.ucla.edu>
3772
3773         * doc/tar.texi (Option Summary): Rewrite the
3774         --atime-preserve=system description in response to Ian Turner's
3775         proposed patch.
3776
3777 2005-11-30  Ian Turner  <ian@zmanda.com>
3778
3779         * doc/tar.texi (Extracting Specific Files): Remove obsolescent
3780         FIXME.
3781
3782 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
3783
3784         * NEWS: New option --atime-preserve=system, which uses O_NOATIME.
3785         * THANKS: Add Ian Turner.
3786
3787         * configure.ac: Prefer AC_CHECK_HEADERS_ONCE to AC_CHECK_HEADERS.
3788         Check for stropts.h and sys/filio.h too, for _FIOSATIME.
3789         * doc/tar.texi: Change "modification time" to "data modification
3790         time", "change time" to "status change time", and "filesystem" to
3791         "file system", so that we use terminology consistent with POSIX.
3792         Use American spacing rather than French for sentence ends.
3793         "non-dependable" -> "undependable".
3794         (Option Summary, Attributes): Explain better the pitfalls of the
3795         --atime-preserve option, and suggest read-only mounts,loopback
3796         mounts, and noatime mounts for older systems.
3797         * doc/value.texi (op-atime-preserve-system): Renamed from
3798         op-atime-preserver-system to fix a misspelling.
3799         * src/common.h (enum atime_preserve): Use lower case for enum values.
3800         * src/compare.c: Don't include utimens.h; no longer needed.
3801         (diff_file): Use set_file_atime rather than utimens; avoid closing
3802         diff_handle until after this, so that we can set the file time stamp
3803         via the file descriptor rather than via its name.
3804         * src/create.c: Don't include utimens.h; no longer needed.
3805         (dump_regular_finish): Remove.  All callers now do its work inline.
3806         (dump_dir): New arg FD.  All callers changed.
3807         Use fdsavedir rather than savedir.
3808         (unknown_file_error): Arg is a const pointer now.
3809         (dump_file0): 2nd arg is a const pointer now.
3810         Treat directories more like files, with respect to --atime-preserve.
3811         For example, also warn if a directory changes while we are dumping it.
3812         Prefer file descriptors to file names when retrieving/setting file
3813         attributes; this saves path-resolution time and allows us to avoid
3814         changing mtime/ctime on Solaris when restoring atime as root.
3815         Use O_DIRECTORY when opening directories, to avoid some race conditions.
3816         Do not reset atime if mtime has changed.  Report an error if
3817         we cannot reset atime.
3818
3819         * lib/.cvsignore: Add malloc.h, regcomp.c, regex.c, regex.h,
3820         regex_internal.c, regex_internal.h, regexc.c; used by rpmatch.
3821
3822 2005-11-29  Ian Turner  <ian@zmanda.com>
3823
3824         First cut at adding support for --atime-preserve=system.
3825         * doc/tar.texi (Option Summary): First cut at documenting it.
3826         All other uses of --atime-preserve changed to --atime-preserve=replace.
3827         * doc/value.texi (op-atime-preserve-replace, op-atime-preserver-system):
3828         New.
3829         (op-atime-preserve): Mention METHOD.
3830         * src/common.h (atime_preserve): New enum.
3831         (atime_preserve_option): Now of the enum type rather than bool.
3832         All uses changed.
3833         * src/compare.c (diff_file): Read with O_NOATIME if asked for.
3834         * src/create.c (dump_file0): Read regular and CTG files with O_NOATIME
3835         if asked for.
3836         * src/tar.c (usage): Mention new usage.
3837         (parse_opt): Parse new usage.
3838
3839 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
3840
3841         * THANKS: Convert back to UTF-8, sort (using LC_ALL=C on Debian
3842         stable), and consistently use tabs rather than spaces.
3843
3844 2005-11-27  Sergey Poznyakoff  <gray@gnu.org.ua>
3845
3846         * src/xheader.c: Remove parts of code prematurely introduced
3847         yesterday. Thanks Eric Blake.
3848
3849 2005-11-26  Sergey Poznyakoff  <gray@gnu.org.ua>
3850
3851         * src/xheader.c (xheader_format_name): Fix memory leak.
3852
3853 2005-11-11  Sergey Poznyakoff  <gray@gnu.org.ua>
3854
3855         * gnulib.modules: Add rpmatch
3856         * lib/stdopen.h, lib/stdopen.c: New file. Imported from coreutils.
3857         * lib/Makefile.tmpl: Add stdopen.h, stdopen.c
3858         * po/POTFILES.in: Add rpmatch.c
3859         * src/tar.c (confirm): Rewritten using rpmatch.
3860         (decode_options): Minor optimizations
3861         (main): Call stdopen() to ensure the first three descriptors are
3862         open.
3863
3864         * tests/multiv01.at, tests/multiv02.at, tests/multiv03.at,
3865         tests/multiv04.at, tests/sparsemv.at, tests/sparsemvp.at,
3866         tests/star/multi-fail.at: Close stdin so that if something fails
3867         causing tar to ask for the next volume, it won't hang the
3868         testsuite.
3869
3870         * src/buffer.c (flush_write,flush_read): Change data type.
3871         (flush_archive): Compute actual buffer fill level before calling
3872         low level function.
3873         (close_archive): Call flush_archive again if the first call
3874         resulted in partially filled buffer.
3875         (try_new_volume): Rewritten handling of initial headers.
3876         (add_chunk_header): New function. Write an additional header
3877         before the continuation chunk. The purpose of the header is to
3878         allow third-party tars to extract the member.
3879         (simple_flush_write): Take an argument.
3880         (_gnu_flush_write): Correctly handle partially filled buffers.
3881         * src/common.h (flush_read,flush_write): Functions, again.
3882         (write_extended): Changed declaration
3883         (xheader_format_name): New declaration
3884         * src/create.c (write_extended): Change type and meaning of
3885         the first argument. All callers updated
3886         * src/xheader.c (xheader_format_name): Remove static
3887         qualifier. Change last argument.
3888         Correct buffer size calculation (allocated too much space).
3889         (xheader_write): Increase global_header_count here ...
3890         (xheader_write_global): ... instead of here
3891
3892         * tests/testsuite.at (AT_TAR_CHECK): Define TEST_TAR_FORMAT
3893         * tests/multiv01.at: Update
3894         * tests/multiv02.at: Update
3895         * tests/multiv03.at: Update
3896         * tests/sparsemvp.at: Update
3897         * tests/star/multi-fail.at: Update
3898
3899         * scripts/tarcat: Handle archives in pax format. Improve handling
3900         of traditional archives.
3901         * doc/tar.texi (Tarcat): New node
3902
3903 2005-11-10  Sergey Poznyakoff  <gray@gnu.org.ua>
3904
3905         Fix splitting of sparse files between the volumes.
3906
3907         * src/buffer.c (try_new_volume): Bugfix. Always check
3908         continued_file_name. If it is absent, the volume is out
3909         of sync.
3910         (add_multi_volume_header): Create GNU.volume.filename keyword in
3911         the extended header.
3912         * src/sparse.c (sparse_dump_region): Call mv_size_left.
3913         (sparse_dump_file): Enclose the loop in mv_begin/mv_end.
3914         * src/system.c: Do not pad compressed output if it goes to
3915         stdout.
3916         * src/xheader.c (xhdr_tab): New keyword GNU.volume.filename.
3917
3918         * tests/sparsemv.at: New testcase
3919         * tests/sparsemvp.at: New testcase
3920         * tests/Makefile.am: Add sparsemv.at and sparsemvp.at.
3921         * tests/testsuite.at: Likewise.
3922
3923 2005-11-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3924
3925         * src/buffer.c: Rewritten in a more modular fashion to provide
3926         GNU extensions (multi-volume archives and archive labels) in
3927         pax format.
3928         NOTICE, that some of the aspects (e.g. splitting the archive
3929         on the extended header boundary) are still not solved, others
3930         (splitting a sparse file between the volume) require additional
3931         testing. Wait for the next commit.
3932
3933         (volume_label,continued_file_name,continued_file_size)
3934         (continued_file_offset): New globals.
3935         (save_name,save_totsize,save_sizeleft): Make static
3936         (mv_begin,mv_end,mv_total_size,mv_size_left): New functions
3937         (open_archive,flush_write,flush_read): Rewritten
3938
3939         * src/common.h (save_name,save_sizeleft,save_totsize): Remove
3940         globals.
3941         (volume_label,continued_file_name,continued_file_size): New
3942         variables.
3943         (flush_read,flush_write): Pointers to functions
3944         (mv_begin,mv_end,mv_total_size,mv_size_left): New functions
3945         (write_extended): New function.
3946
3947         * src/compare.c, src/create.c, src/extract.c, src/incremen.c,
3948         src/list.c: Use mv_.* functions uniformly instead of fiddling
3949         with the global variables.
3950         * src/sparse.c: Use mv_.* functions where necessary.
3951         * src/tar.c (decode_options): Allow to use --multi-volume and
3952         --label with pax archives.
3953         * src/xheader.c (xhdr_tab): Support for new GNU keywords.
3954
3955         * tests/delete01.at, tests/delete02.at, tests/delete03.at,
3956         tests/delete04.at, tests/delete05.at, tests/extrac01.at,
3957         tests/extrac02.at, tests/extrac03.at, tests/extrac04.at,
3958         tests/extrac05.at, tests/incr01.at, tests/incremental.at,
3959         tests/listed01.at, tests/listed02.at, tests/long01.at,
3960         tests/longv7.at, tests/multiv01.at, tests/multiv02.at,
3961         tests/multiv03.at, tests/multiv04.at, tests/options.at,
3962         tests/options02.at, tests/same-order01.at, tests/same-order02.at,
3963         tests/sparse01.at, tests/sparse02.at, tests/sparse03.at,
3964         tests/star/multi-fail.at (AT_KEYWORDS): Improve to allow execution
3965         of related tests in groups.
3966
3967         * doc/tar.texi: Update
3968
3969 2005-11-07  Paul Eggert  <eggert@cs.ucla.edu>
3970
3971         * src/xheader.c (struct xhdr_tab.coder): Last arg is void const *,
3972         not void *, to avoid create.c warning from GCC "passing argument 3
3973         of 'xheader_store' discards qualifiers from pointer target type".
3974         (dummy_coder, atime_coder, gid_coder, gname_coder, linkpath_coder):
3975         (ctime_coder, mtime_coder, path_coder, size_coder, uid_coder):
3976         (uname_coder, sparse_size_coder, sparse_numblocks_coder):
3977         (sparse_offset_coder, sparse_numbytes_coder, dumpdir_coder):
3978         (xheader_store): Likewise.
3979         * src/common.h (xheader_store): Likewise.
3980
3981 2005-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>
3982        and  Paul Eggert  <eggert@cs.ucla.edu>
3983
3984         * src/tar.c (NS_PRECISION_FORMAT_MASK): New macro.
3985         (tar_timespec_cmp): New function. Wrapper over
3986         timespec_cmp using the timespec precision provided by the
3987         current archive format.
3988         * src/common.h (tar_timespec_cmp): New declaration.
3989         * src/compare.c (diff_file): Use tar_timespec_cmp.
3990         * src/extract.c (file_newer_p): Likewise.
3991         * src/update.c (update_archive): Likewise.
3992         * tests/truncate.at: Reverted changes
3993         * tests/update.at: Reverted changes
3994
3995 2005-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>
3996
3997         Support for incremental formats in pax archives.
3998         Fixed POSIX compatibility of `sparse' extended header keywords.
3999
4000         * src/common.h (dumpdir_size,get_gnu_dumpdir)
4001         (xheader_string_begin,xheader_string_add)
4002         (xheader_string_end): New functions.
4003         * src/create.c (dump_dir0): Handle incremental backups in pax
4004         archives.
4005         * src/incremen.c (dumpdir_size, get_gnu_dumpdir): New functions.
4006         (purge_directory): Use stat_info.dumpdir instead of getting its
4007         value explicitely.
4008         * src/list.c (list_archive): Handle incremental backups in pax
4009         format.
4010         (decode_header): Initialize stat_info.dumpdir
4011         * src/sparse.c (sparse_diff_file): Bugfix: set seekable.
4012         (pax_dump_header): Store sparse map in GNU.sparse.map. If this
4013         variable has been explicitely deleted, use GNU.sparse.offset/
4014         GNU.sparse.numbytes variables.
4015         * src/tar.c (decode_options): Incremental options are allowed with
4016         --format=pax
4017         (tar_stat_destroy): Free dumpdir
4018         * src/tar.h (struct tar_stat_info.dumpdir): New member.
4019         * src/xheader.c (xheader_keyword_deleted_p): Remove static
4020         qualifier.
4021         (struct xhdr_tab.decoder): Change prototype. POSIX allows string
4022         values to contain embedded nulls, so take an extra argument
4023         specifying the length of the string.
4024         (decx,decg,dummy_decoder,atime_decoder,gid_decoder)
4025         (gname_decoder,linkpath_decoder,ctime_decoder,mtime_decoder)
4026         (path_decoder,size_decoder,uid_decoder,uname_decoder)
4027         (sparse_size_decoder,sparse_numblocks_decoder)
4028         (sparse_offset_decoder,sparse_numbytes_decoder): Likewise.
4029         (decode_record): Pass value length to the handler
4030         (run_override_list): Pass value length to the decoder
4031         (xheader_print_n): New function
4032         (xheader_print): Rewritten using xheader_print_n
4033         (xheader_finish): Do not rely om strlen to compute the length of
4034         the collected string: it can contain embedded nulls
4035         (xheader_string_begin,xheader_string_add,xheader_string_end): New
4036         functions.
4037         (sparse_map_decoder,dumpdir_coder,dumpdir_decoder): New
4038         functions. Handle GNU.sparse.map and GNU.dumpdir variables.
4039         (xhdr_tab): Add new variables.
4040
4041         * tests/incr01.at: Test gnu, oldgnu, and posix formats
4042         * tests/incremental.at: Likewise
4043
4044 2005-11-06  Paul Eggert  <eggert@cs.ucla.edu>
4045
4046         * NEWS: Minor language and white space fixes.
4047
4048         * tests/truncate.at: Create files whose time stamps must fall on
4049         1-second boundaries.  This prevents tests from failing on hosts
4050         like Solaris 8 that have nanosecond-resolution file time stamps.
4051         * tests/update.at: Likewise.
4052
4053         * src/xheader.c (strtoimax, strtoumax): Remove decls; now done
4054         in system.h.
4055
4056 2005-11-06  Sergey Poznyakoff  <gray@gnu.org.ua>
4057
4058         * doc/tar.texi: Properly document incremental dumps
4059         * doc/value.texi: Likewise.
4060         * doc/snapshot.texi: Likewise.
4061
4062 2005-11-05  Sergey Poznyakoff  <gray@gnu.org.ua>
4063
4064         Improve listed incremental format:
4065
4066         * src/common.h (update_parent_directory): New prototype.
4067         * src/create.c (dump_file): Call update_parent_directory.
4068         * src/incremen.c (struct directory.mtime): New member.
4069         (note_directory): Take additional arguments. All callers updated.
4070         (scan_directory): Updated to use more metadata. In particular,
4071         this allows to correctly detect renamed files.
4072         (read_directory_file,write_directory_file)
4073         (write_directory_file_entry): Support new directory file format.
4074         * tests/listed01.at: Sleep 1 sec before creating second file.
4075         * tests/listed02.at: Never skip the test. It should work on any
4076         filesystem.
4077
4078         * doc/snapshot.texi: New file
4079         * doc/tar.texi: Update.
4080         * doc/Makefile.am: Update.
4081
4082 2005-11-04  Paul Eggert  <eggert@cs.ucla.edu>
4083
4084         * src/extract.c (set_stat): Rewrite to avoid bug in Forte
4085         Developer 7 C 5.4 Patch 111708-09 (2004-02-19).
4086
4087 2005-11-04  Sergey Poznyakoff  <gray@gnu.org.ua>
4088
4089         * bootstrap: Fix quoting in help output.
4090         (update_po): Use backward-compatible wget option --cache instead
4091         of deprecated -C to accomodate for wget 1.10.
4092         Changes proposed by Eric Blake
4093         * THANKS: Add Eric Blake
4094
4095 2005-11-02  Paul Eggert  <eggert@cs.ucla.edu>
4096
4097         * doc/tar.texi: Consistently put two spaces after sentences,
4098         and put commas after "i.e." and "e.g.".  This is the usual GNU
4099         style in manuals.
4100
4101         * lib/.cvsignore: Add creat-safer.c, fcntl--.h, fcntl-safer.h,
4102         open-safer.c, openat-die.c, verify.h, to accommodate recent gnulib
4103         changes.
4104
4105 2005-10-27  Sergey Poznyakoff  <gray@gnu.org.ua>
4106
4107         * src/compare.c (diff_dumpdir): Pass a valid device number to
4108         get_directory_contents.
4109
4110         * THANKS: Add John Thomas McDole
4111
4112         * bootstrap: If file `.bootstrap' exists in the cwd and is
4113         readable, prepend its contents to the command line
4114
4115 2005-10-21  Sergey Poznyakoff  <gray@gnu.org.ua>
4116
4117         * tests/link01.at: Skip test if ln fails (suppose the OS does
4118         not support hard links).
4119
4120 2005-10-04  Sergey Poznyakoff  <gray@gnu.org.ua>
4121
4122         * src/tar.c (decode_options): Report error if -A or -r is used
4123         together with compression option.
4124
4125 2005-09-29  Sergey Poznyakoff  <gray@gnu.org.ua>
4126
4127         * doc/tar.texi: Use @option and @kbd consistently.
4128         Document new options.
4129
4130 2005-09-28  Sergey Poznyakoff  <gray@gnu.org.ua>
4131
4132         * NEWS: Updated
4133         * src/common.h (show_stored_names_option): New variable
4134         * src/list.c (print_header): If show_stored_names_option is given,
4135         list member names as stored in the archive. Patch proposed by Erik
4136         Cumps <erik.cumps@icos.be>
4137         * src/tar.c: Implement --show-stored-names option
4138
4139         * src/common.h (test_label_option): New variable;
4140         * src/list.c (print_header): Special handling if test_label_option
4141         is set.
4142         * src/names.c (all_names_found): If test_label_option is set
4143         return true.
4144         * src/tar.c: New option --test-label tests the archive volume
4145         label. The option proposed by Wouter Verhelst <wouter@nixsys.be>
4146
4147 2005-09-21  Paul Eggert  <eggert@cs.ucla.edu>
4148
4149         * tests/Makefile.am (clean-local): Don't attempt to run
4150         $(TESTSUITE) if it doesn't exist.  Problem reported by
4151         Eric Blake.
4152
4153 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
4154
4155         Don't filter time stamps through the resolution supported
4156         by struct stat; keep them to full nanosecond resolution.
4157         This affects behavior only on older hosts or file systems
4158         that have lower-resolution time stamps.
4159         * src/common.h (OLDER_STAT_TIME): Parenthesize arg.
4160         (OLDER_TAR_STAT_TIME): New macro.
4161         (code_timespec): New function.
4162         (BILLION, LOG10_BILLION, TIMESPEC_STRSIZE_BOUND): New constants.
4163         * src/compare.c (diff_file): Use full time stamp resolution.
4164         * src/create.c (start_header, dump_file0): Likewise.
4165         (start_header, dump_file0): Adjust to new structure layout.
4166         (dump_regular_finish): Simplify by using timespec_cmp.
4167         * src/extract.c (struct delayed_set_stat): Don't store stat info
4168         that we don't need, to save space.  All uses changed.
4169         (struct delayed_set_stat, struct delayed_link, file_newer_p):
4170         (create_placeholder_file, extract_link, apply_delayed_links):
4171         Use full time stamp resolution.
4172         (check_time): Use code_timespec rather than rolling our own code.
4173         (set_stat, delay_set_stat): Arg now points to tar_stat_info to
4174         avoid losing time information.  All callers changed.
4175         * src/list.c (read_and, decode_header, print_heaeder):
4176         Use full time stamp resolution.
4177         * src/misc.c (code_timespec): New function.
4178         * src/tar.h (struct tar_stat_info): Record atime, mtime, ctime
4179         separately, for benefit of hosts with lower resolution.
4180         * src/update.c (update_archive): Use full time stamp resolution.
4181         * src/xheader.c (code_time): Use new code_timespec function
4182         to simplify code.
4183         (atime_coder, atime_decoder, ctime_coder, ctime_decoder):
4184         (mtime_coder, mtime_decoder): Use full time stamp resolution.
4185
4186         Report time stamps to full resolution in environment.
4187         Report memory allocation failures rather than ignoring them.
4188         * src/system.c (time_to_env): New function.
4189         (oct_to_env, str_to_env, chr_to_env): Report memory allocation failures.
4190         (stat_to_env): Report full resolution in time stamps.
4191
4192 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
4193
4194         Merge changes from gnulib for file system sub-second time stamps.
4195         * configure.ac: Remove checks for struct stat.st_spare1, struct
4196         stat.st_atim.tv_nsec, struct stat.st_atimespec.tv_nsec, struct
4197         stat.st_atimensec, as gnulib now does this for us.
4198         Similarly for LIB_CLOCK_GETTIME.
4199         * gnulib.modules: Add stat-time.
4200         * lib/.cvsignore: Add stat-time.h.
4201         * src/common.h: Include stat-time.h.
4202         (timespec_lt): Remove.  All callers changed to use timespec_cmp.
4203         (get_stat_atime, get_stat_ctime, get_stat_mtime):
4204         (set_stat_atime, set_stat_ctime, set_stat_mtime):
4205         Remove; now defined by stat-time.h.
4206
4207 2005-09-14  Sergey Poznyakoff  <gray@gnu.org.ua>
4208
4209         * src/incremen.c (list_dumpdir): New function. Used to dump
4210         contents of GNUTYPE_DUMPDIR blocks.
4211         * src/common.h (list_dumpdir): Likewise.
4212         * src/list.c (list_archive): Use list_dumpdir() to display
4213         GNUTYPE_DUMPDIR blocks. Do that only if two or more -v options are
4214         given.
4215
4216 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
4217
4218         * lib/.cvsignore: Adjust to current gnulib and modules used.
4219         Add getdelim.c, getdelim.h, mbchar.c, mbchar.h, mbuiter.h, memchr.c,
4220         pipe-safer.c, size_max.h, strdup.c, strdup.h, strnlen.h, strnlen1.c,
4221         strnlen1.h, unistd--.h.
4222         Remove getndelim2.c, getndelim2.h, pathmax.h, sysexits.h, xstrdup.c.
4223
4224         Treat fishy-looking hard links like fishy-looking symlinks.
4225         * src/extract.c (struct delayed_set_stat): Rename after_symlinks
4226         member to after_links.  All uses changed.
4227         (struct delayed_link): Renamed from struct delayed_symlink.
4228         All uses changed.  New member is_symlink.
4229         (delayed_link_head): Renamed from delayed_symlink_head.  All uses
4230         changed.
4231         (create_placeholder_file): New function, taken from extract_symlink.
4232         (extract_link): Create placeholders for fishy-looking hard links.
4233         (extract_symlink): Move code into create_placeholder_file.
4234         (apply_delayed_links): Renamed from apply_delayed_symlinks.
4235         All uses changed.  Create both hard links and symlinks.
4236
4237 2005-09-03  Paul Eggert  <eggert@cs.ucla.edu>
4238
4239         * README-alpha: Modernize description of software required for
4240         developers.
4241
4242 2005-09-03  Sergey Poznyakoff  <gray@gnu.org.ua>
4243
4244         * gnulib.modules: Add strdup
4245         * src/incremen.c (purge_directory): Do not dereference symbolic
4246         links. Bug reported by Ralph Corderoy <ralph@inputplus.co.uk> and
4247         David Brown <davidb@davidb.org>
4248         * tests/incr01.at: New test.
4249         * tests/Makefile.am: Add incr01.at
4250         * tests/testsuite.at: Likewise
4251         * THANKS: Updated
4252
4253 2005-08-17  Sergey Poznyakoff  <gray@gnu.org.ua>
4254
4255         * src/incremen.c (read_directory_file): Use strtoumax to read
4256         snapshot file contents.
4257         (write_directory_file_entry): Use umaxtostr().
4258
4259 2005-07-31  Sergey Poznyakoff  <gray@gnu.org.ua>
4260
4261         * src/create.c (file_dumpable_p,dump_file0): Fix handling of
4262         sparse files to /dev/null with --totals option.
4263         * tests/update.at: Remove dependency on file order.
4264
4265 2005-07-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4266
4267         * doc/tar.texi: Fix typo.
4268
4269 2005-07-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4270
4271         * tests/pipe.at: Pipe the output from `tar xfv' through sort.
4272
4273 2005-06-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4274
4275         * src/sparse.c (tar_sparse_init): Fill structure with zeros. Call
4276         sparse_select_optab(). All callers updated.
4277         (sparse_member_p, sparse_fixup_header): Use tar_sparse_init().
4278
4279 2005-06-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4280
4281         * src/sparse.c (pax_sparse_member_p): Checking member size
4282         vs. file size is not reliable enough. Use sparse_map_avail.
4283
4284         * tests/star/gtarfail.at: Adapt to the new output format
4285         * tests/star/gtarfail2.at: Likewise
4286         * tests/star/multi-fail.at: Likewise
4287         * tests/star/pax-big-10g.at: Likewise
4288         * tests/star/ustar-big-2g.at: Likewise
4289         * tests/star/ustar-big-8g.at: Likewise
4290
4291         * tests/sparse03.at: New test.
4292         * tests/Makefile.am: Add sparse03.at
4293         * tests/testsuite.at: Likewise
4294
4295         * src/xheader.c (size_decoder): Do not set archive_file_size.
4296
4297         Fix bugs introduced yesterday:
4298
4299         * src/sparse.c (tar_sparse_init):  Initialize
4300         dimped_size to 0.
4301         (sparse_scan_file): Initialize archive_file_size to 0. The
4302         variable keeps size of the file *as stored in the archive*, not
4303         the size reported by stat.
4304
4305 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
4306
4307         A sweep of the sparse code prompted by a bug report by Jim Meyering.
4308         * src/sparse.c: Include <inttostr.h>.
4309         (struct tar_sparse_file): offset and dumped_size are off_t, not
4310         size_t.  optab is now const *.
4311         (dump_zeros): Return bool success flag, not off_t.
4312         All callers changed.
4313         Use a constant-zero buffer rather than clearing a buffer each time.
4314         Don't mess up if write fails.
4315         (dump_zeros, check_sparse_region):
4316         Don't assume off_t is no wider than size_t.
4317         (tar_sparse_init): Don't bother clearing a field that is already clear.
4318         (zero_block_p): First arg is const *, not *.
4319         (clear_block, SPARSES_INIT_COUNT): Remove.
4320         (sparse_add_map): First arg is now struct start_stat_info *, not
4321         struct tar_sparse_file *.  All callers changed.
4322         Use x2nrealloc to check for size_t overflow.
4323         (parse_scan_file): Cache commonly-used parts of file.
4324         Use an auto buffer, not a static one.
4325         Don't bother clearing the buffer; not needed.
4326         Don't bother clearing items that are already clear.
4327         (oldgnu_optab, star_optab, pax_optab): Now const.
4328         (sparse_dump_region): Don't bother clearing the buffer before
4329         reading into it; just clear the parts that aren't read into.
4330         (sparse_dump_file): Clear the whole local variable 'file'.
4331         (diff_buffer): Remove; now a local var.
4332         (check_sparse_region): Don't bother clearing buffer before
4333         reading into it.  Don't assume off_t is promoted to long.
4334         (oldgnu_get_sparse_info, star_get_sparse_info):
4335         Use an auto status, not static.
4336         * src/tar.h (struct tar_stat_info): had_trailing_slash is
4337         now bool, not int.
4338         * src/xheader.c (sparse_offset_coder, sparse_numbytes_coder):
4339         Rewrite to avoid cast.
4340         (sparse_offset_decoder, sparse_numbytes_decoder):
4341         Diagnose excess entries rather than crashing.
4342
4343 2005-06-22  Jim Meyering  <jim@meyering.net>
4344
4345         * src/common.h (timespec_lt): Add a return type: bool.
4346
4347 2005-06-21  Paul Eggert  <eggert@cs.ucla.edu>
4348
4349         Further improvements inspired by Jim Meyering's fixes.
4350
4351         * NEWS: Better support for full-resolution time stamps.
4352         The -v option now prints time stamps only to 1-minute resolution.
4353         * gnulib.modules: Add utimens.
4354         * lib/.cvsignore: Add imaxtostr.c, inttostr.c, inttostr.h,
4355         offtostr.c, umaxtostr.c, utimens.c, utimens.h.  Remove paxconvert.c.
4356         * lib/Makefile.tmpl (libtar_a_SOURCES): Remove paxconvert.c.
4357         * lib/paxconvert.c: Remove; superseded by umaxtostr.c.
4358         * po/POTFILES.in: Remove lib/paxconvert.c.  Add lib/xalloc-die.c,
4359         lib/obstack.c.
4360         * src/buffer.c (set_start_time, compute_duration, start_time):
4361         Use gettime rather than rolling our own code.
4362         * src/common.h (OLDGNU_NAME_FIELD_SIZE, MAXOCTAL11, MAXOCTAL7): Remove.
4363         (newer_ctime_option): Remove.
4364         (timespec_lt): New function.
4365         (OLDER_STAT_TIME): Use it.
4366         (string_to_chars): First arg is char const *, not char *.
4367         (tartime): Time arg is now struct timespec.  New bool arg.
4368         All callers changed.
4369         (code_ns_fraction): New decl.
4370         (sys_stat_nanoseconds): Remove decl.
4371         (get_stat_atime, get_stat_ctime, get_stat_mtime): New functions.
4372         (set_stat_atime, set_stat_ctime, set_stat_mtime): New functions.
4373         * src/compare.c: Include utimens.h rather than rolling our own.
4374         (diff_dir, diff_file, diff_link, diff_symlink, diff_special):
4375         Prototype.
4376         (diff_dumpdir, diff_multivol): Prototype.
4377         (diff_file): Support higher-resolution time stamps.
4378         * src/create.c: Include utimens.h rather than rolling our own.
4379         (MAX_OCTAL_VAL): New macro.
4380         (tar_copy_str, string_to_chars): Don't bother to zero-fill;
4381         the destination is already zeroed.
4382         (string_to_chars): First arg is char const *.
4383         (start_private_header): Use MINOR_TO_CHARS, not MAJOR_TO_CHARS,
4384         for minor device number.
4385         (write_header_name, dump_hard_link, dump_file0):
4386         Simplify test for old GNU format.
4387         (start_header): Put in placeholders for uid, etc., even when
4388         using extended headers, for benefit of older "tar" implementations.
4389         Don't assume uintmax_t is wider than 32 bits.
4390         Output extended header for mtime if needed.
4391         (dump_regular_finish, dump_file0):
4392         Support extended time stamp resolution.
4393         * src/extract.c: Include utimens.h rather than rolling our own.
4394         (check_time): Support extended time stamp resolution.
4395         * src/list.c: Include <inttostr.h>.
4396         (tartime): Use umaxtostr rather than stringify_uintmax_t_backwards.
4397         * src/xheader.c: Include <inttostr.h>.
4398         Do not include <xstrtol.h>.
4399         (strtoimax) [!HAVE_DECL_STRTOIMAX && !defined strtoimax]: New decl.
4400         (strtoumax) [!HAVE_DECL_STRTOUMAX && !defined strtoumax]: New decl.
4401         (BILLION, LOG10_BILLION): New constants.
4402         (to_decimal): Remove; superseded by inttostr.  All callers changed
4403         to use umaxtostr.
4404         (xheader_format_name): Don't assume pids and uintmax_t values
4405         fit in 63 bytes (!) when printed.
4406         (decode_record): Don't bother to check for ERANGE; an out of range
4407         value must be treater than len_max anyway.
4408         If the length is out of range, output it in the diagnostic.
4409         (format_uintmax): Remove; all callers changed to use umaxtostr.
4410         (xheader_print): Don't assume sizes can be printed in 99 bytes (!).
4411         (out_of_range_header): New function.
4412         (decode_time): Use it.
4413         (code_time): Accept struct timespec, not time_t and unsigned long.
4414         All callers changed.  Size sbuf properly, and remove unnecessary check.
4415         Don't assume time stamps can fit in 199 bytes.
4416         Handle negative time stamps.  Handle fractional time stamps
4417         more consistently.  Don't output unnecessary trailing zeros.
4418         (decode_time): Yield struct timespec, not time_t and unsigned long.
4419         All callers changed.
4420         Handle negative time stamps.  Truncate towards minus infinity
4421         consistently.  Improve overflow checks, and output a better
4422         diagnostic on overflow.
4423         (code_num): Don't assume uintmax_t can be printed in 99 bytes (!).
4424         (decode_num): New function, for better diagnostics.
4425         (atime_coder, atime_decoder, gid_decoder, ctime_coder):
4426         (ctime_decoder, mtime_coder, mtime_decoder, size_decoder):
4427         (uid_decoder, sparse_size_decoder, sparse_numblocks_decoder):
4428         (sparse_offset_decoder, sparse_numbytes_decoder):
4429         Use decode_num, etc., instead of xstrtoumax, etc.
4430
4431 2005-06-21  Jim Meyering  <jim@meyering.net>
4432
4433         Carefully crafted invalid headers can cause buffer overrun.
4434         Invalid header fields go undiagnosed.
4435         Some valid time strings are ignored.
4436
4437         * src/xheader.c (sparse_numblocks_decoder): Remove unchecked use
4438         of `calloc'.  Use xcalloc instead.
4439         (decode_time, gid_decoder, size_decoder, uid_decoder):
4440         (sparse_size_decoder, sparse_offset_decoder, sparse_numblocks_decoder):
4441         Ensure that the result of calling xstrtoumax is no larger than
4442         the maximum value for the target type.  Upon any failure, exit with
4443         a diagnostic.
4444         (sparse_numblocks_decoder): Avoid buffer overrun/heap corruption:
4445         use x2nrealloc, rather than `n *= 2' and xrealloc(p, n,....
4446         (decode_time): Rewrite to accept time strings like
4447         1119018481.000000000.  Before, such strings were always ignored.
4448
4449 2005-06-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4450
4451         * src/create.c (dump_file0): Check for is_avoided_name()
4452         first. Fixes bug reported by Martin Lohmeier
4453         <martin@mein-horde.de>
4454         * tests/update.at: New file
4455         * tests/Makefile.am (TESTSUITE_AT): Add update.at
4456         * tests/testsuite.at: Likewise
4457
4458 2005-06-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4459
4460         * configure.ac (AC_STRUCT_ST_BLKSIZE)
4461         (AC_STRUCT_ST_BLOCKS): Removed. Handled by system.m4.
4462
4463 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
4464
4465         * src/names.c (excluded_name): excluded_filename ->
4466         excluded_file_name, because the name was changed in gnulib.
4467
4468 2005-05-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4469
4470         * src/tar.c (read_name_from_file,update_argv): Automatically
4471         detect nul-terminated list files.
4472         * NEWS: Updated
4473
4474 2005-05-27  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4475
4476         * scripts/backup.sh.in: Bugfixes.
4477
4478 2005-05-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4479
4480         * scripts/backup.in: Minor fixes
4481         * scripts/backup.sh.in (mt_begin,mt_rewind)
4482         (mt_offline,mt_status): Use $MT to invoke mt
4483         (init_common): Set --rsh-command option for mt if TAPE_FILE is a
4484         remote archive.
4485         * doc/tar.texi: Document new backup scripts behavior
4486
4487 2005-05-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4488
4489         * lib/.cvsignore: Updated
4490         * lib/Makefile.tmpl: Add new paxutils files
4491         * po/POTFILES.in: Likewise
4492         * src/buffer.c: Update invocations of safer_name_suffix()
4493         * src/create.c: Likewise
4494         * src/extract.c: Likewise
4495         * src/xheader.c: Likewise
4496         * src/common.h: Include paxlib.h instead of paxerror.h
4497         (safer_name_suffix,removed_prefixes_p): Removed. The functions are
4498         imported from paxutils
4499         * src/names.c (hash_string_hasher,hash_string_compare)
4500         (hash_string_insert,hash_string_lookup,removed_prefixes_p)
4501         (safer_name_suffix): Moved to paxutils
4502
4503 2005-05-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4504
4505         * bootstrap (copy_files): Accept optional third argument: a prefix
4506         to be appended to destination file names.
4507         Import paxutils/paxlib files.
4508         * configure.ac: Remove checking for LIB_SETSOCKOPT, it is handled
4509         by paxutils.
4510         * lib/Makefile.tmpl (libtar_a_SOURCES): Add paxerror.c paxexit.c
4511         paxconvert.c
4512         * po/POTFILES.in: Likewise.
4513         * src/common.h: Remove defines and declarations imported from
4514         paxutils
4515         * src/misc.c: Likewise
4516         * src/list.c (stringify_uintmax_t_backwards): Moved to paxutils
4517
4518 2005-05-17  Paul Eggert  <eggert@cs.ucla.edu>
4519
4520         * src/misc.c (remove_any_file): Fix typo in previous change.
4521
4522 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
4523
4524         Port to Solaris 10's treatment of unlinking directories.
4525         * gnulib-modules: Add unlinkdir.
4526         * lib/.cvsignore: Add unlinkdir.h, unlinkdir.c.
4527         * src/common.h (we_are_root): Remove extern decl; it's now static.
4528         * src/extract.c (we_are_root): Now static.
4529         * src/misc.c: Include <unlinkdir.h>.
4530         (remove_any_file): Use cannot_unlink_dir () rather than we_are_root.
4531
4532         * ChangeLog, ChangeLog.1, Makefile.am, NEWS, PORTS, README,
4533         README-alpha, TODO, bootstrap, configure.ac, doc/Makefile.am,
4534         doc/convtexi.pl, doc/fdl.texi, doc/gendocs_template,
4535         lib/Makefile.tmpl, lib/prepargs.c, lib/waitpid.c, po/POTFILES.in,
4536         scripts/Makefile.am, scripts/backup-specs, scripts/backup.in,
4537         scripts/backup.sh.in, scripts/restore.in, src/Makefile.am,
4538         src/arith.h, src/buffer.c, src/common.h, src/compare.c,
4539         src/create.c, src/delete.c, src/extract.c, src/incremen.c,
4540         src/list.c, src/mangle.c, src/misc.c, src/names.c, src/sparse.c,
4541         src/system.c, src/tar.c, src/tar.h, src/update.c, src/utf8.c,
4542         src/xheader.c, tests/Makefile.am, tests/append.at,
4543         tests/append01.at, tests/comprec.at, tests/delete01.at,
4544         tests/delete02.at, tests/delete03.at, tests/delete04.at,
4545         tests/delete05.at, tests/extrac01.at, tests/extrac02.at,
4546         tests/extrac03.at, tests/extrac04.at, tests/extrac05.at,
4547         tests/gzip.at, tests/ignfail.at, tests/incremental.at,
4548         tests/link01.at, tests/listed01.at, tests/listed02.at,
4549         tests/long01.at, tests/longv7.at, tests/multiv01.at,
4550         tests/multiv02.at, tests/multiv03.at, tests/multiv04.at,
4551         tests/old.at, tests/options.at, tests/options02.at, tests/pipe.at,
4552         tests/recurse.at, tests/same-order01.at, tests/same-order02.at,
4553         tests/shortrec.at, tests/sparse01.at, tests/sparse02.at,
4554         tests/testsuite.at, tests/truncate.at, tests/version.at,
4555         tests/volume.at, tests/star/gtarfail.at, tests/star/gtarfail2.at,
4556         tests/star/multi-fail.at, tests/star/pax-big-10g.at,
4557         tests/star/quicktest.sh, tests/star/ustar-big-2g.at,
4558         tests/star/ustar-big-8g.at:
4559         Update FSF postal mail address.
4560
4561 2005-05-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4562
4563         * NEWS: Updated
4564         * THANKS: Updated
4565         * bootstrap: Install files from paxutils/doc
4566         * doc/Makefile.am (tar_TEXINFOS): Add genfile.texi
4567         * doc/tar.texi (Genfile): New appendix
4568         * src/compare.c (diff_file): diff_handle was not initialized
4569         * src/create.c (dump_regular_file): Correctly pad archive members
4570         that shrunk during archiving. Repored by Frank Heckenbach.
4571         * src/extract.c (file_newer_p): Return false if file does not
4572         exist
4573         (prepare_to_extract): Correct warning wording.
4574         * tests/truncate.at: New test case
4575         * tests/Makefile.am: Add truncate.at
4576         * tests/testsuite.at: Likewise.
4577
4578         * doc/.cvsignore: Updated
4579         * lib/.cvsignore: Updated
4580         * tests/.cvsignore: Updated
4581
4582 2005-05-02  Paul Eggert  <eggert@cs.ucla.edu>
4583
4584         * tests/multivol04.at: Tell awk to read from /dev/null.
4585
4586         Adjust to recent gnulib changes.
4587         * lib/.cvsignore: Add dup-safer.c, fd-safer.c, unistd-safer.h.
4588         * src/common.h (initial_umask): New var.
4589         * src/create.c (start_ueader): Use it, and adjust to new modechange
4590         API.
4591         (hash_link): unsigned -> size_t parameters and result.
4592         * src/incremen.c (hash_directory): Likewise.
4593         * src/names.c (hash_string_hasher): Likewise.
4594         * src/tar.c (parse_opt): Set it, and adjust to new modechange API.
4595
4596 2005-04-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4597
4598         * tests/Makefile.am: Add shortrec.at.
4599
4600 2005-04-18  Paul Eggert  <eggert@cs.ucla.edu>
4601
4602         * src/buffer.c (reading_from_pipe): Remove.  All uses removed.
4603         (short_read): Don't warn about short reads; they're normal.
4604         * tests/shortrec.at: New file.
4605         * tests/testsuite.at: Include it.
4606
4607         * bootstrap (gnulib_modules): Don't create a file modlist.tmp, as
4608         it is sometimes left behind as a garbage file (maybe due to the
4609         multiple traps?).
4610
4611 2005-04-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4612
4613         * src/list.c: Handle Solaris 'X' type flag
4614         * src/tar.h (SOLARIS_XHDTYPE): New define
4615
4616 2005-04-06  Sergey Poznyakoff  <gray@mirddin.farlep.net>
4617
4618         * src/tar.c: Minor fixes to text messages. Proposed by Benno
4619         Schulenberg.
4620         * src/extract.c: Likewise
4621         (extract_file): Assign orig_file_name
4622         to save_name uniformly over the program. This fixes matching
4623         directory names at the start of an archive volume.
4624         * src/buffer.c (flush_write): Warn when the name of the archive
4625         straddling volume boundary is longer than 100 characters. Earlier
4626         behavior was to issue a fatal error.
4627         (struct zip_magic): Reverted part of changes from 2005-04-04.
4628         They make the maintenance too costly. Removing `unsigned'
4629         qualifier from `magic' member should be enough.
4630         * src/compare.c (diff_init): Read directory file if in listed
4631         incremental. This prevents spurious 'Contents differ' diagnostics.
4632         (diff_archive): Minor fixes to text messages
4633         (diff_file,diff_dumpdir,diff_multivol): Assign orig_file_name
4634         to save_name uniformly over the program. This fixes matching
4635         directory names at the start of an archive volume.
4636         * src/create.c: Assign orig_file_name
4637         to save_name uniformly over the program. This fixes matching
4638         directory names at the start of an archive volume.
4639         * src/list.c: Likewise
4640
4641         * tests/multiv03.at: Modified to match the new behavior
4642         * tests/multiv04.at: New file. Test splittind directory members between
4643         the archive volumes.
4644         * tests/Makefile.am: Add multiv04.at
4645         * tests/testsuite.at: Likewise.
4646
4647 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4648
4649         * configure.ac (AC_CONFIG_AUX_DIR): Rename from config to build-aux,
4650         for reasons discussed in the thread beginning at
4651         <http://lists.gnu.org/archive/html/bug-gnulib/2005-03/msg00119.html>.
4652         * .cvsignore: Remove config; add build-aux.
4653
4654         * src/buffer.c (struct zip_magic): Use char arrays, not pointers.
4655         The unsigned char * pointer ran afoul of pedantic C compilers, and
4656         we didn't need pointers anyway.  Put the size field before the
4657         data to avoid unnecessary padding.  All uses changed.
4658         (magic) Make it const, since it doesn't change.  All uses changed.
4659
4660 2005-04-02  Paul Eggert  <eggert@cs.ucla.edu>
4661
4662         * src/xheader.c (decode_record): Don't dump core when given
4663         a corrupted extended header.  Problem reported by Jim Meyering.
4664         Also, check for other ways that the header might be invalid,
4665         e.g., missing newline at end.  Do not allow keys with nulls.
4666         Allow blanks before and after length, as POSIX requires.
4667         Do not allow leading "-" in length.  Check for length overflow.
4668         (xheader_decode, xheader_decode_global): Let decode_record
4669         check for exhaustion of record.
4670         (xheader_read): Null-terminate the extended record;
4671         decode_record relies on this.
4672
4673 2005-03-21  Paul Eggert  <eggert@cs.ucla.edu>
4674
4675         * bootstrap (TP_URL): Change from
4676         <http://www2.iro.umontreal.ca/~gnutra/po/maint/tar/> to
4677         <http://www.iro.umontreal.ca/translation/maint/tar/> to avoid
4678         some redirection glitches.
4679         Use "trap - 0" rather than "trap 0" to fix a POSIX-conformance bug.
4680         * doc/.cvsignore: Change "tar.info" to "tar.info*".  Sort.
4681         * lib/.cvsignore: Add intprops.h (new gnulib file).
4682
4683 2005-03-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4684
4685         * src/list.c (print_header): Print UID/GID in case of
4686         empty user/group name. This could occur when dumping
4687         files belonging to non-existing users and when listing
4688         broken archives.
4689         Reported by Igor Lautar.
4690
4691         * src/create.c: Correctly parse empty uname/gname
4692         * src/sparse.c (sparse_scan_file): Bugfix. offset had
4693         incorrect type.
4694
4695         * scripts/backup.in: Use `head -n 1'. Provide missing
4696         argument to ${MT_STATUS}. Proposed by Jan Merka.
4697         * scripts/backup.sh.in: Likewise. Fixed typo in
4698         MT_OFFLINE assignment.
4699         * scripts/restore.in (restore_fs): Use root_fs
4700
4701 2005-02-15  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4702
4703         * src/create.c: Replace strdup with xstrdup
4704         * src/names.c: Likewise
4705         * src/tar.c: Likewise
4706
4707         * tests/append01.at: Added reference to bug-tar archive
4708         * tests/listed02.at: Use -print with find.
4709
4710 2005-02-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4711
4712         * THANKS: Added Tim Adye. Fixed UTF.
4713         * src/list.c (read_header): Removed assignment to
4714         oldgnu_header.isextended. It was breaking append mode.
4715
4716         * tests/append01.at: New test.
4717         * tests/Makefile.am: Added append01.at
4718         * tests/testsuite.at: Likewise
4719
4720 2005-02-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4721
4722         * gnulib.modules: New file. List of required gnulib
4723         modules.
4724         * bootstrap: Merge list of required modules from
4725         paxutils with that from tar proper.
4726         * src/tar.c: Various fixes in help and diagnostic messages.
4727
4728 2005-02-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4729
4730         * src/common.h (EXTRACT_OVER_PIPE): New macro
4731         * src/compare.c: Code clean up.
4732         * src/extract.c (extract_archive): Do not check for
4733         EXTRACT_OVER_PIPE, decode_options() does this.
4734         * src/misc.c (exec_error,fork_error,dup2_error)
4735         (pipe_error): Removed unneeded functions.
4736         * src/system.c (sys_exec_command): Use xclose, xpipe,
4737         xfork, xdup2 and exec_fatal.
4738         * src/tar.c (options): Improved sorting. Document --backup=off.
4739         (decode_options): Clear backup_option if necessary.
4740
4741 2005-02-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4742
4743         Initial implementation of --to-command option proposed
4744         by Hansjoerg Lipp.
4745
4746         * bootstrap: Get setenv module from gnulib
4747         * src/buffer.c: Do not use 8-bit chars in comments
4748         * src/common.h (to_command_option)
4749         (ignore_command_error_option): New globals
4750         (sys_exec_command,sys_wait_command): New commands
4751         * src/extract.c (extract_file): Handle to_command_option
4752         Fix error recovery: decrease `size' by `written', not
4753         by `count', otherwise tar misses the next header
4754         Do not diagnose write error if to_command_option
4755         is set, since the command may have exited prematurely.
4756         It would be better to check for sigpipe, though.
4757         (prepare_to_extract): Handle to_command_option
4758         * src/misc.c (exec_error, fork_error, dup_error)
4759         (pipe_error): New functions
4760         * src/system.c (sys_exec_command)
4761         (sys_wait_command): New functions
4762         * src/tar.c: Handle new options --to-command,
4763         --ignore-command-error
4764         * THANKS: Added Hansjoerg Lipp
4765
4766 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4767
4768         * src/list.c (from_header): New arg OCTAL_ONLY, normally false.
4769         All uses changed.  Fix typo that sometimes suppressed all "Archive
4770         contains obsolescent base-64 headers" warnings, not just the first
4771         one.
4772         (tar_checksum): Accept only octal checksums, since they aren't
4773         supposed to overflow into weird formats.
4774
4775         Adjust to gnulib changes.
4776         * lib/.cvsignore: Add chdir-long.c, chdir-long.h, memrchr.c,
4777         memrchr.h, openat.c, openat.h.  Remove pathmax.h (added by
4778         mistake, perhaps?), sysexit.h (my typo), xstrdup.c (gnulib removed
4779         this file).  Sort entries.
4780
4781 2005-02-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4782
4783         * src/extract.c: Further rewrite.
4784         * src/buffer.c: Removed unused variables.
4785         * src/list.c: Likewise
4786         * src/tar.c (update_argv): Changed type to void
4787
4788         * src/common.h (OLDGNU_NAME_FIELD_SIZE): New constant
4789         * src/create.c (start_private_header,write_header_name)
4790         (dump_hard_link): Restore compatibility with 1.13.25
4791         * src/extract.c (extract_archive): Rewritten
4792         * src/list.c: Add translators' comments
4793         * src/tar.c (options) Minor spelling fix
4794         * tests/star/quicktest.sh: Determine path to the tar executable.
4795
4796 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4797
4798         * po/POTFILES.in: Added tests/genfile.c
4799         * src/buffer.c (short_read): Use ngettext()
4800         (new_volume): use quote().
4801         * src/create.c: Use quote()
4802         * src/extract.c: Likewise
4803         * src/xheader.c: Likewise
4804         * src/misc.c: Add comments to translators
4805
4806         * tests/same-order01.at: sort ls output
4807         * tests/sparse01.at (RE_CHECK): Added missing space
4808
4809         * tests/sparse02.at: Test extracting sparse files over a pipe.
4810         * tests/Makefile.am: Added sparse02.at
4811         * tests/testsuite.at: Likewise
4812         * tests/listed02.at: Skip the test on filesystems that do not
4813         update ctime of a file when renaming it. To be reverted when
4814         the new incremental mode is ready.
4815         * tests/sparse01.at: Extract and compare sparse file
4816
4817 2005-02-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4818
4819         * src/sparse.c: Extract sparse files even if the output
4820         fd is not seekable.
4821
4822 2005-02-01  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4823
4824         * bootstrap: Add a comment to lib/Makefile.am saying that this
4825         is an autogenerated file.
4826         Exit with code 1 if any of autotools fails.
4827         * lib/Makefile.tmpl: Insert Emacs magic to the first line.
4828         * tests/Makefile.am: Add append.at
4829
4830         * m4/.cvsignore: Ignore all *.m4 files
4831
4832 2005-01-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4833
4834         Rewritten handling of -T (--files-from) option. Now it
4835         inserts the file names immediately into argv array which allows
4836         for:
4837         1) any valid tar options (including another -T) to be used in the file
4838         2) any number of -T options to be given in command line
4839
4840         * configure.ac: Raised version number to 1.15.2
4841         * src/common.h: Include obstack.h
4842         (files_from_option): Removed
4843         (unquote_option): New variable
4844         (stat_fatal): New function
4845         (name_close): Removed function.
4846         * src/incremen.c: Remove inclusion of obstack.h
4847         * src/xheader.c: Likewise.
4848         * src/misc.c (stat_fatal): New function
4849         * src/names.c (name_file): Removed variable.
4850         (read_name_from_file): Removed function. All callers changed.
4851         (name_close): Removed function. All callers changed.
4852         * src/tar.c: New options --unquote (--no-unquote) and
4853         --add-file
4854         (add_file_id,read_name_from_file,update_argv): New functions
4855         (parse_opt): Rewritten handling of -T option. Handle hidden
4856         --HANG option for debugging purposes.
4857         (decode_options): Init unquote_option to true. Init argv_stk.
4858         Remove unneeded references to files_from_option
4859
4860         * doc/tar.texi: Document new options.
4861         Moved rendition macros and option value definitions into
4862         separate files
4863         * doc/rendition.texi: New file
4864         * doc/value.texi: New file
4865         * doc/Makefile.am: Updated
4866
4867 2005-01-13  Paul Eggert  <eggert@cs.ucla.edu>
4868
4869         * tests/testsuite.at (RE_CHECK): Use "join - file", not
4870         "join file -", to work around a bug in Solaris 8 join.
4871         Problem reported by Tomohiro Suzuki.
4872
4873 2005-01-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4874
4875         * src/list.c (read_header): Fixed calculation of the
4876         size for GNU long name/link. Tar was reading one block
4877         more if name_size was divisible by 512. Thanks Josef
4878         Bauer.
4879         * tests/long01.at: New file. Test listing of GNU long names
4880         divisible by 512.
4881         * tests/pipe.at: Sort tar output.
4882         * tests/Makefile.am: Added long01.at
4883         * tests/testsuite.at: Likewise.
4884         * THANKS: Added Josef Bauer
4885         * lib/.cvsignore: Updated
4886         * m4/.cvsignore: Updated
4887         * NEWS: Updated
4888
4889 2005-01-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4890
4891         * directory: Updated for 1.15.1
4892         * doc/Makefile.am: Use gendocs.sh to generate web documentation
4893         * doc/gendocs_template: Template file for gendocs.sh
4894         * doc/tar.texi: Updated docs for --[no-]same-permissions
4895         * src/tar.c: Reworded docstrings for --[no-]same-permissions
4896
4897 2005-01-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4898
4899         * bootstrap: Create m4/paxutils.m4
4900         * configure.ac: Call tar_PAXUTILS
4901         * tests/options02.at: Test that tar correctly handles non-option
4902         arguments interspersed with options.
4903         * tests/Makefile.am: Add options02.at
4904         * tests/testsuite.at: Likewise
4905         * tests/listed02.at: Do not create useless directory
4906
4907 2005-01-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4908
4909         * src/tar.c (parse_opt): Bugfix: Use ARGP_KEY_ARG. Thanks
4910         Mike Frysinger <vapier@gentoo.org> for reporting.
4911
4912 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
4913
4914         * lib/Makefile.tmpl (localedir.h): Omit needless quotes and a
4915         needless sed command.  Problem reported by Paul Jarc.
4916
4917 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
4918
4919         Accommodate latest gnulib.
4920         * doc/.cvsignore: Add getdate.texi.
4921         * bootstrap: Do not treat alloca-opt specially; this is no
4922         longer needed (and breaks builds) with latest gnulib.
4923
4924 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4925
4926         * src/tar.c (main): Reverted recent changes (#ifdef).
4927
4928 2004-12-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4929
4930         * configure.ac: Raise version number to 1.15.1
4931         Check for locale.h
4932         * NEWS: Entry for 1.15.1
4933         * src/buffer.c: Bugfix. Changes introduced 2004-11-26
4934         broke extraction from stdin.
4935         * src/list.c (from_header, tar_checksum): Changed declaration.
4936         All callers updated.
4937         * src/common.h: Likewise
4938         * src/tar.c (main): Protect invocation of setlocale by
4939         ifdef.
4940
4941         * tests/comprec.at: New test
4942         * tests/pipe.at: New test
4943         * tests/Makefile.am (comprec.at,pipe.at): New tests
4944         * tests/testsuite.at: Likewise
4945         * tests/gzip.at: Use AT_GZIP_PREREQ
4946         * tests/star/pax-big-10g.at: Likewise
4947         * tests/star/ustar-big-2g.at: Likewise
4948         * tests/star/ustar-big-8g.at: Likewise
4949
4950         * tests/extrac04.at: Discard stderr from sort, on some
4951         systems it spits out lots of irrelevant info.
4952         * tests/listed02.at: Likewise
4953
4954         * doc/index.html.in: Rewritten in xhtml to follow recent
4955         GNU site standards.
4956         * THANKS: Updated
4957
4958 2004-12-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4959
4960         Released version 1.15. Sources up to this point are
4961         tagged release_1_15.
4962
4963         * configure.ac: Raised version number to 1.15
4964         * NEWS: Likewise
4965         * directory: Updated
4966         * bootstrap (update_po): Give -r to wget. Always remove index.html
4967         Ignore alloca-opt module (it duplicates alloca)
4968
4969         * tests/Makefile.am: Distribute star/quicktest.sh
4970         * tests/star/README: Document quicktest.sh
4971         * tests/star/qucktest.sh: Removed.
4972         * tests/star/quicktest.sh: New file.
4973
4974 2004-12-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4975
4976         * NEWS: Updated
4977         * doc/tar.texi: Document auto-detection of compressed archive
4978         formats.
4979         * src/tar.c (decode_options): Ignore --seek if used with --delete.
4980         Delete.c is based on the assumption that the archive is being
4981         actually read, not lseeked.
4982
4983         * tests/delete05.at: New file
4984         * tests/extrac02.at: Fixed typo in AT_SETUP
4985         * tests/Makefile.am: Added delete05.at
4986         * tests/testsuite.at: Likewise.
4987
4988 2004-12-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4989
4990         * src/delete.c (delete_archive_members): Bugfix: when
4991         attempting to delete an nonexistent member, the last
4992         blocking_factor blocks were zeroed.
4993
4994 2004-12-14  Paul Eggert  <eggert@cs.ucla.edu>
4995
4996         * TODO: Mention sub-second resolution, lutimes, lchmod.
4997
4998 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
4999
5000         Adjust to recent gnulib changes.
5001         * doc/getdate.texi: Remove, since bootstrap gets it from gnulib now.
5002         * .cvsignore: Add rmt, rmt/*, rmt/*/*.
5003         * lib/.cvsignore: Add allocsa.c, allocsa.h, allocsa.valgrind,
5004         charset.alias, config.charset, getcwd.c, getcwd.h, localcharset.c,
5005         localcharset.h, ref-add.sed, ref-add.sin, ref-del.sed,
5006         ref-del.sin, setenv.c, setenv.h, unsetenv.c.  Remove pathmax.h,
5007         xstrdup.c.
5008         * m4/.cvsignore: Add allocsa.m4, eealloc.m4, getcwd-path-max.m4,
5009         localcharset.m4, realloc.m4, setenv.m4.  Remove malloc.m4,
5010         pathmax.m4, realloc.m4.
5011
5012 2004-11-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5013
5014         * configure.ac: Raised version number to 1.14.91
5015         * scripts/tarcat: New file
5016         * scripts/Makefile.am: Added tarcat
5017         * src/buffer.c (hit_eof): Changed type to boolean
5018         (read_full_records,reading_from_pipe): New variables
5019         (check_compressed_archive,open_compressed_archive): New functions
5020         (open_archive): Autodetect compressed archives and act accordingly.
5021         Set reading_from_pipe. This fixes controversial set of changes
5022         introduced 2004-05-11,2004-03-22.
5023         * src/list.c (tar_checksum): New function
5024         (read_header): Use tar_checksum().
5025         * src/common.h (tar_checksum): New function
5026
5027         * tests/star/README: Updated
5028         * NEWS: Updated
5029         * PORTS: Updated
5030
5031 2004-11-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5032
5033         * src/tar.c (decode_options): Fixed -o semantics. Thanks
5034         Jean Delvare <khali@linux-fr.org>
5035
5036 2004-10-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5037
5038         * bootstrap: Add localcharset
5039         * lib/Makefile.tmpl: Initialize SUFFIXES and CLEANFILES since the
5040         makefile snippet from localcharset uses '+=' on them.
5041         * src/Makefile.am (LDADD): Add LIBICONV
5042         * src/list.c (decode_header): Set uname/gname to NULL if their
5043         header counterparts are empty
5044         * src/tar.c (options): Use OPTION_NO_TRANS
5045         * src/utf8.c: Use locale_charset() from gnulib
5046
5047         * tests/star/README: Updated
5048
5049         * NEWS: Updated
5050         * TODO: Minor fix
5051
5052 2004-10-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5053
5054         * THANKS: Added Bryan Ford
5055         * doc/Makefile.am (.text): Fixed rule
5056         * po/POTFILES.in: Added argp-help.c
5057
5058 2004-10-04  Bryan Ford  <baford@mit.edu>
5059
5060         * src/tar.c: New option --exclude-caches, to exclude
5061         cache directories automatically on archive creation.
5062         Cache directories are directories containing a
5063         standardized tag file, as specified at:
5064                 http://www.brynosaurus.com/cachedir/spec.html
5065         * src/common.h: New variable exclude_caches_option.
5066         * src/create.c: New function check_cache_directory(),
5067         called from dump_dir0() if exclude_caches_option is set,
5068         to check for a cache directory tag and exclude the directory
5069         if such a tag is found.
5070         * doc/tar.texi: Updated accordingly.
5071
5072 2004-09-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5073
5074         * doc/tar.texi: Minor fix
5075         * src/tar.c (options): Minor fix
5076
5077 2004-09-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5078
5079         * TODO: Updated
5080         * lib/Makefile.tmpl: Added 'rtapelib.o: localedir.h' dependency
5081         * src/common.h: Comment WANT_DIRECTORY_REMOVE_OPTION.
5082         * src/extract.c: Normalized use of remove_any_file().
5083         * src/misc.c: Likewise.
5084         * src/tar.c (parse_opt): Emit warning if -l option is used.
5085         (show_default_settings): REMOTE_SHELL may be undefined
5086
5087 2004-09-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5088
5089         Test suite rewritten in autotest.
5090
5091         * configure.ac: Updated for autotest
5092         * src/tar.c (argp_program_version): Modified.
5093         * tests/Makefile.am: Rewritten for autotest.
5094
5095         * tests/.cvsignore: Updated
5096         * tests/append.at: New file
5097         * tests/atlocal.in: New file
5098         * tests/delete01.at: New file
5099         * tests/delete02.at: New file
5100         * tests/delete03.at: New file
5101         * tests/delete04.at: New file
5102         * tests/extrac01.at: New file
5103         * tests/extrac02.at: New file
5104         * tests/extrac03.at: New file
5105         * tests/extrac04.at: New file
5106         * tests/extrac05.at: New file
5107         * tests/gzip.at: New file
5108         * tests/ignfail.at: New file
5109         * tests/incremental.at: New file
5110         * tests/link01.at: New file
5111         * tests/listed01.at: New file
5112         * tests/listed02.at: New file
5113         * tests/longv7.at: New file
5114         * tests/multiv01.at: New file
5115         * tests/multiv02.at: New file
5116         * tests/multiv03.at: New file
5117         * tests/old.at: New file
5118         * tests/options.at: New file
5119         * tests/recurse.at: New file
5120         * tests/same-order01.at: New file
5121         * tests/same-order02.at: New file
5122         * tests/sparse01.at: New file
5123         * tests/testsuite.at: New file
5124         * tests/version.at: New file
5125         * tests/volume.at: New file
5126         * tests/star/gtarfail.at: New file
5127         * tests/star/gtarfail2.at: New file
5128         * tests/star/multi-fail.at: New file
5129         * tests/star/pax-big-10g.at: New file
5130         * tests/star/ustar-big-2g.at: New file
5131         * tests/star/ustar-big-8g.at: New file
5132
5133         * tests/preset.in: Removed
5134         * tests/before: Removed
5135         * tests/after: Removed
5136         * tests/version.sh: Removed.
5137         * tests/append.sh: Removed.
5138         * tests/delete01.sh: Removed.
5139         * tests/delete02.sh: Removed.
5140         * tests/delete03.sh: Removed.
5141         * tests/delete04.sh: Removed.
5142         * tests/extrac01.sh: Removed.
5143         * tests/extrac02.sh: Removed.
5144         * tests/extrac03.sh: Removed.
5145         * tests/extrac04.sh: Removed.
5146         * tests/extrac05.sh: Removed.
5147         * tests/gzip.sh: Removed.
5148         * tests/incremen.sh: Removed.
5149         * tests/ignfail.sh: Removed.
5150         * tests/link01.sh: Removed.
5151         * tests/listed01.sh: Removed.
5152         * tests/listed02.sh: Removed.
5153         * tests/longv7.sh: Removed.
5154         * tests/multiv01.sh: Removed.
5155         * tests/multiv02.sh: Removed.
5156         * tests/multiv03.sh: Removed.
5157         * tests/old.sh: Removed.
5158         * tests/options.sh: Removed.
5159         * tests/same-order01.sh: Removed.
5160         * tests/same-order02.sh: Removed.
5161         * tests/volume.sh: Removed.
5162         * tests/recurse.sh: Removed.
5163         * tests/sparse01.sh: Removed.
5164         * tests/star/gtarfail.sh: Removed.
5165         * tests/star/gtarfail2.sh: Removed.
5166         * tests/star/multi-fail.sh: Removed.
5167         * tests/star/ustar-big-2g.sh: Removed.
5168         * tests/star/ustar-big-8g.sh: Removed.
5169         * tests/star/pax-big-10g.sh: Removed.
5170
5171 2004-09-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5172
5173         * bootstrap: Install genfile.c from paxutils
5174         * tests/genfile.c: Removed. Integrated into
5175         paxutils.
5176         * tests/mksparse.c: Removed. Integrated into
5177         (paxutils) genfile.c
5178         * tests/Makefile.am: Removed mksparse
5179         * tests/sparse01.sh: Use genfile instead of mksparse
5180
5181 2004-09-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5182
5183         Started merging with cpio into paxutils. Sources before
5184         this point are tagged alpha-1_14_90
5185
5186         * Makefile.am: Updated for use with paxutils
5187         * README-alpha: Likewise
5188         * bootstrap: Likewise
5189         * configure.ac: Likewise
5190         * lib/Makefile.tmpl: Likewise
5191         * po/POTFILES.in: Likewise
5192         * src/Makefile.am: Likewise
5193         * src/buffer.c: Likewise
5194         * src/common.h: Likewise
5195         * src/compare.c: Likewise
5196         * src/create.c: Likewise
5197         * src/delete.c: Likewise
5198         * src/extract.c: Likewise
5199         * src/incremen.c: Likewise
5200         * src/list.c: Likewise
5201         * src/mangle.c: Likewise
5202         * src/misc.c: Likewise
5203         * src/names.c: Likewise
5204         * src/sparse.c: Likewise
5205         * src/system.c: Likewise
5206         * src/tar.c: Likewise
5207         * src/update.c: Likewise
5208         * src/utf8.c: Likewise
5209         * src/xheader.c: Likewise
5210
5211         * src/system.h: Removed
5212         * src/rmt.c: Removed
5213         * src/rmt.h: Removed
5214         * src/rtapelib.c: Removed
5215
5216 2004-09-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5217
5218         * tests/listed02.sh: Do not depend on any particular ordering
5219         of output.
5220
5221 2004-09-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5222
5223         * doc/tar.texi: Document the use of -C option in
5224         file lists. Document --seek option.
5225         * configure.ac: New option --with-rmt. New configuration variable
5226         DEFAULT_RMT_DIR. Removed DEFAULT_RMT_COMMAND.
5227         * src/Makefile.am: Install rmt into rmtdir
5228         * src/tar.c (usage): Minor fix.
5229         * NEWS: Updated.
5230         * README: Updated.
5231
5232 2004-09-01  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5233
5234         * configure.ac: Raised version number to 1.14.90
5235         * src/common.h (is_individual_file): New prototype
5236         * src/create.c (dump_file0): Fix bug introduced
5237         2004-02-21.
5238         * src/names.c (register_individual_file)
5239         (is_individual_file): New functions.
5240         * tests/listed01.sh: Use genfile instead of dd.
5241         * tests/listed02.sh: New file.
5242         * tests/Makefile.am: Added listed02.sh
5243
5244         * NEWS: Updated
5245
5246 2004-08-31  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5247
5248         * src/sparse.c (sparse_add_map): Fixed improper initializations
5249         of sparse_map_size. We assume that whatever number it contains
5250         describes adequately the current size of sparse_map. The only
5251         number we need to reset is sparse_map_avail.
5252         * src/compare.c (verify_volume): Call set_next_block_after
5253         if read_header returns HEADER_FAILURE
5254         Destroy and reinitialize content of current_stat_info and
5255         extended_header after each iteration (bug reported by
5256         John L. Males <jlmales@yahoo.com>).
5257         Issue a warning if the created archive contains some members
5258         whose file names were stripped off their leading prefixes.
5259         This is a temporary fix of the issue reported by Bdale Garbee
5260         <bdale@gag.com> (Refs: Debian bug 230064, Message-Id
5261         <87n07kyzhi.fsf@rover.gag.com>, Sun, 15 Feb 2004 11:22:17 -0700)
5262
5263         * src/names.c (removed_prefixes_p): New function.
5264
5265         * src/buffer.c: When computing write rate do not take
5266         into account the time needed to verify the archive(s).
5267         The bug reported by John L. Males <jlmales@yahoo.com>
5268         (set_start_time,compute_duration): New functions.
5269         (print_total_written): Use the result of compute_duration().
5270         (close_archive): Call compute_duration.
5271         * src/common.h (set_start_time, removed_prefixes_p): New prototypes.
5272         * src/list.c (decode_header): Fixed initialization
5273         of stat_info->is_sparse
5274         * src/tar.c (main): Call set_start_time().
5275
5276         * src/misc.c (unquote_string): Unquote '\a' and '\v'.
5277         Reported by Helmut Waitzmann <helmut.waitzmann@web.de>.
5278
5279         * NEWS: Updated
5280         * THANKS: Updated
5281
5282 2004-08-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5283
5284         * src/tar.c: Fix copy-n-paste errors in the license
5285
5286 2004-08-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5287
5288         * scripts/backup.in: Renamed LIBPATH to LIBDIR.
5289         Use ROOT_FS with -C option. Do not send mail
5290         if ADMINISTRATOR is set to NONE.
5291         * scripts/backup.sh.in (test_root): Append / to
5292         ROOT_FS if it does not already end in it.
5293         * scripts/restore.in: Renamed LIBPATH to LIBDIR.
5294         New option -a (--all). Do not start restore unless
5295         -a or patterns are given.
5296         (restore_fs,restore_files): Fixed use of --listed option.
5297         * doc/tar.texi: Updated
5298         * NEWS: Updated
5299
5300 2004-08-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5301
5302         * src/tar.c (find_argp_option): Fixed typo
5303
5304 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5305
5306         Merge argp, getopt, xalloc changes from gnulib.
5307         * bootstrap (gnulib_modules): Add xalloc-die.
5308         Remove code to test for patches; we don't have patches now.
5309         Set LC_ALL=C so that file names sort consistently.
5310         Prefer the gnulib copies of gettext.m4, glibc21.m4,
5311         lib-ld.m4, lib-prefix.m4, po.m4 too.
5312
5313         * patches/getopt.diff: Remove; gnulib now works unpatched.
5314         * configure.ac (_getopt_long_only_r): Remove check.
5315         gl_ARGP now does this for us.
5316         * lib/.cvsignore: Add fnmatch.h, getopt_.h, sysexit.h,
5317         xalloc-die.c.
5318         * src/extract.c: Adjust to changes to gnulib xalloc module.
5319         (extr_init): Remove assignment to xalloc_fail_func; no longer needed.
5320         (xalloc_die): New function.
5321
5322 2004-08-10  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5323
5324         * NEWS: Updated
5325
5326         * src/buffer.c (flush_write): Limit filenames
5327         of the members that straddle multivolume archive
5328         boundary to 100 characters.
5329         (flush_read): Use strncmp when comparing multivolume member
5330         names.
5331         * tests/multiv03.sh: New file
5332         * tests/Makefile.am: Added multiv03.sh
5333
5334 2004-08-09  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5335
5336         * src/list.c (read_and): Call decode_header before
5337         calling skip_member()
5338         (skip_member): Use is_sparse field to determine if the
5339         member is a sparse file.
5340
5341         * tests/Makefile.am: Added extrac05.sh
5342         * tests/extrac05.sh: New file
5343         * tests/append.sh: Rearranged leading comments. Added explicit
5344         references to report messages wherever available.
5345         * tests/delete01.sh: Likewise
5346         * tests/delete02.sh: Likewise
5347         * tests/delete03.sh: Likewise
5348         * tests/delete04.sh: Likewise
5349         * tests/extrac01.sh: Likewise
5350         * tests/extrac02.sh: Likewise
5351         * tests/extrac03.sh: Likewise
5352         * tests/extrac04.sh: Likewise
5353         * tests/gzip.sh: Likewise
5354         * tests/ignfail.sh: Likewise
5355         * tests/incremen.sh: Likewise
5356         * tests/link01.sh: Likewise
5357         * tests/listed01.sh: Likewise
5358         * tests/longv7.sh: Likewise
5359         * tests/multiv01.sh: Likewise
5360         * tests/multiv02.sh: Likewise
5361         * tests/old.sh: Likewise
5362         * tests/options.sh: Likewise
5363         * tests/recurse.sh: Likewise
5364         * tests/same-order01.sh: Likewise
5365         * tests/same-order02.sh: Likewise
5366         * tests/sparse01.sh: Likewise
5367         * tests/version.sh: Likewise
5368         * tests/volume.sh: Likewise
5369
5370 2004-08-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5371
5372         * bootstrap: Extended --update-po option to take an
5373         optional argument specifying the po file to update.
5374         * src/create.c: Improved compatibility with 1.13.25
5375         * tests/link01.sh: New file.
5376         * tests/Makefile.am: Added link01.sh
5377
5378 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5379
5380         Merge from gnulib.
5381
5382         * patches/argp.diff: Remove; no longer needed.
5383
5384         * lib/.cvsignore: Add stat-macros.h.
5385         Remove addext.c, malloc.c, realloc.c.
5386
5387         * src/extract.c: Include <getcwd.h>.
5388         (extract_archive): Rewrite with new macro IS_ABSOLUTE_FILE_NAME.
5389         * src/extract.c (make_directories):
5390         FILESYSTEM_PREFIX_LEN -> FILE_SYSTEM_PREFIX_LEN.
5391         * src/misc.c (must_be_dot_or_slash): Likewise.
5392         * src/names.c (excluded_name, safer_name_suffix, stripped_prefix_len):
5393         Likewise.
5394         * src/tar.c (parse_opt): Likewise.
5395         * src/incremen.c (purge_directory): Fix format buffer typos in warning
5396         strings.
5397         * src/tar.c (options): Add missing initializers to pacify gcc.
5398         (decode_options): Remove unused var.
5399
5400 2004-08-02  Paul Eggert  <eggert@cs.ucla.edu>
5401
5402         * bootstrap (gnulib_modules): Add getpagesize.
5403         * configure.ac (valloc): Remove check; valloc no longer used.
5404         * lib/.cvsignore: Add getpagesize.h.
5405         * m4/.cvsignore: Add getpagesize.m4.
5406         * src/buffer.c (record_buffer): New var.
5407         (open_archive): Don't use valloc; on older or buggy hosts, you can't
5408         free the result.  Use page_aligned_alloc instead.
5409         * src/compare.c (diff_init): Likewise.
5410         * src/buffer.c (open_archive): Record the pointer to be freed
5411         into record_buffer.
5412         (close_archive): Free record_buffer.
5413         * src/common.h (page_aligned_alloc): New decl.
5414         * src/misc.c (quote_n, quote): Remove these redundant functions.
5415         (ptr_align): New function, from coreutils/src/system.h.
5416         (page_aligned_alloc): New function.
5417         * src/system.h (valloc): Remove.
5418
5419 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5420
5421         * src/extract.c (extract_archive): Do not report an error
5422         when hard-linking X to X when X exists.  Problem reported by
5423         Toby Peterson.
5424         * lib/.cvsignore: Add fchown-stub.c.
5425
5426 2004-06-29  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5427
5428         * NEWS: Updated
5429         * src/common.h (root_device): New global.
5430         (gnu_restore): Renamed to purge_directory().
5431         * src/extract.c (extr_init): Save the device number
5432         of the root device.
5433         (extract_archive): Renamed gnu_restore() to purge_directory().
5434         * src/incremen.c (gnu_restore): Renamed to purge_directory().
5435         Do not attempt to purge the directory if it is on a different
5436         device and one_file_system_option is set.
5437
5438 2004-06-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5439
5440         * doc/tar.texi: The actual default for exclude patterns
5441         is --no-anchored. Fixed.
5442         * src/tar.c (options): Likewise.
5443         Thanks "Felix Natter" <felix.natter@ldc.de> for noticing.
5444
5445 2004-06-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5446
5447         * doc/tar.texi: Fixed several inconsistencies.
5448         * src/tar.c: Fixed docstring for --checkpoint option.
5449
5450 2004-05-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5451
5452         * src/buffer.c (seek_archive): New function
5453         * src/common.h (seek_archive): New function
5454         (seekable_archive): New global.
5455         * src/list.c (skip_file): Use seek_archive() if
5456         possible.
5457         * src/tar.c (struct fmttab): Accept 'pax' as alias
5458         for 'posix'
5459         (options): New option -n (--seek).
5460         * src/update.c: Determine type of the archive before
5461         appending to it.
5462
5463         * TODO: Updated.
5464
5465 2004-05-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5466
5467         * bootstrap: New option --update-po
5468         * src/tar.c: New option -H (short alias to --format)
5469         * doc/tar.texi: Document -H option
5470         * src/names.c (safer_name_suffix): Fixed bug introduced
5471         2004-05-11.
5472
5473 2004-05-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5474
5475         * bootstrap: Apply patches from patch subdirectory
5476         * patches: New dir
5477         * patches/argp.diff: New file
5478         * patches/getopt.diff: New file
5479         * configure.ac: Check for _getopt_long_only_r and
5480         force using included version of getopt if the function
5481         is not available.
5482         * src/tar.c: Use argp for command line parsing.
5483         * src/system.h: Minor formatting fix
5484         * m4/.cvsignore: Updated
5485         * lib/.cvsignore: Updated
5486         * doc/tar.texi: Minor fix.
5487         * src/extract.c: Fix improper use of 'path' term
5488         * src/incremen.c: Likewise
5489         * src/list.c: Likewise
5490         * src/misc.c: Likewise
5491         * src/names.c: Likewise
5492         * src/rmt.h: Likewise
5493         * src/rtapelib.c: Likewise
5494         * src/update.c: Likewise
5495         * src/xheader.c: Likewise
5496         * tests/star/README: Minor fix
5497
5498 2004-05-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5499
5500         * configure.ac: Raised version number to 1.14.1
5501         * src/tar.c: Renamed --strip-path to --strip-components
5502         Changed improper use of _() to ngettext().
5503         * src/extract.c: Renamed strip_path_option to strip_components_option
5504         * src/common.h: Likewise.
5505         * NEWS: Updated.
5506         * doc/tar.texi: Updated
5507
5508 2004-05-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5509
5510         * src/system.c (sys_child_open_for_uncompress): Do not
5511         set read_full_records_option: the compressed archive is
5512         likely not to contain integer number of records. Should
5513         the user wish to use reblocking, he may always give tar
5514         -B option. This is a minor improvement over the change
5515         dated 2004-03-22.
5516         * src/buffer.c (open_archive): Removed assignment to
5517         read_full_records_option.
5518
5519         * src/names.c (safer_name_suffix): (safer_name_suffix): Use "%s"
5520         as the format argument, rather than a possibly-translated variable
5521         string. Patch provided by Jim Meyering  <jim@meyering.net>
5522         * src/tar.c (decode_options): Fixed typo in the comment.
5523         * tests/star/README: Minor correction
5524
5525 2004-05-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5526
5527         * directory: New file. GNU directory entry for tar.
5528         * doc/Makefile.am: Rewritten. Added rules for generating
5529         documentation for the project's website.
5530         * doc/.cvsignore: Updated
5531         * doc/index.html.in: New file.
5532
5533 2004-05-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5534
5535         * configure.ac: Raised version number to 1.14
5536         * NEWS: Updated.
5537         * tests/after: Added copyleft statement
5538         * tests/before: Added copyleft statement
5539         * tests/preset.in: Added copyleft statement
5540
5541         Tar 1.14 is released. Sources up to this point are tagged
5542         release_1_14
5543
5544 2004-05-10  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5545
5546         * configure.ac: Fixed prerequisite headers for sys/buf.h
5547         (needed on FreeBSD)
5548         * src/system.h: Likewise.
5549         * tests/after (compare): Fixed argument quoting under eval
5550         * tests/before: Quote TAR_ARCHIVE_FORMATS
5551
5552 2004-05-10  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5553
5554         * NEWS: Updated
5555         * README: Updated
5556         * PORTS: Updated
5557         * configure.ac: Call gl_AC_TYPE_INTMAX_T. Document
5558         DEFAULT_.* variables. Use DEFAULT_RMT_COMMAND to set
5559         the pathname of the rmt utility.
5560         New option --enable-backup-scripts.
5561         * doc/tar.texi: Updated
5562         * scripts/Makefile.am: Install the scripts only if requested
5563         by the configure.
5564         * scripts/backup.in: Fixed --version output.
5565         Fixed initialization of the listing files and printing
5566         the time of the last previous level dump.
5567         * scripts/restore.in: Fixed --version output.
5568         * src/Makefile.am (localedir.h rule): Generate correct
5569         DEFAULT_RMT_COMMAND variable.
5570         * src/common.h (rmt_command_option): New variable.
5571         * src/list.c (read_and): Print block number before
5572         issuing 'Skipping to next header' diagnostics, if
5573         requested by block_number_option.
5574         * src/rtapelib.c: Use rmt_command_option instead of
5575         hardcoded "/etc/rmt".
5576         * src/tar.c: New option --rmt-command.
5577         (decode_options): Handle --rmt-command. Initialize
5578         rmt_command_option to DEFAULT_RMT_COMMAND.
5579
5580 2004-05-09  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5581
5582         * doc/tar.texi: Further update.
5583
5584 2004-05-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5585
5586         * configure.ac: Minor fix
5587         * scripts/Makefile.am: Updated
5588         * scripts/backup-specs: Updated
5589         * scripts/backup.in: Minor fixes
5590         * scripts/backup.sh: Removed
5591         * scripts/backup.sh.in: New file. Source for backup.sh
5592         * scripts/restore.in: New file
5593         * scripts/.cvsignore: Updated
5594         * scripts/WARNING: Removed
5595         * doc/tar.texi: Updated
5596         * NEWS: Updated
5597
5598 2004-05-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5599
5600         * src/names.c (name_gather): Bugfix: Honor single -C with
5601         --same-order.
5602         * tests/same-order01.sh: New file
5603         * tests/same-order02.sh: New file
5604         * tests/Makefile.am: Updated
5605
5606         * tests/append.sh: Added copyleft header
5607         * tests/delete01.sh: Likewise
5608         * tests/delete02.sh: Likewise
5609         * tests/delete04.sh: Likewise
5610         * tests/extrac01.sh: Likewise
5611         * tests/extrac02.sh: Likewise
5612         * tests/extrac03.sh: Likewise
5613         * tests/extrac04.sh: Likewise
5614         * tests/gzip.sh: Likewise
5615         * tests/ignfail.sh: Likewise
5616         * tests/incremen.sh: Likewise
5617         * tests/multiv01.sh: Likewise
5618         * tests/old.sh: Likewise
5619         * tests/options.sh: Likewise
5620         * tests/recurse.sh: Likewise
5621         * tests/version.sh: Likewise
5622         * tests/volume.sh: Likewise
5623         * tests/star/gtarfail.sh: Likewise
5624         * tests/star/gtarfail2.sh: Likewise
5625         * tests/star/multi-fail.sh: Likewise
5626         * tests/star/pax-big-10g.sh: Likewise
5627         * tests/star/qucktest.sh: Likewise
5628         * tests/star/ustar-big-2g.sh: Likewise
5629         * tests/star/ustar-big-8g.sh: Likewise
5630
5631         * doc/.cvsignore: Updated
5632
5633 2004-05-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5634
5635         * configure.ac: Check whether date accepts +format argument
5636         (for backup scripts).
5637         * scripts/level-0: Removed
5638         * scripts/level-1: Removed
5639         * scripts/weekly.new: Removed
5640         * scripts/dump-remind: Removed
5641         * scripts/backup.in: New file
5642         * scripts/backup.sh: New file
5643         * scripts/dump-remind.in: New file
5644         * scripts/backup-specs: Updated
5645         * scripts/Makefile.am: Updated for new directory contents.
5646         * scripts/.cvsignore: Updated
5647
5648 2004-05-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5649
5650         * TODO: Updated
5651         * doc/tar.texi: Updated
5652         * src/tar.c: --utc implies -vv
5653
5654 2004-04-28  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5655
5656         * src/utf8.c: Make sure ICONV_CONST is defined. AM_ICONV
5657         does not define it if it fails to find iconv.h.
5658
5659 2004-04-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5660
5661         * bootstrap: Use gnulib-tool to generate lib/Makefile.am
5662         and parts of configure.ac
5663         * configure.ac: Invoke tar_GNULIB to configure gnulib stuff.
5664         * lib/Makefile.am: Removed
5665         * lib/Makefile.tmpl: New file.
5666         * lib/.cvsignore: Updated
5667         * m4/.cvsignore: Updated
5668         * src/xheader.c: Include stpcpy.h
5669
5670         * src/create.c: Produce an error, not warning, if the
5671         filename is too long.
5672         * tests/longv7.sh: Synchronized with the recent changes.
5673
5674 2004-04-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5675
5676         * configure.ac: Fixed test for iconv_t
5677         * src/rmt.h: Bugfix by Jürgen Weigert
5678         * THANKS: Add Jürgen Weigert
5679         * tests/star/README: Fixed typo
5680
5681 2004-04-04  Paul Eggert  <eggert@twinsun.com>
5682
5683         Merge getdate documentation changes from coreutils.
5684
5685         * doc/getdate.texi: Update from coreutils CVS.
5686         * doc/tar.texi: Fix getdate menu to match getdate.texi's.
5687
5688         Merge recent gnulib changes, and remove some lint.
5689
5690         Improve support for nanosecond-resolution time stamps.
5691         * bootstrap: Add gettime, timespec modules.
5692         * configure.ac (gl_GETTIME, gl_TIMESPEC): Add.
5693         * lib/.cvsignore (getopt_int.h, gettime.c, gettimeofday.c,
5694         timespec.h): Add.
5695         * lib/Makefile.am (libtar_a_SOURCES): Add gettime.c, timespec.h.
5696         * m4/.cvsignore: Add clock_time.m4, gettime.m4, gettimeofday.m4,
5697         st_mtim.m4, timespec.m4.  Remove malloc.m4, realloc.m4.
5698         * src/common.h (newer_mtime_option): Now a struct timespec, not
5699         time_t.  All uses changed.
5700         (NEWER_OPTION_INITIALIZED, OLDER_STAT_MTIME): New macros.
5701         * src/create.c (dump_file0): Use OLDER_STAT_TIME to compare times.
5702         * src/incremen.c (scan_path): Likewise.
5703         * src/list.c (read_and): Likewise.
5704         * src/list.c (read_and): Use NEWER_OPTION_INITIALIZED to decide
5705         whether newer_mtime_option is initialized.
5706         * src/tar.c (decode_options): Likewise.
5707         * src/tar.c (decode_options): Adjust to new signature for get_date.
5708
5709         * src/buffer.c (short_read, flush_read): Use size_t, not ssize_t, for
5710         result of safe_read, full_write, and similar functions.
5711         Detect safe_read error by comparing to SAFE_READ_ERROR;
5712         detect full_write error by comparing to 0.
5713         All uses changed.
5714         * src/common.h (write_error_details, sys_write_archive_buffer):
5715         Likewise.
5716         * src/misc.c (write_error_details): Likewise.
5717         * src/rmt.c (main): Likewise.
5718         * src/rmt.h (rmt_read__, rmt_write__): Likewise.
5719         * src/rtapelib.c (rmt_read__, rmt_write__, rmt_ioctl__): Likewise.
5720         * src/sparse.c (sparse_scan_file, sparse_dump_region,
5721         check_sparse_region, check_data_region): Likewise.
5722         * src/system.c (sys_write_archive_buffer, sys_drain_input_pipe,
5723         sys_child_open_for_compress, sys_child_open_for_uncompress): Likewise.
5724         * src/update.c (append_file): Likewise.
5725
5726         * src/buffer.c (clear_read_error_count): Use explicit (void)
5727         to indicate a function with no arguments.
5728         * src/create.c (check_links): Likewise.
5729         * src/system.c (sys_get_archive_stat, sys_save_archive_dev_ino,
5730         sys_detect_dev_null_output, sys_drain_input_pipe, sys_spawn_shell,
5731         sys_reset_uid_gid, sys_get_archive_stat, sys_save_archive_dev_ino,
5732         sys_detect_dev_null_output, sys_drain_input_pipe, sys_spawn_shell):
5733         Likewise.
5734         * src/utf8.c (get_input_charset): Likewise.
5735         * src/xheader.c (xheader_ghdr_name, xheader_write_global,
5736         xheader_decode_global, extended_header_init): Likewise.
5737         * tests/mksparse.c (usage): Likewise.
5738
5739         * src/buffer.c (new_volume): Rename local variables to avoid
5740         shadowing warnings.
5741         * src/common.h (file_dumpable_p, sys_stat_nanoseconds,
5742         sparse_file_p, sparse_member_p, sparse_fixup_header,
5743         sparse_dump_file, sparce_extract_file, sparse_skip_file,
5744         sparse_diff_file): Likewise.
5745         * src/compare.c (diff_archive): Likewise.
5746         * src/create.c (file_dumpable_p, dump_regular_file, dump_dir0,
5747         dump_dir, dump_hard_link, file_count_links, dump_file0, dump_file):
5748         Likewise.
5749         * src/extract.c (repair_delayed_set_stat): Likewise.
5750         * src/misc.c (maybe_backup_file, add_hierarchy_to_namelist):
5751         Likewise.
5752         * src/sparse.c (struct tar_sparse_optab, tar_sparse_dump_region,
5753         tar_sparse_extract_region, sparse_dump_region, sparse_extract_region,
5754         sparse_dump_file, sparse_file_p, sparse_member_p,
5755         sparse_fixup_header, sparse_extract_file, sparse_skip_file,
5756         check_data_region, sparse_diff_file): Likewise.
5757         * src/system.c (sys_stat_nanoseconds): Likewise.
5758         * src/xheader.c (xheader_format_name): Likewise.
5759
5760         * src/common.h (enum old_files): Remove comma before }; not portable.
5761
5762         * src/common.h (read_fatal_details): Add __attribute__ ((noreturn)).
5763         * src/rmt.c (usage): Likewise.
5764         * src/xheader.c (xheader_set_single_keyword): Likewise.
5765         * tests/genfile.c (usage): Likewise.
5766         * tests/mksparse.c (die, usage): Likewise.  Also add printf attribute
5767         to die.
5768
5769         * src/common.h (gname_to_gid, uname_to_uid): Add const to avoid
5770         some gcc warnings.
5771         * src/names.c (uname_to_uid, gname_to_gid): Likewise.
5772         * src/utf8.c (struct langtab.lang, struct langtab.terr, struct
5773         langtab.charset, charset_lookup): Likewise.
5774
5775         * src/common.h (name_init): Remove unused args.  All callers changed.
5776         * src/names.c (name_init): Likewise.
5777
5778         * src/common.h (usage, xheader_write, xheader_write_global,
5779         sys_reset_uid_gid): New decls.
5780
5781         * src/compare.c (report_difference, process_noop): Add
5782         __attribute__ ((unused)) for unused attributes.
5783         * src/sparse.c (oldgnu_sparse_member_p, star_sparse_member_p):
5784         Likewise.
5785         * src/xheader.c (dummy_coder, dummy_decoder, atime_coder,
5786         gid_coder, gname_coder, linkpath_coder, ctime_coder, mtime_coder,
5787         path_coder, size_coder, uid_coder, uname_coder,
5788         sparse_numblocks_coder): Likewise.
5789
5790         * src/create.c (dump_regular_finish, dump_dir0, dump_dir,
5791         dump_file0): Now static.
5792         * src/utf8.c (charset_lookup): Likewise.
5793         * src/xheader.c (xheader_protected_pattern_p,
5794         xheader_protected_keyword_p, xheader_set_single_keyword,
5795         xheader_keyword_deleted_p, xheader_keyword_override_p,
5796         xheader_list_append, xheader_list_destroy, xheader_set_keyword_equal):
5797         Likewise.
5798         * tests/genfile.c (usage): Likewise.
5799         * tests/mksparse.c (die, mkhole, mksparse, usage, xlat_suffix):
5800         Likewise.
5801
5802         * src/create.c (hash_link): Rewrite to avoid cast.
5803
5804         * src/extract.c (file_newer_p): Use parameter, not global var.
5805         * src/misc.c (write_error_details): Likewise.
5806
5807         * src/extract.c (prepare_to_extract): Remove directory arg; not
5808         used.  All callers changed.
5809
5810         * src/misc.c (close_fatal): Remove; not used.
5811         * src/system.c (sys_utimes): Likewise.
5812
5813         * src/rmt.c (get_string): Avoid buffer overrun (off by 1 error).
5814
5815         * src/rmt.c (main): Update copyright date to 2004.
5816         * src/tar.c (decode_options): Likewise.
5817
5818         * src/rtapelib.c (get_status_string): Don't lose errno when
5819         skipping the error messages.
5820         (get_status): Report an error if atol returns a negative number.
5821
5822         * src/utf8.c (struct langtab, langtab, charset_lookup,
5823         get_input_charset) [!defined HAVE_LIBCONV]: Omit unused
5824         definitions.
5825         (iconv_open, iconv, iconv_close) [!defined HAVE_LIBCONV]:
5826         Use macros, not definitions, to avoid type clashes with system
5827         headers.
5828         (charset_lookup): Local var is now auto, not static.
5829         (utf8_convert): Use ICONV_CONST instead of const, to avoid
5830         type clashes.
5831
5832         * src/utf8.c (langtab): Initialize all elements of struct, to
5833         avoid gcc warning.
5834         * src/xheader.c (xhdr_tab): Likewise.
5835
5836         * src/xheader.c: Include fnmatch.h, since we use fnmatch.
5837
5838         * tests/mksparse.c (mkhole): Fix typo: bool was assigned to off_t.
5839
5840 2004-04-04  Sergey Poznyakoff  <gray@Noldor.runasimi.org>
5841
5842         * NEWS: Updated
5843         * configure.ac: Raised version number to 1.13.94
5844         * src/system.h: Protect inclusion of <sys/time.h>
5845         by ifdef.
5846         Declare time() if HAVE_DECL_TIME is 0
5847         * tests/.cvsignore: Added mksparse
5848
5849         * tests/sparse01.sh: New file
5850         * tests/multiv02.sh: New file
5851         * tests/Makefile.am: Add sparse01.sh and multiv02.sh
5852         * tests/longv7.sh: Added missing call to 'after'
5853
5854         * src/common.h: Added missing prototypes
5855         * src/compare.c (diff_archive): Use is_sparse member
5856         instead of GNUTYPE_SPARSE.
5857         * src/create.c: Removed unused variables
5858         * src/extract.c (extract_archive): Use sparse_member_p instead
5859         of GNUTYPE_SPARSE.
5860         Removed unused variables
5861         * src/list.c (decode_header): Use sparse_fixup_header to correct
5862         the st_size value.
5863         (print_header): Do not rely on GNUTYPE_SPARSE type.
5864         Use st->stat.st_size to print real file size.
5865         (skip_member): Assign stat_info.file_name to save_name. This fixes
5866         bug reported by Mads Martin Joergensen <mmj@suse.de>
5867         Use sparse_skip_file() to skip sparse members.
5868         * src/rtapelib.c: include "common.h"
5869         * src/sparse.c (struct tar_sparse_optab.sparse_member_p)
5870         (struct tar_sparse_optab.fixup_header): New member
5871         (tar_sparse_member_p): New function.
5872         (tar_sparse_init): Return true if decode_header is not provided
5873         (tar_sparse_fixup_header)
5874         (sparse_member_p,sparse_fixup_header)
5875         (sparse_skip_file)
5876         (oldgnu_sparse_member_p,oldgnu_fixup_header,star_sparse_member_p)
5877         (star_fixup_header, pax_sparse_member_p): New function
5878         (pax_decode_header): Remove
5879         * src/system.h: Include <sys/time.h> and <utime.h> when available
5880         * src/tar.c (usage): Prototype moved to common.h
5881         * src/tar.h (struct tar_stat_info.is_sparse): New member
5882         * src/utf8.c (utf8_convert): Changed prototype
5883         (get_input_charset): Removed unused variable
5884         * src/xheader.c: include <fnmatch.h>
5885         (size_decoder): Assign to both st->archive_file_size and
5886         st->stat.st_size.
5887         (st->stat.st_size): Assign to st->stat.st_size
5888         (sparse_numbytes_decoder): Removed unused variable
5889         * src/.cvsignore: Added .gdbinit
5890         * THANKS: Added Mads Martin Joergensen
5891
5892 2004-03-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5893
5894         * src/create.c (write_long_name): Do not allow more than
5895         NAME_FIELD_SIZE-1 characters in a file name for V7 format
5896         archives.
5897         * tests/longv7.sh: New file.
5898         * tests/Makefile.am: Add longv7.sh
5899
5900 2004-03-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5901
5902         * src/buffer.c (open_archive): Clear read_full_records_option
5903         if reading from a pipe.
5904         (short_read): Display warning about the deduced record size
5905         if version > 1
5906         * tests/star/pax-big-10g.sh: Updated to match the above changes.
5907         * tests/star/ustar-big-2g.sh: Likewise.
5908         * tests/star/ustar-big-8g.sh: Likewise.
5909
5910         * configure.ac: Added gl_FUNC_STRTOULL
5911         * src/create.c (start_header): Check for GNU_FORMAT
5912         if incremental_option is set.
5913         * src/xheader.c (to_decimal): New function.
5914         (xheader_format_name): Use to_decimal() instead of snprintf.
5915         * tests/listed01.sh: Use genfile instead of dd
5916         * tests/multiv01.sh: Likewise.
5917
5918 2004-03-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5919
5920         * src/list.c (read_and): Stop processing the archive after
5921         encountering a single zero record. Many old archives contain
5922         arbitrary garbage after it.
5923         The warning is issued anyway.
5924
5925 2004-03-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5926
5927         * src/rtapelib.c (rmt_lseek__,rmt_ioctl__): Bugfix. The
5928         conversion buffer was not null terminated. Fix provided
5929         by Leland Lucius <llucius@tiny.net>
5930         * THANKS: Added Leland Lucius
5931         * src/utf8.c (utf8_convert): Indentation fix.
5932
5933 2004-02-29  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5934
5935         * src/buffer.c (flush_read): Bugfix: the
5936         condition at line 714 included
5937
5938               || (status > 0 && !read_full_records_option)
5939
5940         which is grossly wrong, since even if new_volume() below succeeds,
5941         the subsequent call to rmtread will overwrite the chunk of data
5942         already read in the buffer and thus spoil everything.
5943         * src/system.c (sys_child_open_for_uncompress): Minor stylistic
5944         fix.
5945         * tests/star/multi-fail.sh: New test.
5946         * tests/Makefile.am: Added multi-fail.sh
5947         * tests/star/README: Updated
5948
5949 2004-02-29  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5950
5951         * NEWS: Updated
5952         * configure.ac: Removed spurious AC_CHECK_LIB(iconv)
5953         * src/common.h (utc_option): new global
5954         (enum old_files.KEEP_NEWER_FILES): New element
5955         * src/extract.c: Handle --keep-newer-files option
5956         * src/list.c (tartime): Print UTC if --utc was given.
5957         * src/tar.c: New options: --utc and keep-newer-files
5958
5959         * tests/Makefile.am: Added new tests
5960         * tests/after: Rewritten
5961         * tests/before: Rewritten
5962         * tests/preset.in: Rewritten
5963         * tests/delete03.sh: Accommodate for the new testsuite logic
5964         * tests/gzip.sh: Likewise
5965         * tests/incremen.sh: Likewise
5966         * tests/listed01.sh: Likewise
5967         * tests/multiv01.sh: Likewise
5968         * tests/old.sh: Likewise
5969         * tests/options.sh: Likewise
5970         * tests/version.sh: Likewise
5971         * tests/volume.sh: Likewise
5972
5973         * tests/star: New directory
5974         * tests/star/README: New file
5975         * tests/star/gtarfail.sh: New file
5976         * tests/star/gtarfail2.sh: New file
5977         * tests/star/pax-big-10g.sh: New file
5978         * tests/star/qucktest.sh: New file
5979         * tests/star/ustar-big-2g.sh: New file
5980         * tests/star/ustar-big-8g.sh: New file
5981
5982 2004-02-26  Paul Eggert  <eggert@twinsun.com>
5983
5984         * doc/tar.texi (dircategory Individual utilities): Append period,
5985         as suggested by Karl Berry.
5986
5987 2004-02-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5988
5989         * src/list.c (decode_header): Call xheader_decode before
5990         the assignment to current_stat_info.archive_file_size.
5991
5992 2004-02-23  Paul Eggert  <eggert@twinsun.com>
5993
5994         * configure.ac: Invoke AM_ICONV, to define ICONV_CONST if needed.
5995
5996 2004-02-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5997
5998         1.13.93 released.
5999
6000         * NEWS: Updated
6001         * tests/before: Move testing of the prerequisite archive formats
6002         to the separate function 'prereq'. Do not expect any arguments
6003         * tests/delete03.sh: Use prereq() instead of passing arguments
6004         to 'before'.
6005         * tests/incremen.sh: Likewise.
6006         * tests/listed01.sh: Likewise.
6007         * tests/multiv01.sh: Likewise.
6008
6009 2004-02-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6010
6011         Added UTF-8 support. Finished global extended header
6012         support.
6013
6014         * NEWS: Minor fix
6015         * configure.ac: Detect libiconv
6016         * src/utf8.c: New file. Conversions to and from utf-8.
6017         * src/Makefile.am: Added utf8.c
6018         * src/create.c (write_header_name) In pax format, use
6019         "path" keyword if the file name is not ASCII
6020         (start_header): Likewise for uname and gname.
6021         * src/list.c: Decode encountered global headers.
6022         * src/xheader.c: Use keywords from the global
6023         headers.
6024         Correctly handle UTF-8 conversions.
6025         (xheader_list_destroy): New function.
6026         (xheader_set_single_keyword,xheader_set_keyword_equal): Added
6027         missing gettext markers
6028         (decode_record): Rewritten using caller-provided handler and
6029         data closure.
6030         * tests/listed01.sh: Give credit to Andreas Schuldei.
6031
6032 2004-02-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6033
6034         * src/create.c (dump_file0): The conditional at line
6035         1296 prevented incremental backups on individual files
6036         from working, as reported by Andreas Schuldei
6037         <andreas@schuldei.org>.
6038
6039         This is due to the condition
6040
6041           (0 < top_level || !incremental_option)
6042
6043         Removing it makes incremental backups work for individual
6044         files as well as for directories. On the other hand, it does
6045         not affect other functionality, as shown by the reasoning below:
6046
6047         To begin with, the two parts of this condition are mutually
6048         superfluous, because
6049
6050           1) when top_level < 0, incremental_option == 1
6051           so the condition yields false
6052           2) when top_level >= 0, incremental_option == 0
6053           so the condition yields true.
6054
6055         In other words, it is completely equivalent to
6056
6057               (!incremental_option)
6058
6059         Now, let's consider the effect of its removal. There are two cases:
6060
6061         1) when incremental_option==1
6062         This means incremental backup in progress. In this case dump_file
6063         is invoked only for directories or for files marked with 'Y' by
6064         get_directory_contents. The latter are those that did not meet the
6065         condition in incremen.c:242, which is exactly the same condition
6066         as this at create.c:1296. So, for these files the check
6067         (!incremental_option) is useless, since the rest of the
6068         conditional will yield false anyway. On the other hand, if
6069         dump_file is invoked on a directory, the conditional will yield
6070         false due to !S_ISDIR assertion, so these will be processed as usual.
6071
6072         Thus, for this case the extra condition (!incremental_option) is
6073         irrelevant, and its removal won't alter the behavior of tar,
6074         *except* that it will enable incremental backups on individual
6075         files, which is the wanted effect.
6076
6077         2) when incremental_option==0
6078         In this case the condition yields true and its removal does not
6079         affect the functionality.
6080
6081         * THANKS: Updated
6082         * configure.ac: Raised patchlevel to 93
6083         * src/incremen.c: Minor stylistic fixes.
6084         * tests/listed01.sh: New test. Check listed incremental
6085         backups on individual files.
6086         * tests/Makefile.am: Added listed01.sh
6087
6088 2004-02-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6089
6090         * src/common.h (simple_finish_header,start_private_header): New
6091         declarations
6092         (xheader_ghdr_name): Changed declaration
6093         * src/create.c (start_private_header): Removed static qualifier.
6094         (write_extended): Removed superfluous last argument. Use
6095         xheader_write()
6096         (simple_finish_header): New function.
6097         (finish_header): Use simple_finish_header() to break recursive
6098         dependency between this function and write_extended().
6099         * src/tar.c (assert_format): Do not bail out if several
6100         --format arguments are given. This is a common case when
6101         TAR_OPTIONS are used.
6102         (decode_options): New option --show-defaults displays the
6103         compiled-in defaults.
6104         Use POSIX format if no --format option was given and
6105         --pax-option was specified.
6106         Do not allow to use --pax-option unless the archive format is
6107         set to POSIX (or reading subcommand is requested).
6108
6109         * src/update.c (update_archive): Write global extended header if
6110         constructed.
6111         * src/xheader.c (xheader_format_name): Bugfix.
6112         (xheader_xhdr_name): Changed the default extended header name
6113         to '%d/PaxHeaders.%p/%f', as POSIX requires.
6114         (xheader_ghdr_name): Removed unused argument.
6115         (xheader_write,xheader_write_global): New function.
6116         (xheader_decode): Modified to honor overrides whatever
6117         the current archive format is.
6118
6119         * src/delete.c (delete_archive_members): Call xheader_decode
6120         unconditionally.
6121         * src/list.c (decode_header): Likewise.
6122         * src/incremen.c (sort_obstack): Fixed typo in the comment
6123
6124         * doc/tar.texi: Document new default for extended
6125         header names.
6126
6127         * tests/before: Accept an optional list of allowed archive
6128         formats. Exit with the status 77 if the current archive
6129         format does not match any of them.
6130         * tests/delete03.sh: Require gnu, oldgnu or posix format
6131         * tests/incremen.sh: Require gnu or oldgnu format
6132         * tests/multiv01.sh: Likewise
6133
6134 2004-02-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6135
6136         * doc/tar.texi (Option Summary): Documented --pax-option
6137         * src/tar.c: Likewise.
6138         * NEWS: Likewise.
6139         * src/create.c (to_chars): Added a comment.
6140         * src/tar.h: Comment to GNU_FORMAT
6141
6142 2004-02-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6143
6144         * README: Updated
6145         * configure.ac: Added stpcpy
6146         * bootstrap: Likewise
6147         * lib/Makefile.am: Likewise
6148         * src/common.h (xheader_xhdr_name,xheader_ghdr_name): New
6149         functions
6150         * src/create.c (write_extended): Call xheader_xhdr_name
6151         instead of using hardcoded "././@PaxHeader" name.
6152         * src/tar.c: New option --pax-option (equivalent to -o option
6153         of pax).
6154         * src/xheader.c: Implement pax -o option. Fixed misleading
6155         heading comment (introduced 2003-09-02).
6156         * src/incremen.c: Minor fixes
6157         * m4/.cvsignore: Updated
6158
6159 2004-02-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6160
6161         * src/incremen.c: Removed accumulator stuff in favor of obstack.
6162         (get_directory_contents): Split into two functions
6163         * src/update.c: Minor changes
6164         * doc/tar.texi: Fixed typo
6165
6166 2004-02-15  Paul Eggert  <eggert@twinsun.com>
6167
6168         Fix Debian bug 230872, originally reported by Jeff King in
6169         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=230872>.
6170
6171         * doc/tar.texi (posix compliance): Remove.  The whole section
6172         was a misunderstanding of what POSIXLY_CORRECT is supposed to
6173         mean.  The GNU Coding Standards says that POSIXLY_CORRECT
6174         is for disabling extensions that are incompatible with POSIX:
6175         it is not for disabling compatible extensions.  All references
6176         to this section removed.
6177         (posix): This format is created only if the posix format is
6178         specified; it is no longer created if gnu format is specified
6179         and POSIXLY_CORRECT is set.
6180         * src/tar.c (decode_options): Ignore POSIXLY_CORRECT.
6181         POSIX does not specify the behavior of tar, so we should
6182         not worry about POSIXLY_CORRECT here.
6183
6184 2004-01-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6185
6186         * Makefile.am: Removed m4
6187         * configure.ac: Require automake-1.8/autoconf-2.59. Removed
6188         m4/Makefile.
6189         * README-alpha: Updated
6190         * bootstrap: Updated TP URL, improved help output. Default
6191         to :ext:anoncvs and set CVS_RSH, unless already set.
6192         * m4/Makefile.am: Removed
6193
6194 2004-01-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6195
6196         * bootstrap: Bugfix by Marco Gerards <metgerards@student.han.nl>:
6197         Use $option instead of $1 so all options will be parsed.
6198
6199 2004-01-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6200
6201         Started rewriting buffer.c ...
6202
6203         * bootstrap: New option --no-po
6204         * src/buffer.c (new_volume,check_label_pattern): Changed return type.
6205         (time_to_start_writing): Changed data type
6206         (file_to_switch_to): Removed. Variable never assigned to.
6207         (open_archive) Moved option compatibility checks to tar.c
6208         Other minor changes.
6209         * src/common.h (maybe_backup_file): Changed return type
6210         * src/misc.c: Likewise.
6211         * src/create.c: Updated invocations of safer_name_suffix
6212         * src/extract.c: Likewise
6213         * src/delete.c: Updated assignment to write_archive_to_stdout
6214         * src/tar.c (decode_options): More option compatibility checks
6215         (moved from buffer.c)
6216         * src/update.c (time_to_start_writing): Changed data type.
6217         * tests/recurse.sh: New test case.
6218         * tests/mksparse.c: New file.
6219         * tests/Makefile.am: Added recurse.sh and mksparse.c
6220
6221 2004-01-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6222
6223         * src/sparse.c (sparse_diff_file): Bugfix. Thanks
6224         Martin Simmons for the patch.
6225         * src/create.c (dump_dir0): Bugfix. Thanks Piotr Czerwinski
6226         <pius@pld-linux.org> for the patch.
6227
6228 2003-12-26  Paul Eggert  <eggert@twinsun.com>
6229
6230         Synchronize with Gettext 0.13.1, Automake 1.8, Autoconf 2.59,
6231         and translation website.
6232
6233         * bootstrap: Don't bother skipping codeset.m4, glibc21.m4,
6234         intdiv0.m4, inttypes_h.m4, inttypes.m4, inttypes-pri.m4,
6235         isc-posix.m4, and lcmessage.m4 from gnulib.  This list of files is
6236         a bit obsolete anyway, now that gettext 0.13.1 is out.  Also, the
6237         files are replaced by autoreconf.  Also, there seems to be a bug
6238         in gettext/autoconf/automake if we try to omit these files after
6239         autoreconf has replaced them, even though the gettext manual says
6240         they're optional.  So give up and just include them for now, even
6241         though they make 'configure' longer and slower.
6242
6243         Change translation URL from
6244         <http://www.iro.umontreal.ca/contrib/po/maint/tar/> to
6245         <http://www2.iro.umontreal.ca/~gnutra/po/maint/tar/> to
6246         accommodate translator website revamp.
6247
6248         Fail if autoreconf fails.
6249
6250         * m4/.cvsignore: Add intmax.m4, longdouble.m4, printf-posix.m4,
6251         signed.m4, size_max.m4, wchar_t.m4, wint_t.m4, xsize.m4, to
6252         ignore files now supplied by gettext 0.13.1.
6253
6254 2003-12-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6255
6256         Synchronized with the backup repository on Mirddin
6257
6258 2003-12-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6259
6260         * configure.ac: Check for varios members of struct stat
6261         that may represent file modification times with a subsecond
6262         precision.
6263         Check for utimes (for future use)
6264         * src/buffer.c (short_read): Issue a warning on short reads.
6265         * src/common.h (sys_stat_nanoseconds): New function
6266         * src/create.c (dump_file0): Use sys_stat_nanoseconds().
6267         * src/list.c (read_and): Treat only two successive zero
6268         filled blocks as an EOF indicator. Issue a warning if
6269         a single one is encountered.
6270         * src/system.c (sys_stat_nanoseconds): New function
6271         * src/tar.h (tar_stat_info.atime_nsec,mtime_nsec,ctime_nsec): New
6272         members.
6273         * src/xheader.c (code_time,decode_time): Support for subsecond
6274         precision.
6275         (atime_coder,atime_decoder,ctime_coder,ctime_decoder)
6276         (mtime_coder,mtime_decoder): Update invocations of code_time and
6277         decode_time.
6278         (gid_decoder,size_decoder,uid_decoder,sparse_size_decoder)
6279         (sparse_numblocks_decoder,sparse_offset_decoder)
6280         (sparse_numbytes_decoder): Updated
6281
6282 2003-12-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6283
6284         * src/names.c (safer_name_suffix): Reverted change made
6285         2003-11-14. Reason: Discussion with Paul Eggert and
6286         Jean-Louis Martineau. See also ChangeLog entry from
6287         1999-08-14.
6288         * tests/delete03.sh: Likewise.
6289         * tests/extrac04.sh: Likewise.
6290         * tests/multiv01.sh: Likewise.
6291
6292 2003-12-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6293
6294         * src/incremen.c (write_directory_file): Use sys_truncate
6295         * src/list.c (print_header): Use archive_file_size member
6296         when printing real file size.
6297         * src/sparse.c (sparse_scan_file): Correctly handle files with
6298         a hole at the end.
6299         (sparse_dump_region,sparse_extract_region): Allow for zero size
6300         trailing blocks
6301
6302 2003-12-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6303
6304         * configure.ac: Raised version number to 1.13.92
6305         * src/list.c (decode_header): Discern between pax and ustar
6306         formats
6307         Initialize current_stat_info.archive_file_size.
6308
6309         NOTE: Modifications from this date on are temporarily
6310         stored on local CVS on mirddin. This repository will
6311         be synchronized with Savannah as soon as the latter
6312         becomes operational again.
6313
6314 2003-12-01  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6315
6316         * TODO: Updated
6317         * src/sparse.c: Initial implementation of GNU/pax sparse
6318         file format.
6319         * src/common.h (xheader_store): Changed prototype.
6320         * src/create.c: Update calls to xheader_store
6321         * src/extract.c (extract_archive): Check reported size vs.
6322         archive file size to determine if we have to do with a
6323         sparse file.
6324         * src/tar.c (usage): Cleaned up the sample argument to --newer
6325         option.
6326         (decode_options): Allow --sparse for POSIX_FORMAT archives.
6327         * src/xheader.c (struct xhdr_tab.coder; all coder function): Added
6328         extra argument
6329         Implemented GNU.sparse.* keywords.
6330
6331 2003-11-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6332
6333         * configure.ac: Check for setlocale. Thanks Bruno Haible for
6334         reporting.
6335
6336 2003-11-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6337
6338         * src/create.c (write_gnu_long_link): Use oldgnu
6339         magic with @LongLink blocks.
6340
6341 2003-11-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6342
6343         * src/tar.h: Support for star sparse format.
6344         * src/sparse.c: Likewise.
6345
6346 2003-11-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6347
6348         * src/sparse.c (sparse_diff_file): New function
6349         * src/common.h (sys_compare_uid,sys_compare_gid): New functions
6350         (sys_compare_uid_gid): Removed.
6351         (sys_compare_links,report_difference): Changed prototype
6352         (sparse_diff_file): New function
6353         * src/system.c (sys_compare_uid,sys_compare_gid): New functions
6354         (sys_compare_uid_gid): Removed.
6355         (sys_compare_links): Changed declaration
6356         * src/compare.c (diff_archive): Use sparse_diff_file.
6357
6358 2003-11-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6359
6360         Rewritten sparse file handling.
6361
6362         * src/sparse.c: New file. Provides a universal framework
6363         for various methods for sparse files handling.
6364         * src/Makefile.am: Added sparse.c
6365         * src/common.h (struct sp_array,sparsearray,sp_array_size)
6366         (init_sparsearray,fill_in_sparse_array): Removed
6367         (enum dump_status): New data type
6368         (pad_archive,close_diag,open_diag,read_diag_details)
6369         (readlink_diag,savedir_diag,seek_diag_details,stat_diag): New
6370         functions.
6371         (sparse_file_p,sparse_dump_file,sparse_extract_file): New
6372         functions.
6373         (print_header): Changed prototype declaration.
6374         * src/tar.h (struct sp_array): Declaration from common.h
6375         (struct tar_stat_info): New members archive_file_size,
6376         sparse_map_avail,sparse_map.
6377         * src/create.c: Major rewrite.
6378         * src/extract.c: Use new sparse file interface.
6379         * src/compare.c (diff_sparse_files): Temporary placeholder.
6380
6381         * src/buffer.c: Minor changes
6382         * src/tar.c: Likewise.
6383         * src/list.c: Likewise.
6384         * src/misc.c (close_diag,open_diag,read_diag_details)
6385         (readlink_diag,savedir_diag,seek_diag_details,stat_diag): New
6386         diagnostics functions.
6387         * src/incremen.c: Use new diagnostics functions.
6388         * src/names.c: Likewise.
6389
6390 2003-11-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6391
6392         * configure.ac: Fixed check for setsockopt
6393
6394         * src/create.c: Do not zero-terminate name field if
6395         the name is exactly 100 characters long.
6396         (write_ustar_long_name): Fixed cheking for unsplittable
6397         names.
6398
6399 2003-11-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6400
6401         * src/create.c (start_header): Removed debugging hook
6402         (dump_file): Fixed handling of linkname field.
6403         * src/names.c (safer_name_suffix): If the input
6404         file name ends with a slash, output one should do so
6405         as well.
6406         * doc/tar.texi: Documented --format=ustar
6407
6408 2003-11-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6409
6410         * src/tar.h (archive_format): USTAR_FORMAT: New type.
6411         * src/create.c: Added POSIX.1-1988 support.
6412         * src/names.c (safer_name_suffix): Skip leading ./
6413         * src/tar.c: New option --format=ustar forces
6414         POSIX.1-1988 archive format.
6415         * tests/delete03.sh: Updated.
6416         * tests/extrac04.sh: Updated.
6417         * tests/multiv01.sh: Updated.
6418
6419 2003-11-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6420
6421         * src/list.c (read_and): Initialize current_stat_info
6422         and extended_header at the start of the loop.
6423         * src/names.c (all_names_found): Check if the argument
6424         contains valid filename. Fixes coredump on `not_a_tar_file'
6425         * src/xheader.c (atime_decoder,gid_decoder,ctime_decoder)
6426         (mtime_decoder,size_decoder,uid_decoder): Use xstrtoumax.
6427         Fixes `pax-big-10g' bug.
6428
6429 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6430
6431         Fix some C compatibility bugs reported by Joerg Schilling.
6432
6433         * src/common.h (stripped_prefix_len): Fix misspelling
6434         "stripped_path_len" in declaration.
6435         * src/rmt.c (main): Use "return FOO;" rather than
6436         "exit (FOO);"; we no longer have to worry about
6437         pre-ANSI hosts that mishandled returned values from "main".
6438         * src/tar.c (main): Likewise.  This avoids warnings on some
6439         compilers.
6440         * src/system.c: Include signal.h, for 'kill'.
6441         * src/system.h (DEV_BSIZE): Remove.
6442         (DEFAULT_ST_BLKSIZE): New macro.
6443         (ST_BLKSIZE): Use it, instead of DEV_BSIZE.
6444         * src/tar.c (enum): Remove comma just before }.
6445
6446 2003-11-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6447
6448         * src/list.c (decode_header): Initialize st_atime and
6449         st_ctime.
6450
6451 2003-11-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6452
6453         * configure.ac (tar_save_LIBS): Bugfix. Thanks Adrian
6454         Bunk <bunk@fs.tum.de> for reporting.
6455         * doc/tar.texi: Fixed spelling. Thanks Martin Buchholz
6456         <martin@xemacs.org> for spotting.
6457
6458 2003-11-04  Paul Eggert  <eggert@twinsun.com>
6459
6460         * src/xheader.c (xhdr_tab): Make it extern, not static, as C89 and
6461         C99 require this.
6462
6463 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6464
6465         * src/system.c (sys_spawn_shell): Cast trailing null to (char *).
6466         Bug reported by Christian Weisgerber.
6467
6468 2003-10-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6469
6470         * AUTHORS: Updated
6471         * NEWS: Updated
6472         * src/tar.c (decode_options): Removed superfluous archive format
6473         check
6474         * doc/tar.texi: Documented new features.
6475
6476 2003-10-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6477
6478         * NEWS: Updated
6479         * THANKS: Added Wojciech Polak
6480         * configure.ac: Added checks for missing functions. Raised
6481         version number to indicate alpha release.
6482         * lib/Makefile.am: Added missing headers
6483         * lib/waitpid.c: Added missing includes.
6484         * src/extract.c: Likewise.
6485         * src/names.c: Removed spurious includes.
6486         * src/xheader.c: Likewise.
6487         * src/system.h [MSDOS]: Fixed spelling of EACCES. Added
6488         macro overriding broken mkdir prototypes.
6489
6490 2003-10-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6491
6492         * configure.ac: Check for dev_t and ino_t.
6493         * m4/Makefile.am: Added missing files.
6494         * src/system.c: New file.
6495         * src/Makefile.am: Added system.c
6496         * src/common.h: Prototypes for functions from system.c
6497         * src/system.h (SET_BINARY_MODE, ERRNO_IS_EACCESS): New defines
6498         * src/buffer.c: Moved system dependencies to system.c
6499         * src/compare.c: Likewise.
6500         * src/create.c: Likewise.
6501         * src/delete.c: Likewise.
6502         * src/extract.c: Likewise.
6503         * src/rtapelib.c: Likewise.
6504
6505 2003-10-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6506
6507         Implemented --occurrence option.
6508
6509         * NEWS: Updated.
6510         * src/tar.c: New option --occurrence.
6511         * src/common.h (occurrence_option): New global
6512         (struct name): Changed `found' member to `uintmax_t
6513         found_count'.
6514         (names_done): Removed
6515         (all_names_found): Changed prototype.
6516         (ISFOUND,WASFOUND): New macros
6517         * src/delete.c (delete_archive_members): Honor --occurrence
6518         option.
6519         * src/list.c (read_and): Likewise.
6520         * src/names.c: Count number of occurrences of each name in the
6521         archive.
6522         (name_match): Honor --occurrence option.
6523         (names_done): Removed
6524         (all_names_found,names_notfound): Rewritten.
6525
6526 2003-10-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6527
6528         * src/tar.c: Removed extra precaution regarding
6529         subcommand_option == CAT_SUBCOMMAND
6530         * lib/Makefile.am: Updated
6531
6532 2003-10-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6533
6534         * src/common.h (names_done): New function.
6535         * src/names.c: Likewise.
6536         * src/list.c (read_and): Use all_names_found() as `while'
6537         condition.
6538         * src/tar.c: New option --first-copy
6539         * NEWS: Updated
6540
6541 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6542
6543         * src/rmt.c (main): Don't translate Copyright string; international
6544         law says the word "Copyright" should be in English.
6545         * src/tar.c (decode_options): Likewise.
6546
6547 2003-09-22  Paul Eggert  <eggert@twinsun.com>
6548
6549         * doc/tar.texi (extracting untrusted archives): New section.
6550
6551         * src/common.h (stripped_path_len): Renamed from cut_path_elements.
6552         Return size_t, not pointer, so that we don't have to worry about
6553         violating the C standard by converting char const * to char *.
6554         All callers changed.
6555         * src/names.c (stripped_path_len): Likewise.  Strip file system
6556         prefix, too.  Count adjacent slashes as if they were one slash;
6557         that is the POSIX standard.
6558
6559 2003-09-17  Paul Eggert  <eggert@twinsun.com>
6560
6561         * README-alpha: Document maintainer tool assumptions a bit.  GNU
6562         'sed' is no longer required.  For GNU m4 1.4, suggest the patch in
6563         Debian bug 211447.  Fix minor misspellings/whitespace nits.
6564
6565         * configure.ac (AC_AIX, AC_MINIX): Remove; subsumed by
6566         gl_USE_SYSTEM_EXTENSIONS.
6567
6568         * lib/.cvsignore: Add exit.h, time_r.c, time_r.h.
6569         * m4/.cvsignore: Add restrict.m4, time_r.m4.
6570
6571 2003-09-17  Paul Eggert  <eggert@twinsun.com>
6572
6573         * bootstrap: Don't use "for option; do";
6574         Solaris 8 /bin/sh doesn't like that.
6575
6576 2003-09-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6577
6578         * README-alpha: Updated
6579         * bootstrap: Updated
6580
6581 2003-09-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6582
6583         * README-alpha: Updated
6584         * bootstrap: Updated
6585         * po/POTFILES.in: Added src/xheader.c
6586         * src/common.h (cut_path_elements): Added proto.
6587
6588 2003-09-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6589
6590         * src/buffer.c: Use ngettext where appropriate.
6591         * src/compare.c: Likewise.
6592         * src/create.c: Likewise.
6593         * src/misc.c: Likewise.
6594         * src/tar.c: Likewise.
6595         * src/update.c: Likewise.
6596
6597 2003-09-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6598
6599         * .cvsignore: Added *.shar.gz
6600         * NEWS: Updated
6601         * TODO: Updated
6602         * src/common.h (strip_path_elements): New variable.
6603         * src/extract.c (extract_archive): Implemented --strip-path
6604         * src/names.c (cut_path_elements): New function.
6605         * src/tar.c: New option --strip-path=NUM.
6606         (decode_options) Assign boolean values to bool variables.
6607
6608 2003-09-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6609
6610         * src/delete.c: Fixed deletion from the POSIX archives.
6611         * src/list.c (read_header): Minor change.
6612         * src/tar.c (main): Do not check for volume_label_option
6613         if subcommand_option is not CREATE_SUBCOMMAND.
6614         * src/xheader.c (xheader_decode): Store the header as
6615         well (for eventual delete).
6616
6617         * tests/incremen.sh: Explicitly request GNU format. This will
6618         disappear when GNU extended header keywords are working.
6619         * tests/multiv01.sh: Likewise
6620         * tests/volume.sh: Likewise
6621
6622 2003-09-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6623
6624         * src/create.c: Support for "linkpath" extended keyword.
6625         * src/xheader.c (decode_record): Reversed the return
6626         condition.
6627
6628 2003-09-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6629
6630         * configure.ac: Allow to redefine the default output format.
6631         * src/tar.c: Use DEFAULT_ARCHIVE_FORMAT macro
6632         (archive_format_string): New function.
6633         (usage): Updated help output.
6634         * README: Updated.
6635         * NEWS: Updated.
6636         * TODO: Updated.
6637
6638 2003-09-02  Paul Eggert  <eggert@twinsun.com>
6639
6640         * src/common.h (destroy_stat, xheader_decode, xheader_store,
6641         xheader_read, xheader_finish, xheader_destroy): Add decls;
6642         C99 requires this.
6643
6644         * src/create.c (write_extended): Remove unused local 'bufsize'.
6645
6646         * src/delete.c (delete_archive_members): Handle case of
6647         HEADER_SUCCESS_EXTENDED followed by HEADER_FAILURE.
6648         * src/list.c (read_and): Abort if HEADER_SUCCESS_EXTENDED
6649         occurs, as it's not possible.
6650         * src/update.c (update_archive): Likewise.
6651
6652         Use "const" when possible in new code.
6653         * src/tar.c (struct fmttab.name): Now char const *.  All uses changed.
6654         (fmttab): Now const.  All uses changed.
6655         * src/xheader.c (struct xhdr_tab.keyword): Now pointer to const.
6656         (struct xhdr_tab.coder, struct xhdr_tab.decoder, locate_handler,
6657         decode_record, xheader_store, xheader_print, code_string, code_time,
6658         code_num, dummy_coder, dummy_decoder, atime_coder, atime_decoder,
6659         gid_coder, gid_decoder, gname_coder, gname_decoder, linkpath_coder,
6660         linkpath_decoder, ctime_coder, ctime_decoder, mtime_coder,
6661         mtime_decoder, path_coder, path_decoder, size_coder, size_decoder,
6662         uid_coder, uid_decoder, uname_coder, uname_decoder):
6663         Use pointers to const when possible.
6664         (xhdr_tab): Now const.
6665
6666         * src/tar.c (fmttab): Avoid GCC warning by not eliding initializers.
6667         (set_archive_format): Report an error if no format name matches,
6668         instead of returning an undefined value.
6669
6670         * src/xheader.c (struct xhdr_tab.decoder, dummy_decoder,
6671         atime_decoder, gid_decoder, gname_decoder, linkpath_decoder,
6672         ctime_decoder, mtime_decoder, path_decoder, size_decoder,
6673         uid_decoder, uname_decoder): Remove unused keyword arg.
6674         All uses changed.
6675
6676         * src/tar.c (set_archive_format): Now static.
6677         * src/xheader.c (xhdr_tab, format_uintmax): Now static.
6678
6679         * src/xheader.c (dummy_coder, dummy_decoder, atime_coder,
6680         atime_decoder, gid_coder, gid_decoder, gname_coder, gname_decoder,
6681         linkpath_coder, linkpath_decoder, mtime_coder, mtime_decoder,
6682         ctime_coder, ctime_decoder, path_coder, path_decoder, size_coder,
6683         size_decoder, uid_coder, uid_decoder, uname_coder, uname_decoder):
6684         Remove forward decls; no longer needed.
6685         (xhdr_tab): Move to end, so that the forward decls aren't needed.
6686         Add a forward declaration.
6687
6688         Use 'bool' in new code, when appropriate.
6689         * src/xheader.c (decode_record): Return bool, not int.
6690         * src/common.h (read_header): Since it accepts bool, change
6691         all callers to use false and true rather than 0 and 1.
6692
6693         * src/xheader.c (decode_record): Fix misspelling in diagnostic
6694         "extended headed" -> "extended header".
6695
6696         GNU coding style fixes.
6697         * src/xheader.c (decode_record, xheader_decode):
6698         Do not use decls like "char *p, *q;".
6699
6700         Minor style fixes.
6701         (xheader_store): Avoid parentheses around object operand of sizeof.
6702
6703 2003-09-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6704
6705         * src/create.c (start_header): Store long file names
6706         in "path" keyword of an extended header if in POSIX
6707         mode.
6708         (finish_header): print header before calling write_extended().
6709         * src/list.c (list_archive): Always decode the header. This
6710         is necessary so the extended header is processed and the correct
6711         filename is printed no matter what the state of verbose_option.
6712         * src/xheader.c (xhdr_tab): Reserved GNU keywords (commented out
6713         for the time being).
6714
6715 2003-09-01  Paul Eggert  <eggert@twinsun.com>
6716
6717         Update from gnulib, and correct fnmatch to fnmatch-gnu.
6718         * bootstrap (gnulib_modules): Change fnmatch to fnmatch-gnu.
6719         Sort.
6720         * configure.ac (gl_USE_SYSTEM_EXTENSIONS): Use this instead
6721         of AC_GNU_SOURCE.
6722         * lib/.cvsignore: Add alloca.h, stdbool.h.  Sort.  Append newline.
6723         * lib/Makefile.am (lib_OBJECTS): New macro, for convenience when
6724         copying rules from gnulib module descriptions.
6725         (BUILT_SOURCES, EXTRA_DIST, all-local, alloca.h):
6726         Update from gnulib modules alloca, fnmatch, getline, stdbool.
6727         * m4/.cvsignore: Add utimes-null.m4.  Sort.
6728
6729 2003-09-01  Sergey Poznyakoff
6730
6731         Added initial support for creating POSIX headers.
6732
6733         * src/common.h (MAXOCTAL11,MAXOCTAL7): New defines
6734         (string_to_chars): New functions
6735         (struct xheader): Changed structure
6736         (gid_to_gname,gname_to_gid,uid_to_uname,uname_to_uid): Changed
6737         prototypes.
6738         * src/create.c (string_to_chars): New function.
6739         (write_extended): New function
6740         (start_header): Create extended POSIX headers if necessary.
6741         (finish_header): Likewise.
6742         * src/list.c (print_header): Take user/group from
6743         current_stat_info.
6744         * src/names.c (gid_to_gname,gname_to_gid)
6745         (uid_to_uname,uname_to_uid): Changed prototypes.
6746         * src/tar.c: New option --format.
6747         * src/tar.h (OLDGNU_COMPATIBILITY): Removed
6748         (struct extra_header): Removed unused structure.
6749         (union block.extra_header): Removed unused member.
6750         * src/xheader.c: Implemented coder functions.
6751         * bootstrap: Added obstack.
6752         * lib/.cvsignore: Likewise.
6753         * configure.ac: Added 'gl_OBSTACK'
6754         * m4/Makefile.am: Added new files.
6755         * m4/.cvsignore: Likewise.
6756         * TODO: Minor formatting change
6757
6758 2003-08-31  Sergey Poznyakoff
6759
6760         Added initial support for POSIX extended and STAR headers
6761         (only for listing/extracting).
6762
6763         * src/xheader.c: New file.
6764         * src/Makefile.am: Added xheader.c
6765         * src/tar.h (struct star_header): New datatype
6766         (XHDTYPE,XGLTYPE): New defines
6767         (enum archive_format:STAR_FORMAT): New member
6768         (struct tar_stat_info): New datatype.
6769         (union block.star_header): New member.
6770         * src/common.h (orig_file_name,current_file_name)
6771         (current_trailing_slash,current_link_name): Removed variables.
6772         (current_stat_info): New variable
6773         (current_stat): Removed
6774         (extended_header): New variable
6775         (decode_header): Changed prototype.
6776         * src/list.c (decode_header): Added initial support for POSIX extended
6777         and STAR headers.
6778         (skip_member): Check oldgnu_header only if current_format is set
6779         to OLDGNU_FORMAT.
6780         * src/buffer.c: Use current_stat_info
6781         * src/compare.c: Likewise.
6782         * src/create.c: Likewise.
6783         * src/delete.c: Likewise.
6784         * src/incremen.c: Likewise.
6785         * src/mangle.c: Likewise.
6786         * src/update.c: Likewise.
6787         * src/extract.c: Likewise.
6788         (make_directories): Improved check for the existence of the directory
6789         * src/tar.c (destroy_stat): New function.
6790
6791 2003-08-29  Paul Eggert  <eggert@twinsun.com>
6792
6793         * NEWS, bootstrap: Drop en_GB locale; it was more trouble than it
6794         was worth (e.g., different users in en_GB disagree about -ize
6795         versus -ise).
6796         * po/en_GB.po: Remove.
6797
6798 2003-07-28  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6799
6800         * TODO: Updated
6801         * NEWS: Updated
6802         * src/tar.c: Removed support for the obsolete command line
6803         options.
6804         * doc/tar.texi: Removed references to the obsolete command
6805         line options.
6806
6807 2003-07-27  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6808
6809         * TODO: Updated
6810         * NEWS: Updated
6811         * doc/tar.texi: Updated
6812         * src/common.h (check_links_option): New variable
6813         (orig_file_name): New variable
6814         (check_links): New proto.
6815         * src/create.c (struct link.nlink): New member
6816         (link_table): Static for the module.
6817         (dump_file): Update `link' member when adding new links
6818         to the link_table.
6819         (check_links): New function.
6820         * src/list.c (print_header): Use orig_file_name.
6821         * src/tar.c: New option --check-links. Changed semantics of
6822         -o to comply to UNIX98 when extracting and to its previous
6823         semantics otherwise.
6824         (main): Call check_links if --check-links. was given.
6825
6826 2003-07-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6827
6828         * src/list.c (print_header): Revised
6829         * NEWS: Started the entry for 1.13.26
6830         * doc/Makefile.am (tar.dvi): Fixed TEXINPUTS value.
6831
6832 2003-07-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6833
6834         * .cvsignore: Added to the repository.
6835         * doc/.cvsignore: Likewise.
6836         * lib/.cvsignore: Likewise.
6837         * m4/.cvsignore: Likewise.
6838         * po/.cvsignore: Likewise.
6839         * scripts/.cvsignore: Likewise.
6840         * src/.cvsignore: Likewise.
6841         * tests/.cvsignore: Likewise.
6842
6843         * lib/Makefile.am: Added exitfail.[hc]
6844         * src/misc.c (chdir_do): Fixed call to restore_cwd
6845         * src/buffer.c (flush_read): Fixed behavior on short
6846         reads right after opening the new archive (multiv01.sh test).
6847         (new_volume): Special handling for "-".
6848         * src/list.c (print_header): Print trailing slash if
6849         current_trailing_slash was set (extrac03.sh,extrac04.sh tests).
6850         * tests/multiv01.sh: Minor changes.
6851         * m4/Makefile.am: Added missing files.
6852
6853 2003-07-05  Paul Eggert  <eggert@twinsun.com>
6854
6855         Finish the checkin begin yesterday.
6856
6857         * NEWS: Document the user-visible changes installed in the last
6858         two days.
6859
6860         * TODO: New file (actually, resurrected; but with new contents).
6861
6862         * src/list.c (read_and): Give full type for procedure arg.
6863         (read_header): Strip trailing slashes, setting current_trailing_slash.
6864         (tartime): Avoid int overflow when printing year (!).
6865         (print_header): New arg specifying block ordinal.  All uses changed.
6866         Print link as 'h' type.  Give labels for long links and names.
6867
6868         * src/misc.c (contains_dot_dot): Moved to names.c
6869         (must_be_dot_or_slash): New function.
6870         (safer_rmdir): Use it.
6871         (remove_any_file): Now takes enum as option, not boolean.
6872         Check for (Linux) EISDIR as well as (POSIX) EPERM when attempting
6873         to unlink a directory.
6874         (deref_stat): Accept bool, not int.
6875
6876         * src/names.c (namelist_match): Allow partial matches only if
6877         recursive.
6878         (hash_string_hasher): Renamed from hash_avoided_name.
6879         (hash_string_compare): Renamed from compare_avoided_anames.
6880         (hash_string_insert, hash_string_lookup): New functions.
6881         (add_avoided_name, is_avoided_name): Use them.
6882         (safer_name_suffix): New function.
6883         (contains_dot_dot): Moved here from misc.c.  Now returns bool, not int.
6884
6885         * src/rmt.c: Don't include print-copyr.h.
6886         (prepare_input_buffer): New arg FD.
6887         Do not read more than INT_MAX bytes at once,
6888         since it breaks on some brain damaged Tru64 hosts.
6889         Divide size by two
6890         when retrying instead of subtracting 1024; for speed.
6891         (main): Use gettext to translate (C), not print_copyright.
6892
6893         * src/system.h: Include <alloca.h> and <stdbool.h> unconditionally,
6894         now that gnulib handles this.
6895         Include <stddef.h> and <limits.h> unconditionally, now that we assume
6896         C89 or better.
6897         Assume that offsetof is defined in stddef.h.
6898         Do not include <sys/param.h>.
6899         (realloc, lseek): Do not declare.
6900         (HAVE_DECL_VALLOC): Renamed from HAVE_VALLOC.
6901         (CHAR_BIT, CHAR_MAX, UCHAR_MAX, LONG_MAX): Remove
6902         declarations, since we now assume C89 or better.
6903         (PARAMS): Remove, as we now assume C89.  All uses changed.
6904         (bindtextdomain, textdomain): Include <gettext.h> to define.
6905         Include <unlocked-io.h>.
6906         (valloc): Define if not defined, and if valloc is not declared.
6907         (xstrdup): Remove decl.
6908
6909         * src/tar.c: Do not include <print-copyr.h>.
6910         Include <getdate.h>.
6911         (get_date): Remove decl.
6912         (ATIME_PRESERVE_OPTION, CHECKPOINT_OPTION, FORCE_LOCAL_OPTION,
6913         IGNORE_FAILED_READ_OPTION, INDEX_FILE_OPTION, NO_OVERWRITE_DIR_OPTION,
6914         NUMERIC_OWNER_OPTION, RECURSIVE_UNLINK_OPTION, REMOVE_FILES_OPTION,
6915         SHOW_OMITTED_DIRS_OPTION, TOTALS_OPTION): New constants.
6916         (long_options, decode_options): Use them.
6917         (OVERWRITE_DIR_OPTION): Remove.
6918         (long_options): New options --index-file, --no-overwrite-dir.
6919         Remove --overwrite-dir option.
6920         (usage): Use PACKAGE_BUGREPORT.
6921         (decode_options): Terminate new argv properly.
6922         Use PACKAGE_NAME, PACKAGE_VERSION.
6923         If verbose, report how we grokked any textual date option.
6924         (main): Add support for index-file.
6925
6926         * tests/Makefile.am: Convert to UTF-8.
6927         (AUTOMAKE_OPTIONS): Remove.
6928         (TESTS): Add delete04.sh, multiv01.sh, options.sh.
6929         (INCLUDES): Remove ../intl.
6930         (LDADD): Don't link libtar.a twice.
6931
6932         * tests/genfile.c: Convert to UTF-8.
6933         Don't include <print-copyr.h>.
6934         (DEFAULT_PATTERN): Renamed from DEFAULT.
6935         (ZEROS_PATTERN): Renamed from ZEROS.
6936         (main): Use gettext to translate (C), not print_copyright.
6937
6938 2003-07-04  Paul Eggert  <eggert@twinsun.com>
6939
6940         Revamp to meet current standards of autoconf, automake,
6941         gettext, and gnulib, and incorporate new translations.
6942
6943         * config/config.guess, config/config.sub, config/depcomp,
6944         config/install-sh, config/mdate-sh, config/missing,
6945         config/mkinstalldirs, config/texinfo.texi:
6946         Moved here from parent directory, or from doc.
6947         * config.hin: Renamed from config.h.in.
6948         * config/config.rpath: New file.
6949
6950         * intl: Remove this subdirectory.
6951
6952         * lib/fnmatch_.h: Renamed from lib/fnmatch.hin.
6953
6954         * lib/getstr.c, lib/getstr.h, lib/msleep.c, lib/print-copyr.c,
6955         lib/print-copyr.h, lib/readutmp.c, lib/rename.c, lib/stpcpy.c,
6956         lib/strstr.c, lib/strtoimax.c, lib/strtoll.c, lib/strtoull.c,
6957         lib/strtoumax.c, lib/unicodeio.c, lib/unicodeio.h,
6958         lib/xstrtoimax.c, m4/c-bs-a.m4, m4/ccstdc.m4, m4/check-decl.m4,
6959         m4/decl.m4, m4/jm-mktime.m4, m4/prereq.m4, m4/xstrtoimax.m4,
6960         stamp-h.in: Remove.
6961
6962         * lib/alloca_.h, lib/fnmatch_loop.c, lib/gettext.h, lib/pathmax.h,
6963         lib/safe-write.c, lib/safe-write.h, lib/stdbool_.h, lib/strcase.h,
6964         lib/stripslash.c, lib/unlocked-io.h, lib/xgetcwd.h, m4/alloca.m4,
6965         m4/backupfile.m4, m4/bison.m4, m4/chown.m4, m4/dirname.m4,
6966         m4/dos.m4, m4/exclude.m4, m4/fileblocks.m4, m4/ftruncate.m4,
6967         m4/getdate.m4, m4/getopt.m4, m4/hash.m4, m4/human.m4,
6968         m4/intdiv0.m4, m4/intmax_t.m4, m4/inttypes-pri.m4,
6969         m4/inttypes_h.m4, m4/isc-posix.m4, m4/lchown.m4, m4/lib-ld.m4,
6970         m4/lib-link.m4, m4/lib-prefix.m4, m4/memset.m4, m4/mktime.m4,
6971         m4/modechange.m4, m4/nls.m4, m4/onceonly.m4, m4/pathmax.m4,
6972         m4/po.m4, m4/quote.m4, m4/quotearg.m4, m4/rmdir.m4,
6973         m4/safe-read.m4, m4/safe-write.m4, m4/save-cwd.m4, m4/savedir.m4,
6974         m4/ssize_t.m4, m4/stdbool.m4, m4/stdint_h.m4, m4/strcase.m4,
6975         m4/strtoimax.m4, m4/strtol.m4, m4/strtoll.m4, m4/strtoul.m4,
6976         m4/strtoull.m4, m4/strtoumax.m4, m4/tm_gmtoff.m4, m4/uintmax_t.m4,
6977         m4/unlocked-io.m4, m4/xalloc.m4, m4/xgetcwd.m4, m4/xstrtol.m4,
6978         po/LINGUAS, po/Makevars, po/Rules-quot, po/boldquot.sed,
6979         po/en@boldquot.header, po/en@quot.header, po/en_GB.po,
6980         po/insert-header.sin, po/remove-potcdate.sin, po/stamp-po: New files.
6981
6982         * ABOUT-NLS, INSTALL, lib/addext.c, lib/alloca.c, lib/argmatch.c,
6983         lib/argmatch.h, lib/backupfile.c, lib/backupfile.h, lib/dirname.c,
6984         lib/dirname.h, lib/error.c, lib/exclude.c, lib/exclude.h,
6985         lib/fnmatch.h, lib/full-write.c, lib/full-write.h, lib/getdate.h,
6986         lib/getdate.y, lib/getline.c, lib/getline.h, lib/getopt.c,
6987         lib/getopt.h, lib/getopt1.c, lib/hash.c, lib/hash.h, lib/human.c,
6988         lib/human.h, lib/lchown.c, lib/malloc.c, lib/mktime.c,
6989         lib/modechange.c, lib/modechange.h, lib/quote.c, lib/quote.h,
6990         lib/quotearg.c, lib/quotearg.h, lib/realloc.c, lib/safe-read.c,
6991         lib/safe-read.h, lib/save-cwd.c, lib/save-cwd.h, lib/savedir.c,
6992         lib/savedir.h, lib/strcasecmp.c, lib/utime.c, lib/xalloc.h,
6993         lib/xgetcwd.c, lib/xmalloc.c, lib/xstrdup.c, lib/xstrtol.c,
6994         lib/xstrtol.h, lib/xstrtoumax.c, m4/codeset.m4, m4/d-ino.m4,
6995         m4/error.m4, m4/fnmatch.m4, m4/getcwd.m4, m4/getline.m4, m4/gettext.m4,
6996         m4/glibc21.m4, m4/iconv.m4, m4/inttypes.m4, m4/lcmessage.m4,
6997         m4/longlong.m4, m4/malloc.m4, m4/mbrtowc.m4, m4/mbstate_t.m4,
6998         m4/progtest.m4, m4/realloc.m4, m4/strerror_r.m4, m4/ulonglong.m4,
6999         m4/utimbuf.m4, m4/utime.m4, m4/utimes.m4, m4/xstrtoumax.m4,
7000         po/Makefile.in.in:
7001         Upgrade to latest version from external source.  The file "bootstrap"
7002         now grabs these automatically, so we needn't keep track of them
7003         in this change long any longer.
7004
7005         * Makefile.am (AUTOMAKE_OPTIONS): Remove.  Now done by configure.ac.
7006         (SUBDIRS): Remove intl.
7007         * PORTS: Update for star, Macintosh.
7008         * README, README-alpha: Suggest Autoconf 2.57, Automake 1.7.5,
7009         Bison 1.875, gettext 0.12.1.
7010         * THANKS: Add Bernhard Rosenkraenzer, Solar Designer.
7011         * configure.ac (AC_INIT, AM_INIT_AUTOMAKE): Convert to modern form.
7012         (AC_CONFIG_AUX_DIR): New.
7013         (AC_CONFIG_HEADERS): Rename config.h.in to config.hin, to be more
7014         like coreutils.
7015         (AC_PREREQ): Bump from 2.52 to 2.57.
7016         (AC_GNU_SOURCE): New.
7017         (AC_PROG_GCC_TRADITIONAL, AM_C_PROTOTYPES, AC_C_CONST): Remove;
7018         we no longer support K&R C.
7019         (YACC): Remove.
7020         (AC_CHECK_HEADERS): Remove limits.h, poll.h, stdbool.h, stropts.h,
7021         sys/ioccom.h, sys/param.h, sys/time.h, sys/timeb.h, wchar.h, wctype.h.
7022         (AC_MBSTATE_T): Remove.
7023         (HAVE_UTIME_H, HAVE_DECL_FREE, HAVE_DECL_GETGRGID, HAVE_DECL_GETPWUID,
7024         HAVE_DECL_GETENV, HAVE_DECL_MALLOC, HAVE_DECL_STRTOUL,
7025         HAVE_DECL_STRTOULL, HAVE_MKNOD): Remove our special code.
7026         (AM_STDBOOL_H): Add.
7027         (AC_HEADER_TIME, AC_STRUCT_TIMEZONE,
7028         jm_CHECK_TYPE_STRUCT_DIRENT_D_INO): Remove.
7029         (AC_CHECK_TYPE): Remove ssize_t.
7030         (gt_TYPE_SSIZE_T): Add.
7031         (jm_AC_PREREQ_XSTRTOUMAX, jm_PREREQ_ADDEXT, jm_PREREQ_ERROR,
7032         jm_PREREQ_HUMAN, jm_PREREQ_QUOTEARG, jm_PREREQ_XGETCWD,
7033         AC_FUNC_ALLOCA, AC_FUNC_CLOSEDIR_VOID, AC_FUNC_STRERROR_R,
7034         AC_FUNC_FNMATCH, AC_FUNC_VPRINTF, AM_FUNC_GETLINE, jm_FUNC_MALLOC,
7035         jm_FUNC_MKTIME, jm_FUNC_REALLOC):
7036         Remove.  Switch to gnulib macros like gl_BACKUPFILE instead.
7037         (tar_LDADD): Rename to LIB_CLOCK_GETTIME.  All uses changed.
7038         (rmt_LDADD): Rename to LIB_SETSOCKOPT.  All uses changed.
7039         (AC_CHECK_FUNCS): Remove fchdir, ftime, getcwd, isascii, nap,
7040         napms, poll, select, strstr, usleep.
7041         (AC_REPLACE_FUNCS): Remove ftruncate, lchown, memset, rename,
7042         rmdir, strcasecmp, strncasecmp, strtol, strtoul.
7043         (AM_GNU_GETTEXT): Use external and need-ngettext options.
7044         (AM_GNU_GETTEXT_VERSION): New.
7045         (AC_OUTPUT): Remove intl/Makefile.
7046
7047         * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
7048         ($(srcdir)/tar.info, tar.dvi): Remove obsolete warnings.
7049         * doc/fdl.texi: Update to current GNU version.
7050         * doc/gettext.texi: Update to current coreutils version,
7051         plus a copyright notice.
7052         * doc/tar.texi: Switch to new method for doing copyright notices.
7053         Use @acronym instead of @sc where appropriate.
7054         Remove empty examples.  Give a few more examples.
7055
7056         * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
7057         (EXTRA_DIST, libtar_a_SOURCES): Switch to gnulib, so that they
7058         are built up in pieces with +=.
7059         (noinst_HEADERS, INCLUDES): Remove.
7060         (BUILT_SOURCES, MAINTAINERCLEANFILES, MOSTLYCLEANFILES): New.
7061         (libtar_a_LIBADD): Use $ rather than @.
7062         (all-local, alloca.h, fnmatch.h, stdbool.h): New rules, from gnulib.
7063
7064         * m4/Makefile.am (EXTRA_DIST): Add alloca.m4, backupfile.m4,
7065         bison.m4, chown.m4, dirname.m4, dos.m4, exclude.m4, fileblocks.m4,
7066         ftruncate.m4, getdate.m4, getopt.m4, hash.m4, human.m4,
7067         intdiv0.m4, intmax_t.m4, inttypes_h.m4, inttypes-pri.m4,
7068         isc-posix.m4, lcown.m4, lib-ld.m4, lib-link.m4, lib-prefix.m4,
7069         memset.m4, mktime.m4, modechange.m4, nls.m4, onceonly.m4,
7070         pathmax.m4, po.m4, quotearg.m4, quote.m4, rmdir.m4, safe-read.m4,
7071         safe-write.m4, save-cwd.m4, savedir.m4, ssize_t.m4, stdbool.m4,
7072         stdint_h.m4, strcase.m4, strtoimax.m4, strtoll.m4, strtol.m4,
7073         strtoull.m4, strtoul.m4, strtoumax.m4, tm_gmtoff.m4, uintmax_t.m4,
7074         unlocked-io.m4, xalloc.m4, xgetcwd.m4, xstrtol.m4.
7075         Remove c-bs-a.m4, ccstdc.m4, check-decl.m4, decl.m4, jm-mktime.m4,
7076         prereq.m4, xstrtoimax.m4.
7077
7078         * po/POTFILES.in: Remove tests/genfile.c; it doesn't need to
7079         be translated, since it's not a user-visible tool.
7080
7081         * scripts/Makefile.am (AUTOMAKE_OPTIONS): Remove.
7082
7083         * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
7084         (INCLUDES): Remove ../intl.  Put top-srcdir before ., for
7085         consistency with coreutils.
7086         (LDADD): Link LIBINTL after libtar.a, since
7087         it's now external and should stand by itself.
7088
7089         * src/buffer.c (print_total_written): Adjust to new human.h
7090         interface.
7091         (child_open_for_compress): Do not increase size to BLOCKSIZE.
7092         (open_archive): Open index file name.
7093         Strip trailing slahes from file names.
7094         (flush_write): Set size to 0 if not saving names.
7095         (flush_write, flush_read): Use safer_name_suffix rather than
7096         inline code.
7097
7098         * src/common.h: Include <quote.h>.
7099         (absolute_names_option, atime_preserve_option, backup_option,
7100         block_number_option, checkpoint_option, dereference_option,
7101         force_local_option, ignore_failed_read_option, ignore_zeros_option,
7102         incremental_option, interactive_option, multi_volume_option,
7103         numeric_owner_option, one_file_system_option, recursive_unlink_option,
7104         read_full_records_option, remove_files_option, same_order_option,
7105         show_omitted_dirs_option, sparse_option, starting_file_option,
7106         to_stdout_option, totals_option, touch_option, verify_option,
7107         dev_null_output, now_verifying, we_are_root): Now bool, not int.
7108         (current_trailing_slash, index_file_name, recent_long_name_blocks,
7109         recent_long_link_blocks): New vars.
7110         (NO_OVERWRITE_DIR_OLD_FILES): New constant.
7111         (OVERWRITE_OLD_DIRS): Remove.
7112         (enum remove_option): New enum.
7113         (remove_any_file): Use it as option arg, not int.
7114         (is_avoided_name, contains_dot_dot): Return bool, not int.
7115         (safer_name_suffix): New decl.
7116
7117         * src/compare.c (now_verifying): Now bool, not int.
7118         (fill_in_sparse_array): Move to extract.c.  Now returns bool;
7119         all callers changed to test for failure.
7120         (diff_sparse_files): Take size from current_stat, not from param.
7121         (diff_archive): Do not count trailing slashes in archives.
7122         (verify_volume): Test for header failure after loop, not before.
7123
7124         * src/create.c (relativize): Remove; replaced by safer_name_suffix.
7125         All callers changed.
7126         (start_header): Clear devmajor and devminor fields, too.
7127         (finish_header): New arg block_ordinal.
7128         (init_sparsearray): Now extern.  Set sp_array_size to
7129         SPARSES_IN_OLDGNU_HEADER if it is zero.
7130         (dump_file): Keep link table as a hash.
7131         Do not count "file changed as we read it" as a failure.
7132
7133         * src/delete.c (recent_long_name_blocks, recent_long_link_blocks):
7134         Move extern decl to common.h.
7135
7136         * src/extract.c (we_are_root): Now bool, not int.
7137         (check_time): Warn about implausibly old time stamps.
7138         (set_stat): Use utimbuf, not stat_info.
7139         (prepare_to_extract): New arg DIRECTORY.
7140         (fill_in_sparse_array): Moved here from compare.c.
7141         (extract_sparse_file): Now returns off_t, giving size left.
7142         Truncate file at end.
7143         (extract_archive): Use safer_name_suffix rather than rolling our own.
7144         Use fill_in_sparse_array rather than rolling our own.
7145         Strip trailing slashes more effectively.
7146         Check for unsafe names.
7147
7148         * src/incremen.c (struct directory): nfs and found are now of type
7149         bool, not int.
7150         (gnu_restore): Now takes directory name as argument, not offset
7151         of directory name in a global.  All uses changed.
7152         (CURRENT_FILE_NAME): Remove.
7153
7154         New tests.
7155         * tests/delete04.sh, tests/multiv01.sh, tests/options.sh: New
7156         files.
7157
7158 2002-09-30  Paul Eggert  <eggert@twinsun.com>
7159
7160         * src/rmt.c (prepare_input_buffer): Renamed form
7161         prepare_record_buffer.  All uses changed.  Do not assume that
7162         size_t is the same width as int.
7163
7164 2002-03-29  Paul Eggert  <eggert@twinsun.com>
7165
7166         * src/incremen.c (get_directory_contents):
7167         If ignore_failed_read_option, only warn about
7168         get_directory_contents failures.  Fix suggested by
7169         Mark Costlow.
7170
7171 2002-01-31  Mark W. Eichin  <eichin@thok.org>
7172
7173         * src/buffer.c (child_open_for_compress): Don't try to read
7174         past the end of the buffer.
7175
7176 2001-10-11  Jim Meyering  <meyering@lucent.com>
7177
7178         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
7179         and quote_n (1, ... to avoid clobbering a buffer.
7180
7181 2001-09-26  Paul Eggert  <eggert@twinsun.com>
7182
7183         * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 1.13.25.
7184
7185         * src/buffer.c (flush_read): Don't diagnose partial blocks before
7186         end of file; just ignore them silently.
7187
7188         * src/list.c (read_header): Don't keep around extended name
7189         and link info indefinitely; keep it only for the next file.
7190         This fixes a bug introduced in 1.13.24, and removes the need
7191         for some static variables.  Set recent_long_name and
7192         recent_long_link to zero if there were no long links; this
7193         avoids a violation of ANSI C rules for pointers in delete.c.
7194         * THANKS: Add Christian Laubscher.
7195
7196 2001-09-26  Jim Meyering  <meyering@lucent.com>
7197
7198         * doc/tar.texi (Remote Tape Server): is know -> is known
7199
7200 2001-09-25  Paul Eggert  <eggert@twinsun.com>
7201
7202         * lib/unicodeio.c (EILSEQ): Include <iconv.h> first, since
7203         <iconv.h> may define EILSEQ (e.g. libiconv).  Define a
7204         replacement EILSEQ to be ENOENT, not EINVAL, since callers may
7205         want to distinguish EINVAL and EILSEQ.
7206
7207 2001-09-24  Christophe Kalt  <Christophe.Kalt@kbcfp.com>
7208
7209         * src/extract.c (maybe_recoverable):
7210         Treat OVERWRITE_OLD_DIRS like DEFAULT_OLD_FILES.
7211
7212 2001-09-22  Paul Eggert  <eggert@twinsun.com>
7213
7214         * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 1.13.24.
7215
7216         * ABOUT-NLS, intl/*: Update to gettext-0.10.40, replacing LGPL
7217         with GPL.
7218
7219         * INSTALL, mkinstalldirs: Update to autoconf 2.52 version.
7220         * PORTS: Add copyright notice, 'star' reference.
7221         * README-alpha: Add copyright notice, autoconf 2.52 patch.
7222         * THANKS: Add Christophe Kalt.
7223         * config.sub: Upgrade to 2001-09-14 version.
7224
7225         * configure.ac (ALL_LINGUAS): Add ko.
7226         * po/ko.po: Resurrected file.
7227
7228         * doc/convtexi.pl: Add coding advice for Emacs.
7229
7230         * doc/getdate.texi: Add copyright notice.
7231
7232         * doc/mdate-sh: Upgrade to automake 1.5 version.
7233
7234         * doc/tar.texi (extracting files): Mention --to-stdout.
7235         (Option Summary, Dealing with Old Files): New option --overwrite-dir.
7236         (Overwrite Old Files): Likewise.
7237
7238         * lib/Makefile.am (noinst_HEADERS):
7239         Remove copysym.h.  Add print-copyr.h, unicodeio.h.
7240         (libtar_a_SOURCES): Remove copysym.c, Add print-copyr.c, unicodeio.c.
7241
7242         * lib/copysym.c, lib/copysym.h: Remove.
7243         * lib/print-copyr.c, lib/print-copyr.h, lib/unicodeio.c,
7244         lib/unicodeio.h: New files.
7245
7246         * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
7247         lib/mktime.c, lib/strtoll.c: Switch from LGPL to GPL.
7248
7249         * lib/quotearg.c (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
7250         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
7251
7252         * m4/Makefile.am (EXTRA_DIST): Remove isc-posix.m4.
7253         * m4/isc-posix.m4: Remove.
7254
7255         * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit.
7256
7257         * po/POTFILES.in: Add copyright notice.
7258
7259         * src/Makefile.am (LDADD): Like libtar.a before @INTLLIBS@ as
7260         well as after.
7261         * tests/Makefile.am (LDADD): Likewise.
7262
7263         * src/buffer.c (write_archive_buffer, close_archive):
7264         If an archive is a socket, treat it like a FIFO.
7265         (records_read, records_written): New vars.
7266         (write_archive_to_stdout): Now bool, not int.
7267         (open_archive, flush_write, flush_read): Keep records_read and
7268         records_written up to date.
7269
7270         * src/common.h (enum old_files): New value OVERWRITE_OLD_DIRS.
7271         (write_archive_to_stdout): Now bool, not int.
7272         (enum read_header): New value HEADER_SUCCESS_EXTENDED.
7273         (read_header): Now takes bool arg.  Existing callers modified
7274         to pass 0, unless otherwise specified.
7275
7276         * src/delete.c (records_read): Remove; now a global.
7277         (acting_as_filter): Now bool, not int.
7278         (recent_long_name, recent_long_link, recent_long_name_blocks,
7279         recent_long_link_blocks, records_read, records_written): New decls.
7280         (records_skipped): New var.
7281         (move_archive): Don't divide by zero if arg is 0.
7282         Use the above vars to compute how far to move.
7283         (write_recent_blocks): New function.
7284         (delete_archive_member): Pass 1 to read_header, so that it doesn't
7285         read more than 1 block.  Handle resulting HEADER_SUCCESS_EXTENDED code.
7286         Keep track of how many records have been skipped.
7287         Let the buffer code count records.
7288         When copying a header, copy any extended headers that came before it.
7289
7290         * src/extract.c (extract_archive): When marking a directory to be
7291         updated after symlinks, stat all directories after it in the
7292         delayed-set-stat list too, since they will be checked after
7293         symlinks.  Add support for --overwrite-dir.
7294
7295         * src/list.c (recent_long_name, recent_long_link,
7296         recent_long_name_blocks, recent_long_link_blocks): New vars.
7297         (read_and): Pass 0 to read_header.
7298         (read_header): New arg RAW_EXTENDED_HEADERS.  Store away extended
7299         headers into new vars.  Null-terminate incoming symbolic links.
7300
7301         * src/rmt.c: Include print-copyr.h, not copysym.h.
7302         (main): Use print_copyright, not copyright_symbol.
7303         * src/tar.c (decode_options): Likewise.
7304         (OVERWRITE_DIR_OPTION): New constant.
7305         (long_options, usage, decode_options): Add --overwrite-dir.
7306
7307         * src/tar.h: Put copyright notice into documentation.
7308
7309         * tests/Makefile.am (TESTS): Add delete03.sh.
7310         * tests/delete03.sh: New file.
7311
7312         * tests/genfile.c: Include print-copyr.h, not copysym.h.
7313         (main): Use print_copyright, not copyright_symbol.
7314         Include <argmatch.h>.
7315         (pattern_strings): Remove.
7316         (pattern_args, pattern_types): New constants.
7317         (main): Use XARGMATCH, not argmatch.
7318
7319 2001-09-20  Jim Meyering  <meyering@lucent.com>
7320
7321         * lib/xstrtol.c (strtoimax): Guard declaration with
7322         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
7323         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
7324         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
7325         (strtoumax): Likewise, for completeness (it wasn't necessary).
7326         * m4/xstrtoimax.m4 (jm_AC_PREREQ_XSTRTOIMAX):
7327         Check for declaration of strtoimax.
7328         * m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX):
7329         Check for declaration of strtoumax.
7330
7331 2001-09-16  Paul Eggert  <eggert@twinsun.com>
7332
7333         * fnmatch.m4 (jm_FUNC_FNMATCH): Fix typo in previous patch: yes -> no.
7334
7335 2001-09-14  Paul Eggert  <eggert@twinsun.com>
7336
7337         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.23.
7338
7339         * README-alpha: Describe automake patch.
7340
7341         * configure.ac (LIBOBJS):
7342         Remove automake 1.4 workaround, as we're using 1.5 now.
7343         (USE_INCLUDED_LIBINTL): New AC_DEFINE.
7344
7345         * lib/copysym.c: Include stddef.h, for size_t.
7346         Include langinfo.h if needed.
7347         Use locale_charset only if USE_INCLUDED_LIBINTL;
7348         if not, use nl_langinfo (CODESET) if available.
7349
7350 2001-09-13  Paul Eggert  <eggert@twinsun.com>
7351
7352         * config.guess, config.sub: Sync with canonical versions.
7353
7354         * configure.ac (jm_PREREQ_XGETCWD): Add.
7355
7356         * lib/Makefile.am (noinst_HEADERS): Add copysym.h.
7357         (libtar_a_SOURCES): Add copysym.c.
7358         * copysym.c, copysym.h: New files.
7359
7360         * lib/error.c: Sync with fileutils version.
7361
7362         * m4/Makefile.am (EXTRA_DIST): Add getcwd.m4; remove uintmax_t.m4.
7363         * m4/getcwd.m4: New file.
7364         * m4/uintmax_t.m4: Remove.
7365
7366         * m4/gettext.m4 (AM_WITH_NLS):
7367         Fix bug with calculating version of Bison 1.29.
7368         Reported by Karl Berry.
7369
7370         * src/Makefile.am (datadir): Remove.
7371
7372         * src/rmt.c: Include copysym.h.
7373         (main): Use copyright_symbol to translate copyright notice,
7374         instead of gettext.
7375         * src/tar.c: Likewise.
7376         * tests/genfile.c: Likewise.
7377
7378         * src/system.h (MB_LEN_MAX): New symbol.
7379
7380 2001-09-11  Paul Eggert  <eggert@twinsun.com>
7381
7382         * src/extract.c (struct delayed_set_stat): New member
7383         'after_symlinks'.
7384         (delay_set_stat): Initialize it to 0.
7385         (set_mode): New arg current_stat_info.  Use it (if nonnull) to avoid
7386         taking an extra stat ourselves.  All callers changed.
7387         (set_stat): Likewise.
7388         (apply_nonancestor_delayed_set_stat): New arg 'after_symlinks'.
7389         If false, stop when encountering a struct whose 'after_symlinks'
7390         member is true.  Otherwise, go through all structures but check
7391         them more carefully.  All callers changed.
7392         (extract_archive): When extracting a deferred symlink, if its parent
7393         directory's status needs fixing, then mark the directory as needing
7394         to be fixed after symlinks.
7395         (extract_finish): Fix status of ordinary directories, then apply
7396         delayed symlinks, then fix the status of directories that are
7397         ancestors of delayed symlinks.
7398
7399         * src/rtapelib.c (rexec):
7400         Remove declaration; it ran afoul of prototypes on Crays.
7401         Reported by Wendy Palm of Cray.
7402
7403 2001-09-06  Paul Eggert  <eggert@twinsun.com>
7404
7405         * lib/strtoimax.c (HAVE_LONG_LONG):
7406         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
7407         (strtoimax): Use sizeof (long), not
7408         sizeof strtol (ptr, endptr, base),
7409         to work around bug in IBM C compiler.
7410
7411 2001-09-04  Paul Eggert  <eggert@twinsun.com>
7412
7413         * lib/xgetcwd.c: Include "xalloc.h".
7414         (xgetcwd): Do not return NULL when memory is exhausted; instead,
7415         report an error and exit.
7416
7417         * m4/prereq.m4 (jm_PREREQ_XREADLINK): New macro.
7418         (jm_PREREQ): Use it.
7419
7420 2001-09-03  Paul Eggert  <eggert@twinsun.com>
7421
7422         * m4/prereq.m4 (jm_PREREQ): Add jm_PREREQ_XGETCWD.
7423         (jm_PREREQ_XGETCWD): New macro.
7424
7425         * lib/exclude.c (fnmatch_no_wildcards):
7426         Fix typo that caused us to do case-folding
7427         search even when that was not desired.  This occurred only in the
7428         no-wildcard case.
7429
7430         * lib/xgetcwd.c: Include pathmax.h if not HAVE_GETCWD.
7431         Do not include xalloc.h.
7432         (INITIAL_BUFFER_SIZE): New symbol.
7433         Do not use xmalloc / xrealloc, since the caller is responsible for
7434         handling errors.  Preserve errno around `free' during failure.
7435         Do not overrun buffer when using getwd.
7436
7437         * lib/xgetcwd.c (xgetcwd):
7438         Use HAVE_GETCWD_NULL, not defined __GLIBC__ && __GLIBC__ >= 2,
7439         to decide whether to use getcwd (NULL, 0).
7440
7441 2001-09-02  Paul Eggert  <eggert@twinsun.com>
7442
7443         * lib/xgetcwd.c: Fix typo in local var; from Jim Meyering.
7444
7445 2001-09-01  Jim Meyering  <meyering@lucent.com>
7446
7447         * exclude.c: Use `""', not `<>' to #include non-system header files.
7448         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
7449         and strncasecmp as r-values.  Unixware didn't have declarations.
7450
7451 2001-08-31  Jim Meyering  <meyering@lucent.com>
7452
7453         * lib/xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
7454         Use an initial, malloc'd, buffer of length 128 rather than
7455         a statically allocated one of length 1024.
7456
7457 2001-08-30  Paul Eggert  <eggert@twinsun.com>
7458
7459         * lib/utime.c: Include full-write.h.
7460         * lib/xstrtol.c (strtoimax): New decl.
7461
7462 2001-08-29  Paul Eggert  <eggert@twinsun.com>
7463
7464         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.22.
7465
7466         * src/create.c (dump_file): Relativize link names before dumping.
7467         This fixes a bug reported by Jose Pedro Oliveira.
7468
7469         * src/create.c (dump_file): Use offsetof when computing sizes for
7470         struct hack; this avoids wasted space in some cases.
7471         * src/incremen.c (note_directory, find_directory): Likewise.
7472         * src/names.c (name_gather, addname): Likewise.
7473
7474         * src/extract.c (extract_archive): Use strcpy, not memcpy,
7475         for consistency with other code that does similar things.
7476         * src/names.c (name_gather): Likewise.
7477
7478         * src/names.c (read_name_from_file, name_next, name_gather,
7479         add_hierarchy_to_namelist): Avoid quadratic behavior when
7480         reallocating buffers.  Check for buffer size overflow.
7481         (addname): Avoid unnecessary clearing of memory.
7482
7483 2001-08-29  "Jan D."  <Jan.Djarv@mbox200.swipnet.se>
7484
7485         * src/extract.c (delay_set_stat): Fix off-by-one error in file
7486         name size allocation that caused core dumps.
7487
7488 2001-08-28  Paul Eggert  <eggert@twinsun.com>
7489
7490         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.21.
7491
7492         * configure.ac (GNU_SOURCE): Define to 1, not /**/.
7493         (major_t, minor_t, ssize_t): Use new-style AC_CHECK_TYPE.
7494         (daddr_t): Remove; no longer used.
7495         (jm_PREREQ_HUMAN): Add.
7496
7497         * acconfig.h: Remove; no longer needed.
7498
7499         * config.guess, config.sub:
7500         New files, from automake 1.5.  Gettext 0.10.39 needs them.
7501         * depcomp, missing, mkinstalldirs: Upgrade to automake 1.5.
7502
7503         * Makefile.am (AUTOMAKE_OPTIONS): Add dist-bzip2.
7504         (SUBDIRS): Put intl before lib, as gettext requires.
7505
7506         * ABOUT-NLS: Upgrade to gettext 0.10.39.
7507         * intl: Upgrade entire directory to gettext 0.10.39.
7508         * m4/codeset.m4, m4/glibc21.m4, m4/iconv.m4:
7509         New files, from gettext 0.10.39.
7510         * m4/gettext.m4, m4/isc-posix.m4, m4/lcmessage.m4, m4/progtest.m4,
7511         Upgrade to gettext 0.10.39,
7512         * po/Makefile.in.in: Likewise, except fix a typo in its copying
7513         permissions.
7514         * po/cat-id-tbl.c, po/stamp-cat-id:
7515         Remove; no longer used by gettext 0.10.39.
7516         * po/ChangeLog: New file.
7517
7518         * doc/Makefile.am (EXTRA_DIST): Add freemanuals.texi.
7519         $(srcdir)/tar.texi: Likewise.
7520         * doc/freemanuals.texi: New file.
7521         * doc/tar.texi (Free Software Needs Free Documentation): New appendix.
7522         `fileds' -> `fields'
7523         * doc/texinfo.tex: Upgrade to version 2001-07-25.07.
7524
7525         * lib/Makefile.am (EXTRA_DIST): Add strtoll.c, strtoimax.c.
7526         (noinst_HEADERS): Add quote.h.
7527         (libtar_a_SOURCES): Add quote.c, xstrtoimax.c.
7528
7529         * lib/exclude.c: Fix typo in '#include <stdint.h>' directive.
7530
7531         * lib/full-write.c, lib/savedir.c: Comment fix.
7532
7533         * lib/pathmax.h: Remove.
7534
7535         * lib/quote.c, lib/quote.h: New files.
7536
7537         * lib/xgetcwd.c: Don't include pathmax.h.
7538         Include stdlib.h and unistd.h if available.
7539         Include xalloc.h.
7540         (xmalloc, xstrdup, free): Remove decls.
7541         (xgetcwd): Don't assume sizes fit in unsigned.
7542         Check for overflow when computing sizes.
7543         Simplify reallocation code.
7544
7545         * lib/xmalloc.c: Quote failure tests.
7546
7547         * lib/strtoumax.c, lib/xstrtoimax.c: New files.
7548
7549         * lib/strtoimax.c: Renamed from strtouxmax.c.  Make it more
7550         similar to strtol.c.
7551         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.
7552         (verify): New macro.
7553         (strtoumax, uintmax_t, strtoull, strtol): Remove.
7554         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
7555         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
7556         changed to signed values.  Check sizes at compile-time, not
7557         run-time.  Prefer strtol to strtoll if both work.
7558         (main): Remove.
7559
7560         * lib/xstrtol.h (xstrtoimax): New decl.
7561
7562         * m4/Makefile.am (EXTRA_DIST):
7563         Add codeset.m4, glibc21.m4, iconv.m4, inttypes.m4,
7564         longlong.m4, xstrtoimax.m4.
7565
7566         * m4/inttypes.m4 (jm_AC_HEADER_INTTYPES_H):
7567         Remove; now done by autoconf.
7568         (jm_AC_TYPE_INTMAX_T, jm_AC_TYPE_UINTMAX_T): Replace with
7569         Use AC_CHECK_TYPE instead of merely looking for the header.
7570
7571         * m4/uintmax_t.m4: Use shorter comment.
7572
7573         * m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX):
7574         Quote first arg of AC_DEFUN.
7575         Require jm_AC_TYPE_INTMAX_T and jm_AC_TYPE_LONG_LONG since they
7576         is needed to parse the include file.
7577         Simplify logic behind the args to AC_REPLACE.
7578
7579         * src/Makefile.am (OMIT_DEPENDENCIES): Remove.
7580
7581         * src/ansi2knr.1, src/ansi2knr.c: Remove; wasn't being used.
7582
7583         * src/rmt.c (main):
7584         Use "Copyright %d" to simplify the translator's job in the future.
7585         Advise translator about circle-C.
7586         * src/tar.c: (decode_options): Likewise.
7587         * tests/genfile.c (main): Likewise.
7588
7589 2001-08-28  Jim Meyering  <meyering@lucent.com>
7590
7591         * lib/argmatch.c: Include "quote.h".
7592         (argmatch_invalid): Quote the context.
7593
7594         * lib/dirname.c (dir_name): Fix typo on PC platforms.
7595
7596         * lib/backupfile.c, lib/basename.c, lib/dirname.c, lib/strtoul.c:
7597         Use single-quote for local .h files.
7598
7599         * lib/error.h (__attribute__): Don't depend on __STRICT_ANSI__.
7600
7601         * lib/getopt.c, lib/getopt.h, lib/getopt1.c: Upgrade to recent
7602         glibc versions.
7603
7604         * lib/getdate.y (get_date): Initialize tm_isdst to -1 before
7605         invoking mktime the last time.
7606
7607         * lib/pathmax.h: Use #if rather than #ifdef for HAVE_UNISTD_H.
7608
7609         * lib/rename.c: Major rewrite by Volker Borchert to use system
7610         rename function, but to work around problems with trailing
7611         slashes.
7612
7613         * lib/strtoll.c: New file, from glibc.
7614         * lib/strtoul.c: Update from glibc.
7615
7616         * lib/strtouxmax.c: Renamed from lib/strtoumax.c.
7617         Add support for signed numbers, too.
7618         (strtoul, strtoull): Do not declare if STRTOUXMAX_UNSIGNED
7619         is not defined.
7620         (strtol, strtoll): Declare as needed, if STRTOUXMAX_UNSIGNED is
7621         not defined.
7622         (strtoumax, uintmax_t, strtoull, strtoul): New macros.
7623         (main): Use generic names in debugging output.
7624         * lib/strtoimax.c: Plus add the following changes of my own:
7625         (main): Use accurate names in debugging output.
7626
7627         * lib/xgetcwd.c (xgetcwd): Use getcwd if glibc 2 or later.
7628         Don't use PATH_MAX.
7629
7630         * m4/c-bs-a.m4, m4/check-decl.m4, m4/d-ino.m4, m4/error.m4,
7631         m4/getline.m4, m4/jm-mktime.m4, m4/malloc.m4, m4/mbrtowc.m4,
7632         m4/mbstate_t.m4, m4/realloc.m4, m4/uintmax_t.m4, m4/utimbuf.m4,
7633         m4/utime.m4, m4/utimes.m4:
7634         Quote the first argument in each use of AC_DEFUN.
7635
7636         * m4/getline.m4: Don't use string.h.
7637
7638         * m4/inttypes.m4, m4/longlong.m4, m4/xstrtoimax.m4: New files.
7639
7640         * m4/mbrtowc.m4 (jm_FUNC_MBRTOWC): @%:@ -> #.
7641
7642 2001-08-27  Paul Eggert  <eggert@twinsun.com>
7643
7644         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.20.
7645
7646         The biggest change is the new --exclude semantics and options.
7647         The basic idea was suggested by Gerhard Poul; thanks!
7648
7649         * NEWS: Describe new --exclude semantics and options, and bug fixes.
7650         * README: ignfail.sh fails on some NFS hosts.
7651         * NEWS, README, lib/xstrtol.h: Add copyright notice.
7652
7653         * Makefile.am (ACLOCAL_AMFLAGS): Add -I m4.
7654         (M4DIR, ACINCLUDE_INPUTS, $(srcdir)/acinclude.m4):
7655         Remove; the automake bug has been fixed.
7656         * acinclude.m4: Remove.
7657
7658         * configure.ac: Renamed from configure.in.
7659         (AC_PREREQ): Bump from 2.13 to 2.52.
7660         (ALL_LINGUAS): Add id, tr.  Remove ko, as po/ko.po (dated
7661         1997-05-30) has an encoding error.
7662         (jm_AC_HEADER_INTTYPES_H): Remove; now done by autoconf.
7663         (AC_FUNC_FNMATCH): Use AC_CONFIG_LINKS, not AC_LINK_FILES.
7664
7665         * doc/fdl.texi: Update to current GNU version.
7666
7667         * doc/tar.texi: Put leading '*' in direntry.
7668         Accommodate new gfdl sectioning.
7669         New option --recursion (the default) that is the inverse of
7670         --no-recursion.
7671
7672         New options --anchored, --ignore-case, --wildcards,
7673         --wildcards-match-slash, and their negations (e.g., --no-anchored).
7674         Along with --recursion and --no-recursion, these control how exclude
7675         patterns are interpreted.  The default interpretation of exclude
7676         patterns is now --no-anchored --no-ignore-case --recursion
7677         --wildcards --wildcards-match-slash.
7678
7679         * lib/Makefile.am (OMIT_DEPENDENCIES): Remove.
7680
7681         * lib/exclude.c (bool): Declare, perhaps by including stdbool.h.
7682         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
7683         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
7684         Include if available.
7685         (<xalloc.h>): Include
7686         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
7687         (verify): New macro.  Use it to verify that EXCLUDE macros do not
7688         collide with FNM macros.
7689         (struct patopts): New struct.
7690         (struct exclude): Use it, as exclude patterns now come with options.
7691         (new_exclude): Support above changes.
7692         (new_exclude, add_exclude_file):
7693         Initial size must now be a power of two to simplify overflow checking.
7694         (free_exclude, fnmatch_no_wildcards): New function.
7695         (excluded_filename): No longer requires options arg, as the options
7696         are determined by add_exclude.  Now returns bool, not int.
7697         (excluded_filename, add_exclude):
7698         Add support for the fancy new exclusion options.
7699         (add_exclude, add_exclude_file): Now takes int options arg.
7700         Check for arithmetic overflow when computing sizes.
7701         (add_exclude_file): xrealloc might modify errno, so don't
7702         realloc until after errno might be used.
7703
7704         * lib/exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
7705         New macros.
7706         (free_exclude): New decl.
7707         (add_exclude, add_exclude_file): Now takes int options arg.
7708         (excluded_filename): No longer requires options arg, as the options
7709         are determined by add_exclude.  Now returns bool, not int.
7710
7711         * lib/prepargs.c: Include <string.h>; required for C99 since
7712         we use strlen.
7713
7714         * lib/quotearg.c:
7715         BSD/OS 4.1 wchar.h requires FILE and struct tm to be declared.
7716
7717         * lib/xstrtol.h (_DECLARE_XSTRTOL): Improve quality of
7718         diagnostic for LONGINT_INVALID_SUFFIX_CHAR.
7719
7720         * m4/Makefile.am (EXTRA_DIST): Add check-decl.m4, mbrtowc.m4.
7721         Remove inttypes_h.m4, largefile.m4, mktime.m4.
7722
7723         * m4/inttypes_h.m4, m4/largefile.m4, m4/mktime.m4: Remove;
7724         subsumed by Autoconf 2.50.
7725
7726         * m4/error.m4: Upgrade to serial 2.
7727
7728         * m4/fnmatch.m4 (jm_FUNC_FNMATCH): Upgrade to serial 4, but
7729         remove test for GNU C library.  It's not correct, as some
7730         older glibcs are buggy.
7731
7732         * m4/getline.m4, m4/malloc.m4: Upgrade to serial 4.
7733
7734         * m4/prereq.m4: Upgrade to serial 20, but then:
7735         (jm_PREREQ): Add jm_PREREQ_EXCLUDE.
7736         (jm_PREREQ_EXCLUDE): New macro.
7737         (jm_PREREQ_HUMAN): Remove jm_AC_HEADER_INTTYPES_H, as it is subsumed
7738         by autoconf 2.5x.
7739
7740         * m4/realloc.m4: Upgrade to serial 4.
7741
7742         * m4/strerror_r.m4: Revert to serial 1002.
7743
7744         * m4/uintmax_t.m4: Upgrade to autoconf 2.5x.
7745
7746         * m4/utimes.m4: Upgrade to latest version (still "serial 3").
7747
7748         * m4/xstrtoumax.m4: Upgrade to serial 3, but then:
7749         (jm_AC_PREREQ_XSTRTOUMAX): Remove jm_AC_HEADER_INTTYPES_H, as
7750         it is now subsumed by autoconf.  Add inttypes.h.
7751
7752         * po/cs.po, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
7753         po/it.po, po/pl.po, po/sl.po, po/sv.po: Sync with translation project.
7754
7755         * src/buffer.c (new_volume): Stop if the script exits with an error.
7756
7757         * src/common.h (excluded_with_slash, excluded_without_slash):
7758         Remove, replacing by:
7759         (excluded): New decl.
7760         (link_error): New decl.
7761         (excluded_name): Now returns bool.
7762
7763         * src/extract.c:
7764         (struct delayed_symlinks, extract_archive, apply_delayed_symlinks):
7765         Support hard links to symbolic links.
7766
7767         (struct delayed_symlink): Remove 'names' member, replacing it with
7768         'sources' and 'target' member.  All uses changed.
7769
7770         (struct string_list): New type.
7771
7772         (delayed_set_stat, extract_archive): Use offsetof when computing sizes
7773         for struct hack; this avoids wasted space in some cases.
7774
7775         (extract_archive): Fix test for absolute pathnames and/or "..".
7776         Use link_error to report errors for links.
7777         Remove redundant trailing '/' at "really_dir", for all uses, not
7778         just before invoking mkdir.
7779         If overwriting old files, do not worry so much about existing
7780         directories.
7781         Fix mode computation in the case where the directory exists.
7782
7783         (apply_delayed_symlinks): If we can't make a hard link to a symbolic
7784         link, make a copy of the symbolic link.
7785
7786         * src/incremen.c (get_directory_contents):
7787         If ignore_failed_read_option, only warn about
7788         stat failures.
7789
7790         * src/list.c (from_header): Do not issue a diagnostic if TYPE is zero.
7791         However, check for error even for '-' or '+' case.
7792
7793         (print_header): Try parsing uids and gids as unsigned integers first,
7794         and as a uid_t or gid_t only if that fails.  This adds support for
7795         listing positive uids and gids that are greater than UID_MAX and
7796         GID_MAX.
7797
7798         * src/misc.c (link_error): New function.
7799
7800         * src/names.c (collect_and_sort_names):
7801         If ignore_failed_read_option, only warn about
7802         stat errors.
7803
7804         (excluded_name): Now returns bool.  Simplify, as the fancy
7805         features are now all in excluded_filename.
7806
7807         * src/rtapelib.c (base_name): Remove decl, as system.h now
7808         declares it.
7809
7810         * src/system.h: Include stddef.h if available.
7811         (offsetof): Declare if stddef.h doesn't.
7812
7813         Include <dirname.h>.
7814         (FILESYSTEM_PREFIX_LEN, ISSLASH): Remove; now defined by dirname.h.
7815
7816         * src/tar.c (ANCHORED_OPTION, IGNORE_CASE_OPTION,
7817         NO_ANCHORED_OPTION, NO_IGNORE_CASE_OPTION, NO_WILDCARDS_OPTION,
7818         NO_WILDCARDS_MATCH_SLASH_OPTION, WILDCARDS_OPTION,
7819         WILDCARDS_MATCH_SLASH_OPTION):
7820         New enum values.
7821
7822         (long_options, usage, decode_options): Add support for --anchored,
7823         --ignore-case, --no-anchored, --no-ignore-case, --no-wildcards,
7824         --no-wildcards-match-slash, --recursion, --wildcards,
7825         --wildcards-match-slash.
7826
7827         (decode_options): Implement the new way of interpreting exclude
7828         patterns.
7829
7830         (usage): --newer-mtime takes a DATE operand.  DATE may be a file name.
7831
7832         (OPTION_STRING, decode_options): Add -I, -y.  Currently these options
7833         just print error messages suggesting alternatives.
7834
7835         (add_filtered_exclude): Remove.
7836
7837         * tests/Makefile.am (TESTS): Alphabetize, except put version.sh first.
7838
7839         * tests/extrac04.sh (out): Remove
7840         directory/subdirectory/file1, as the new semantics for
7841         --exclude exclude it.
7842
7843         * tests/genfile.c (main): Don't use non-ASCII char in msgid.
7844
7845 2001-08-12  Paul Eggert  <eggert@twinsun.com>
7846
7847         * lib/addext.c (<errno.h>): Include.
7848         (errno): Declare if not defined.
7849         (addext): Work correctly on the Hurd, where pathconf returns -1 and
7850         leaves errno alone, because there is no limit.  Also, work even if
7851         size_t is narrower than long.
7852
7853 2001-07-08  Paul Eggert  <eggert@twinsun.com>
7854
7855         * lib/alloca.c (alloca): Arg is of type size_t, not unsigned.
7856
7857 2001-05-10  Paul Eggert  <eggert@twinsun.com>
7858
7859         * lib/addext.c (ISSLASH, base_name): Remove decls; now in dirname.h.
7860         Include <backupfile.h> and <dirname.h> after size_t is defined.
7861         (addext): Use base_len to trim redundant trailing slashes instead of
7862         doing it ourselves.
7863
7864         * lib/backupfile.c (ISSLASH, base_name):
7865         Remove decls; now in dirname.h.
7866         Include <argmatch.h>, <backupfile.h>, <dirname.h> after size_t
7867         is defined.
7868         (find_backup_file_name): Rename locals to avoid new functions.
7869         Use base_len instead of rolling it ourselves.
7870         Work even if dirlen is 0.
7871         Use a dir of '.' if given the empty string.
7872
7873         * lib/basename.c:
7874         Do not include <stdio.h>, <assert.h>; no longer needed.
7875         (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Remove; now in dirname.h.
7876         Include <string.h>, <dirname.h>.
7877         (base_name): Allow file names ending in slashes, other than names
7878         that are all slashes.  In this case, return the basename followed
7879         by the slashes.
7880
7881         * lib/dirname.c: Include <string.h> instead of <stdlib.h>.
7882         (FILESYSTEM_PREFIX_LEN, ISSLASH): Remove; now in dirname.h.
7883         (dir_len): Renamed from dirlen.
7884         All callers changed.
7885
7886         * lib/dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
7887         New macros.
7888         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
7889
7890 2001-02-16  Paul Eggert  <eggert@twinsun.com>
7891
7892         * lib/quotearg.c (mbrtowc, mbrtowc, mbsinit):
7893         Do not declare or define if HAVE_MBRTOWC,
7894         since the test for HAVE_MBRTOWC now requires proper declarations.
7895
7896         * lib/alloca.c (malloc): Undef before defining.
7897
7898 2001-02-13  Paul Eggert  <eggert@twinsun.com>
7899
7900         * src/compare.c (read_and_process): Use off_t for size.
7901         From Maciej W. Rozycki.
7902
7903 2001-01-26  Paul Eggert  <eggert@twinsun.com>
7904
7905         * lib/quotearg.c: Include stddef.h.  From Jim Meyering.
7906
7907 2001-01-12  Paul Eggert  <eggert@twinsun.com>
7908
7909         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.19.
7910
7911         * lib/savedir.h (savedir): Remove size arg.
7912
7913         * doc/tar.texi: Add @setchapternewpage odd.
7914         Remove -I as an alias for -T, for now.
7915         Add @dircategory.
7916         Update copyright.  Remove "Published by".
7917         Dates beginning with / or . are taken to be file names.
7918
7919         * src/tar.c (<time.h>): Do not include;
7920         (time): Do not declare.
7921         (usage): Remove -I as an alias for -T.
7922         (OPTION_STRING): Remove -I.
7923         (decode_options): Dates that look like an absolute path name,
7924         or that start with '.', are presumed to be file names whose
7925         dates are taken.
7926         Remove 'I' as an aliase for 'T'.
7927         Update copyright.
7928
7929         * src/extract.c (<time.h>): Do not include; system.h now does this.
7930         (make_directories): Skip filesystem prefixes.
7931         Don't assume '/' is the only separator.
7932         (extract_sparse_file): Use new full_write semantics.
7933         On write error, return instead of invoking skip_file.
7934         Do not free sparsearray; caller does this now.
7935         (apply_nonancestor_delayed_set_stat): Do not assume '/' is the only
7936         separator.
7937         (extract_archive): Don't assume file name lengths fit in int.
7938         Report what got stripped from member name; it might be more than '/'.
7939         Use new full_write semantics.
7940         Do not pass redundant trailing "/" to mkdir, as POSIX does not allow
7941         mkdir to ignore it.
7942         Do not report mkdir error if old_files_option == KEEP_OLD_FILES.
7943
7944         * src/buffer.c (<time.h>): Do not include; system.h now does this.
7945         (time): Remove decl; likewise.
7946         (child_open_for_uncompress): Use new full_write semantics.
7947         (flush_write): Use ISSLASH instead of testing for '/'.
7948         (flush_read): Likewise.
7949
7950         * src/rmt.h (_remdev): Look for / anywhere in Path.
7951
7952         * src/misc.c (contains_dot_dot): Skip filesystem prefix.
7953         Don't assume '/' is the only separator.
7954         (safer_rmdir): Don't assume '/' is the only separator.
7955
7956         * src/compare.c (diff_archive): Don't assume '/' is the only separator.
7957
7958         * lib/dirname.h (dirlen): New decl.
7959
7960         * src/incremen.c (get_directory_contents):
7961         Remove path_size arg; all callers changed.
7962         Don't assume '/' is the only directory separator.
7963         (gnu_restore): Work even if file name length doesn't fit in int.
7964
7965         * lib/addext.c (ISSLASH): New macro.
7966         (addext): Trim any redundant trailing slashes.
7967
7968         * src/names.c (name_next):
7969         Don't assume '/' is the only directory separator.
7970         (namelist_match): Likewise.
7971         (add_hierarchy_to_namelist): Remove dirsize arg.
7972         Do not assume '/' is the only directory separator.
7973         (new_name): Likewise.
7974
7975         * lib/Makefile.am (noinst_HEADERS): Add dirname.h, full-write.h.
7976         (libtar_a_SOURCES): Add dirname.c.
7977
7978         * src/create.c (relativize):
7979         New function, with much of old start_header's guts.
7980         Handle filesystem prefixes.
7981         (start_header): Use this new function.
7982         (init_sparsearray): Don't bother to zero out the new array;
7983         it's not needed.
7984         (deal_with_sparse): Fix array allocation bug.
7985         (create_archive): Don't assume '/' is the only separator.
7986         (dump_file): Likewise.
7987         Don't worry about leading / in symlink targets.
7988
7989         * lib/savedir.c (savedir):
7990         Remove size arg; it wasn't portable.  All callers changed.
7991
7992         * lib/utime.c (utime_null): Adjust to new full_write convention.
7993
7994         * configure.in (YACC): Avoid portability problem with Ultrix sh.
7995
7996         * lib/backupfile.c: Include <dirname.h>.
7997         (ISSLASH): New macro.
7998         (find_backup_file_name): Use dirlen to calculate directory lengths.
7999         (max_backup_version): Strip redundant trailing slashes.
8000
8001         * src/common.h: Include <full-write.h>.
8002         (get_directory_contents): No longer has size arg.
8003         (gnu_restore): Arg is size_t, not int.
8004
8005         * src/system.h: Include <time.h>.
8006         (time): Declare if not defined.
8007
8008         * lib/full-write.c: Include full-write.h, not safe-read.h.
8009         full_write returns size_t, with short writes meaning failure.
8010         All callers changed.
8011
8012         * src/rtapelib.c: Include full-write.h.
8013
8014         * src/rmt.c: Include full-write.h.
8015         (main): Update copyright.
8016
8017         * doc/getdate.texi: Mention that only English is supported.
8018         Show how to use "date" so that the output is acceptable to getdate.
8019         Mention Z as an abbreviation for UTC.
8020
8021         * lib/full-write.h: New file.
8022
8023         * src/list.c: system.h now does time.h stuff.
8024
8025         * lib/dirname.c:
8026         Use HAVE_STDLIB_H, not STDC_HEADERS, to decide whether to include
8027         stdlib.h.
8028         Do not include string.h, strings.h, or assert.h; no longer needed.
8029         (strrchr, memrchr, malloc): Remove decls; no longer needed.
8030         Include <xalloc.h>.
8031         (base_name): New decl.
8032         (BACKSLASH_IS_PATH_SEPARATOR): Remove.
8033         (dir_name_r): Remove.
8034         (dirlen): New function.
8035         (dir_name): Use dirlen instead of dir_name_r.
8036         (<string.h>, <strings.h>): Include only if test program.
8037         (main): Use "return 0", not "exit (0)".
8038
8039 2000-12-08  Paul Eggert  <eggert@twinsun.com>
8040
8041         * lib/dirname.h: New file.
8042
8043 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
8044
8045         * lib/fnmatch.c: Do not comment out all the code if we are using
8046         the GNU C library, because in some cases we are replacing buggy
8047         code in the GNU C library itself.
8048
8049 2000-10-30  Paul Eggert  <eggert@twinsun.com>
8050
8051         * lib/fnmatch.c (FOLD): Do not assume that characters are unsigned.
8052
8053 2000-10-29  Paul Eggert  <eggert@twinsun.com>
8054
8055         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.18.
8056
8057         * src/tar.c: Include <fnmatch.h>, for FNM_LEADING_DIR.
8058
8059 2000-10-28  Paul Eggert  <eggert@twinsun.com>
8060
8061         * doc/tar.texi: --no-recursion now applies to extraction, too.
8062         * src/create.c (dump_file): no_recurse_option -> ! recursion_option
8063         * src/names.c (namelist_match, excluded_name):
8064         Do not match subfiles of a directory
8065         if --no-recursion is specified.
8066         * src/tar.c (NO_RECURSE_OPTION): Remove.
8067         (long_options): Have getopt set the --no-recursion flag.
8068         (decode_options): Initialize recursion_option to FNM_LEADING_DIR.
8069         Remove case for NO_RECURSE_OPTION.
8070         * src/common.h (recursion_option):
8071         Renamed from no_recurse_option, with sense
8072         negated, and with FNM_LEADING_DIR being the nonzero value.
8073
8074         * names.c (namelist_match): New function.
8075         (name_match, name_scan): Use it to eliminate duplicate code.
8076         (names_notfound): Remove special case for Amiga.
8077
8078 2000-10-27  Paul Eggert  <eggert@twinsun.com>
8079
8080         * src/misc.c (read_error_details, read_warn_details,
8081         read_fatal_details): Don't assume size_t is unsigned long.
8082
8083         * src/buffer.c (flush_read): If read_full_records_option, try to
8084         fill the input buffer, as --delete -f - needs this.
8085
8086 2000-10-24  Paul Eggert  <eggert@twinsun.com>
8087
8088         * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Port to autoconf 2.13.
8089
8090         * src/buffer.c (check_label_pattern):
8091         Make sure header name is a string before
8092         passing it to fnmatch.
8093         (init_volume_number): Check for global_volno overflow.
8094         (new_volume): Check for global_volno overflow.
8095
8096         * src/tar.c (decode_options):
8097         Check that volume label is not too long to overflow
8098         name in tar header block.
8099
8100         * Makefile.am (EXTRA_DIST): Remove rebox.el.
8101
8102         * configure.in (HAVE_DECL_STRERROR_R): Remove our handwritten code.
8103         (AC_FUNC_STRERROR_R): Use this instead.
8104
8105 2000-10-23  Paul Eggert  <eggert@twinsun.com>
8106
8107         * src/extract.c: Include <time.h>, since we invoke "time".
8108
8109         * lib/prepargs.c (prepend_default_options):
8110         Don't use NULL, for portability.
8111
8112         * m4/fnmatch.m4: Add "working" to message.
8113
8114         * src/names.c: (_GNU_SOURCE): Remove; autoconf now does this.
8115         Include <hash.h>.
8116         (getpwuid, getgrgid): Declare only if system headers don't.
8117         (gid_to_gname): Don't invoke setgrent.
8118         (namelist): Now static, not global.
8119         (nametail): New var.  All uses of namelast changed to use
8120         nametail, with one extra level of indirection.
8121         (name_gather): Use memcpy instead of strncpy + assignment of NUL.
8122         (name_match): Set nametail too, when setting namelist to null.
8123         (add_hierarchy_to_namelist): Change type of dir arg from char * to
8124         struct name *, so that we don't have to look up the name again
8125         here.  Get change_dir from dir rather than as a separate arg.  Add
8126         dirsize arg, and pass it along to get_directory_contents.  Remove
8127         unnecessary check of directory type.
8128         (new_name): Do not append a slash if PATH already ends in one.
8129         (avoided_names, struct avoided_name): Remove.
8130         (avoided_name_table): New var, replacing avoided_names.
8131         (hash_avoided_name, compare_avoided_names): New function.
8132         (add_avoided_name, is_avoided_name): Use hash table rather than
8133         linked list.
8134
8135         * src/buffer.c (_GNU_SOURCE): Remove; autoconf now does this.
8136         (child_open_for_compress, child_open_for_uncompress,
8137         close_archive): Propagate any failure of the compression process
8138         back to "tar".
8139         (open_archive, flush_write, flush_read, close_archive): Do not
8140         allocate an array of size PATH_MAX, as PATH_MAX might be (size_t)
8141         -1.  Instead, allocate an array with the size that's needed.
8142         (open_archive): Don't bother checking S_ISCHR of /dev/null.
8143         (backspace_output): Don't try to backspace past start of archive.
8144         (close_archive): Remove special case for DELETE_SUBCOMMAND.
8145
8146         * acconfig.h (_GNU_SOURCE, DEFAULT_ARCHIVE, DEFAULT_BLOCKING,
8147         DENSITY_LETTER, DEVICE_PREFIX, EMUL_OPEN3, HAVE_GETGRGID,
8148         HAVE_GETPWUID, HAVE_MKNOD, HAVE_RTAPELIB, HAVE_ST_FSTYPE_STRING,
8149         HAVE_UNION_WAIT, HAVE_UTIME_H, HAVE_VALLOC, MTIO_CHECK_FIELD, PACKAGE,
8150         PROTOTYPES, REMOTE_SHELL, STD_INC_PATH, VERSION, WITH_CATALOGS,
8151         WITH_DMALLOC, WITH_REGEX):
8152         Remove; now generated automatically.
8153
8154         * configure.in (_GNU_SOURCE): Define to empty, not 1, for
8155         compatibility for glibc fragments.
8156         (_GNU_SOURCE, HAVE_UTIME_H, MTIO_CHECK_FIELD,
8157         HAVE_ST_FSTYPE_STRING, HAVE_MKNOD, REMOTE_SHELL, DENSITY_LETTER,
8158         DEVICE_PREFIX, DEFAULT_ARCHIVE, DEFAULT_BLOCKING): Add comment so
8159         that we needn't put an entry into acconfig.h.
8160         (ALL_LINGUAS): Add da.
8161         (AC_C_BACKSLASH_A): Remove; jm_PREREQ_QUOTEARG now does this.
8162         (AC_CHECK_HEADERS): Add stdbool.h (for hash.h users), wctype.h
8163         (for strtol.c).
8164         (AC_MBSTATE_T): Add.
8165         (RMT): Append $(EXEEXT).
8166         (HAVE_GETGRGID, HAVE_GETPWUID, pe_AC_TYPE_SIGNED_CHAR): Remove.
8167         (HAVE_DECL_FREE, HAVE_DECL_GETGRGID, HAVE_DECL_GETPWUID,
8168         HAVE_DECL_GETENV, HAVE_DECL_MALLOC, HAVE_DECL_STRTOUL,
8169         HAVE_DECL_STRTOULL, HAVE_DECL_STRERROR_R): New macros.
8170         (jm_PREREQ_ADDEXT, jm_PREREQ_ERROR, jm_PREREQ_QUOTEARG): Add.
8171         (AC_REPLACE_FUNCS): Remove execlp; no longer needed.
8172         (AC_CHECK_FUNCS): Add clock_gettime; AC_SEARCH_LIBS wasn't enough.
8173         Remove mbrtowc; jm_PREREQ_QUOTEARG now does this.
8174         (EMUL_OPEN3): Remove; no longer needed.
8175         (DENSITY_LETTER, DEVICE_PREFIX): Simplify m4 quoting.
8176
8177         * m4/fnmatch.m4 (AC_FUNC_FNMATCH): Detect d*/*1 vs d/s/1 bug.
8178
8179         * src/common.h: Do not include basename.h.
8180         * src/rtapelib.c (base_name): Do not include basename.h;
8181         declare base_name instead.
8182
8183         * lib/basename.h, lib/execlp.c, lib/getpagesize.h, lib/mkdir.c:
8184         Remove these files.
8185         * lib/getstr.c, lib/getstr.h, lib/hash.h, lib/hash.h, lib/prepargs.c,
8186         lib/prepargs.h, lib/savedir.c, lib/savedir.h: New files.
8187         * lib/Makefile.am (EXTRA_DIST, noinst_HEADERS, libtar_a_SOURCES):
8188         Adjust to the above changes.
8189
8190         * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove ../src/ansi2knr.
8191
8192         * src/open3.c: Remove.
8193
8194         * src/Makefile.am (AUTOMAKE_OPTIONS): Remove ansi2knr.
8195         (tar_SOURCES): Remove open3.c.
8196         (INCLUDES): Remove -I.., as automake does that.
8197         (OMIT_DEPENDENCIES): ../lib/fnmatch.h -> fnmatch.h.  Add localedir.h.
8198
8199         The following changes are to put LOCALEDIR into localedir.h instead
8200         of passing it on the command line.
8201         (DEFS): Remove.
8202         (DISTCLEANFILES): New macro.
8203         (localedir.h): New rule.
8204         (rmt.o tar.o): Now depend on localedir.h.
8205
8206         * tests/delete02.sh, tests/extrac04.sh: New files.
8207
8208         * tests/Makefile.am (AUTOMAKE_OPTIONS): Remove ansi2knr.
8209         (TESTS): Add extrac04.sh, and restore delete02.sh.
8210         (DEFS): Remove; LOCALEDIR is now done via localedir.h.
8211         (INCLUDES): Remove -I.. as automake does this now.
8212
8213         * src/rtapelib.c (rexec): Don't declare unless using it.
8214         (do_command): Simplify signal-handling code slightly.
8215
8216         * src/delete.c (blocks_needed): Remove.  All uses changed to use
8217         blocking_factor - new_blocks.
8218         (acting_as_filter): New var.
8219         (write_record, delete_archive_members): Use acting_as_filter
8220         rather than archive == STDIN_FILENO to detect whether we're acting
8221         as a filter, as open can return STDIN_FILENO in some cases.
8222         (delete_archive_members): Ignore zero blocks if
8223         ignore_zeros_option is nonzero.  Fix bug that messed up last
8224         output block: write_eot can't be used here, as it gets confused
8225         when the input is at end of file.
8226
8227         * src/compare.c (diff_archive): Do not impose an arbitrary limit on
8228         symbolic link contents length.  Pass directory size to
8229         get_directory_contents.
8230
8231         * m4/decl.m4, m4/error.m4, m4/mbstate_t.m4, m4/prereq.m4,
8232         m4/strerror_r.m4: New files.
8233         * m4/signedchar.m4: Remove this file.
8234         * Makefile.am (ACINCLUDE_INPUTS): Adjust to above changes.
8235         * m4/Makefile.am (EXTRA_DIST): Likewise.
8236
8237         * Makefile.am (DISTCLEANFILES): Add intl/libintl.h.
8238
8239         * po/da.po: New translation file.
8240
8241         * src/mangle.c (extract_mangle):
8242         Fix diagnostic with wrong number of %s'es.
8243
8244         * lib/fnmatch.c (fnmatch):
8245         Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
8246         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
8247
8248         * lib/full-write.c (full_write): Some buggy drivers return 0 when you
8249         fall off a device's end.  Detect this.
8250
8251         * src/system.h (IN_CTYPE_DOMAIN): Renamed from CTYPE_DOMAIN.  All
8252         uses changed.
8253         (open): Remove macro; we no longer support EMUL_OPEN3.  Do not
8254         include <pathmax.h> and directory include files like <dirent.h>;
8255         no longer used.  Include <savedir.h> instead.
8256         (closedir, signed_char): remove macro; no longer used.
8257         (bool, false, true): Include <stdbool.h> if you have the include
8258         file, otherwise define.
8259
8260         * src/misc.c:
8261         (is_dot_or_dotdot, closedir_error, closedir_warn, opendir_error,
8262         opendir_warn, readdir_error): Remove; no longer needed.
8263         (safer_rmdir): Strip leading ./ (or .// or ./// or ././ or etc.)
8264         before deciding whether we're trying to remove ".".
8265         (remove_any_file): Try unlink first if we are not root.  Use
8266         savedir when recursively removing directories, to avoid exhausting
8267         file descriptors.
8268         (savedir_error, savedir_warn, symlink_error): New functions.
8269
8270         * src/list.c: (read_and): Do not invoke
8271         apply_nonancestor_delayed_set_stat; DO_SOMETHING is now
8272         responsible for that.  Do not invoke apply_delayed_set_stat; our
8273         caller is now responsible for that.
8274         (read_header): Use signed char instead of signed_char.  Prevent
8275         later references to current_header from mistakenly treating it as
8276         an old GNU header.
8277         (from_header): Quote invalid base-64 strings in diagnostics.
8278         (time_from_header): Do not warn about future timestamps in
8279         archive; check_time now does that.
8280         (print_header): Quote unknown file types.
8281         (skip_member): New function, replacing skip_extended_headers and
8282         now skipping the whole member instead of just the extended
8283         headers.  All callers changed.  This makes the code handle
8284         extended headers uniformly, and fixes some bugs.
8285
8286         * src/update.c (update_archive): Use skip_member.
8287
8288         * src/extract.c (we_are_root): Now global.
8289         (struct delayed_symlink): New type.
8290         (delayed_symlink_head): New var.
8291         (extr_init, fatal_exit): Invoke extract_finish on fatal errors,
8292         not apply_delayed_set_stat.
8293         (set_mode, set_stat): Pointer args are now const pointers.
8294         (check_time): New function.
8295         (set_stat): Warn if setting a file's timestamp to be the future.
8296         (make_directories): Do not save and restore errno.
8297         (maybe_recoverable): Set errno to ENOENT if we cannot make missing
8298         intermediate directories.
8299         (extract_archive): Invoke apply_nonancestor_delayed_set_stat here,
8300         not in caller.  Extract potentially dangerous symbolic links more
8301         carefully, deferring their creation until the end, and using a
8302         regular file placeholder in the meantime.  Do not remove trailing
8303         / and /. from file names.  Do not bother checking for ".." when
8304         checking whether a directory loops back on itself, as loopbacks
8305         can occur with symlinks too.  Also, in that case, do not bother
8306         saving and restoring errno; just set it to EEXIST.
8307         (apply_nonancestor_delayed_set_stat): A prefix is a potential
8308         ancestor if it ends in slash too (as well as ending in a char just
8309         before slash).
8310         (apply_delayed_set_stat): Remove.
8311         (apply_delayed_symlinks, extract_finish): New functions.
8312
8313         * doc/fdl.texi: New file.
8314         * doc/Makefile.am (EXTRA_DIST): Add fdl.texi.
8315         ($(srcdir)/tar.info): Add fdl.texi.  Invoke makeinfo with --no-split.
8316         * doc/tar.texi: Add Free Documentation License.  New section
8317         "Overwrite Old Files", and revamp that section to make it easier to
8318         follow.  "tar" -> "GNU tar" where appropriate.  Migrate getdate
8319         documentation into getdate.texi.  Fix several minor typos.  Describe
8320         TAR_OPTIONS.  Describe incompatibility between incremental backups and
8321         --atime-preserve.  Describe incompatibility between --verify and other
8322         options.  Mention that tar normally removes symbolic links rather than
8323         following them, when extracting a file of the same name.
8324
8325         * THANKS: Add gpoul.  Change skip's address.
8326
8327         * po/POTFILES.in: Add lib/human.c.
8328
8329         * src/common.h (namelist, namelast): Remove decls.
8330         (we_are_root, extract_finish, skip_member, savedir_error,
8331         savedir_warn, symlink_error, gnu_list_name): New decls.
8332         (apply_delayed_set_stat, apply_nonancestor_delayed_set_stat,
8333         skip_extended_headers, is_dot_or_dotdot, closedir_error,
8334         closedir_warn, opendir_error, opendir_warn, readdir_error,
8335         readdir_warn): Remove decls.
8336         (get_directory_contents): New off_t arg.
8337         (addname): Now returns struct name *.
8338
8339         * src/tar.h, tests/genfile.c: Fix comments.
8340
8341         * src/create.c: Include hash.h.
8342         (gnu_list_name): Remove decl.
8343         (struct link): Remove "next" member.
8344         (linklist): Remove.
8345         (start_header): Say "leading `FOO'" rather than "`FOO' prefix" for
8346         consistency with other diagnostics.
8347         (deal_with_sparse): Check for I/O error when closing the file.
8348         (create_archive): Do not allocate an array of size PATH_MAX, as
8349         PATH_MAX might be (size_t) -1.  Instead, allocate an array with
8350         the size that's needed.
8351         (hash_link, compare_links): New functions.
8352         (dump_file): Do not exhaust open file descriptors when descending
8353         deeply into a directory, by using savedir rather than
8354         opendir/readdir.  Do not zero-fill the name buffer unnecessarily.
8355         Hash the set of links already created, instead of using a linked
8356         list.  Fix some bugs in outputting sparse files which caused the
8357         sparse tables to be incorrect.  When a file unexpectedly shrinks,
8358         output zeros rather than garbage.  Do not allocate an array of
8359         size PATH_MAX, as PATH_MAX might be (size_t) -1.  Instead,
8360         allocate an array with the size that's needed.
8361
8362         * src/incremen.c: Include hash.h.
8363         (struct directory): Remove "next", "dir_text".  Change "name" to
8364         be char[1] with struct hack, not const char *.  Add "found".
8365         (directory_list): Remove.  Replaced by directory_table.
8366         (directory_table): New var.
8367         (nfs_string): Renamed from nfs.
8368         (hash_directory, compare_directories): New functions.
8369         (note_directory): Now returns struct directory *.  First arg is
8370         now const pointer.  struct stat arg is now dev_t, ino_t, nfs.
8371         Remove text arg.  New "found" arg, basically corresponding to the
8372         old text arg not being null.  All callers changed.
8373         (note_directory, find_directory): Use hash table rather than
8374         linked list.
8375         (get_directory_contents): New arg "device".  Use savedir to do the
8376         hard work.  Save the nfs-ness of stat_data, since it might change
8377         under us.  Use note_directory instead of find_directory to save
8378         some work.  When adding an "A" record, do it with
8379         add_to_accumulator instead of cheating with strcat.
8380         (read_directory_file): Use "+" flag before device to indicate
8381         whether it was NFS.  Fix typo in checking for strtoul error.
8382         (write_directory_file_entry): New function.
8383         (write_directory_file): Use it, and use the hash routines to
8384         traverse the directory table.
8385         (gnu_restore): Use savedir rather than opendir/readdir.
8386
8387         * src/tar.c: Include localedir.h, prepargs.h.
8388         (long_options): Now static.
8389         (long_options, usage, decode_options): -j is now short for
8390         --bzip2, and -I is now an alias for -T.
8391         (decode_options, main): argv is not const pointer now.
8392         (decode_options): Invoke prepend_default_options to support
8393         TAR_OPTIONS.  In diagnostic, mention the string that was the
8394         invalid blocking factor, tape length, group, owner, or record
8395         size.  --delete is no longer incompatible with -f -, undoing
8396         2000-01-07 change.
8397         (main): Invoke extract_finish at end of extraction.
8398
8399         * src/rmt.c: Include localedir.h.
8400         (main): Update copyright date to 2000.
8401
8402         * doc/getdate.texi: New file, taken from fileutils 4.0.27, with the
8403         following changes: Use @sc where appropriate.  Document the ranges of
8404         supported times more precisely.  Add Eggert to getdate authors.
8405         Document old Latin 12m/12pm tradition.  Remove list of alphabetic time
8406         zone names, as it wasn't correct and people shouldn't be relying on it
8407         anyway.  Relative items also account for non-DST adjustments.  Fix
8408         some misspellings.
8409
8410         * lib/prepargs.c, lib/prepargs.h, tests/extrac04.sh: New file.
8411
8412         * tests/ignfail.sh: opendir -> savedir in diagnostics.
8413
8414         * tests/preset.in: Set LANGUAGE to the empty string, for some
8415         brain damaged host.
8416
8417 2000-10-20  Paul Eggert  <eggert@twinsun.com>
8418
8419         * m4/fnmatch.m4: Mention the GNU C library.
8420
8421 2000-10-19  Paul Eggert  <eggert@twinsun.com>
8422
8423         * m4/fnmatch.m4: Add a couple more test cases to catch bugs in
8424         glibc 2.1.95.
8425
8426 2000-10-17  Paul Eggert  <eggert@twinsun.com>
8427
8428         * lib/human.c (<limits.h>): Do not include; human.h does it if needed.
8429         (CHAR_BIT): Remove.
8430
8431         * lib/human.h (<limits.h>): Include if HAVE_LIMITS_H.
8432         (CHAR_BIT): Define if not defined.
8433
8434 2000-09-09  Paul Eggert  <eggert@twinsun.com>
8435
8436         * lib/quotearg.c: From fileutils: rename ISASCII to IN_CTYPE_DOMAIN.
8437
8438 2000-08-07  Paul Eggert  <eggert@twinsun.com>
8439
8440         * lib/xmalloc.c: Memory exhausted -> memory exhausted
8441
8442         * lib/xalloc.h (xalloc_msg_memory_exhausted):
8443         change to array from char *.
8444
8445 2000-08-06  Paul Eggert  <eggert@twinsun.com>
8446
8447         * m4/mbstate_t.m4: Define mbstate_t to be int, not char, for
8448         compatibility with glibc 2.1.3 strftime.c.
8449
8450 2000-07-31  Paul Eggert  <eggert@twinsun.com>
8451
8452         * lib/quotearg.c (quotearg_n_options):
8453         Don't make the initial slot vector a constant,
8454         since it might get modified.
8455
8456         * lib/quotearg.c: Add support for more than one preallocated slot.
8457
8458 2000-07-30  Paul Eggert  <eggert@twinsun.com>
8459
8460         * lib/quotearg.c (quotearg_n_options):
8461         Preallocate a slot 0 buffer, so that the caller
8462         can always quote one small component of a "memory exhausted" message
8463         in slot 0.
8464
8465 2000-07-23  Paul Eggert  <eggert@twinsun.com>
8466
8467         * lib/quotearg.c:
8468         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX), so that
8469         mbstate_t is always defined.
8470
8471         Do not inspect MB_LEN_MAX, since it's incorrectly defined to be 1 in
8472         some GCC installations, and this configuration error is likely to be
8473         common.
8474
8475 2000-07-22  Paul Eggert  <eggert@twinsun.com>
8476
8477         * lib/quotearg.c:
8478         When the system forces us to redefine mbstate_t, shadow its mbsinit
8479         function.  From Bruno Haible.
8480
8481 2000-07-14  Paul Eggert  <eggert@twinsun.com>
8482
8483         * lib/xmalloc.c: Simplify exhausted message.
8484
8485         * lib/quotearg.h: Update copyright date; from Jim Meyering.
8486
8487 2000-07-13  Paul Eggert  <eggert@twinsun.com>
8488
8489         * lib/quotearg.h (enum quoting style):
8490         New constant clocale_quoting_style.
8491
8492         * lib/quotearg.c:
8493         (quoting_style_args, quoting_style_vals, quotearg_buffer_restyled):
8494         Add support for clocale_quoting_style, undoing previous change to
8495         locale_quoting_style.
8496
8497 2000-07-10  Paul Eggert  <eggert@twinsun.com>
8498
8499         * lib/quotearg.c:
8500         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX,
8501         since otherwise we don't need it.
8502         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
8503         since we don't do multibytes in that case.
8504         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
8505         invoke multibyte primitives.
8506
8507         * m4/mbstate_t.m4 (AC_MBSTATE_T):
8508         Renamed from AC_MBSTATE_T_OBJECT.  All uses changed.
8509         Change from a two-part test, which defines both HAVE_MBSTATE_T_OBJECT
8510         and mbstate_t, to a single-part test that simply defines mbstate_t.
8511
8512         * lib/quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
8513         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
8514         to decide whether to define the BeOS workaround macro;
8515         this adjusts to the change to AC_MBSTATE_T.
8516
8517         * m4/strerror_r.m4: New file.
8518
8519 2000-07-05  Paul Eggert  <eggert@twinsun.com>
8520
8521         * lib/quotearg.c: Use double-quote to quote.
8522
8523         * lib/quotearg.c (N_): New macro.
8524         (gettext_default): New function.
8525         (quotearg_buffer_restyled): Use gettext_default ("{LEFT QUOTATION MARK}",
8526         "\"") for left quote, and gettext_default ("{RIGHT QUOTATION MARK}", "\"")
8527         for right quote.
8528
8529         * lib/quotearg.c (struct quoting_options):
8530         Simplify quote_these_too dimension.
8531         From Bruno Haible  <haible@clisp.cons.org>.
8532
8533         * m4/mbstate_t.m4 (AC_MBSTATE_T_OBJECT):
8534         Test for mbstate_t only if the test
8535         for an object-type mbstate_t fails.
8536
8537         * lib/quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
8538
8539 2000-07-03  Paul Eggert  <eggert@twinsun.com>
8540
8541         * m4/mbstate_t.m4 (AC_MBSTATE_T_OBJECT): Port to autoconf 2.13.
8542         Add AC_CHECK_HEADERS(stdlib.h), since we use HAVE_STDLIB_H.
8543
8544         * lib/quotearg.c (mbrtowc):
8545         Assign to *pwc, and return 1 only if result is nonzero.
8546         (iswprint): Define to ISPRINT if we are substituting our own mbrtowc.
8547
8548 2000-07-02  Paul Eggert  <eggert@twinsun.com>
8549
8550         * lib/quotearg.c (mbstate_t):
8551         Do not define; it should be defined with AC_CHECK_TYPE.
8552
8553 2000-06-26  Paul Eggert  <eggert@twinsun.com>
8554
8555         * m4/mbstate_t.m4: Include stdio.h before wchar.h, to work around
8556         a bug in glibc 2.1.3.
8557
8558         * lib/xmalloc.c: Fix inaccurate comment for xrealloc.
8559
8560 2000-06-19  Paul Eggert  <eggert@twinsun.com>
8561
8562         * lib/quotearg.c (ISASCII): Add #undef and move definition to follow
8563         inclusion of wctype.h to work around solaris2.6 namespace pollution.
8564         (ISPRINT): Likewise.
8565         Reported by Tom Tromey.
8566
8567 2000-06-15  Paul Eggert  <eggert@twinsun.com>
8568
8569         * lib/human.c (adjust_value): New function.
8570         (human_readable_inexact): Apply rounding style even when printing
8571         approximate values.
8572
8573         * lib/human.c: Avoid shadowing warnings.
8574         From Jim Meyering.
8575
8576 2000-06-14  Paul Eggert  <eggert@twinsun.com>
8577
8578         * lib/human.c (human_readable_inexact): Allow an input block size
8579         that is not a multiple of the output block size, and vice versa.
8580
8581         * lib/getdate.y (get_date): Apply relative times after time zone
8582         indicator, not before.
8583
8584 2000-05-31  Paul Eggert  <eggert@twinsun.com>
8585
8586         * m4/largefile.m4: Rewrite so that we don't need to run getconf,
8587         and thus don't need AC_CANONICAL_HOST.
8588
8589         (AC_SYS_LARGEFILE_FLAGS, AC_SYS_LARGEFILE_SPACE_APPEND): Remove.
8590         (AC_SYS_LARGEFILE_TEST_INCLUDES): New macro.
8591         (AC_SYS_LARGEFILE_MACRO_VALUE): Change arguments from
8592         CODE-TO-SET-DEFAULT to VALUE, INCLUDES, FUNCTION-BODY.  All uses
8593         changed.  Instead of inspecting the output of getconf, try to
8594         compile the test program without and with the macro definition.
8595         (AC_SYS_LARGEFILE): Do not require AC_CANONICAL_HOST or check for
8596         getconf.  Instead, check for the needed flags by compiling test
8597         programs.
8598
8599         * configure.in (AC_CANONICAL_HOST): Remove; the largefile stuff no
8600         longer needs it.
8601         * config.guess, config.sub: Remove these files, for similar reasons.
8602
8603 2000-05-03  Paul Eggert  <eggert@twinsun.com>
8604
8605         * m4/largefile.m4 (AC_SYS_LARGEFILE): Define _XOPEN_SOURCE to be
8606         500, instead of _GNU_SOURCE to be 1, to work around glibc 2.1.3
8607         bug.  This avoids a clash when files like regex.c that define
8608         _GNU_SOURCE.
8609
8610 2000-05-02  Paul Eggert  <eggert@twinsun.com>
8611
8612         * m4/largefile.m4 (AC_SYS_LARGEFILE):
8613         Define _GNU_SOURCE if this is needed to make
8614         ftello visible (e.g. glibc 2.1.3).  Use compile-time test, rather than
8615         inspecting host and OS, to decide whether to define _LARGEFILE_SOURCE.
8616
8617         * lib/quotearg.c (mbrtowc, mbstat_t):
8618         Add definitions if !HAVE_MBSTATE_T_OBJECT.
8619         (<wctype.h>): Include if HAVE_WCTYPE_H.
8620         (iswprint): Define to 1 if we lack it
8621
8622 2000-04-18  Paul Eggert  <eggert@twinsun.com>
8623
8624         * m4/mbstate_t.m4: New file.
8625
8626 2000-04-17  Bruno Haible  <haible@clisp.cons.org>
8627
8628         * tests/ignfail.sh: Test for uid 0 along with user "root".
8629
8630 2000-04-05  Paul Eggert  <eggert@twinsun.com>
8631
8632         * m4/largefile.m4 (AC_SYS_LARGEFILE_FLAGS):
8633         Don't use -n32 on IRIX if the installer said
8634         otherwise.
8635
8636 2000-02-28  Paul Eggert  <eggert@twinsun.com>
8637
8638         * lib/quotearg.c (ALERT_CHAR): New macro.
8639         (quotearg_buffer_restyled): Use it.
8640
8641 2000-02-23  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
8642
8643         * src/list.c (tartime): Fix off-by-one error when copying year if
8644         OLD_CTIME.
8645
8646 2000-02-18  Paul Eggert  <eggert@twinsun.com>
8647
8648         * lib/getdate.y: Handle two-digit years with leading zeros correctly.
8649         (textint): New typedef.
8650         (parser_control): Changed from struct parser_control to typedef
8651         (for consistency).  Member year changed from int to textint.  All
8652         uses changed.
8653         (YYSTYPE): Removed; replaced by %union with int and textint
8654         members.
8655         (tID): Removed; not used.
8656         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE,
8657         tMERIDIAN, tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER,
8658         tUNUMBER, tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
8659         (tSNUMBER, tUNUMBER): Now of type <textintval>.
8660         (date, number, to_year): Use width of number in digits, not its
8661         value, to determine whether it's a 2-digit year, or a 2-digit
8662         time.
8663         (yylex): Store number of digits of numeric tokens.  Return '?' for
8664         unknown identifiers, rather than (unused) tID.
8665
8666 2000-01-16  Paul Eggert  <eggert@twinsun.com>
8667
8668         * lib/quotearg.c (quotearg_buffer_restyled):
8669         Do not quote alert, backslash, formfeed,
8670         and vertical tab unnecessarily in shell quoting style.
8671
8672 2000-01-15  Paul Eggert  <eggert@twinsun.com>
8673
8674         * m4/c-bs-a.m4:
8675         Change quoting to be compatible with future autoconf versions.
8676
8677 2000-01-11  Paul Eggert  <eggert@twinsun.com>
8678
8679         * lib/exclude.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Remove unused macros.
8680
8681 2000-01-07  Paul Eggert  <eggert@twinsun.com>
8682
8683         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.17.
8684
8685         Fix bug with fnmatch.h dependency, as follows:
8686         * src/Makefile.am (OMIT_DEPENDENCIES): New macro.
8687         * lib/Makefile.am (OMIT_DEPENDENCIES): New macro.
8688
8689         * src/common.h (apply_nonancestor_delayed_set_stat):
8690         Renamed from apply_delayed_set_stat.
8691         (apply_delayed_set_stat, decode_mode, chmod_error_details,
8692         chown_error_details, close_warn, closedir_warn, mkdir_error,
8693         read_error_details, read_fatal_details, read_warn_details,
8694         seek_error_details, seek_warn_details, utime_error,
8695         write_error_details, write_fatal_details): New decls.
8696
8697         Make diagnostic messages more regular.
8698         * src/create.c (dump_file): Quote file names with colons if possible.
8699         * src/compare.c (diff_archive): Likewise.
8700         * src/extract.c (repair_delayed_set_stat, extract_archive): Likewise.
8701         * src/incremen.c (get_directory_contents, gnu_restore): Likewise.
8702         * src/mangle.c (extract_mangle): Likewise.
8703         * src/misc.c (call_arg_error, call_arg_fatal, call_arg_warn):
8704         Likewise.
8705         * src/buffer.c (archive_write_error, flush_archive, close_archive,
8706         new_volume, xclose):
8707         Use error message functions to report errors consistently.
8708         * src/compare.c (diff_sparse_files, diff_archive): Likewise.
8709         * src/create.c (finish_sparse_file, dump_file): Likewise.
8710         * src/extract.c (set_mode, set_stat, extract_sparse_file,
8711         extract_archive): Likewise.
8712         * src/list.c (list_archive): Likewise.
8713         * src/update.c (append_file): Likewise.
8714         * src/compare.c (diff_init, diff_sparse_files):
8715         Use xalloc_die to report memory exhaustion.
8716         * src/incremen.c (gnu_restore): Likewise.
8717         * src/list.c (read_header): Likewise.
8718         * src/mangle.c (extract_mangle): Likewise.
8719         * src/misc.c (maybe_backup_file): Likewise.
8720         * src/tar.c (decode_options): Likewise.
8721         * src/compare.c (read_and_process, fill_in_sparse_array,
8722         diff_sparse_files):
8723         Use consistent terminology for unexpected-EOF message.
8724         * src/extract.c (extract_sparse_file, extract_archive): Likewise.
8725         * src/list.c (list_archive, read_header, skip_file,
8726         skip_extended_headers): Likewise.
8727         * src/buffer.c (archive_write_error): Add noreturn attribute to decl.
8728         (xdup2): Regularize messages with rest of tar.
8729
8730         * src/buffer.c (flush_read): Don't read past EOF.
8731
8732         * src/extract.c (extr_init):
8733         If we run out of memory, invoke apply_delayed_set_stat.
8734         (prepare_to_extract): Don't complain if we can't remove ".".
8735         (apply_delayed_set_stat): New function.
8736         (apply_nonancestor_delayed_set_stat):
8737         Renamed from apply_delayed_set_stat.  All uses changed.
8738         Don't remove head if it doesn't apply.
8739
8740         * src/create.c (find_new_file_size):
8741         Return size instead of storing through pointer.
8742         All callers changed.
8743         (deal_with_sparse): Don't keep reading after read errors.
8744         (finish_sparse_file): Just abort if there is an internal error.
8745         (dump_file): Fix typo: stat_warn and stat_error were interchanged.
8746         Don't restore access times on directories during incremental dumps
8747         until after dealing with the directory.
8748         If ignoring failed reads, count closedir, read, and unknown
8749         file errors as warnings, not errors.
8750         Fix buffer overrun problem when dumping sparse files.
8751
8752         * src/list.c (read_and):
8753         Invoke apply_nonancestor_delayed_set_stat on file names
8754         after handling them.
8755         (decode_mode): Remove; moved to misc.c.
8756
8757         * src/misc.c (safer_rmdir): New function.
8758         (remove_any_file): Use it to avoid problems with rmdir(".").
8759         (maybe_backup_file): Regularize diagnostics.
8760         (undo_backup_file): Likewise.
8761         (decode_mode): Moved here from list.c.
8762         (chmod_error_details, chown_error_details, close_fatal,
8763         close_warn, closedir_warn, mkdir_error, read_error_details,
8764         read_warn_details, read_fatal_details, seek_error_details,
8765         seek_warn_details, utime_error, write_error_details,
8766         write_fatal_details): New functions.
8767
8768         * src/delete.c (save_record): Remove static variable (now local).
8769         (move_archive): Don't position before start of archive.
8770         (write_record): Abort if count is zero at inopportune time.
8771         Plug memory leak.
8772
8773         * src/tar.c (decode_options): --delete and -f - are now
8774         incompatible, since we didn't have time to fix their bugs.
8775
8776         * tests/Makefile.am (TESTS): Remove delete02.sh.
8777         * tests/ignfail.sh: Adjust to new quoting scheme again.
8778
8779 2000-01-06  Paul Eggert  <eggert@twinsun.com>
8780
8781         * lib/getdate.y: Sync tm_diff with the GNU C Library.
8782         (TM_YEAR_BASE): Renamed from TM_YEAR_ORIGIN.  All uses changed.
8783         (tm_diff): Renamed from difftm.  All uses changed.
8784         Replace body with that taken from GNU C Library 2.1.3pre1.
8785         (get_date): Prefer tm_gmtoff to tm_diff if available.
8786
8787 1999-12-29  "Melissa O'Neill"  <oneill@cs.sfu.ca>
8788
8789         * tests/incremen.sh: Invoke stat on newly created file so that its
8790         ctime is updated on Nextstep.
8791
8792 1999-12-21  Machael Stone  <mstone@cs.loyola.edu>
8793
8794         * lib/getdate.y (get_date):
8795         Fix typo when checking for time_t overflow in time zone calculations.
8796
8797 1999-12-13  Paul Eggert  <eggert@twinsun.com>
8798
8799         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.16.
8800
8801         * README-alpha: New file.
8802         * README: New sections for gzip and bzip2, Solaris.
8803         Remove mention of BACKLOG.
8804
8805         * configure.in (AC_C_BACKSLASH_A): Add.
8806         (AC_CHECK_HEADERS): Add wchar.h.
8807         (AC_CHECK_FUNCS): Add mbrtowc.
8808         (AC_FUNC_CLOSEDIR_VOID): Add.
8809
8810         * tests/Makefile.am (TESTS): Add delete02.sh.
8811         (POSTPONED_TESTS): Remove.
8812         (EXTRA_DIST): Remove $(POSTPONED_TESTS).
8813
8814         * tests/preset.in:
8815         Set LC_ALL rather than LANGUAGE, LANG, and LC_MESSAGES.
8816
8817         * tests/ignfail.sh (err): Adjust to new quoting scheme.
8818
8819         * tests/delete02.sh: Fix typo: need to list archive2, not archive.
8820
8821         * tests/extrac03.sh: Use -P option, so that .. doesn't get diagnosed.
8822
8823         * src/tar.c ("quotearg.h"): New include.
8824         (usage): Now has __attribute__ ((noreturn)).
8825         (confirm): Report errno if we can't open tty.
8826         (confirm, decode_options):
8827         Quote arbitrary strings in diagnostics.
8828         (OVERWRITE_OPTION): New constant.
8829         (long_options, usage, decode_options): New --overwrite option.
8830         (decode_options): --keep-old-files, --overwrite, and --unlink-first
8831         are now mutually exclusive.
8832         Don't assume that gettext preserves errno.
8833         (main): Set default quoting style to escape_quoting_style.
8834
8835         * src/update.c (<quotearg.h>): New include.
8836         (append_file):
8837         Don't assume that gettext preserves errno.
8838         Quote arbitrary strings in diagnostics.
8839         Check for close error.
8840
8841         * src/names.c (<quotearg.h>): New include.
8842         (name_init, name_next, name_close, names_notfound,
8843         collect_and_sort_names): Don't assume that gettext preserves
8844         errno.  Quote arbitrary strings in diagnostics.
8845         (excluded_name): Fix typo that caused empty patterns to be
8846         mishandled.
8847
8848         * src/misc.c (<quotearg.h>): New include.
8849         (quote_copy_string): Quote only newline and backslash; the output is no
8850         longer meant for humans, and is locale-independent.
8851         (contains_dot_dot): New function.
8852         (remove_any_file): Don't use lstat; just rmdir the file and then use
8853         unlink if the rmdir fails because the file isn't a directory.
8854         Check for readdir and closedir errors.
8855         (maybe_backup_file): Report "stat" for stat errors.
8856         (maybe_backup_file, chdir_do):
8857         Quote arbitrary strings in diagnostics.
8858         (maybe_backup_file, undo_last_backup):
8859         Don't assume that gettext preserves errno.
8860         (call_arg_error, call_arg_fatal, call_arg_warn,
8861         chdir_fatal, close_error, closedir_error, exec_fatal, mkfifo_error,
8862         mknod_error, open_error, open_fatal, open_warn, opendir_error,
8863         opendir_warn, read_error, read_fatal, readdir_error, readdir_warn,
8864         readlink_error, readlink_warn, seek_error, seek_warn, stat_error,
8865         stat_warn, truncate_error, truncate_warn, unlink_error, waitpid_error,
8866         write_error, write_fatal, xfork, xpipe, quote_n, quote): New functions.
8867
8868         * src/system.h (__attribute__): New macro.
8869         (O_NDELAY, O_NONBLOCK, O_APPEND): Remove.
8870         (S_ISDOOR): New macro.
8871         (closedir): New macro, if CLOSEDIR_VOID.
8872
8873         * src/rmt.c, src/rtapelib.c (decode_oflag):
8874         O_APPEND might not be defined.
8875
8876         * src/list.c: (read_and, list_archive):
8877         Quote arbitrary strings in diagnostics.
8878         (from_header): Use locale_quoting_style to quote diagnostics.
8879         (print_header, print_for_mkdir): Quote with quotearg, not quote_copy_string.
8880
8881         * src/rmt.h (REM_BIAS): Increase from 128 to (1 << 30).
8882
8883         * src/Makefile.am: Use ## for copyright comments.
8884
8885         * src/extract.c (<quotearg.h>): New include.
8886         (enum permstatus): New enum.
8887         (struct delayed_set_stat): file_name is now at end of buffer, to avoid
8888         two mallocs.  New members file_name_len, invert_permissions, permstatus.
8889         (extr_init): Remove hack that silently adjusted newdir_umask.
8890         (set_mode, set_stat): New args invert_permissions, permstatus, typeflag.
8891         Use these args to decide whether and how to set modes.
8892         (set_mode, set_stat, prepare_to_extract, extract_sparse_file, extract_archive):
8893         Don't assume that gettext preserves errno.
8894         (set_stat): Remove arg symlink_flag; subsumed by typeflag.
8895         (delay_set_stat, repair_delayed_set_stat): New functions.
8896         (make_directories): Avoid mkdir where last part of path is "..".
8897         Create a struct delayed_set_stat for each directory made.
8898         (prepare_to_extract): Renamed from unlink_destination, and
8899         return 0 immediately if to_stdout_option; all callers changed.
8900         (maybe_recoverable): New parameter interdir_made.
8901         Add support for --overwrite.
8902         (extract_sparse_file, extract_archive):
8903         Quote arbitrary strings in diagnostics.
8904         (extract_archive): By default, warn about ".." in member names, and skip them.
8905         Don't open files with O_NONBLOCK or O_APPEND.
8906         Open with O_TRUNC only if --overwrite; otherwise, use O_EXCL to avoid
8907         overwriting them.  Pass only rwxrwxrwx permissions to `open' and `mkdir',
8908         minus the current umask.  Keep track of intermediate directories made,
8909         to avoid looping when making x/../x when x doesn't exist; the
8910         earlier code solved this in a different way that didn't fit well
8911         into the new scheme.  Don't extract permissions onto existing
8912         directories unless --overwrite is given.  Do not add -wx------
8913         permissions to new directories permanently; just do it temporarily.
8914         Remove no-longer-needed hack with MSDOS and directory time stamps.
8915         (apply_delayed_set_stat): New argument specifies which directories to
8916         fix statuses of.  Do not wait until the end of extraction to fix
8917         statuses; instead, fix a directory's status once we exit that directory.
8918         This requires less memory and does the right thing in some cases
8919         where the old method didn't.
8920         (fatal_exit): New function.
8921
8922         * src/incremen.c (<quotearg.h>): New include.
8923         (get_directory_contents, gnu_restore):
8924         Check for readdir and closedir errors.
8925         (get_directory_contents, read_directory_file, gnu_restore):
8926         Quote arbitrary strings in diagnostics.
8927         (get_directory_contents, read_directory_file, write_directory_file):
8928         Don't assume that gettext preserves errno.
8929
8930         * src/create.c (<quotearg.h>): New include.
8931         (start_header): Use `member names' to refer to archive member names, not
8932         `archive names'.  Warn about `..' in member names.
8933         (finish_sparse_file, dump_file):
8934         Quote arbitrary strings in diagnostics.
8935         (finish_sparse_file, dump_file):
8936         Don't assume that gettext preserves errno.
8937         (dump_file): Don't use `access' to determine whether a directory is readable;
8938         this isn't reliable if tar is setuid.  Use `opendir' instead.
8939         Check for readdir and closedir failures.
8940         Don't dump sockets as if they were fifos; just warn and skip.
8941
8942         * src/delete.c (move_archive):
8943         Don't report fatal error merely because sizes don't fit
8944         into struct mtop values; fall back on lseek instead.
8945         Say `Cannot' uniformly, instead of `Could not' sometimes and `Cannot' others.
8946         Say `reposition' instead of `re-position'.
8947         (delete_archive_members):
8948         Set archive to STDOUT_FILENO before outputting trailing buffer.
8949
8950         * src/compare.c (<quotearg.h>): New include.
8951         (diff_init): Use `Cannot' uniformly, instead of `Could not' sometimes
8952         and `Cannot' others.
8953         (report_difference, diff_archive):
8954         Quote arbitrary strings in diagnostics.
8955         (process_rawdata, diff_sparse_files, get_stat_data, diff_archive, seek_warn):
8956         Don't assume that gettext preserves errno.
8957         (diff_archive): Don't open regular files with O_NONBLOCK.
8958         Preserve access times of files if --atime.
8959
8960         * src/common.h (FATAL_ERROR): Use new fatal_exit function to exit.
8961         (FATAL_ERROR, USAGE): Don't return 0.
8962         (enum old files): New enum.
8963         (old_files_option): New variable, replacing keep_old_files_option and
8964         unlink_first_option.
8965         (apply_delayed_set_stat): Now takes char const * param.
8966         (fatal_exit, contains_dot_dot, chdir_fatal, close_error,
8967         closedir_error, exec_fatal, mkfifo_error, mknod_error, open_error,
8968         open_fatal, open_warn, opendir_error, opendir_warn, read_error,
8969         read_fatal, readdir_error, readdir_warn, readlink_error,
8970         readlink_warn, seek_error, seek_warn, stat_error, stat_warn,
8971         truncate_error, truncate_warn, unlink_error, waitpid_error,
8972         write_error, write_fatal, xfork, xpipe, quote, quote_n): New decls.
8973
8974         * src/buffer.c:
8975         (xclose, xdup2, child_open_for_compress, child_open_for_uncompress,
8976         archive_write_error, archive_read_error, flush_archive, close_archive,
8977         init_volume_number, new_volume):
8978         Don't assume that gettext preserves errno.
8979
8980         (xdup2): Don't report errno if dup returns an unexpected nonnegative value.
8981         (open_archive): Reject multivolume verify attempts a bit earlier.
8982         Rename local variable `access', in case it's defined by system header.
8983
8984         (open_archive, backspace_output): Use `Cannot' uniformly, instead of
8985         `Could not' sometimes and `Cannot' others.
8986
8987         (open_archive, flush_read, flush_archive, close_archive, new_volume):
8988         Quote arbitrary strings in diagnostics.
8989
8990         (read_error): Set archive to STDOUT_FILENO temporarily when writing
8991         archive buffer.
8992
8993         (init_volume_number): Check for input and output errors in volno_file.
8994
8995         (new_volume): Use new fatal_exit function to exit, and new xfork
8996         function to fork.
8997
8998         * m4/Makefile.am (EXTRA_DIST): Add c-bs-a.m4.
8999
9000         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/c-bs-a.m4.
9001
9002         * doc/tar.texi: Add --overwrite.
9003         --absolute-names rejects ".." in names.
9004
9005         * lib/quotearg.c: Add support for multibyte characters.
9006         (ISGRAPH): Remove.
9007         (ISPRINT): New macro.
9008         (<wchar.h>): Include if HAVE_MBRTOWC && HAVE_WCHAR_H.
9009         (isprint, mbrtowc, mbsinit, mbstate_t): New macros,
9010         defined if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
9011         (quotearg_buffer_restyled): New function, with most of the old
9012         quotearg_buffer's contents.
9013         Major rewrite to support multibyte characters.
9014         (quotearg_buffer): Now just calls quotearg_buffer_restyled.
9015
9016         * m4/c-bs-a.m4: New file.
9017
9018         * lib/Makefile.am: Use ## for copyright notice.
9019
9020         * scripts/Makefile.am: Use ## on copyright notice.
9021
9022         * doc/Makefile.am:
9023         ($(srcdir)/tar.info, tar.dvi): We now use texinfo 4.0.
9024
9025 1999-12-05  Paul Eggert  <eggert@twinsun.com>
9026
9027         * doc/ChangeLog, lib/ChangeLog, scripts/ChangeLog,
9028         src/ChangeLog, tests/ChangeLog: Remove these files.
9029         * ChangeLog.1: New file, incorporating the above files, plus old
9030         ChangeLog entries.
9031         * Makefile.am (EXTRA_DIST): Add ChangeLog.1.
9032
9033 1999-12-05  Dale Worley  <worley@ariadne.com>
9034
9035         * src/compare.c (<utime.h>, struct utimbuf): Add.
9036         (diff_archive): Restore access times if --atime.
9037         * doc/tar.texi: Explain that --atime also preserves modification time.
9038
9039 1999-12-04  Gerhard Poul  <gpoul@gnu.org>
9040
9041         * ABOUT-NLS: Update to latest version from ftp.gnu.org.
9042         * BACKLOG, TODO: Remove.
9043         * Makefile.am (all-local, BABYL, dist-zoo, id, ID): Remove.
9044         * README: Bring up to date.
9045
9046 1999-12-03  Paul Eggert  <eggert@twinsun.com>
9047
9048         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.15.
9049
9050         * src/compare.c (diff_archive):
9051         Do not set errno to EPIPE; we no longer use perror.
9052
9053         * src/create.c (dump_file):
9054         If a parent directory said that a file should be there but it is
9055         absent, diagnose it as being removed in the meantime.
9056         Do not pass meaningless errno to ERROR when reporting that the
9057         file changed as we read it.
9058         Report that a file changed if its ctime changes; this is more
9059         sensitive than mtime+size, and more accurate.
9060
9061         * src/incremen.c (enum children): New type.
9062         (struct directory): Change old char allnew member to new enum children
9063         children member.
9064         All uses changed.
9065         (get_directory_contents): When doing an incremental dump that does
9066         not cross filesystem boundaries, dump the mount points, even though
9067         they are in a different filesystem.  This is for convenience when
9068         restoring, and for consistency with non-incremental dumps.
9069         This requires a 3-way flag for keeping track of which children we want,
9070         so we use enum children rather than boolean.
9071
9072         * src/open3.c (modes): Remove.
9073         (open3): Remove unportable assumptions about flag encodings.
9074         Use `stat' instead of `access' for testing file existence,
9075         to avoid problems with setuid programs.
9076
9077         * src/names.c (name_next): If file names are given both in the
9078         command line (e.g. via -C) and in a file (via -T), do not
9079         ignore the command-line names.
9080
9081         * m4/uintmax_t.m4: Backport to autoconf 2.13.
9082
9083         * doc/tar.texi: Clarify getdate authorship.
9084
9085 1999-11-23  Paul Eggert  <eggert@twinsun.com>
9086
9087         * lib/Makefile.am (DISTCLEANFILES): New macro.
9088
9089         * configure.in (tar_fnmatch_hin):
9090         Remove; it runs afoul of a bug in autoconf 2.13.
9091         Instead, always link fnmatch.h to some file, even if it's a throwaway.
9092
9093 1999-11-19  Paul Eggert  <eggert@twinsun.com>
9094
9095         * m4/largefile.m4: Update serial.
9096
9097 1999-11-18  Paul Eggert  <eggert@twinsun.com>
9098
9099         * m4/largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Work around a bug in
9100         the QNX shell, which doesn't propagate exit status of failed
9101         commands inside shell assignments.
9102
9103 1999-11-07  Paul Eggert  <eggert@twinsun.com>
9104
9105         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.14.
9106
9107         * configure.in (AC_PREREQ): Bump to 2.13.
9108         (ALL_LINGUAS): Add pt_BR, ja.
9109         (AC_FUNC_FNMATCH): Remove lib/funmatch.h before invoking, not after.
9110         (tar_cv_path_RSH): Prefer a non-symlink rsh to a symlink one,
9111         for AIX crossbuilds.
9112
9113         * doc/tar.texi: New node create options for --ignore-failed-read.
9114         Remove unused version control symbols.
9115         Modernize texinfo usage.
9116
9117         * src/tar.c (usage): Add examples.
9118
9119         * m4/fnmatch.m4 (AC_FUNC_FNMATCH):
9120         Include fnmatch.h when testing fnmatch.
9121
9122         * src/common.h (collect_and_sort_names): New decl.
9123
9124         * src/list.c (from_header):
9125         Handle 32-bit two's complement negative time stamps
9126         even if the leading octal digit is 2 or 3.
9127
9128         * src/extract.c (set_stat): Remove duplicate code.
9129
9130         * src/create.c (to_chars): Remove trailing newline from warning.
9131         (dump_file): Ignore doors.
9132         (finish_header): Report block numbers with origin 0, not origin 1.
9133
9134         * src/rmt.c: Include getopt.h.
9135         (long_opts): New constant.
9136         (usage): New function.
9137         (main): Implement --help and --version.
9138         Output usage message if arguments are bad.
9139
9140 1999-10-10  Paul Eggert  <eggert@twinsun.com>
9141
9142         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.13.
9143
9144         * README: Remove --with-dmalloc.
9145         Add --disable-largefile.
9146         Remove old NeXT dirent problems, or AIX valloc problems.
9147         Remove old union wait advice, and old %lld advice.
9148         Remove advice about FreeBSD 2.1.7, ISC 4.1mu, Ultrix `make'.
9149
9150         * doc/tar.texi: Clarify documentation for portable file names.
9151
9152         * configure.in (AM_WITH_DMALLOC): Remove.
9153         (ALL_LINGUAS): Add ja.
9154
9155         * src/tar.c (decode_options):
9156         Invalid dates are now treated as (time_t) -1.
9157         Redo version message to conform to GNU standards.
9158
9159         * src/create.c (dump_file):
9160         Fix typo: last two args to dump_file were interchanged.
9161         * src/update.c (update_archive): Likewise.
9162
9163         * src/common.h (tartime): New decl.
9164
9165         * src/list.c (tartime): Now extern.
9166         (read_and): Invalid headers cause errors, not warnings.
9167
9168 1999-10-03  Paul Eggert  <eggert@twinsun.com>
9169
9170         * lib/getdate.y (__attribute__):
9171         Don't use if GCC claims to be before 2.8; this is
9172         needed for OPENStep 4.2 cc.  Also, don't use if strict ANSI.
9173
9174 1999-09-25  Paul Eggert  <eggert@twinsun.com>
9175
9176         * lib/fnmatch.c, lib/fnmatch.hin: Merge changes from latest glibc.
9177         * lib/getopt.c, lib/getopt.h, lib/getopt1.c: Likewise.
9178
9179         * tests/incremen.sh: Add yet another sleep.
9180
9181 1999-09-24  Paul Eggert  <eggert@twinsun.com>
9182
9183         * NEWS: A read error now causes a nonzero exit status.
9184
9185         * src/create.c (to_chars): Fix base-256 output.
9186
9187         * src/buffer.c (write_error):
9188         Read error is an error, not just a warning.
9189
9190 1999-09-24  Paul Eggert  <eggert@twinsun.com>
9191
9192         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.12.
9193
9194         * src/tar.c (<time.h>): Include.
9195         (time): Declare if not defined.
9196         (confirm): Don't read past EOF.
9197         (long_options, usage): Add --no-same-owner, --no-same-permissions.
9198         (main): Use clock_gettime if available.
9199
9200         * tests/Makefile.am (TESTS): Add incremen.sh
9201         (INCLUDES): Add -I../lib, for fnmatch.h.
9202
9203         * src/update.c (update_archive):
9204         Remove call to name_expand; had no effect.
9205         Use chdir_do to change into directory.
9206         Use deref_stat instead of stat.
9207         Use add_avoided_name to mark names to be avoided; the old method of
9208         setting a bit with the name caused all descendants of that name to
9209         be avoided, in some circumstances.
9210
9211         * tests/incremen.sh: Remove unnecessary sleeps.
9212
9213         * src/names.c (name_next): Go back to using plain chdir.
9214         (name_gather): Use chdir_arg to keep track of arguments to chdir.
9215         (addname): Likewise.
9216         (name_match): Use chdir_do to act on chdir args.
9217         (merge_sort): Moved here from incremen.c.
9218         (compare_names, add_hierarchy_to_namelist, collect_and_sort_names):
9219         Likewise.
9220         (name_expand): Remove.
9221         (name_from_list): Skip fake names.
9222         Use chdir_do to act on chdir args.
9223         (struct avoided_name): New struct.
9224         (avoided_names): New var.
9225         (add_avoided_name, is_avoided_name): New functions.
9226
9227         * src/system.h (stat, lstat): Define in terms of statx on
9228         STX_HIDDEN && !_LARGE_FILES /* AIX */ hosts.
9229         (UCHAR_MAX): New macro.
9230         (TYPE_MAXIMUM): Cast to arg type, for types narrow than int.
9231
9232         * m4/largefile.m4: Work around GCC 2.95.1 bug with HP-UX 10.20.
9233
9234         * src/incremen.c (<time.h>): Remove include; no longer used.
9235         (time): Remove decl.
9236         (time_now): Remove.
9237         (get_directory_contents): Use deref_stat.
9238         Consider a subdirectory to be all new only if
9239         listed_incremental_option or if it its timestamp is newer than the
9240         cutoff.
9241         (add_hierarchy_to_namelist, merge_sort): Move to names.c.
9242         (read_directory_file): Now extern.  Do not set time_now.
9243         (write_directory_file): Renamed from write_dir_file.
9244         Use start_time instead of time_now.
9245         (compare_names, collect_and_sort_names): Move to names.c.
9246
9247         * src/mangle.c (<time.h>): Remove; not used.
9248         (time): Do not declare.
9249
9250         * src/misc.c (chdir_from_initial_wd): Remove.
9251         (deref_stat): New function.
9252         (struct wd): New struct.
9253         (wd, wds, wd_alloc): New variables.
9254         (chdir_arg, chdir_do): New function.
9255
9256         * src/compare.c (get_stat_data): Use deref_stat.
9257
9258         * src/common.h (name_expand): Remove.
9259
9260         * src/list.c (time): Declare if not defined.
9261         (base_64_digits): Moved here from create.c.
9262         (base64_map): Use UCHAR_MAX for size, not less-clear (unsigned char)
9263         -1.
9264         (read_and): Don't get time from header unless we need it now;
9265         as getting time can cause duplicate diagnostics if bogus.
9266         Remove "Hmm, " from diagnostic.
9267         Use "Skipping to next header" uniformly.
9268         (from_header): Renamed from from_chars.  All uses changed.
9269         Allow different forms for unportable 2's complement numbers.
9270         Don't check for extended forms when parsing checksums.
9271         Parse base-256 output.
9272         (gid_from_header): Renamed from gid_from_chars.  All uses changed.
9273         (major_from_header): Renamed from major_from_chars.  All uses changed.
9274         (minor_from_header): Renamed from minor_from_chars.  All uses changed.
9275         (mode_from_header): Renamed from mode_from_chars.  All uses changed.
9276         (off_from_header): Renamed from off_from_chars.  All uses changed.
9277         (size_from_header): Renamed from size_from_chars.  All uses changed.
9278         (time_from_header): Renamed from time_from_chars.  All uses changed.
9279         Warn about future timestamps.
9280         (uid_from_header): Renamed from uid_from_chars.  All uses changed.
9281         (uintmax_from_header): Renamed from uintmax_from_chars.
9282         All uses changed.
9283         (tartime): New function, incorporating isotime.
9284         (isotime): Delete.
9285         (print_header): Use tartime.
9286
9287         * src/create.c (to_chars): Fix typo in decl.
9288         Don't assign through char const *.
9289         Rename name_expand back to collect_and_sort_names.
9290
9291         * src/extract.c (<time.h>): No need to include.
9292         (time): No need to declare.
9293         (now): Remove variable.
9294         (extr_init): Don't initialize `now'.
9295         Increment same_permissions_option and same_owner_option if we_are_root
9296         is nonzero; this supports the new --no-same-owner option.
9297         (set_stat): Use start_time instead of `now'.
9298
9299         * src/create.c (struct link): Remove unused linkcount member.
9300         (base_64_digits): Move to list.c.
9301         (base_8_digits): Remove.
9302         (to_octal): New function, with some of old contents of to_base.
9303         (to_base): Remove.
9304         (to_base256): New function.
9305         (to_chars): Use base 256, not base 64, for huge values.
9306         (mode_to_chars): Don't use two's complement in GNU format or POSIX
9307         format.
9308         (dump_file): Interchange last two arguments. If TOP_LEVEL is negative,
9309         it means we have an incremental dump where we don't know whether this
9310         is a top-level call.
9311         Use deref_stat instead of statx / stat / lstat.
9312         Cast result of alloca.
9313         Check for dates if 0 < top_level, not if listed_incremental_option.
9314         Move multiple-link check after directory check.
9315         Do not dump avoided names.
9316         Dump hard links to symbolic names as links, not as separate
9317         symbolic links.
9318         start_header cannot return a null pointer, so don't test for it.
9319         Likewise for find_next_block.
9320
9321         * src/buffer.c, src/common.h (<human.h>): Include.
9322         (read_error): Read error is an error, not just a warning.
9323         (print_total_written): Also print human-readable byte count, and
9324         bytes/s.
9325         (open_archive, flush_write): Use start_time, not current time.
9326         (flush_read): Report about garbage bytes ignored at end of archive,
9327         but act on non-garbage bytes (instead of ignoring them).
9328         (new_volume): Use WARN for warnings.
9329
9330         * doc/Makefile.am:
9331         ($(srcdir)/tar.info): Add -I$(srcdir) so that subdir builds work.
9332
9333         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/fnmatch.m4.
9334
9335         * m4/Makefile.am (EXTRA_DIST): Add fnmatch.m4.
9336
9337         * lib/Makefile.am (noinst_HEADERS):
9338         Rename fnmatch.h to fnmatch.hin; add human.h.
9339         (libtar_a_SOURCES): Add human.c, xstrtoul.c.
9340         (INCLUDES): Remove -I.. -I$(srcdir) -- automake adds this for us.
9341
9342         * src/Makefile.am (rmt_LDADD, tar_LDADD): New macros.
9343
9344         * lib/fnmatch.c (strchrnul):
9345         Define to __strchrnul if _LIBC, to our own replacement otherwise.
9346         Do not define if !_LIBC and if it already exists.
9347         (internal_fnmatch): Use it.
9348
9349         * configure.in (tar_LDADD): New variable, used only when linking tar.
9350         (rmt_LDADD): Similarly, for rmt.
9351         (AC_FUNC_FNMATCH): Link fnnmatch.hin to fnmatch.h if we're using our
9352         fnmatch.c; otherwise, use the system fnmatch.h.
9353
9354         * doc/tar.texi: Add --no-same-owner, --no-same-permissions.
9355         Modernize sample backup script.
9356
9357         * THANKS: Martin Goik's email address has changed.
9358
9359         * m4/fnmatch.m4: New file.
9360
9361 1999-09-03  Paul Eggert  <eggert@twinsun.com>
9362
9363         * lib/lchown.h (ENOSYS): Don't use ENOMSG; it's not in NeXTStep3.3.
9364         Use EINVAL instead.
9365
9366 1999-08-29  Paul Eggert  <eggert@twinsun.com>
9367
9368         * lib/getdate.y (get_date):
9369         Rename outermost local `probe' to `quarter'.
9370         Rename latter local `tm' to probe_tm.
9371         From: Jim Meyering <meyering@ascend.com>
9372         Message-ID: <uryn1vafyyc.fsf@ixi.eng.ascend.com>
9373
9374 1999-08-28  Paul Eggert  <eggert@twinsun.com>
9375
9376         * lib/getdate.y (PC): New macro; use it when possible.
9377         (number): Handle `Nov 11 1996' example correctly.
9378         See Risks Digest 20.55 (1999-08-27)
9379         http://catless.ncl.ac.uk/Risks/20.55.html#subj18
9380
9381 1999-08-23  Paul Eggert  <eggert@twinsun.com>
9382
9383         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.11.
9384
9385         Remove minor cases of lint from many source files: this includes
9386         unnecessary casts, uses of NULL, etc.
9387
9388         * configure.in (AC_PROG_YACC): Remove.
9389         (YACC): Always use bison.
9390         (AC_STRUCT_TIMEZONE): Add.
9391         (AC_REPLACE_FUNCS): Add strcasecmp, strncasecmp.
9392
9393         * doc/tar.texi: --bzip2 is now -I.  Remove obsolete time zone info.
9394         Fix spelling.
9395
9396         * lib/Makefile.am (EXTRA_DIST): Add strcasecmp.c, strncasecmp.c.
9397         ($(srcdir)/getdate.c): Rename y.tab.c to getdate.c only if successful.
9398
9399         * lib/strcasecmp.c, lib/strncasecmp.c: New files.
9400
9401         * src/common.h (merge_sort): Remove decl; no longer exported.
9402
9403         * src/system.h (voidstar): Remove.
9404         (memcpy, memcmp): Cast args.
9405         ("xalloc.h"): Add include.
9406         (xmalloc, xrealloc): Remove decl.
9407
9408         * src/mangle.c (time): Do not declare if defined.
9409         (first_mangle, mangled_num): Remove.
9410
9411         * src/list.c (from_chars): Report out-of-range values more precisely.
9412         (off_from_chars): Do not allow negative offsets.
9413         (uid_from_chars): Allow negative uids.
9414
9415         * src/create.c (linklist): Now static.
9416         (to_chars): Fix wording of message to match from_chars.
9417
9418         * src/misc.c (merge_sort): Move to incremen.c.
9419         * src/incremen.c (merge_sort): Move here from misc.c; now static.
9420         It's too painful to make it both generic and portable.
9421         (read_directory_file): "timestamp" -> "time stamp" in messages.
9422
9423         * src/tar.c (long_options, usage, main): -y is now -I (for --bzip).
9424         (usage): Fix misspelling.
9425         (OPTION_STRING): -y is now -I.
9426         (decode_options): Use -1, not EOF, for getopt_long result.
9427         Fix typo when invoking xstrtoumax: look for LONGINT_OK, not LONG_MAX.
9428         Handle operands after any "--" argument.
9429         (main): Report any output errors.
9430
9431         * src/rmt.c (main): status is ssize_t, not long.
9432
9433         * src/names.c (name_gather): Handle trailing -C option correctly.
9434         (addname): use memcpy, not strncpy, to copy a string of known length.
9435         (name_match): Handle trailing -C option correctly.
9436         Propagate -C option to following files.
9437         (name_match, name_scan): Remove redundant matching code.
9438
9439         * src/buffer.c (open_archive): Use American spelling in diagnostic.
9440
9441         * lib/getdate.y: Major rewrite.  Add copyright notice.
9442         (<stdio.h>): Include only if testing.
9443         (ISUPPER): Remove.
9444         (ISLOWER): New macro.
9445         (<string.h>): Include if HAVE_STRING_H, not USG.
9446         (bcopy): Remove.
9447         (yymaxdepth, ..., yycheck): Don't bother to redefine, since we assume
9448         bison.
9449         (EPOCH_YEAR): Renamed from EPOCH.
9450         (table): Renamed from TABLE.
9451         (meridian): Now an anonymous enum.
9452         (struct parser_control): New type.
9453         (YYLEX_PARAM, YYPARSE_PARAM, YYSTYPE): New macros.
9454         (yyInput, ..., yyRelYear): Migrated into struct parser_control.
9455         (%pure_parser): Added, so that the parser is pure.
9456         (%union): Removed; the type is now just plain int.
9457         All %type directives removed.
9458         (tLOCAL_ZONE): New %token.
9459         (month_day_table): Renamed from MonthDayTable.
9460         (gmtime, localtime, mktime, time): Declare only if not defined.
9461         (meridian_table): New table.
9462         (dst_table): New table.
9463         (units_table): renamed from UnitsTable.
9464         (relative_time_table): Renamed from OtherTable.
9465         (time_zone_table): Renamed from TimezoneTable.  Modernized.
9466         (military_table): Renamed from MilitaryTable.
9467         (to_hour): Renamed from ToHour.
9468         (to_year): Renamed from ToYear.
9469         (lookup_zone): New function.
9470         (LookupWord): Renamed from lookup_word.  Use lookup_zone for time
9471         zones.
9472         (yylex): Now reentrant.  All callers changed.
9473         (get_date): Add support for local time zone abbreviations.
9474         Make it reentrant.
9475
9476 1999-08-20  Paul Eggert  <eggert@twinsun.com>
9477
9478         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.10.
9479
9480         * src/create.c (to_chars): Generate GNU base-64 representation
9481         if we are generating an old or new GNU format tar file for a
9482         number that can't be represented with the POSIX format.
9483
9484         * configure.in (AC_CHECK_FUNCS): Add fchdir.
9485         (AM_FUNC_GETLINE): Add.
9486         (LIBOBJS): Add getline.o to workaround comment.
9487         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/getline.m4.
9488         * m4/Makefile.am (EXTRA_DIST): Add getline.m4.
9489         * lib/Makefile.am (noinst_HEADERS): Add getline.h, save-cwd.h.
9490         (libtar_a_SOURCES): Add save-cwd.c, xgetcwd.c.
9491         * lib/getline.c, lib/getline.h, lib/save-cwd.c,
9492         lib/save-cwd.h, m4/getline.m4: New files.
9493
9494         * src/misc.c (<save-cwd.h>): Include.
9495         (chdir_from_initial_wd): New function.
9496
9497         * src/names.c (name_next): Use chdir_from_initial_wd, not chdir.
9498         (name_gather): Handle `-C x -C y' correctly.
9499         Do not rely on addname to handle -C.
9500         (addname): New CHANGE_DIR parameter.  All callers changed.
9501         Remove ugly calls to getcwd; no longer needed.
9502         (name_match, name_from_list): Use chdir_from_initial_wd, not chdir.
9503
9504         * src/incremen.c (listed_incremental_stream): New var.
9505         (read_directory_file): Remove arbitrary limits on file name length.
9506         Do not attempt to get the working directory; we can bypass this
9507         on fchdir hosts.  Open the listed_incremental_option file for both
9508         read and write instead of opening it twice.  Check for I/O errors
9509         when doing I/O to this file.  Check for invalid data in the file,
9510         and report line numbers of invalid data.
9511         (write_dir_file): Likewise.
9512         (collect_and_sort_names): Use chdir_from_initial_wd, not chdir.
9513         Do not invoke write_dir_file; that's our caller's responsibility.
9514
9515         * src/list.c (max): New macro.
9516         (isotime): Now takes time_t, not time_t *.  Report the decimal values
9517         of times that can't be broken down.
9518         (print_header): Don't assume that major and minor device numbers can
9519         fit into uintmax_t.
9520
9521         * src/common.h (struct name): change_dir is now char const *.
9522         (write_directory_file): Remove unused decl.
9523         (STRINGIFY_BIGINT): Assume b always points to UINTMAX_STRSIZE_BOUND
9524         chars; the old `sizeof (b)' broke when b was a pointer not an array.
9525         (chdir_from_initial_wd): New decl.
9526         (addname): New 2nd arg.
9527
9528         * THANKS: Torsten Lull -> Catrin Urbanneck
9529
9530 1999-08-18  Paul Eggert  <eggert@twinsun.com>
9531
9532         * configure.in (HAVE_GETHOSTENT, HAVE_SETSOCKOPT):
9533         Don't depend on ac_cv_func variables.
9534         From Albert Chin-A-Young <china@thewrittenword.com>.
9535
9536 1999-08-18  Paul Eggert  <eggert@twinsun.com>
9537
9538         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.9
9539
9540         * m4/signedchar.m4: New file.
9541         * configure.in (pe_AC_TYPE_SIGNED_CHAR): Add.
9542         * src/system.h (signed_char): New macro.
9543         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/signedchar.m4.
9544         * m4/Makefile.am (EXTRA_DIST): Add signedchar.m4.
9545
9546         * src/create.c (write_eot): Write at least two zero blocks.
9547
9548         * src/extract.c (extract_archive): Fix sparse array bug:
9549         we did not find end of array correctly.
9550
9551         * src/compare.c: (fill_in_sparse_array, diff_sparse_files):
9552         Don't assume find_next_block yields nonnull.
9553         * src/extract.c (extract_sparse_file, extract_archive): Likewise.
9554         * src/list.c (skip_extended_headers): Likewise.
9555
9556         * src/list.c (read_and, list_archive): Simplify code.
9557         (read_header): Fix computation of signed checksums on machines where
9558         char is unsigned.
9559         Do not consider a block to be zero unless all its bytes are zero,
9560         even the checksum bytes.  Do not attempt to parse the checksum of
9561         a zero block.  Fix memory leak with long names and links.
9562         (from_chars): Accommodate a buggy tar that outputs leading NUL
9563         if the previous field overflows.
9564
9565         * src/misc.c (quote_copy_string): Generate \177 for '\177', not
9566         \?, for portability to non-ASCII hosts.
9567
9568 1999-08-16  Paul Eggert  <eggert@twinsun.com>
9569
9570         * configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.8.
9571
9572         * src/extract.c (make_directories): Do not chown intermediate
9573         directories, even if we are root.
9574
9575         * src/list.c (read_header): Fix bugs when interpreting
9576         POSIX-compliant headers that do not contain null bytes in the
9577         header or link names.
9578
9579 1999-08-14  Paul Eggert  <eggert@twinsun.com>
9580
9581         * configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.7.
9582
9583         * configure.in (AC_CHECK_HEADERS): Remove sys/wait.h.
9584         (AC_HEADER_SYS_WAIT): Add.
9585         (AC_REPLACE_FUNCS): Add waitpid.
9586         (tar_cv_header_union_wait, HAVE_UNION_WAIT): Remove.
9587         * lib/waitpid.c: New file.
9588         * lib/Makefile.am (EXTRA_DIST): Add waitpid.c.
9589         * src/system.h (WCOREDUMP): Remove; no longer used.
9590         (WIFSTOPPED): Likewise.
9591         (WEXITSTATUS, WIFSIGNALED): Default to Solaris 7 versions.
9592         * src/buffer.c (child_open_for_compress): Undo previous change.
9593         (close_archive): Use waitpid, POSIX-style, instead of old BSD style.
9594         (new_volume): Likewise.
9595
9596         * src/buffer.c, src/extract.c, src/incremen.c (time):
9597         Don't declare if defined.
9598         * src/extract.c (extr_init): Remove unneeded cast around 0 arg to time.
9599         * src/incremen.c (read_directory_file):
9600         Invoke `time' the same way everyone else does.
9601         Check validity of --listed-incremental file contents a bit better.
9602         Do not worry about --after-date-option; tar.c now checks this.
9603         * src/list.c (isotime): Report ??? if localtime returns null.
9604         Don't assume years fit into four digits.
9605         Don't append trailing newline.
9606         (print_header): Report ??? if localtime returns null;
9607         Don't assume years fit into four digits.
9608
9609         * src/compare.c (diff_archive): Do not fall back on absolute name
9610         when --absolute-names is not specified.
9611
9612         * src/create.c (start_header):
9613         Include text of ignored filesystem prefix in warning.
9614         (create_archive): Check for excluded names when doing incremental
9615         pass through directory.
9616         (dump_file): Do not dump old files explicitly given on command line
9617         when using --listed-incremental.  Do not strip ./ prefix from names.
9618
9619         * src/tar.c: -g now implies after_date_option = 1.
9620         -g and -N are now incompatible options.
9621
9622         * doc/tar.texi: Explain --exclude better.  Don't strip leading `./'.
9623
9624 1999-08-11  Jeff Dairiki  <dairiki@dairiki.org>
9625
9626         * src/list.c (read_header): Don't parse OLDGNU_FORMAT
9627         incremental headers as POSIX prefixes.
9628
9629 1999-08-11  Paul Eggert  <eggert@twinsun.com>
9630
9631         * NEWS, configure.in: Version 1.13.6.
9632
9633         * configure.in (ALL_LINGUAS): Add pt_BR.
9634         * po/pt_BR.po: New file.
9635
9636         * doc/Makefile.am ($(srcdir)/tar.info, $(srcdir)/header.texi):
9637         Renamed from tar.info and header.texi; adjust actions so that
9638         they work in other directories.
9639
9640         * doc/tar.texi: Add -y and --bzip2.
9641         Patterns containing / now exclude only file names whose prefix match.
9642
9643         * lib/exclude.h (excluded_filename): New option parameter.
9644         (add_exclude_file): New ADD_FUNC parameter.
9645         (excluded_pathname): Remove decl.
9646         * lib/exclude.c (_GNU_SOURCE):
9647         Remove; no longer needed since we don't use FNM_ macros.
9648         (excluded_filename): Renamed from excluded_filename_opts.
9649         (excluded_filename, excluded_pathname): Remove.
9650         (add_exclude_file): New ADD_FUNC parameter.
9651
9652         * po/POTFILES.in: Add lib/quotearg.c.
9653
9654         * src/buffer.c (_GNU_SOURCE): Define.
9655         (<fnmatch.h>): Include unconditionally.
9656         (child_open_for_compress): Dup after closing, to avoid possible file
9657         descriptor exhaustion.
9658         (flush_write): Use FILESYSTEM_PREFIX_LEN instead of MSDOS ifdef.
9659         (flush_read): Likewise.
9660
9661         * src/common.h (LG_8, LG_64): New macros.
9662         (excluded_with_slash, excluded_without_slash): New vars.
9663         (excluded): Remove.
9664         (base_64_digits): New decl.
9665         (gid_to_chars, major_to_chars, minor_to_chars, mode_to_chars,
9666         off_to_chars, size_to_chars, time_to_chars, uid_to_chars,
9667         uintmax_to_chars,
9668         GID_TO_CHARS, MAJOR_TO_CHARS, MINOR_TO_CHARS, MODE_TO_CHARS,
9669         OFF_TO_CHARS, SIZE_TO_CHARS, TIME_TO_CHARS, UID_TO_CHARS,
9670         UINTMAX_TO_CHARS):
9671         Renamed from gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct,
9672         off_to_oct, size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct,
9673         GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT, MODE_TO_OCT, OFF_TO_OCT,
9674         SIZE_TO_OCT, TIME_TO_OCT, UID_TO_OCT, UINTMAX_TO_OCT,
9675         respectively.  All definitions and uses changed.
9676         (excluded_name): New decl.
9677
9678         * src/compare.c (diff_archive):
9679         Open files with O_NONBLOCK instead of O_NDELAY.
9680
9681         * src/create.c (base_64_digits): New constant.
9682         (base_8_digits): New macro.
9683         (MAX_VAL_WITH_DIGITS): New macro.
9684         (to_base): First half of old to_oct.  Support base 64 too.
9685         (to_chars): Other half of old to_oct, for 64-bit support.
9686         (GID_NOBODY, UID_NOBODY): Don't define if the headers don't.
9687         (gid_substitute, uid_substitute): Look up names dynamically if
9688         GID_NOBODY and UID_NOBODY aren't defined; use -2 if all else fails.
9689         (mode_to_chars): Renamed from mode_to_oct.
9690         Support negative values in all the _to_chars functions.
9691         (start_header): Use FILESYSTEM_PREFIX_LEN instead of MSDOS ifdef.
9692         Abort if archive format is DEFAULT_FORMAT when it shouldn't be.
9693         (dump_file): Inspect entire pathname, not just new file name
9694         component, when deciding whether to exclude it.
9695
9696         * src/extract.c (extract_archive):
9697         Open files with O_NONBLOCK instead of O_NDELAY.
9698
9699         * src/incremen.c (get_directory_contents):
9700         Inspect entire pathname, not just new file name
9701         component, when deciding whether to exclude it.
9702
9703         * src/list.c (<fnmatch.h>): Do not include.
9704         (from_chars): Renamed from from_oct.  New parameter specifying
9705         the negative of the minimum allowed value.  Support negative
9706         and base-64 values.
9707         (base64_map): New var.
9708         (base64_init): New function.
9709         (print_header): Output numeric uids and gids if numeric_owner_option.
9710
9711         * src/misc.c (quote_copy_string): Use LG_8 instead of constants.
9712
9713         * src/names.c (_GNU_SOURCE): Define.
9714         (<fnmatch.h>): Include unconditionally.
9715         (excluded_name): New function, taking over duties of excluded_pathname.
9716         All uses changed.
9717
9718         * src/rmt.c (decode_oflag): New function.
9719         (main): Use it to support symbolic open flags.
9720
9721         * src/rtapelib.c (encode_oflag): New function.
9722         (rmt_open__): Do not allow newlines in the path.
9723         Propagate errno correctly.
9724         Decode symbolic open flags, if present.
9725
9726         * src/system.h (FILESYSTEM_PREFIX_LEN, ISSLASH, O_ACCMODE, O_NONBLOCK):
9727         New macros.
9728
9729         * src/tar.c: (long_options, usage, OPTION_STRING, decode_options):
9730         New -y or --bzip2 option.
9731         (add_filtered_exclude): New function.
9732         (decode_options): Put excluded patterns with / into
9733         excluded_with_slash, and without / into excluded_without_slash.
9734         Compare newer_mtime_option to its new initial value
9735         TYPE_MINIMUM (time_t) when deciding whether more than one
9736         threshold date was specified.
9737
9738 1999-07-20  Paul Eggert  <eggert@twinsun.com>
9739
9740         * NEWS, configure.in: Version 1.13.5.
9741
9742         * src/common.h (FATAL_ERROR): Invoke apply_delayed_set_stat
9743         before exiting.
9744         * src/buffer.c (new_volume): Likewise.
9745         * src/incremen.c (read_directory_file): Likewise.
9746         * src/tar.c (decode_options):
9747         ERROR ((TAREXIT_FAILURE, ... -> FATAL_ERROR ((0,
9748         for consistency.
9749
9750         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.4.
9751         * configure.in (AC_CHECK_FUNCS): Add lstat, readlink, symlink.
9752
9753         * src/system.h (lstat): Define only if !HAVE_LSTAT && !defined lstat.
9754         (S_ISMPB, S_ISMPC, S_ISNWK): Remove unused macros.
9755         (S_ISBLK, S_ISCHR, S_ISCTG, S_ISFIFO, S_ISLNK, S_ISSOCK):
9756         Define to 0 if the corresponding S_IF* macro is not defined.
9757         (mkfifo): Do not define if already defined, or if S_IFIFO
9758         is not defined.
9759
9760         * src/compare.c (diff_archive): Use HAVE_READLINK, not
9761         S_ISLNK, to determine whether to invoke readlink.
9762         * src/create.c (dump_file): Likewise.
9763
9764         * src/extract.c (set_mode):
9765         Do not chmod unless we are root or the -p option was given;
9766         this matches historical practice.
9767         (unlink_destination): New function, which checks for unlink failures.
9768         (maybe_recoverable): Stay quiet if -U.
9769         (extract_archive): Use O_EXCL if unlink_first_option.
9770         Report unlink failures.
9771         Use HAVE_SYMLINK, not S_ISLNK, to determine whether symlink exists.
9772         Use HAVE_MKFIFO || defined mkfifo, not S_ISFIFO, to determine whether
9773         mkfifo exists.
9774
9775         * src/incremen.c (get_directory_contents): Depend on
9776         S_ISHIDDEN, not AIX, to determine whether to invoke S_ISHIDDEN.
9777
9778         * src/list.c: Remove S_IS* ifdefs.
9779         * src/misc.c (maybe_backup_file): Likewise.
9780
9781         * src/misc.c (maybe_backup_file):
9782         "Virtual memory exhausted" -> "Memory exhausted",
9783         to conform to the other places this message is issued.
9784
9785         * src/mangle.c (extract_mangle):
9786         Replace #ifdef S_ISLNK with #ifdef HAVE_SYMLINK.
9787
9788         * src/rtapelib.c (rmt_open__):
9789         Remove typo that caused us to omit the first char
9790         of the basename.
9791
9792 1999-07-16  Paul Eggert  <eggert@twinsun.com>
9793
9794         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.13.3.
9795
9796         * doc/tar.texi: A path name is excluded if any of its file name
9797         components matches an excluded pattern, even if the path name was
9798         specified on the command line.
9799         * src/create.c (create_archive): Likewise.
9800         * src/list.c (read_and): Likewise.
9801         * src/update.c (update_archive): Likewise.
9802         * lib/exclude.h (excluded_pathname): New decl.
9803         * lib/exclude.c (_GNU_SOURCE): Define.
9804         (FILESYSTEM_PREFIX_LEN, ISSLASH): New macros.
9805         (excluded_filename_opts): New function.
9806         (excluded_pathname): New function.
9807
9808         * lib/Makefile.am (EXTRA_DIST):
9809         xstrtol.c moved here from libtar_a_SOURCES.
9810         (libtar_a_SOURCES): Move xstrtol.c to EXTRA_DIST.
9811         Remove xstrtoul.c; no longer needed.
9812         * lib/xstrtol.c: Remove.
9813
9814         * src/tar.c (decode_options):
9815         Set newer_time_option to TYPE_MINIMUM, so that
9816         negative timestamps are handled correctly.
9817         Replace invocations of xstrtol and xstrtoul with xstrtoumax, for
9818         uniformity (and so that we don't need to have the other fns).
9819         (main): Remove call to init_total_written; no longer needed.
9820
9821         * configure.in (AC_CHECK_SIZEOF): Remove no-longer-needed
9822         checks for unsigned long and long long.
9823         * src/arith.c: Remove.
9824         * src/Makefile.am (tar_SOURCES): Remove arith.c.
9825         * po/POTFILES.in: Remove src/arith.c.
9826         * src/arith.h: Use double, to simplify configuration gotchas.
9827         (tarlong): Now double.
9828         (TARLONG_FORMAT): New macro.
9829         (BITS_PER_BYTE, BITS_PER_TARLONG, SUPERDIGIT, BITS_PER_SUPERDIGIT,
9830         LONGS_PER_TARLONG, SIZEOF_TARLONG, struct tarlong,
9831         zerop_tarlong_helper, lessp_tarlong_helper, clear_tarlong_helper,
9832         add_to_tarlong_helper, mult_tarlong_helper, print_tarlong_helper,
9833         zerop_tarlong, lessp_tarlong, clear_tarlong, add_to_tarlong,
9834         mult_tarlong, print_tarlong): Remove.  All callers replaced with
9835         arithmetic ops.
9836
9837         * src/common.h (init_total_written): Remove decl.
9838
9839         * src/buffer.c (total_written):
9840         Remove; replaced with prev_written + bytes_written.
9841         (prev_written): New var.
9842         (init_total_written): Remove.
9843         (print_total_written): Use TARLONG_FORMAT instead of print_tarlong.
9844
9845         * m4/ulonglong.m4 (jm_AC_TYPE_UNSIGNED_LONG_LONG):
9846         Make sure that we can shift, multiply
9847         and divide unsigned long long values; Ultrix cc can't do it.
9848
9849         * lib/modechange.c (mode_compile): Use uintmax_t, not unsigned long.
9850         Check for any unknown bits, not just unknown bits left of the leftmost
9851         known bit.
9852
9853         * lib/quotearg.c (quotearg_buffer):
9854         Don't quote spaces if C quoting style.
9855         * src/list.c (from_oct):
9856         Use C quoting style for error; omit trailing NULs.
9857
9858 1999-07-14  Paul Eggert  <eggert@twinsun.com>
9859
9860         * configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.2.
9861
9862         * m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX): Check whether
9863         <inttypes.h> defines strtoumax as a macro (and not as a function).
9864         HP-UX 10.20 does this.
9865
9866         * src/tar.c (usage): tar-bugs@gnu.org -> bug-tar@gnu.org
9867         * PORTS, README, TODO, doc/tar.texi: Likewise.
9868
9869 1999-07-12  Paul Eggert  <eggert@twinsun.com>
9870
9871         * configure.in (AM_INIT_AUTOMAKE): Version 1.13.1.
9872         (LIBOBJS): Add mktime.o to automake 1.4 bug workaround.
9873
9874         * src/list.c (decode_header):
9875         Do not assume that S_IFBLK and S_IFCHR are defined.
9876
9877         * src/create.c (start_header): Do not assume S_IFMT is defined.
9878         (dump_file): Remove unnecessary check for screwy apollo lossage.
9879         Do not assume S_IFBLK and S_IFCHR are defined.
9880
9881         * src/extract.c (extract_archive):
9882         Test whether S_IFCHR and S_IFBLK are nonzero,
9883         not whether they are defined, for consistency with other tests.
9884
9885         * src/buffer.c (is_regular_file):
9886         Don't succeed on files that we can't access due to
9887         permissions problems.
9888         (open_archive): Fix wording on fatal error message.
9889         Don't bother to stat /dev/null if the archive is not a character
9890         special device.
9891
9892         * src/compare.c (process_rawdata, diff_sparse_files, diff_archive):
9893         Report an error, not a warning, for I/O errors.
9894         (process_rawdata, process_dumpdir, diff_sparse_files):
9895         Change ungrammatical "Data differs" to "Contents differ".
9896         (get_stat_data): Find hidden files on AIX.
9897         Accept file name as argument; all uses changed.
9898         (get_stat_data, diff_archive): Use system error message for
9899         nonexistent files rather than rolling our own.
9900         (diff_archive): Unknown file types are errors, not warnings.
9901         Normalize spelling of message to "File type differs".
9902         Use get_stat_data to get link status, for consistency.
9903         Do not inspect st_rdev for fifos.
9904         Do not assume st_mode values contain only file types and mode bits.
9905         Check for mode changes and device number changes separately.
9906
9907         * src/update.c (append_file):
9908         Open the file before statting it, to avoid a race.
9909         Complain about file shrinkage only when we reach EOF.
9910
9911 1999-07-08  Paul Eggert  <eggert@twinsun.com>
9912
9913         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13 released.
9914
9915         * configure.in (AC_EXEEXT): Add.
9916
9917         * lib/Makefile.am (noinst_HEADERS):
9918         Add basename.h, exclude.h.  Remove full-write.h.
9919         (libtar_a_SOURCES): Add exclude.c.
9920
9921         * lib/basename.h, lib/exclude.c, lib/exclude.h, lib/safe-read.h:
9922         New files.
9923         * lib/full-write.c: Include safe-read.h instead of full-write.h.
9924         * lib/safe-read.h (safe_read): New decl.
9925         * src/rmt.c: Include safe-read.h.
9926         * src/rtapelib.c: Include basename.h, save-read.h.
9927         (rmt_open__): Use base_name to compute base name.
9928
9929         * src/common.h:
9930         Include basename.h, exclude.h; don't include full-write.h.
9931         (exclude_option): Remove decl.
9932         (excluded): New decl.
9933         (add_exclude, add_exclude_file, check_exclude): Remove decls.
9934
9935         * src/list.c (read_and):
9936         Use excluded_filename instead of check_exclude.
9937         Check base name of incoming file name, not entire file name, when
9938         deciding whether to exclude it.
9939
9940         * src/create.c (finish_sparse_file):
9941         Use excluded_filename instead of check_exclude.
9942         Don't bother to stat excluded file names.
9943         * src/incremen.c (get_directory_contents): Likewise.
9944
9945         * src/names.c (exclude_pool, exclude_pool_size,
9946         allocated_exclude_pool_size, simple_exclude_array,
9947         simple_excludes, allocated_simple_excludes,
9948         pattern_exclude_array, pattern_excludes,
9949         allocated_pattern_excludes, add_exclude, add_exclude_file,
9950         check_exclude):
9951         Remove; now done in ../lib/exclude.c.
9952
9953         * src/tar.c (decode_options): Initialize `excluded'.
9954         Use new add_exclude_file and add_exclude functions.
9955
9956 1999-07-05  Paul Eggert  <eggert@twinsun.com>
9957
9958         * m4/gettext.m4: Use changequote rather than [[ ]].
9959
9960         * lib/safe-read.c: Renamed from lib/full-read.c.
9961         (safe_read): Renamed from full_read.  All uses changed.
9962         * lib/safe-read.h, lib/full-write.h: New files.
9963         * lib/Makefile.am (noinst_HEADERS): Add full-write.h, safe-read.h.
9964         (libtar_a_SOURCES): Rename full-read.c to safe-read.c.
9965         * lib/full-write.c: Include full-write.h.
9966         * src/common.h: Include full-write.h, safe-read.h.
9967         * src/system.h: (full_read, full_write): Remove decls.
9968
9969         * src/Makefile.am (datadir): New var; needed for Solaris gettext.
9970
9971         * src/system.h (bindtextdomain, textdomain): undef before
9972         defining, to avoid preprocessor warnings with --disable-nls
9973         on hosts whose locale.h includes libintl.h.
9974
9975         * lib/xstrtol.c (__strtol): Remove decl; it doesn't work if __strtol
9976         expands to a macro, which occurs in HP-UX 10.20 with strtoumax.
9977         (strtol, strtoul): New decls (for pre-ANSI hosts), to replace
9978         the above decl.
9979
9980 1999-07-02  Paul Eggert  <eggert@twinsun.com>
9981
9982         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/mktime.m4.
9983         * m4/mktime.m4: New file.
9984         * m4/Makefile.am.in, m4/README: Remove these files.
9985         * m4/Makefile.am (EXTRA_DIST): Add mktime.m4;
9986         remove README, Makefile.am.in.
9987         (Makefile.am): Remove rule; it didn't work in BSD/OS 4.0.
9988         * m4/jm-mktime.m4 (jm_FUNC_MKTIME): Invoke AC_FUNC_MKTIME,
9989         not AM_FUNC_MKTIME.
9990
9991         * src/tar.c: Include signal.h.
9992         (SIGCHLD): Define to SIGCLD if SIGCLD is defined but SIGCHLD is not.
9993         (main): Ensure SIGCHLD is not ignored.
9994
9995         (BACKUP_OPTION, DELETE_OPTION, EXCLUDE_OPTION, GROUP_OPTION,
9996         MODE_OPTION, NEWER_MTIME_OPTION, NO_RECURSE_OPTION, NULL_OPTION,
9997         OWNER_OPTION, POSIX_OPTION, PRESERVE_OPTION, RECORD_SIZE_OPTION,
9998         RSH_COMMAND_OPTION, SUFFIX_OPTION, USE_COMPRESS_PROGRAM_OPTION,
9999         VOLNO_FILE_OPTION, OBSOLETE_ABSOLUTE_NAMES,
10000         OBSOLETE_BLOCK_COMPRESS, OBSOLETE_BLOCKING_FACTOR,
10001         OBSOLETE_BLOCK_NUMBER, OBSOLETE_READ_FULL_RECORDS, OBSOLETE_TOUCH,
10002         OBSOLETE_VERSION_CONTROL): Make sure they can't be valid chars, so
10003         they don't overlap with char codes.  Use an enum instead of a lot
10004         of #defines.
10005
10006         * src/system.h (ISASCII): Remove.
10007         (CTYPE_DOMAIN, ISDIGIT, ISODIGIT, ISPRINT, ISSPACE, S_ISUID,
10008         S_ISGID, S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP,
10009         S_IROTH, S_IWOTH, S_IXOTH, MODE_WXUSR, MODE_R, MODE_RW,
10010         MODE_RWX, MODE_ALL, SEEK_SET, SEEK_CUR, SEEK_END, CHAR_MAX,
10011         LONG_MAX): New macros.
10012
10013         * src/incremen.c (ISDIGIT, ISSPACE): Remove; now in system.h.
10014         (read_directory_file): Cast ISSPACE arg to unsigned char.
10015         * src/misc.c (ISPRINT): Remove; now in system.h.
10016         (remove_any_file): Add brackets to pacify gcc -Wall.
10017         * src/list.c: Don't include <ctype.h>; system.h already does this.
10018         (ISODIGIT, ISSPACE): Remove; now in system.h.
10019         (decode_header): No need to AND mode with 07777; MODE_FROM_OCT
10020         does this now.
10021         (from_oct): Cast ISSPACE arg to unsigned char.
10022
10023         * src/create.c (mode_to_oct): Translate modes from internal to
10024         external form.
10025         * src/list.c (mode_from_oct): Translate modes from external to
10026         internal form.  Do not complain about unrecognized mode bits.
10027         * src/common.h (TSUID, TSGID, TSVTX, TUREAD, TUWRITE, TUEXEC,
10028         TGREAD, TGWRITE, TGEXEC, TOREAD, TOWRITE, TOEXEC): Remove undefs.
10029
10030         * src/extract.c: (extr_init, make_directories, extract_archive):
10031         Do not assume mode bits have traditional Unix values.
10032         * src/list.c (decode_mode): Likewise.
10033         * src/create.c (start_header, dump_file): Likewise.
10034         * src/buffer.c (child_open_for_compress,
10035         child_open_for_uncompress, open_archive, (close_archive): Likewise.
10036         * src/compare.c (diff_archive): Likewise.
10037
10038         * src/extract.c (set_mode): Use %04 not %0.4 format.
10039         (extract_sparse_file): Do not use data_block uninitialized.
10040         Check for lseek failures.
10041
10042         * src/rtapelib.c (rmt_lseek__):
10043         Convert lseek whence values to portable integers on the wire.
10044         * src/rmt.c (main): Likewise.  Check for whence values out of range.
10045
10046         * src/create.c (finish_sparse_file): Use lseek whence macros
10047         instead of integers.
10048         * src/buffer.c (backspace_output): Likewise.
10049         * src/compare.c (diff_archive, verify_volume): Likewise.
10050         * src/delete.c (move_archive): Likewise.
10051         * src/extract.c (extract_sparse_file): Likewise.
10052
10053         * src/create.c (dump_file): Do not invoke finish_sparse_file
10054         on a negative file descriptor.
10055
10056         * src/buffer.c: Add braces to pacify gcc -Wall.
10057
10058         * src/compare.c (diff_sparse_files): Report lseek errors.
10059
10060         * configure.in (ALL_LINGUAS): Add cs, es, ru.
10061
10062         * PORTS, TODO: gnu.ai.mit.edu -> gnu.org
10063
10064         * src/arith.c, src/buffer.c (new_volume): Don't put ^G in
10065         message to be internationalized; \a doesn't work with msgfmt.
10066
10067         * src/tar.c (long_options, main, usage, OPTION_STRING):
10068         Remove -E or --ending-file.
10069         * src/list.c (read_and): Likewise.
10070         * src/common.h (ending_file_option): Likewise.
10071         * src/buffer.c (close_archive): Likewise.
10072
10073         * tests/after: Don't run two commands together in a pipeline,
10074         as some old shells mishandle pipeline exit status.
10075
10076 1999-06-28  Paul Eggert  <eggert@twinsun.com>
10077
10078         * configure.in (AM_INIT_AUTOMAKE): version 1.12.64015.
10079         * NEWS: Describe changes since 1.12.
10080         * README: Update bug reporting address; move paxutils ref to NEWS.
10081
10082         Handle EINTR correctly.
10083         * lib/Makefile.am (libtar_a_SOURCES): Add full-read.c, full-write.c.
10084         * lib/full-read.c, lib/full-write.c: New files.
10085         * src/buffer.c (child_open_for_compress, child_open_for_uncompress):
10086         Prefer full_read to read and full_write to write.
10087         * src/compare.c (process_rawdata, diff_sparse_files): Likewise.
10088         * src/create.c (deal_with_sparse, finish_sparse_file, dump_file):
10089         Likewise.
10090         * src/extract.c (extract_sparse_file): Likewise.
10091         * src/rmt.c (get_string, main, report_error_message,
10092         report_numbered_error): Likewise.
10093         * src/rmt.h (rmtread, rmtwrite): Likewise.
10094         * src/rtapelib.c (do_command, get_status_string, rmt_read__,
10095         rmt_write__, rmt_ioctl__): Likewise.
10096         * src/update.c (append_file): Likewise.
10097         * src/system.h (full_read, full_write): New decls.
10098
10099         * po/POTFILES.in: Add lib/argmatch.c, lib/error.c lib/getopt.c,
10100         lib/xmalloc.c, src/arith.c, src/misc.c.
10101
10102         * src/system.h (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO):
10103         New macros.  All uses of STDIN and STDOUT changed.
10104         * src/rmt.c (prepare_record_buffer, main): Use STDIN_FILENO
10105         instead of 0 and STDOUT_FILENO instead of 1.
10106         * src/rtapelib.c (_rmt_rexec): Use STDIN_FILENO and STDOUT_FILENO
10107         instead of fileno (stdin) and fileno (stdout) or 0 and 1.
10108
10109         * src/rmt.c (private_strerror): Avoid const.  Translate results.
10110
10111         * tests/Makefile.am (TESTS): Remove incremen.sh; it doesn't work
10112         in the presence of NFS clock skew.
10113
10114 1999-06-25  Paul Eggert  <eggert@twinsun.com>
10115
10116         * configure.in (AM_INIT_AUTOMAKE): version 1.12.64014.
10117
10118         * src/buffer.c (write_archive_buffer): New function.
10119         (child_open_for_compress, flush_write, flush_read): Use it to write
10120         buffers.
10121         (open_archive): Report error if fstat of archive fails.
10122         Improve efficiency of check for /dev/null.
10123         Also, fix some corner cases with remote archives and /dev/null checking.
10124         (close_archive): Test for input fifo only if not remote.
10125         Truncate output archive only if it's not remote.
10126
10127         * src/misc.c (remove_any_file):
10128         Don't terminate if you see . or ..; just skip them.
10129
10130 1999-06-18  Paul Eggert  <eggert@twinsun.com>
10131
10132         * configure.in (AM_INIT_AUTOMAKE): version 1.12.64013.
10133
10134         Output sizes using a format that's more compatible with
10135         traditional tar (and with GNU Emacs).
10136         * src/common.h (GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT,
10137         MODE_TO_OCT, SIZE_TO_OCT, UID_TO_OCT, UINTMAX_TO_OCT):
10138         Don't subtract 1 from size.
10139         * src/create.c (to_oct): Prepend leading zeros, not spaces.
10140         Output a trailing NUL unless the value won't fit without it.
10141         (finish_header): No need to append NUL to chksum, now that
10142         to_oct is doing it.
10143
10144 1999-06-16  Paul Eggert  <eggert@twinsun.com>
10145
10146         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64012.
10147
10148         * src/Makefile.am (LDADD): Link libtar.a after @INTLLIBS@, since
10149         @INTLLIBS@ might invoke rpl_realloc.
10150
10151         * src/tar.c (backup_type): Remove decl; backupfile.h now has it.
10152         (intconv): Remove; use xstrto* fns instead.
10153         ("xstrtol.h"): Include.
10154         (check_decimal): Remove.
10155         (long_options, usage, OPTION_STRING, decode_options):
10156         Remove -y, --bzip2, --unbzip2.
10157         (decode_options): Use xget_version instead of get_version.
10158         Check for overflow with -b and -L and RECORD_SIZE_OPTION.
10159         Replace invocations of check_decimal  with xstrtoumax.
10160
10161         * tests/preset.in (echo_n, echo_c): Remove.
10162
10163         * tests/after: Don't rely on $echo_c and $echo_n.
10164
10165         * lib/addext.c, lib/dirname.c, lib/lchown.c, lib/lchown.h,
10166         lib/malloc.c, lib/mktime.c, lib/realloc.c, lib/strtol.c, lib/strtoul.c,
10167         lib/strtoull.c, lib/strtoumax.c, lib/utime.c, lib/xstrtol.c,
10168         lib/xstrtol.h, lib/xstrtoul.c, lib/xstrtoumax.c,
10169         m4/Makefile.am.in, m4/README, m4/ccstdc.m4, m4/d-ino.m4,
10170         m4/gettext.m4, m4/inttypes_h.m4, m4/isc-posix.m4,
10171         m4/jm-mktime.m4, m4/largefile.m4, m4/lcmessage.m4,
10172         m4/malloc.m4, m4/progtest.m4, m4/realloc.m4, m4/uintmax_t.m4,
10173         m4/ulonglong.m4, m4/utimbuf.m4, m4/utime.m4, m4/utimes.m4,
10174         m4/xstrtoumax.m4: New files.
10175
10176         * configure.in(fp_PROG_ECHO): Remove; no longer needed.
10177         (AC_SYS_LARGEFILE): Renamed from AC_LFS.
10178         (jm_AC_HEADER_INTTYPES_H): Replaces inline code.
10179         (jm_STRUCT_DIRENT_D_INO, jm_AC_TYPE_UINTMAX_T, jm_AC_PREREQ_XSTRTOUMAX): Add.
10180         (AC_CHECK_FUNCS): Remove lchown.
10181         (AC_REPLACE_FUNCS): Remove basename, dirname.
10182         Add lchown, strtol, strtoul.
10183         (jm_FUNC_MKTIME): Add.
10184         (LIBOBJS): Replace .o with $U.o, so that the .o files in LIBOBJS
10185         are also built via the ANSI2KNR-filtering rules.
10186         Use a no-op line to work around bug in automake 1.4 with malloc and
10187         realloc.
10188         (AC_OUTPUT): Add m4/Makefile.
10189
10190         * lib/Makefile.am (EXTRA_DIST):
10191         Add lchown.c, malloc.c, mktime.c, realloc.c,
10192         strtol.c, strtoul.c, strtoull.c, strtoumax.c, utime.c.
10193         (noinst_HEADERS): Add lchown.h, modechange.h, xstrtol.h.
10194         (libtar_a_SOURCES): Add addext.c, basename.c, xstrtol.c,
10195         xstrtoul.c, xstrtoumax.c.  Remove getversion.c.
10196         ($(srcdir)/getdate.c:): Remove `expect conflicts' line.
10197
10198         * src/system.h (uintmax_t): Don't declare; configure now does this.
10199
10200         * src/common.h (backup_type): New decl.
10201         * src/common.h, src/misc.c, src/tar.c:
10202         Move include of backupfile.h to common.h.
10203
10204         * src/misc.c (maybe_backup_file):
10205         Pass backup_type to find_backup_file_name.
10206
10207         * src/list.c (print_header): Change sizes of uform and gform from 11 to
10208         UINTMAX_STRSIZE_BOUND.
10209
10210         * doc/tar.texi: Remove --bzip2.
10211         Fix @xref typos reported by latest makeinfo.
10212
10213         * Makefile.am (ACLOCAL_AMFLAGS): New macro.
10214         (SUBDIRS): Add m4.
10215         (M4DIR, ACINCLUDE_INPUTS): New macros.
10216         ($(srcdir)/acinclude.m4): New rule.
10217
10218         * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT,
10219         HAVE_INTTYPES_H, HAVE_LC_MESSAGES, HAVE_STPCPY): Remve #undefs;
10220         now generated automatically by autoconf.
10221
10222 1999-05-15  Paul Eggert  <eggert@twinsun.com>
10223
10224         * doc/tar.texi: Remove -y.
10225
10226 1999-04-09  Paul Eggert  <eggert@twinsun.com>
10227
10228         * src/system.h (INT_STRLEN_BOUND): Fix off-by-factor-of-10 typo
10229         (we were allocating too much storage).
10230         (uintmax_t): Don't declare; configure now does this.
10231
10232         * ABOUT-NLS: Update to gettext 0.10.35 edition.
10233
10234 1999-03-22  Paul Eggert  <eggert@twinsun.com>
10235
10236         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64010
10237
10238         * acinclude.m4 (AC_LFS_FLAGS):
10239         Don't use -mabi=n32 with GCC on IRIX 6.2; it's the default.
10240         (AC_LFS): -n32, -o32, and -n64 are CPPFLAGS, not CFLAGS.
10241         (jm_FUNC_MALLOC, jm_FUNC_REALLOC): New macros.
10242
10243         * configure.in (jm_FUNC_MALLOC, jm_FUNC_REALLOC):
10244         New macros; needed for latest GNU xmalloc.c.
10245
10246         * Makefile.am (noinst_HEADERS): Add quotearg.h, xalloc.h.
10247         (libtar_a_SOURCES): Add quotearg.c.
10248         * list.c: Include <quotearg.h>.
10249         (from_oct): Add forward decl.
10250         (read_header): Return HEADER_FAILURE if we can't parse the checksum.
10251         (from_oct): Report an error only if TYPE is nonzero.
10252         Quote any funny characters in bad header.
10253
10254 1999-03-20  Paul Eggert  <eggert@twinsun.com>
10255
10256         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64009
10257
10258         * acinclude.m4 (AC_LFS_FLAGS): Add support for IRIX 6.2 and later.
10259         (AC_LFS_SPACE_APPEND): Assume $2 is quoted properly; all callers
10260         changed.
10261         (AC_LFS): Simplify AIX revision number test.
10262
10263 1999-03-17  Paul Eggert  <eggert@twinsun.com>
10264
10265         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64008
10266
10267         * configure.in (AC_VALIDATE_CACHED_SYSTEM_TUPLE):
10268         Remove; it doesn't work that well
10269         with AC_CANONICAL_HOST.
10270         (fp_WITH_INCLUDED_MALLOC): Remove; we'll just use the system malloc.
10271
10272         * Makefile.am (EXTRA_DIST): Remove AC-PATCHES, AM-PATCHES, BI-PATCHES.
10273
10274         * Makefile.am (EXTRA_DIST): Remove gmalloc.c.
10275
10276         * acinclude.m4 (fp_WITH_INCLUDED_MALLOC): Remove.
10277
10278         * tar.texi: Fix bug-report addr.
10279
10280         * README: Remove --with-included-malloc.
10281         Upgrade version numbers of build software.
10282
10283 1999-03-07  Paul Eggert  <eggert@twinsun.com>
10284
10285         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64007.
10286
10287         * acinclude.m4 (AM_WITH_NLS): Port to Solaris 2.5.1,
10288         where bindtextdomain and gettext require -lintl.
10289         (AC_LFS_FLAGS): Simplify so that it only gets the flags;
10290         `no' means it failed.
10291         (AC_LFS_SPACE_APPEND, AC_LFS_MACRO_VALUE): New macros.
10292         (AC_LFS): Use them.  Set _FILE_OFFSET_BITS, _LARGEFILE_SOURCE, and
10293         _LARGE_FILES from LFS_CFLAGS, so that in the normal case we don't need
10294         to add anything to the command line (it's all in config.h).
10295         Put any extra -D and -I options into CPPFLAGS, the rest into CFLAGS.
10296
10297 1999-03-01  Paul Eggert  <eggert@twinsun.com>
10298
10299         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64006.
10300
10301         * acinclude.m4 (AC_LFS_FLAGS): Port to AIX 4.2.
10302
10303         * src/list.c: (gid_from_oct, major_from_oct, minor_from_oct,
10304         mode_from_oct, off_from_oct, size_from_oct, time_from_oct,
10305         uid_from_oct, uintmax_from_oct): Use TYPE_MAXIMUM instead of macros
10306         like OFF_MAX, which are not reliable
10307         (e.g. OFF_MAX in AIX 4.2 is incorrect).
10308         * src/system.h (GID_MAX, MAJOR_MAX, MINOR_MAX, MODE_MAX, OFF_MAX,
10309         SIZE_MAX, TIME_MAX,UID_MAX, UINTMAX_MAX):  Remove; no longer used.
10310
10311         * src/incremen.c (get_directory_contents):
10312         Don't use statx if _LARGE_FILES; it doesn't work under AIX 4.2.
10313         Have statx depend on STX_HIDDEN, not AIX.
10314
10315         * src/create.c (to_oct):
10316         New parameter substitute, giving a substitute value to use
10317         when the original value is out of range.  Do not append a space to the
10318         output; modern tars don't.  When a value is out of range, specify the
10319         maximum value, not the number of bits.
10320         (GID_NOBODY, UID_NOBODY): New macros.
10321         (gid_to_oct, uid_to_oct): Use them as substitutes.
10322         (finish_header): Do not assume that UINTMAX_TO_OCT appends a space.
10323         (dump_file): Check whether the file changed as we read it.
10324
10325         * src/rmt.c (main): Remove suspicious AIX/386 code.
10326
10327 1999-02-19  Paul Eggert  <eggert@twinsun.com>
10328
10329         * intl/localealias.c (read_alias_file): Don't assume that memcpy
10330         returns a type compatible with char *; it doesn't on SunOS
10331         4.1.4 with Sun cc, since <string.h> doesn't declare memcpy.
10332
10333         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64005.
10334
10335         * src/tar.c (long_options, usage): Prefer --unbzip2 to --bunzip2.
10336         * doc/tar.texi: Add --bzip2, --unbzip2 options.
10337
10338         * configure.in (AC_CANONICAL_HOST, AC_VALIDATE_CACHED_SYSTEM_TUPLE):
10339         Add.
10340         (AC_LINK_FILES): Omit; AM_GNU_GETTEXT now does this.
10341         (AC_OUTPUT): Omit munging of po/Makefile; AM_GNU_GETTEXT now does this.
10342         * acinclude.m4 (AM_WITH_NLS):
10343         Update to latest gettext version (serial 5).
10344         (AC_LFS_FLAGS): New macro
10345         (AC_LFS): Use it.  Append to CFLAGS, LDFLAGS, LDLIBS instead of
10346         working only with unset variables.  Append to CFLAGS, not CPPFLAGS.
10347         Work properly in cross-compilation scenario, by checking for getconf
10348         with AC_CHECK_TOOL and by ditching uname in favor of
10349         AC_CANONICAL_HOST and $host_os.  Add --disable-lfs option.
10350
10351         * lib/getdate.y: Update to fileutils 4.0 getdate.y, with one patch:
10352         replace FORCE_ALLOCA_H with HAVE_ALLOCA_H.
10353         * lib/Makefile.am (AUTOMAKE_OPTIONS): Append ../src/ansi2knr,
10354         since getdate.y now uses ANSI code.
10355
10356         * config.guess, config.sub: New files; taken from automake 1.4.
10357
10358         * intl/Makefile.in, intl/VERSION, intl/bindtextdom.c,
10359         intl/cat-compat.c, intl/dcgettext.c, intl/dgettext.c,
10360         intl/explodename.c, intl/finddomain.c, intl/gettext.c,
10361         intl/gettext.h, intl/gettextP.h, intl/hash-string.h,
10362         intl/l10nflist.c, intl/libgettext.h, intl/loadinfo.h,
10363         intl/loadmsgcat.c, intl/localealias.c, intl/textdomain.c:
10364         Update to GNU gettext 0.10.35, with patches as per GCC snapshot 990109.
10365
10366 1999-02-01  Paul Eggert  <eggert@twinsun.com>
10367
10368         * src/tar.c: Update copyright.
10369
10370         * NEWS: 1.12.64004
10371
10372 1999-02-01  Paul Eggert  <eggert@twinsun.com>
10373
10374         * NEWS, configure.in: Version 1.12.64004
10375
10376         * configure.in (AC_LFS): Use this macro, instead of open-coding it.
10377
10378         * acinclude.m4 (AC_LFS, AM_PROG_CC_STDC): New macros.
10379
10380         * src/extract.c (extract_archive): Fix bug when extracting sparse
10381         files: they were trashing the tar file header.
10382
10383         * src/tar.c: (long_options, usage, OPTION_STRING, decode_options):
10384         Add -y or --bzip2 or --bunzip2 option.
10385
10386 1999-01-30  Paul Eggert  <eggert@twinsun.com>
10387
10388         * src/names.c (cached_no_such_uname, cached_no_such_gname,
10389         cached_no_such_uid, cached_no_such_gid): New vars.
10390         (uid_to_uname, gid_to_gname, uname_to_uid, gname_to_gid):
10391         Cache failures, too.
10392
10393         * src/tar.c (decode_options):
10394         Don't pass names longer than UNAME_FIELD_SIZE to
10395         uname_to_uid, as it messes up the cache.  Similarly for gname_to_uid.
10396
10397 1999-01-27  Paul Eggert  <eggert@twinsun.com>
10398
10399         * NEWS, configure.in: Version 1.12.64003
10400
10401         * src/buffer.c (backspace_output, close_archive):  Cast
10402         rmtlseek position arg to off_t, for benefit of K&R compilers
10403         with long long.
10404         * src/compare.c (verify_volume): Likewise.
10405
10406         * NEWS, configure.in: Version 1.12.64002
10407
10408         * src/create.c (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct,
10409         off_to_oct, size_to_oct, time_to_oct, uid_to_oct):
10410         Cast arg to uintmax_t for benefit of pre-ANSI compilers with long long.
10411         * src/list.c: (gid_from_oct, major_from_oct, minor_from_oct,
10412         mode_from_oct, off_from_oct, size_from_oct, time_from_oct,
10413         uid_from_oct): Likewise.
10414
10415 1999-01-25  Paul Eggert  <eggert@twinsun.com>
10416
10417         * incremen.sh: Fix timing bug in regression test.
10418
10419 1999-01-22  Paul Eggert  <eggert@twinsun.com>
10420
10421         * NEWS, configure.in: Update version
10422
10423         * Makefile.am (localedir): Change to $(datadir)/locale.
10424         (DEFS): New macro, defining LOCALEDIR.
10425         (tar.o, tar._o, rmt.o, rmt._o): Remove.
10426         (INCLUDES): Add -I..
10427
10428         * Makefile.am (localedir): Change to $(datadir)/locale.
10429
10430 1999-01-21  Paul Eggert  <eggert@twinsun.com>
10431
10432         * NEWS, README, configure.in: Unofficial version 1.12.64001.
10433
10434         * tests/Makefile.am (localedir): Change to $(datadir)/locale.
10435         * src/Makefile.am (localedir): Likewise.
10436         (DEFS): New macro, defining LOCALEDIR.
10437         (tar.o, tar._o, rmt.o, rmt._o): Remove.
10438         (INCLUDES): Add `-I..'.
10439
10440         * tests/incremen.sh: Fix timing bug.
10441
10442 1999-01-20  Paul Eggert  <eggert@twinsun.com>
10443
10444         * NEWS, README, configure.in: Unofficial version 1.12.64000.
10445         `lfs.7' changed to `64000' in version number
10446         to conform to gnits standards.
10447
10448         * COPYING, INSTALL, doc/texinfo.tex, install-sh, missing,
10449         mkinstalldirs, ansi2knr.c: Update to latest public versions.
10450
10451         Rebuild with automake 1.4 and autoconf 2.13, to work around some
10452         porting problems.
10453
10454 1998-12-07  Paul Eggert  <eggert@twinsun.com>
10455
10456         * NEWS, README, configure.in: Unofficial version 1.12.lfs.6.
10457
10458         * src/list.c (read_header):
10459         Accept file names as specified by POSIX.1-1996 section 10.1.1.
10460
10461 1998-11-30  Paul Eggert  <eggert@twinsun.com>
10462
10463         * configure.in: Quote the output of uname.
10464
10465         * src/extract.c (set_stat): chmod after chown even when not root;
10466         if we are using --same-owner this is needed e.g. on Solaris 2.5.1.
10467
10468 1998-11-15  Paul Eggert  <eggert@twinsun.com>
10469
10470         * NEWS, README, configure.in: Unofficial version 1.12.lfs.5.
10471
10472         * configure.in (ac_test_CPPFLAGS, ac_test_LDFLAGS, ac_test_LIBS,
10473         ac_getconfs, ac_result): Special case for HP-UX 10.20 or later.
10474
10475 1998-10-28  Paul Eggert  <eggert@twinsun.com>
10476
10477         * NEWS, README, configure.in: Unofficial version 1.12.lfs.4.
10478
10479         * src/system.h (voidstar): Use void * if __STDC__ is defined,
10480         not merely nonzero.
10481
10482         * src/rtapelib.c: Don't use rexec code unless compiled with WITH_REXEC.
10483         On many installations, rexec is disabled.
10484
10485 1998-08-07  Paul Eggert  <eggert@twinsun.com>
10486
10487         * NEWS, README, configure.in: Unofficial version 1.12.lfs.3.
10488
10489         * src/names.c (uid_to_uname, gid_to_gname): Don't used cached name
10490         for nameless users and groups.
10491
10492 1998-02-17  Paul Eggert  <eggert@twinsun.com>
10493
10494         * NEWS, README, configure.in: Unofficial version 1.12.lfs.2.
10495         * NEWS, README: Add explanation of why this isn't an official version.
10496
10497 1998-02-02  Paul Eggert  <eggert@twinsun.com>
10498
10499         * NEWS, README, configure.in: Unofficial version 1.12.lfs.1.
10500         This is an unofficial version.
10501
10502 1997-12-17  Paul Eggert  <eggert@twinsun.com>
10503
10504         * src/incremen.c (ST_DEV_MSB): New macro.
10505         (NFS_FILE_STAT): Use most significant bit of st_dev,
10506         even if it's unsigned.
10507
10508 1997-12-08  Paul Eggert  <eggert@twinsun.com>
10509
10510         * src/system.h (ST_NBLOCKS): Fix typo in definition.
10511
10512 1997-11-19  Paul Eggert  <eggert@twinsun.com>
10513
10514         * configure.in (HAVE_INTTYPES_H):
10515         Don't ignore cache variable if it's already set.
10516
10517 1997-11-10  Paul Eggert  <eggert@twinsun.com>
10518
10519         * src/rmt.c (main): Don't assume mt_count is of type daddr_t.
10520         * src/delete.c (records_read): Now off_t.
10521         (move_archive): Don't assume mt_count is of type daddr_t.
10522
10523 1997-10-30  Paul Eggert  <eggert@twinsun.com>
10524
10525         * configure.in (CPPFLAGS, LDFLAGS, LIBS):
10526         Set to appropriate values if large file support
10527         needs explicit enabling.
10528         (HAVE_INTTYPES_H, HAVE_ST_FSTYPE_STRING, daddr_t, major_t, minor_t,
10529         ssize_t):
10530         New macros to configure.
10531         (AC_TYPE_MODE_T, AC_TYPE_PID_T, AC_TYPE_OFF_T): Add.
10532
10533         * acconfig.h (daddr_t, HAVE_INTTYPES_H, HAVE_ST_FSTYPE_STRING,
10534         major_t, minor_t, ssize_t): New macros.
10535
10536         * src/arith.h (TARLONG_FORMAT):
10537         Fix typo: %uld -> %lu.  Use unsigned when long long
10538         (%lld -> %llu).
10539         (add_to_tarlong_helper, mult_tarlong_helper): 2nd arg is now unsigned long.
10540         (add_to_tarlong, mult_tarlong): Cast 2nd arg to unsigned long.
10541
10542         * src/arith.c (add_to_tarlong_helper, mult_tarlong_helper):
10543         2nd arg is now unsigned long.
10544
10545         * src/rmt.c (allocated_size): Now size_t, and now initialized to 0.
10546         (prepare_record_buffer): Arg is now size_t.
10547         Remove now-useless casts.
10548
10549         (main): Use `long' for status, so that it can store ssize_t.
10550         Use daddr_t, mode_t, size_t, off_t when appropriate.
10551         Convert daddr_t and off_t values ourselves, since they might be longer
10552         than long.  Convert other types using `long' primitives.
10553         When processing MTIOCTOP, do not try to pass resulting
10554         count back, since it won't work (it could be too large) and it's
10555         not expected anyway.
10556
10557         * src/update.c:
10558         (append_file) Use off_t, size_t, ssize_t when appropriate.  Remove
10559         now-useless casts.  Use unsigned long to print *_t types, except use
10560         STRINGIFY_BIGINT for off_t.
10561         (update_archive): Cast -1 to dev_t when necessary.
10562
10563         * src/tar.c (check_decimal):
10564         Now returns 1 if successful, 0 otherwise, and returns
10565         uintmax_t value into new arg.  Check for arithmetic overflow.
10566         (decode_options): Avoid overflow if record_size fits in size_t but not int.
10567         Check for overflow on user or group ids.
10568
10569         * src/compare.c (diff_init, process_rawdata, read_and_process,
10570         diff_sparse_files, diff_archive):
10571         Use off_t, pid_t, size_t, ssize_t when appropriate.
10572         Remove now-useless casts.  Use unsigned long to print *_t types,
10573         except use STRINGIFY_BIGINT for off_t.
10574
10575         (process_noop, process_rawdata, process_dumpdir, read_and_process):
10576         Size arg is now size_t.
10577
10578         (diff_sparse_files): Arg is now off_t.  Check for size_t overflow
10579         when allocating buffer.
10580
10581         * src/rtapelib.c:
10582         (do_command, rmt_open__, rmt_read__, rmt_lseek__, rmt_ioctl__):
10583         Use pid_t, size_t, ssize_t when appropriate.  Remove now-useless casts.
10584         Use unsigned long to print *_t types, except use STRINGIFY_BIGINT for
10585         off_t.
10586
10587         (get_status_string, get_status_off): New function.
10588         (get_status): Now returns long, so that it can store ssize_t.
10589         Invoke get_status_string to do the real work.
10590         (rmt_read__, rmt_write__): Now returns ssize_t. Size arg is now size_t.
10591         (rmt_lseek__): Now returns off_t, using new get_status_off function.
10592         (rmt_ioctl__): Convert mt_count by hand,
10593         since it might be longer than long.
10594
10595         * src/mangle.c (extract_mangle):
10596         Check for overflow when converting off_t to size_t.
10597         Use off_t, size_t when appropriate.  Remove now-useless casts.
10598
10599         * src/system.h (mode_t): Remove; now done by autoconf.
10600         (ST_NBLOCKS): Do not overflow if st_size is near maximum.
10601         Return number of ST_NBLOCKSIZE-byte blocks,
10602         not number of 512-byte blocks;
10603         this also helps to avoid overflow.
10604         (st_blocks): Declare if needed.
10605         (ST_NBLOCKSIZE): New macro.
10606         (<limits.h>, <inttypes.h>): Include if available.
10607         (CHAR_BIT): New macro.
10608         (uintmax_t): New typedef.
10609         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_STRLEN_BOUND,
10610         UINTMAX_STRSIZE_BOUND, GID_MAX, MAJOR_MAX, MINOR_MAX, MODE_MAX,
10611         OFF_MAX, SIZE_MAX, TIME_MAX, UID_MAX, UINTMAX_MAX): New macros.
10612
10613         * src/names.c (name_init):
10614         Fix typo in error message: FILE* was passed, but char*
10615         was wanted.
10616
10617         (read_name_from_file, name_gather, addname, name_match, name_scan,
10618         add_exclude): Use size_t when appropriate.  Remove now-useless casts.
10619
10620         (exclude_pool_size, allocated_exclude_pool_size): Now size_t.
10621
10622         * src/extract.c (newdir_umask, current_umask): Now mode_t.
10623         (extract_sparse_file): Args now use off_t.
10624
10625         (set_mode, set_stat, make_directories, extract_sparse_file,
10626         extract_archive): Use off_t, size_t, ssize_t when appropriate.  Remove
10627         now-useless casts.  Use unsigned long to print *_t types, except use
10628         STRINGIFY_BIGINT for off_t.
10629
10630         * src/misc.c (quote_copy_string):
10631         Use size_t when appropriate.  Remove now-useless casts.
10632
10633         * src/list.c (read_and, list_archive, read_header, decode_mode,
10634         print_header, print_for_mkdir):
10635         Use mode_t, off_t, size_t when appropriate.  Remove
10636         now-useless casts.  Use unsigned long to print *_t types, except use
10637         STRINGIFY_BIGINT for off_t.
10638
10639         (read_header): Check for overflow when converting header size.
10640
10641         (from_oct): Now static.  Now returns uintmax_t.  `where' arg is now
10642         const char *.  Size arg is now size_t.  Now takes new type and maxval
10643         args.  Compute result using uintmax_t, not long.  Report error if
10644         field does not contain octal number in range.
10645         (gid_from_oct, major_from_oct, minor_from_oct, mode_from_oct,
10646         off_from_oct, size_from_oct, time_from_oct, uid_from_oct,
10647         uintmax_from_oct): New functions.
10648
10649         (stringify_uintmax_t_backwards): New function.
10650
10651         (decode_mode, print_for_mkdir): Mode arg is now mode_t.
10652         (skip_file): Offset arg is now off_t.
10653
10654         * src/buffer.c (record_start_block, save_totsize, save_sizeleft,
10655         real_s_totsize, real_s_sizeleft, current_block_ordinal):
10656         Now off_t.
10657         (write_error): Arg is now ssize_t.
10658         (child_pid): Now pid_t.
10659         (available_space_after): Now size_t.
10660
10661         (child_open_for_compress, child_open_for_uncompress, flush_write,
10662         open_archive, flush_write, write_error, flush_read, close_archive):
10663         Use pid_t, ssize_t, size_t when appropriate.  Remove now-useless
10664         casts.  Use unsigned long to print *_t types, except use
10665         STRINGIFY_BIGINT for off_t.
10666
10667         * src/delete.c (records_read): Now daddr_t.
10668         (move_archive): Arg is now daddr_t.  Check for overflow when
10669         computing offset.
10670         (move_archive, delete_archive_members): Use daddr_t, off_t when
10671         appropriate.  Remove now-useless casts.
10672
10673         * src/rmt.h (rmt_read__, rmt_write__): Now returns ssize_t.
10674         (rmt_lseek): Now returns off_t.
10675
10676         * src/create.c (to_oct):
10677         Now static.  Value arg is now uintmax_t.  Accept new args
10678         giving name of type of octal field, for error messages.  Report an
10679         error if the value is too large to fit in the field.
10680         (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct, off_to_oct,
10681         size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct): New functions.
10682
10683         (write_eot, write_long, finish_header, deal_with_sparse,
10684         finish_sparse_file, dump_file): Use dev_t, off_t, ssize_t, size_t when
10685         appropriate.  Remove now-useless casts.  Use unsigned long to print
10686         *_t types, except use STRINGIFY_BIGINT for off_t.
10687
10688         (find_new_file_size): 1st arg is now off_t*.
10689         (finish_sparse_file): Args now use off_t, not long.
10690         Check for lseek error.
10691         (create_archive, dump_file): Cast -1 to dev_t when necessary.
10692         (dump_file): Device arg is now dev_t.
10693         Avoid overflow when testing whether file has holes
10694         by using the new ST_NBLOCKSIZE macro.
10695
10696         * src/incremen.c (struct accumulator, add_to_accumulator,
10697         get_directory_contents, add_hierarchy_to_namelist, gnu_restore):
10698         Use size_t for sizes.
10699         (struct directory, get_directory_contents, add_hierarchy_to_namelist):
10700         Use dev_t, ino_t for devices and inodes.
10701         (gnu_restore): Use off_t for file offsets.
10702         (struct directory): Use char for flags.  Add new flag `nfs'.
10703         (nfs): New constant
10704         (NFS_FILE_STAT): New macro.
10705         (note_directory): Accept struct stat * instead of
10706         device and inode number.  All callers changed.
10707         (note_directory, get_directory_contents):
10708         Use NFS_FILE_STAT to determine whether directory is an NFS directory.
10709         (write_dir_file): Cast time_t to unsigned long before printing as %lu.
10710
10711         * src/common.h (record_size, struct name, struct sp_array,
10712         available_space_after):
10713         Use size_t for sizes.
10714         (save_sizeleft, save_totsize, current_block_ordinal, skip_file):
10715         Use off_t for file offsets.
10716         (struct name): dir_contents is now const char *, not char *.
10717         (dump_file, get_directory_contents): Use dev_t for devices.
10718         (to_oct): Remove decl.
10719         (GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT, MODE_TO_OCT, SIZE_TO_OCT,
10720         UID_TO_OCT, UINTMAX_TO_OCT, OFF_TO_OCT, TIME_TO_OCT, STRINGIFY_BIGINT,
10721         GID_FROM_OCT, MAJOR_FROM_OCT, MINOR_FROM_OCT, MODE_FROM_OCT,
10722         OFF_FROM_OCT, SIZE_FROM_OCT, TIME_FROM_OCT, UID_FROM_OCT,
10723         UINTMAX_FROM_OCT): New macros.
10724         (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct, off_to_oct,
10725         size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct,
10726         stringify_uintmax_t_backwards, gid_from_oct, major_from_oct,
10727         minor_from_oct, mode_from_oct, off_from_oct, size_from_oct,
10728         time_from_oct, uid_from_oct, uintmax_from_oct): New decls.
10729         (print_for_mkdir): 2nd arg is now mode_t.
10730
10731         -----
10732
10733         See ChangeLog.1 for earlier changes.
10734
10735         -----
10736
10737         Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007
10738         Free Software Foundation, Inc.
10739
10740         This file is part of GNU tar.
10741
10742         GNU tar is free software; you can redistribute it and/or modify
10743         it under the terms of the GNU General Public License as published by
10744         the Free Software Foundation; either version 3, or (at your option)
10745         any later version.
10746
10747         GNU tar is distributed in the hope that it will be useful,
10748         but WITHOUT ANY WARRANTY; without even the implied warranty of
10749         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10750         GNU General Public License for more details.
10751
10752         You should have received a copy of the GNU General Public License
10753         along with GNU tar; see the file COPYING.  If not, write to
10754         the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
10755         Boston, MA 02110-1301, USA.
10756 \f
10757 Local Variables:
10758 mode: change-log
10759 version-control: never
10760 buffer-read-only: t
10761 End: