Elide non-DFSG compliant upstream components
[debian/tar] / ChangeLog
1 2011-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>
2
3         Version 1.26
4         * NEWS, configure.ac: Update.
5         * po/POTFILES.in: Remove paxexit.c (see bb971a1e).
6
7 2011-03-08  Paul Eggert  <eggert@cs.ucla.edu>
8
9         --atime-preserve=replace: fix correctness and performance bugs
10         reported by Eric Blake in
11         <http://lists.gnu.org/archive/html/bug-tar/2011-03/msg00000.html>.
12         * src/compare.c (diff_file): Do not restore atime of size-zero
13         files.
14         * src/create.c (dump_file0): Likewise.  Also, do not restore atime
15         when fd is zero, because that indicates a file we haven't opened.
16
17 2011-02-23  Paul Eggert  <eggert@cs.ucla.edu>
18
19         * doc/tar.texi: Adjust example commands and output for accuracy.
20         The original problem was reported by Michael Witten in
21         <http://lists.gnu.org/archive/html/bug-tar/2011-02/msg00033.html>.
22
23 2011-02-16  Paul Eggert  <eggert@cs.ucla.edu>
24
25         tar: if (p) free (p); -> free (p);
26         There is no longer (since SunOS 4) any need to guard against
27         free (NULL), so replace each "if (p) free (p);" with "free (p);".
28         From Jim Meyering in
29         <http://lists.gnu.org/archive/html/bug-tar/2011-01/msg00026.html>.
30         * src/incremen.c (scan_directory, read_directory_file): As above.
31         (try_purge_directory): Likewise.
32         * src/list.c (read_header): Likewise.
33         * src/misc.c (assign_string): Likewise.
34
35 2010-12-14  Sergey Poznyakoff  <gray@gnu.org.ua>
36
37         Correctly store long sparse file names in PAX archives.
38         * src/sparse.c (pax_dump_header_1): Make sure the created header
39         name is
40         shorter than NAME_FIELD_SIZE bytes.
41         * tests/sparse04.at: New testcase.
42         * tests/Makefile.am (TESTSUITE_AT): Add sparse04.at.
43         * tests/testsuite.at: Include sparse04.at.
44         * NEWS: Update.
45
46 2010-12-07  Paul Eggert  <eggert@cs.ucla.edu>
47
48         tests: make the truncate test smaller and less buggy (tiny change)
49         Reported by Solar Designer in
50         <http://lists.gnu.org/archive/html/bug-tar/2010-12/msg00003.html>.
51         * tests/truncate.at: Use a smaller test case, and make its
52         race condition less likely.
53
54 2010-11-27  Paul Eggert  <eggert@cs.ucla.edu>
55
56         tests: skip SIGPIPE-dependent tests in environments ignoring
57         SIGPIPE
58         Problem reported by Sven Joachim in
59         <http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00043.html>.
60         * tests/remfiles01.at: Use AT_SIGPIPE_PREREQ.
61         * tests/sigpipe.at: Likewise.
62         * tests/testsuite.at (AT_SIGPIPE_PREREQ): New macro.
63
64 2010-11-25  Paul Eggert  <eggert@cs.ucla.edu>
65
66         tar: work around NetBSD and Tru64 symlink incompatibility
67         with POSIX
68         Problem reported by Bruno Haible in
69         <http://lists.gnu.org/archive/html/bug-gnulib/2010-11/msg00306.html>.
70         * src/extract.c (maybe_recoverable):  Also treat EFTYPE (if
71         defined)
72         and ENOTSUP like ELOOP.
73
74 2010-11-24  Paul Eggert  <eggert@cs.ucla.edu>
75
76         tar: adjust to paxutils change: paxexit.c -> paxexit-status.c
77         * lib/Makefile.am (libtar_a_SOURCES): paxexit.c renamed to
78         paxexit-status.c.
79
80         tar: remove unused function dir_removed_diag
81         * src/common.h (dir_removed_diag): Remove unused decl.
82         * src/misc.c (dir_removed_diag): Remove unused function.
83
84 2010-11-23  Paul Eggert  <eggert@cs.ucla.edu>
85
86         tar: work around FreeBSD symlink incompatibility with POSIX
87         * src/extract.c (maybe_recoverable): Treat EMLINK like ELOOP, for
88         FreeBSD.  Problem reported by Christian Weisgerber in
89         <http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00080.html>.
90
91         * src/names.c: tar: fix bug with --one-file-system
92         --listed-incremental
93         Problem (and idea for fix) reported by Martin Weigel
94         <http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00071.html>.
95         * src/common.h (is_individual_file): Remove decl.
96         * src/create.c (dump_file0): Replace "is_individual_file (p)"
97         with "top_level".
98         * src/incremen.c (procdir): Replace "!is_individual_file
99         (name_buffer)" with "st->parent".  Fix bug with --one-file-system
100         and --listed-incremental.
101         * src/names.c (individual_file_table, register_individual_file):
102         (is_individual_file): Remove.  All uses removed.
103
104         tests: new test listed04 for --one-file-system
105         --listed-incremental
106         * tests/Makefile.am (TESTSUITE_AT): Add listed04.at.
107         * tests/listed04.at: New file.
108         * tests/testsuite.at: Include it.
109
110         scripts: fix option parsing
111         Problem reported by Dennis Wydra in
112         <http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00082.html>.
113         * scripts/backup.in: Accept "-l LEVEL".  Be more systematic about
114         backslashes inside ``; it shouldn't matter for modern shells but
115         it might matter for older ones.
116         * scripts/restore.in: Likewise.
117         * scripts/backup.in: Adjust implementation of -t/--time to match
118         the new implementation of -l/--level.
119
120 2010-11-15  Sergey Poznyakoff  <gray@gnu.org.ua>
121
122         Issue a warning if the archive being compared contais transformed
123         file names.
124         * src/common.h (transform_program_p): New proto.
125         * src/transform.c (transform_program_p): New function.
126         * src/compare.c (verify_volume): Warn if the archive contains
127         transformed file names.
128
129         Minor change.
130         * doc/tar.texi: Reword the description of decompress-program.
131
132 2010-11-15  Paul Eggert  <eggert@cs.ucla.edu>
133
134         tar: fix --verify option, which broke in 1.24
135         * NEWS: Document this.
136         * src/compare.c (verify_volume): Decode the header before invoking
137         diff_archive, as diff_archive no longer does this as of the
138         2010-06-28 commit.  Also, don't try to invoke diff_archive on a
139         zero block.
140         * tests/Makefile.am (TESTSUITE_AT): Add verify.at.
141         * tests/testsuite.at: Include verify.at.
142         * tests/verify.at: New file.
143
144 2010-11-08  Paul Eggert  <eggert@cs.ucla.edu>
145
146         Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/tar
147
148 2010-11-08  Jim Meyering  <meyering@redhat.com>
149
150         tests: avoid spurious failure when VERSION_CONTROL envvar is set
151         * tests/backup01.at: Unset VERSION_CONTROL.  Otherwise,
152         when set to e.g., 'always', it would cause this test to fail.
153
154 2010-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>
155
156         Version 1.25
157         * configure.ac: Version 1.25
158         * NEWS: Describe the changes.
159
160 2010-11-05  Sergey Poznyakoff  <gray@gnu.org.ua>
161
162         Run alternative decompression programs if the principal one is
163         not available.
164         Some compression programs are able to handle various compression
165         formats
166         (e.g. `gzip' can decompress files created by `compress', `xz'
167         is able
168         to handle lzma, etc.)  Tar tries to use such programs for
169         decompression
170         if the principal decompressor cannot be started.
171
172         * src/buffer.c (compress_type): Swap ct_none and ct_tar.
173         (archive_compression_type): New static variable.
174         (zip_magic): Remove program and option fields.
175         (zip_program): New structure and static.
176         (compress_program): Remove macro.
177         (find_zip_program): New static function.
178         (first_decompress_program,next_decompress_program): New functions.
179         (open_compressed_archive): Set archive_compression_type instead of
180         use_compress_program_option.
181         * src/common.h (first_decompress_program)
182         (next_decompress_program): New functions.
183         (WARN_DECOMPRESS_PROGRAM): New flag.
184         (WARN_VERBOSE_WARNINGS): Include WARN_DECOMPRESS_PROGRAM.
185         * src/warning.c (warning_args): Add "decompress-program".
186         (warning_types): Add WARN_DECOMPRESS_PROGRAM.
187         * src/system.c (run_decompress_program): New function.
188         (sys_child_open_for_uncompress): Use run_decompress_program
189         instead of calling execlp directly.
190
191 2010-11-02  Paul Eggert  <eggert@cs.ucla.edu>
192
193         tests: fix some issues with signals, timestamps, "test" typo
194         * tests/extrac17.at: Add --warning=no-timestamp, to avoid
195         bogus warning due to NFS clock skew.
196         * tests/remfiles01.at: Discard diagnostics that some shells
197         generate about broken pipes.
198         * tests/sigpipe.at: Likewise.
199         * tests/remfiles01.at: Fix typo: "test $EC" was written where
200         "test $EC -ne 0" was intended.
201
202 2010-11-01  Sergey Poznyakoff  <gray@gnu.org.ua>
203
204         Fix extraction of device nodes.
205         * src/extract.c (extract_node): Do not mask out node type.
206         The bug was introduced in commit ea964cce.
207
208 2010-10-28  Paul Eggert  <eggert@cs.ucla.edu>
209
210         tar: don't cross struct member boundaries with OLDGNU_MAGIC
211         * src/create.c (write_gnu_long_link, start_header): Access
212         header->buffer + offsetof (struct posix_header, magic), instead of
213         header->header.magic, when reading or writing the OLDGNU_MAGIC
214         pattern.  The code violates the C standard without this change,
215         and GCC warns about this if fortify checking is enabled.  It's not
216         a bug on traditional (i.e., non-debugging) platforms, but it does
217         violate the C standard so it should be fixed.  Problem originally
218         reported by John Emil Karlson in
219         <http://lists.gnu.org/archive/html/bug-tar/2010-04/msg00023.html>.
220         * src/list.c (decode_header): Likewise.
221
222         tests: port to sh variants that squirrel away file descriptors
223         OpenBSD /bin/sh, and some other sh variants, squirrel away file
224         descriptors before closing them.  For example, for "cat 3<&-" they
225         first dup file descriptor 3 to a fd that is 10 or greater, then
226         close 3 (because if "cat" had been a builtin command like ":" then
227         they would have wanted to avoid the fork and restore the fd after
228         ":" finished); and they treat ordinary (forking) commands the same
229         as builtin commands.  This approach fails after "ulimit -n 10".
230         Work around this deficiency by closing the file descriptors before
231         invoking ulimit.  Problem reported by Christian Weisgerber in
232         <http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00041.html>;
233         solution suggested by Jilles Tjoelker in
234         <http://article.gmane.org/gmane.comp.shells.dash/415>.
235
236         * tests/extrac11.at (scarce file descriptors): Close file
237         descriptors before invoking ulimit -n.
238
239 2010-10-27  Sergey Poznyakoff  <gray@gnu.org.ua>
240
241         Transform file names when updating and appendig to archives.
242         This complements 28e91b48.
243
244         * src/common.h (transform_stat_info): New prototype.
245         * src/list.c (transform_stat_info): Remove static qualifier.
246         * src/update.c (update_archive): Call transform_stat_info.
247         * tests/Makefile.am (TESTSUITE_AT): Add append03.at
248         * tests/testsuite.at: Include append03.at
249
250 2010-10-27  Paul Eggert  <eggert@cs.ucla.edu>
251
252         tests: port to Solaris diff
253         * tests/extrac13.at: Don't assume that "diff -c" outputs nothing
254         when there are no differences.  This is not true on Solaris,
255         where it outputs "No differences encounted".
256
257         tar: fix -x --overwrite bug (no --dereference, ! O_NOFOLLOW)
258         This bug was discovered on Solaris 8.  On older hosts lacking
259         O_NOFOLLOW, tar -x --overwrite (without --dereference) follows
260         symbolic links, causing the "extract over symlinks" test to fail.
261
262         * src/extract.c (open_output_file): If O_NOFOLLOW is needed but
263         does not work, check for a symlink separately.
264
265         tar: don't use "((" in shell scripts
266         * tests/extrac11.at: Replace "((" with "( (" in shell scripts, as
267         "((" is not portable to the Korn shell, and POSIX 1003.1-2008 says
268         that "((" is not portable.
269
270 2010-10-26  Sergey Poznyakoff  <gray@gnu.org.ua>
271
272         Make sure name matching occurs before name transformation.
273         The commit 9c194c99 altered that order.
274
275         * src/list.c (transform_stat_info): New function.  Split off from
276         decode_header.
277         (read_and): Call transform_stat_info right before do_something,
278         and after deciding if we should proceed with this member name,
279         so that name matching occurs before name transformation.
280
281         * tests/extrac17.at: New file.
282         * tests/Makefile.am (TESTSUITE_AT): Add extrac17.at
283         * tests/testsuite.at: Include extrac17.at.
284
285 2010-10-26  Paul Eggert  <eggert@cs.ucla.edu>
286
287         tar: don't assume stdin is open when testing fd limits
288         * tests/extrac11.at: Redirect stdin from /dev/null, in case
289         the parent 'make' is running with stdin closed.
290
291 2010-10-26  Sergey Poznyakoff  <gray@gnu.org.ua>
292
293         Further fixes in bootstrap.
294         * bootstrap: Restore the default for gnulib_path
295         (symlink_to_dir): Re-apply 67cad07.
296
297 2010-10-26  Paul Eggert  <eggert@cs.ucla.edu>
298
299         tar: fix bug with -C and extracting directories
300         Problem reported by Denis Excoffier in
301         <http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00034.html>.
302
303         * src/extract.c (extract_dir): Use mkdirat, not mkdir.
304         * tests/extrac16.at: New file, to test for this bug.
305         * tests/Makefile.am (TESTSUITE_AT): Add it.
306         * tests/testsuite.at: Include it.
307
308         This file is a placeholder. It will be replaced with the actual
309         ChangeLog
310         by make dist.  Run make ChangeLog if you wish to create it
311         earlier.
312
313 2010-10-25  Sergey Poznyakoff  <gray@gnu.org.ua>
314
315         Version 1.24
316         * configure.ac, NEWS: Version 1.24
317         * bootstrap: Restore tar-specific code lost during last
318         sync from gnulib (241b72ffad).
319         * src/misc.c (chdir_do): Remove unused automatic variable.
320
321 2010-10-16  Paul Eggert  <eggert@cs.ucla.edu>
322
323         tar: use more-accurate diagnostic when intermediate mkdir fails
324         Without this change, if tar tried to extract a file A/B/C, noticed
325         that A/B didn't exist, attempted to mkdir A/B, and the mkdir
326         failed, it did not diagnose the mkdir failure, but simply reported
327         the failure to open A/B/C.  This sometimes led to confusion
328         because it wasn't clear what tar was trying to do, in particular
329         that tar tried to mkdir A/B.  With this patch, tar issues two
330         diagnostics in this case: one for A/B and the other for A/B/C.
331         Problem reported by Hauke Laging in
332         <http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00020.html>.
333         * gnulib.modules: Remove faccessat.
334         * src/extract.c (make_directories): New arg INTERDIR_MADE.
335         Diagnose mkdir failure.  Return 0 on success, nonzero on failure,
336         as opposed to nonzero iff some directory was created.  All callers
337         changed.  Simplify the code when mkdir fails, by checking whether
338         the desired file exists unless errno==EEXIST: this is more robust.
339         * tests/extrac15.at: New test, to check this.
340         * tests/Makefile.am (TESTSUITE_AT): Add it.
341         * tests/testsuite.at: Include it.
342
343         tests: port to NFS file servers with clock skew
344         Several of the tests assumed that a newly created file cannot
345         have a time stamp dated in the future.  This assumption is not
346         true when files are served by a remote host whose clock is
347         slightly in advance of ours.  Fix the problems that I observed
348         when running "make check" a couple of times on such a server.
349
350         * tests/backup01.at: Use --warning=no-timestamp to suppress
351         clock-skew warnings.
352         * tests/chtype.at, tests/comprec.at, tests/exclude06.at:
353         * tests/extrac01.at, tests/extrac03.at, tests/extrac05.at:
354         * tests/extrac06.at, tests/extrac08.at, tests/extrac13.at:
355         * tests/extrac14.at, tests/incr01.at, tests/incr03.at,
356         tests/link01.at:
357         * tests/multiv01.at, tests/multiv02.at, tests/multiv03.at:
358         * tests/pipe.at, tests/rename02.at, tests/rename03.at:
359         * tests/rename05.at, tests/same-order01.at, tests/same-order02.at:
360         * tests/sparse01.at:
361         Likewise.
362
363 2010-10-12  Paul Eggert  <eggert@cs.ucla.edu>
364
365         gnulib: sync from latest gnulib, notably bootstrap and
366         parse-datetime
367         * bootstrap: Sync from gnulib.
368         * doc/.gitignore: Rename getdate.texi to parse-datetime.texi.
369         * doc/Makefile.am (tar_TEXINFOS): Likewise.
370         * doc/tar.texi (Top): Adjust to renaming of getdate to
371         parse-datetime.
372         * gnulib.modules: Likewise.  Also, remove ftruncate (now
373         obsolete).
374         And add inttostr (we missed this dependency).
375         * src/tar.c: Include parse-datetime.h, not getdate.h.  All calls
376         to get_date replaced with parse_datetime.
377
378 2010-09-24  Paul Eggert  <eggert@cs.ucla.edu>
379
380         tar: -x -C symlink fix
381         * src/misc.c (chdir_do): Don't use O_NOFOLLOW when opening the
382         argument to -C.  This is for consistency with "tar -c -C FOO", and
383         matches the new documentation.
384         * tests/extrac14.at: New file.
385         * tests/Makefile.am (TESTSUITE_AT): Add it.
386         * tests/testsuite.at: Include it.
387
388         tar: --dereference consistency
389         This closes another race condition, that occurs when overwriting a
390         symlink with a regular file.
391         * NEWS (--dereference consistency): New section.
392         * doc/tar.texi (Option Summary): Describe new --deference
393         behavior.
394         (dereference): Likewise.  Remove discussion that I didn't follow,
395         even before --dereference was changed.
396         * src/common.h (deref_stat, set_file_atime): Adjust signatures.
397         * src/compare.c (diff_file, diff_multivol): Respect
398         open_read_flags
399         instead of rolling our own flags.  This implements the new
400         behavior
401         for --dereference.
402         (diff_file, diff_dumpdir): Likewise, for fstatat_flags.
403         * src/create.c: Adjust to set_file_atime signature change.
404         * src/extract.c (mark_after_links, file_newer_p, extract_dir):
405         Likewise.
406         * src/incremen.c (try_purge_directory): Likewise.
407         * src/misc.c (maybe_backup_file): Likewise.
408         * src/extract.c (file_newer_p): New arg STP.  All callers changed.
409         (maybe_recoverable): New arg REGULAR.  All callers changed.
410         Handle the case of overwriting a symlink with a regular file,
411         when --overwrite is specified but --dereference is not.
412         (open_output_file): Add O_CLOEXEC, O_NOCTTY, O_NONBLOCK for
413         consistency with file creation.  Add O_NOFOLLOW if
414         overwriting_old_files && ! dereference_option.
415         * src/incremen.c (update_parent_directory): Use fstat, not
416         fstatat;
417         there's less to go wrong.
418         * src/misc.c (deref_stat): Remove DEREF arg.  All callers changed.
419         Instead, use fstatat_flags.
420         (set_file_atime): Remove ATFLAG arg.  All callers changed.
421         Instead, use fstatat_flags.
422         * src/names.c, src/update.c: Adjust to deref_stat signature
423         change.
424         * src/tar.c (get_date_or_file): Use stat, not deref_stat, as this
425         is not a file to be archived.
426         * tests/Makefile.am (TESTSUITE_AT): Add extrac13.at.
427         * tests/extrac13.at: New file.
428         * tests/testsuite.at: Include it.
429
430 2010-09-20  Paul Eggert  <eggert@cs.ucla.edu>
431
432         tar: do not crash with --listed-incremental
433         Problem reported by Frantisek Hanzlik in
434         <https://bugzilla.redhat.com/635318> via Kamil Dudka in
435         <http://lists.gnu.org/archive/html/bug-tar/2010-09/msg00066.html>.
436         I don't understand this code either, but Sergey can take a look at
437         this patch, and perhaps install a better one, when he has
438         the time.
439         * src/incremen.c (append_incremental_renames): Don't actually
440         append
441         anything to DIR if DIR is null.
442
443 2010-09-19  Paul Eggert  <eggert@cs.ucla.edu>
444
445         tar: prefer openat-style functions
446         This change replaces traditional functions like 'open' with the
447         POSIX.1-2008 functions like 'openat'.  Mostly this is an internal
448         refactoring change, in preparation for further changes to close
449         some races.
450         * gnulib.modules: Add faccessat, linkat, mkfifoat, renameat,
451         symlinkat.
452         Remove save-cwd.
453         * src/Makefile.am (tar_LDADD): Add $(LIB_EACCESS).
454         * tests/Makefile.am (LDADD): Likewise.
455         * src/common.h (chdir_fd): New extern var.
456         * src/compare.c (diff_file, diff_multivol): Use openat instead
457         of open.
458         * src/create.c (create_archive, restore_parent_fd): Likewise.
459         * src/extract.c (create_placeholder_file): Likewise.
460         * src/names.c (collect_and_sort_names): Likewise.
461         * src/update.c (append_file): Likewise.
462         * src/compare.c (diff_symlink): Use readlinkat instead of
463         readlink.
464         * src/compare.c (diff_file): Use chdir_fd instead of AT_FDCWD.
465         * src/create.c (subfile_open, dump_file0): Likewise.
466         * src/extract.c (fd_chmod, fd_chown, fd_stat, set_stat):
467         (repair_delayed_set_stat, apply_nonancestor_delayed_set_stat):
468         Likewise.
469         * src/extract.c (mark_after_links, file_newer_p, extract_dir):
470         (extract_link, apply_delayed_links):
471         Use fstatat rather than stat or lstat.
472         * src/misc.c (maybe_backup_file, deref_stat): Likewise.
473         * src/extract.c (make_directories): Use mkdirat rather than mkdir.
474         Use faccessat rather than access.  This fixes a minor permissions
475         bug when tar is running setuid (who would want to do that?!).
476         (open_output_file): Use openat rather than open.
477         In the process, this removes support for Masscomp's O_CTG files,
478         which aren't compatible with openat's signature.  Masscomp!  Wow!
479         That's a blast from the past.  As far as I know, that operating
480         system hasn't been supported for more than 20 years.
481         (extract_link, apply_delayed_links):
482         Use linkat rather than link.
483         (extract_symlink, apply_delayed_links):
484         Use symlinkat rather than symlink.
485         (extract_node): Use mknodat rather than mknod.
486         (extract_fifo): Use mkfifoat rather than mkfifo.
487         (apply_delayed_links): Use unlinkat rather than unlink or rmdir.
488         * src/misc.c (safer_rmdir, remove_any_file): Likewise.
489         * src/unlink.c (flush_deferred_unlinks): Likewise.
490         * src/extract.c (rename_directory): Use renameat rather than
491         rename.
492         * src/misc.c (maybe_backup_file, undo_last_backup): Likewise.
493         * src/misc.c: Don't include <save-cwd.h>; no longer needed now
494         that we're using openat etc.
495         (struct wd): Add member fd.  Remove members err and fd.  All uses
496         changed.
497         (CHDIR_CACHE_SIZE): New constant.
498         (wdcache, wdcache_count, chdir_fd): New vars.
499         (chdir_do): Use openat rather than save_cwd.  Keep the cache up
500         to date.  This code won't scale well, but is good enough for now.
501         * src/update.c (update_archive): Use openat + fdopendir +
502         streamsavedir rather than savedir.
503
504         This file is a placeholder. It will be replaced with the actual
505         ChangeLog
506         by make dist.  Run make ChangeLog if you wish to create it
507         earlier.
508
509 2010-09-18  Paul Eggert  <eggert@cs.ucla.edu>
510
511         tar: add utimens.h includes
512         * src/extract.c: Include <utimens.h>, needed for fdutimens
513         prototype.
514         * src/misc.c: Likewise.
515
516         tar: switch to gnulib fdutimensat module
517         * gnulib.modules: Add fdutimensat.
518         * src/common.h (fd_utimensat): Remove decl.
519         * src/extract.c (set_stat): Call fdutimensat, not fd_utimensat.
520         * src/misc.c (set_file_atime): Likewise.
521         (fd_utimensat): Remove.
522
523 2010-09-17  Paul Eggert  <eggert@cs.ucla.edu>
524
525         tar: extract permissions for . last
526         * src/common.h (must_be_dot_or_slash): New decl.
527         * src/extract.c (mark_after_links): New function, taking code
528         that used to be in create_placeholder_file.
529         (create_placeholder_file): Use it.
530         (delay_set_stat): Always delay setting status for . and /.
531         * src/misc.c (must_be_dot_or_slash): Now extern.
532         * tests/extrac12.at: New file.
533         * tests/Makefile.am (TESTSUITE_AT): Add it.
534         * tests/testsuite.at: Likewise.
535
536         tar: don't check for getdtablesize; use AC_CHECK_FUNCS_ONCE
537         * configure.ac: Don't check for getdtablesize; no longer needed.
538         Use AC_CHECK_FUNCS_ONCE rather than AC_CHECK_FUNCS, for
539         efficiency.
540
541         tar: extract symlink attributes, close some symlink-related races
542         * NEWS: Describe symlink-extraction improvements.
543         * src/extract.c (enum permstatus): Remove.
544         (fchmod, fchown): Define dummy replacement macros if the system
545         does not supply them.
546         (implemented): New function.
547         (struct delayed_set_stat): Remove members invert_permissions,
548         permstatus.  They were too confusing, and tried to do too much
549         in too-little space.  Instead, add members current_mode,
550         current_mode_mask, interdir, atflag.  All users changed.
551         (struct delayed_link): Add members mode, atime, mtime, to support
552         platforms such as BSD where symlinks have these attributes.
553         All users changed.
554         (fd_chmod): Renamed from fdchmod.  New argument atflag.  Check for
555         operation not supported at run-time, not at configure-time.  Put
556         fd argument first.  All callers changed.
557         (fd_chown): Likewise, renaming from fdchown.
558         (fd_stat): Likewise, renaming from fdstat.
559         (set_mode): Remove args stat_info, cur_info, invert_permissions,
560         permstatus.  Add args mode, mode_mask, current_mode,
561         current_mode_mask,
562         atflag.  All callers changed.  Close some races.  Use an easier-to
563         understand method for computing permissions.  Work around POSIX
564         incompatibility in Linux fchmodat.  Support extraction of symlink
565         modes, if the OS allows it.
566         (set_stat): Remove args cur_info, invert_permissions, permstatus.
567         Add args current_mode, current_mode_mask, interdir, atflag.
568         All callers changed.  Close some races.  Support extraction of
569         attributes on symlinks, if the OS allows it.
570         (delay_set_stat): Remove args invert_permissions, permstatus.
571         Add args current_mode, current_mode_mask, mode, atflag.
572         The ST arg can be null now, indicating that it's an intermediate
573         directory.  All callers changed.
574         (repair_delayed_set_stat, apply_nonancestor_delayed_set_stat):
575         Close some races.
576         (extract_dir): Also be paranoid if only --same-permissions, due
577         to semantics of setgid and setuid directories on some hosts.
578         This closes a race on those hosts.  Simplify calculation of
579         delay_set_stat arguments; the old code was truly strange and
580         probably wrong in some border cases.
581         (extract_dir, extract_file, extract_node, extract_fifo): Don't
582         rely on
583         unspecified behavior in mode arg of open, mknod, etc.  Instead,
584         mask out those bits when creating the file, and add them later via
585         fchmod or chmodat.
586         (open_output_file): file_name is now const.  Add arg current_mode,
587         current_mode_mask.  All callers changed.  When overwriting
588         old files,
589         refuse to overwrite something that is not a regular file, since
590         we're extracting a regular file.
591         (extract_file): Remove the FIXME comment.  Whatever the protection
592         issues were, they should be fixed now.  As a result of all
593         the other
594         API changes, we now use fchmod etc. rather than chmod etc.,
595         closing
596         some races.
597         (create_placeholder_file, apply_delayed_links): Record desired
598         mode and times for symlinks, for OSes that support that.
599
600 2010-09-16  Paul Eggert  <eggert@cs.ucla.edu>
601
602         tar: tar -x without --incremental no longer sets atime again
603         * src/extract.c (set_stat): Use UTIME_OMIT rather than UTIME_NOW.
604         The UTIME_NOW was there only to emulate the previous behavior of
605         using the current time, and the previous behavior was there only
606         because before we started assuming POSIX.1-2008 there was no
607         portable way to get the effect of UTIME_NOW.
608
609         tar: another --atime-preserve race fix
610         * src/common.h (set_file_atime): Add parentfd arg.
611         * src/compare.c (diff_file): Use it.
612         * src/create.c (dump_file0): Likewise.  This closes yet another
613         race condition with symbolic links.
614         * src/misc.c (set_file_atime): Add parentfd arg.
615
616         tar: --atime-preserve fixes for races etc.
617         This patch fixes a race condition in the --atime-preserve=replace
618         option, which might cause tar to improperly follow a symbolic
619         link.
620
621         It also drops the use of the _FIOSATIME ioctl of Solaris 2.x
622         and later, which loses resolution on time stamps.  Modern Solaris
623         systems support full-resolution time stamps in the kernel, and
624         it's not worth the hassle of testing this call, useful only in
625         no-longer-supported Solaris variants.
626
627         Also, it undoes a change I recently introduced to the --compare
628         option, which caused it to not follow symbolic links unless the
629         --dereference option was also used.  Quite possibly this change is
630         a good idea, but the old behavior was documented and the change
631         should not have been installed casually.
632
633         * configure.ac: Don't check for stropts.h and sys/filio.h.
634         * gnulib.modules: Add futimens, utimensat.  Remove futimens.
635         * src/common.h (fd_utimensat): New decl.
636         * src/compare.c (diff_file, diff_multivol):
637         Don't use open_read_flags: those are for --create only.
638         * src/create.c (dump_file0): Adjust to set_file_atime changes.
639         Pass fstatat_flags to set_file_atime, so that symbolic links are
640         not followed inadvertantly.
641         * src/extract.c: Don't include utimens.h.
642         (set_stat): Use fd_utimensat ant UTIME_NOW rather than fdutimens.
643         * src/misc.c: Don't include utimens.h, stropts.h, sys/filio.h.
644         (fd_utimensat): New function.
645         (set_file_atime): Use it.  New arg atflag, controlling symlink
646         handling.  All callers changed.
647
648 2010-09-14  Paul Eggert  <eggert@cs.ucla.edu>
649
650         * configure.ac: tar: close some race conditions when extracting
651         * configure.ac: Check for fchmod and fchown.  Don't check
652         for utimes.
653         * src/extract.c (fdchmod, fdchown, fdstat): New functions.
654         (set_mode, set_stat): New arg FD.  All callers changed.
655         This avoids some race conditions between closing a regular file
656         and setting its metadata, and it's a bit faster.
657
658 2010-09-13  Paul Eggert  <eggert@cs.ucla.edu>
659
660         tar: don't worry about fdopendir closing its argument
661         * NEWS: Don't mention dirfd; no longer needed.
662         * gnulib.modules: Remove dirfd.
663         * src/create.c (get_directory_entries): Remove the code dealing
664         with dirfd failures, as the new fdopendir replacement doesn't
665         close its argument so we don't need to call dirfd.  See
666         <http://lists.gnu.org/archive/html/bug-gnulib/2010-09/msg00208.html>
667         and gnulib commit 970c9038e4cca46e1b037ae0a6d574dfae6a7327.
668
669         * NEWS: Fix wording typo in previous change.
670         Reported by Jim Meyering.
671
672         tar: live within system-supplied limits on file descriptors
673         * NEWS: Note the change.  Mention dirfd and fdopendir.
674         * gnulib.modules: Add dirfd and fdopendir.  The code was already
675         using fdopendir; dirfd is a new need.
676         * src/common.h (open_searchdir_flags, get_directory_entries):
677         (subfile_open, restore_parent_fd, tar_stat_close): New decls.
678         (check_exclusion_tags): Adjust signature to match code change.
679         * src/create.c (IMPOSTOR_ERRNO): New constant.
680         (check_exclusion_tags): First arg is now a struct tar_stat_info
681         const *, not an fd.  All callers changed.
682         (dump_regular_file, dump_file0): A zero fd represents an unused
683         slot, so play it safe if the fd member is zero here.  A negative
684         fd represents the negation of an errno value, so play it safe and
685         do not assign -1 to fd merely because an open fails.
686         (open_failure_recover, get_directory_entries, restore_parent_fd):
687         (subfile_open): New functions.  These help to recover from file
688         descriptor exhaustion.
689         (dump_dir, dump_file0): Use them.
690         (dump_file0): Use tar_stat_close instead of rolling our own close.
691         * src/incremen.c (scan_directory): Use get_directory_entries,
692         subfile_open, etc., to recover from file descriptor exhaustion.
693         * src/names.c (add_hierarchy_to_namelist): Likewise.
694         (collect_and_sort_names): A negative fd represents the negation
695         of an errno value, so play it safe and do not assign -1 to fd.
696         * src/tar.c (decode_options): Set open_searchdir_flags.
697         Add O_CLOEXEC to all the open flags.
698         (tar_stat_close): New function, which knows how to deal with
699         new convention for directory streams and file descriptors.
700         Diagnose 'close' failures.
701         (tar_stat_destroy): Use it.
702         * src/tar.h (struct tar_stat_info): New member dirstream.
703         fd now has the negative of an errno value, not merely -1, if
704         the file could not be opened, so that failures to reopen
705         directories
706         are better-diagnosed later.
707         * tests/Makefile.am (TESTSUITE_AT): Add extrac11.at.
708         * tests/testsuite.at: Likewise.
709         * tests/extrac11.at: New file.
710
711 2010-09-08  Paul Eggert  <eggert@cs.ucla.edu>
712
713         tar: improve documentation of reliability and security issues
714         * doc/tar.texi (Reliability and security, Reliability):
715         (Permissions problems, Data corruption and repair, Race
716         conditions):
717         (Security, Privacy, Integrity, Live untrusted data):
718         (Security rules of thumb): New nodes.
719
720 2010-09-06  Paul Eggert  <eggert@cs.ucla.edu>
721
722         tar: more reliable directory traversal when creating archives
723         * NEWS: Document this.
724         * gnulib.modules: Add openat, readlinkat.
725         * src/common.h (open_read_flags, fstatat_flags): New global
726         variables.
727         (cachedir_file_p, dump_file, check_exclusion_tags,
728         scan_directory):
729         Adjust to new signatures, described below.
730         (name_fill_directory): Remove.
731         * src/compare.c (diff_file, diff_multivol): Use open_read_flags.
732         * src/create.c (struct exclusion_tag): Exclusion predicates
733         now take
734         a file descriptor, not a file name.
735         (add_exclusion_tag): Likewise.  All uses changed.
736         (cachedir_file_p): Likewise.
737         (check_exclusion_tags): The directory is now a file descriptor,
738         not a file name.  All uses changed.  Use openat for better
739         traversal.
740         (file_dumpable_p): Arg is now a struct stat, not a struct
741         tar_stat_info.  All uses changed.  Check the arg's file types too.
742         (dump_dir0, dump_dir, dump_file0, dump_file): Omit top_level and
743         parent_device args, since st->parent tells us that now.  All uses
744         changed.
745         (dump_dir): Likewise.  Also, omit fd arg for similar reasons.
746         Apply fdsavedir to a dup of the file descriptor, since we need a
747         file descriptor for openat etc. as well, and fdsavedir (perhaps
748         unwisely) consumes its file descriptor when successful.
749         Do not consume st->fd when successful; this simplifies the caller.
750         (create_archive): Allocate a file descriptor when retraversing
751         a directory, during incremental dumps.
752         (dump_file0): Use fstatat, openat, and readlinkat for better
753         traversal.
754         When opening a file, use the result of fstat on the file
755         descriptor
756         rather than the fstatat on the directory entry, to avoid some race
757         conditions.  No need to reopen the directory since we now
758         no longer
759         close it.  Change "did we open the file?" test from 0 <= fd to
760         0 < fd since fd == 0 now represents uninitialized.
761         (dump_file): Now accepts struct tar_stat_info describing parent,
762         not parent_device.  Also, accept basename and fullname of entry.
763         All uses changed.
764         * src/incremen.c (update_parent_directory): Accept struct
765         tar_stat_info for parent, not name.  All callers changed.
766         Use fstatat for safer directory traversal.
767         (procdir): Accept struct tar_stat_info, not struct stat and
768         dev_t, for info about directory.  All callers changed.
769         (scan_directory): Accept struct tar_stat_info, not name,
770         device, and cmdline, for info about directory.  All callers
771         changed.  Do not consume the file descriptor, since caller
772         might need it.  Use fstatat and openat for safer directory
773         traversal; also, use fstat after opening to double-check.
774         (name_fill_directory): Remove.
775         * src/names.c (add_hierarchy_to_namelist): Accept struct
776         tar_stat_info instead of device and cmdline.  All callers changed.
777         When descending into a subdirectory, use openat and fstat for
778         safer directory traversal.
779         (collect_and_sort_names): Use open and fstat for safer directory
780         traversal.  Set up struct tar_stat_info for callee's new API.
781         * src/tar.c (decode_options): Initialize open_read_flags
782         and fstatat_flags.
783         (tar_stat_destroy): Close st->fd if it is positive (not zero!).
784         * src/tar.h (struct tar_stat_info): New members parent, fd.
785         * src/update.c (update_archive): Adjust to dump_file's API change.
786         * tests/filerem02.at: Ignore stderr since its contents now depend
787         on the file system implementation.
788
789 2010-09-05  Paul Eggert  <eggert@cs.ucla.edu>
790
791         tar: remove lint discovered by Sun C compiler
792         * src/common.h (WARN_ALL): Don't mask with 0xffffffff; on a 32-bit
793         host, 0xffffffff is of type 'unsigned int', which makes WARN_ALL
794         an unsigned int value that is too large to fit into an int, and
795         the C standard says that this has undefined behavior.  The mask is
796         not needed, so omit it.
797
798 2010-09-04  Paul Eggert  <eggert@cs.ucla.edu>
799
800         tar: restore macros that are used in some cases
801         * src/tar.c (LOW_DENSITY_NUM, MID_DENSITY_NUM, HIGH_DENSITY_NUM):
802         Restore these macros, undoing the previous change to this file.
803         The macros are used after all, in some cases.  Sorry about that.
804
805 2010-09-03  Paul Eggert  <eggert@cs.ucla.edu>
806
807         tar: remove unused macros
808         * src/create.c (UINTMAX_TO_CHARS): Remove; no longer used.
809         * src/tar.c (LOW_DENSITY_NUM, MID_DENSITY_NUM, HIGH_DENSITY_NUM):
810         Likewise.
811         * src/incremen.c (DIR_IS_NEW): Comment out; not used.
812         Mark this with a FIXME, since it looks like it should be used.
813
814 2010-08-27  Sergey Poznyakoff  <gray@gnu.org.ua>
815
816         Fix --remove-files in update/append mode.
817         * src/update.c (update_archive): Call finish_deferred_unlinks when
818         done.
819
820 2010-08-26  Paul Eggert  <eggert@cs.ucla.edu>
821
822         tar: avoid assumptions about root access and chmod -w in test
823         cases
824         * tests/extrac07.at, tests/extrac09.at, tests/listed03.at: Use
825         AT_UNPRIVILEGED_PREREQ, since this test requires non-root
826         privileges.
827         * tests/extrac07.at: Don't use "chmod -w", as POSIX says it's not
828         portable to start a chmod permissions-list with "-" as it may be
829         confused with an option.  Use "chmod a-w" instead.
830
831         tar: fix bug with -C and delayed setting of metadata
832         * src/common.h (chdir_current): New decl.
833         * src/extract.c (struct delayed_set_stat, struct delayed_link):
834         New member change_dir.
835         (delay_set_stat, create_placeholder_file): Set it.
836         (apply_nonancestor_delayed_set_stat, apply_delayed_links): Use it.
837         (extract_link): Check that the links are all relative to the same
838         directory.
839         (extract_archive): Restore the current directory after
840         apply_nonancestor_delayed_set_stat has possibly changed it.
841         * src/misc.c (chdir_current): New external var; this used to
842         be the private static variable 'previous' inside chdir_dir.
843         All uses changed.
844         * tests/Makefile.am (TESTSUITE_AT): New test extrac10.at.
845         * tests/extrac10.at: New file.
846         * tests/testsuite.at: Include it.
847
848 2010-08-25  Sergey Poznyakoff  <gray@gnu.org.ua>
849
850         Don't apply file transformations to volume names.
851         * src/list.c (decode_header): Don't apply file transformations
852         to volume names.
853         * tests/xform01.at: New testcase.
854         * tests/xform-h.at (xform): Rename macro to xformtest. Use
855         pushdef/popdef.
856         * tests/Makefile.am, tests/testsuite.at: Add xform01.at
857
858 2010-08-25  Paul Eggert  <eggert@cs.ucla.edu>
859
860         tar: optimize -c --sparse when file is entirely sparse
861         * src/sparse.c (sparse_scan_file): If the file is entirely sparse,
862         that is, if ST_NBLOCKS is zero, don't bother scanning for nonzero
863         blocks.  Idea by Kit Westneat, communicated by Bernd Schubert in
864         <http://lists.gnu.org/archive/html/bug-tar/2010-08/msg00038.html>.
865         Also, omit unnecessary lseek at start of file.
866
867         tar: don't assume size of a sparse file chunk fits in size_t
868         * src/tar.h (struct sp_array): Change numbytes from size_t
869         to off_t.
870         All uses changed.
871         * scripts/xsparse.c (struct sp_array): Likewise.
872         Include <stdint.h>, for SIZE_MAX.
873         (expand_sparse): Don't try to allocate a buffer bigger than
874         SIZE_MAX bytes.
875         * src/common.h (SIZE_TO_CHARS, size_to_chars, SIZE_FROM_HEADER):
876         (size_from_header): Remove decls.
877         * src/create.c (size_to_chars): Remove.
878         * src/list.c (size_from_header): Remove.
879         * src/sparse.c (sparse_extract_region, check_data_region):
880         (oldgnu_add_sparse, oldgnu_store_sparse_info, pax_decode_header):
881         Don't assume chunk sizes fit in size_t.
882         (oldgnu_add_sparse): Check for off_t overflow.
883         * src/xheader.c (sparse_numbytes_decoder, sparse_map_decoder):
884         Likewise.
885
886         tar: use ctime, not mtime, when checking placeholders
887         * src/extract.c (struct delayed_link): Rename member mtime
888         to ctime.
889         All uses changed to use ctime rather than mtime.
890
891 2010-08-24  Paul Eggert  <eggert@cs.ucla.edu>
892
893         tar: add comment to link04.at test
894         * tests/link04.at: Add explanatory comment at head.
895
896         tar: fix 1.23 Solaris regression related to PRIV_SYS_LINKDIR
897         The idea was suggested by Petr Sumbera in the thread starting
898         here:
899         http://lists.gnu.org/archive/html/bug-tar/2010-08/msg00000.html
900         * src/extract.c (set_mode): Save the errno of the chmod that
901         failed, for the benefit of chmod_error_details.  Do not bother
902         retrying chmod unless the mode suggests setuid is the issue.
903         (extract_archive): Remove redundant call to
904         priv_set_remove_linkdir.
905         * src/system.c: Include priv-set.h.
906         (sys_spawn_shell, sys_child_open_for_compress):
907         (sys_child_open_for_uncompress, sys_exec_command):
908         (sys_exec_info_script, sys_exec_checkpoint_script):
909         Invoke priv_set_restore_linkdir before execv or execlp, so that
910         the subprocess has the same privileges that tar originally did.
911
912         tar: handle files that occur multiple times but have link count 1
913         This patch was inspired by the following patch that addressed a
914         similar problem in GNU coreutils du:
915         http://git.savannah.gnu.org/gitweb/?p=coreutils.git;h=efe53cc72b599979ea292754ecfe8abf7c839d22
916         * src/common.h (name_count): New decl.
917         * src/create.c (trivial_link_count): New static var.
918         (create_archive): Initialize it.
919         (dump_hard_link, file_count_links): Use it, so that files with
920         link count 1 are handled correctly when they are found multiple
921         times.
922         * src/names.c (allocated_entries): Renamed from allocated_names,
923         since the identifier's name was misleading.  All uses changed.
924         (entries): Renamed from names.  All uses changed.
925         (scanned): Renamed from name_index.  All uses changed.
926         (name_count): New var.
927         (name_add_name): Increment it.
928         * tests/link04.at: New file.
929         * tests/testsuite.at: Add it.
930         * tests/Makefile.am (TESTSUITE_AT): Likewise.
931
932 2010-08-23  Paul Eggert  <eggert@cs.ucla.edu>
933
934         tar: use nlink_t for link counts
935         * src/create.c (struct link): nlink is now of type nlink_t,
936         not size_t.
937
938         tar: don't export names that aren't used elsewhere
939         * src/common.h (file_dumpable_p, gid_to_chars, major_to_chars):
940         (minor_to_chars, mode_to_chars, uid_to_chars, uintmax_to_chars):
941         (string_to_chars, dumpdir_creat0, dumpdir_create, dumpdir_free):
942         (dumpdir_locate, dumpdir_next, dumpdir_first, gid_from_header):
943         (major_from_header, minor_from_header, mode_from_header):
944         (time_from_header, uid_from_header, quote_copy_string,
945         request_stdin):
946         (xheader_init, transform_header_name):
947         Remove declarations; these are no longer exported from their
948         modules.
949         (GID_TO_CHARS, MAJOR_TO_CHARS, MINOR_TO_CHARS, MODE_TO_CHARS):
950         (UID_TO_CHARS, UINTMAX_TO_CHARS, UNAME_TO_CHARS, GNAME_TO_CHARS):
951         Move to src/create.c, since no other module uses these.
952         (GID_FROM_HEADER, MAJOR_FROM_HEADER, MINOR_FROM_HEADER):
953         (MODE_FROM_HEADER, TIME_FROM_HEADER, UID_FROM_HEADER):
954         Move to src/extract.c, since no other module uses these.
955         (dumpdir_t, dumpdir_iter_t): Remove; no longer used.
956         * src/create.c (gid_to_chars, major_to_chars, minor_to_chars):
957         (mode_to_chars, uid_to_chars, uintmax_to_chars, string_to_chars):
958         (file_dumpable_p): Now static.
959         * src/incremen.c (dumpdir_create0, dumpdir_create, dumpdir_free):
960         (dumpdir_locate, dumpdir_next, dumpdir_first): Now static.
961         (scan_directory, write_directory_file_entry):
962         Use struct dumpdir_iter * rather than dumpdir_iter_t.
963         * src/list.c (gid_from_header, major_from_header,
964         minor_from_header):
965         (mode_from_header, time_from_header, uid_from_header):
966         (transform_member_name): Now static.
967         * src/misc.c (quote_copy_string): #if 0 out, as it's not used
968         anywhere.
969         * src/system.c (wait_for_grandchild): Now static.
970         * src/tar.c (request_stdin): Now static.
971         * src/xheader.c (xheader_init): Now static.
972
973         tar: fix misspelled identifier "set_comression_program_by_suffix"
974         * src/suffix.c (set_compression_program_by_suffix): Renamed from
975         set_comression_program_by_suffix.
976         * src/buffer.c, src/common.h, src/tar.c: All uses changed.
977
978 2010-08-20  Paul Eggert  <eggert@cs.ucla.edu>
979
980         tar: change interdir_made from int to bool
981         * src/extract.c (maybe_recoverable, create_placeholder_file):
982         Change interdir_made from int * to bool *, since the flag has just
983         two values 0 and 1.  All uses changed.  This does not affect tar's
984         behavior.
985
986         tar: remove trailing white space from source files
987         * ChangeLog.1, ChangeLog.CVS, Makefile.am, NEWS, README:
988         * README-hacking, directory, doc/Makefile.am, doc/dumpdir.texi:
989         * doc/gendocs_template, doc/intern.texi, doc/mastermenu.el:
990         * doc/snapshot.texi, doc/sparse.texi, doc/tar-snapshot-edit.texi:
991         * doc/value.texi, lib/Makefile.am, scripts/backup-specs:
992         * scripts/dump-remind.in, scripts/tar-snapshot-edit,
993         scripts/tarcat:
994         * scripts/xsparse.c, src/arith.h, src/buffer.c, src/compare.c:
995         * src/create.c, src/delete.c, src/exit.c, src/suffix.c, src/tar.c:
996         * src/tar.h, src/update.c, src/warning.c, src/xheader.c:
997         * tests/append01.at, tests/append02.at, tests/atlocal.in:
998         * tests/delete03.at, tests/exclude.at, tests/exclude06.at:
999         * tests/extrac04.at, tests/extrac05.at, tests/extrac06.at:
1000         * tests/extrac07.at, tests/filerem01.at, tests/filerem02.at:
1001         * tests/incr01.at, tests/incr02.at, tests/incr03.at,
1002         tests/incr06.at:
1003         * tests/label02.at, tests/label03.at, tests/label04.at:
1004         * tests/label05.at, tests/link02.at, tests/link03.at:
1005         * tests/listed01.at, tests/listed02.at, tests/long01.at:
1006         * tests/longv7.at, tests/multiv01.at, tests/multiv02.at:
1007         * tests/multiv03.at, tests/multiv05.at, tests/multiv06.at:
1008         * tests/multiv07.at, tests/multiv08.at, tests/options.at:
1009         * tests/options02.at, tests/remfiles03.at, tests/rename01.at:
1010         * tests/rename02.at, tests/rename03.at, tests/rename04.at:
1011         * tests/rename05.at, tests/same-order01.at, tests/same-order02.at:
1012         * tests/shortfile.at, tests/shortupd.at, tests/sparse01.at:
1013         * tests/sparse02.at, tests/sparsemv.at, tests/sparsemvp.at:
1014         * tests/star/README, tests/star/gtarfail2.at:
1015         * tests/star/multi-fail.at:
1016         * tests/star/pax-big-10g.at, tests/star/quicktest.sh:
1017         * tests/star/ustar-big-2g.at, tests/star/ustar-big-8g.at:
1018         * tests/update01.at, tests/update02.at, tests/volsize.at:
1019         * tests/volume.at:
1020         Remove trailing spaces and tabs from lines, and remove
1021         trailing empty lines from files.  This makes it a bit easier
1022         to share code among coreutils and other projects that do this.
1023
1024 2010-08-19  Paul Eggert  <eggert@cs.ucla.edu>
1025
1026         tar: update licenses to latest versions from www.gnu.org
1027         * COPYING: Update to latest version; this is just minor
1028         formatting.
1029         * doc/fdl.texi: Update from GFDL 1.2 to 1.3.
1030         * doc/tar.texi: Adjust to new format of fdl.texi.  Omit trailing
1031         white space.
1032
1033 2010-07-18  Paul Eggert  <eggert@cs.ucla.edu>
1034
1035         * src/misc.c (struct wd): Fix comment to match code.
1036
1037 2010-07-18  Paul R. Eggert  <eggert@cs.ucla.edu>
1038
1039         tar: no need to report getcwd error if never using the result
1040         * src/misc.c (struct wd): Rename 'saved' to 'err', with new
1041         semantics.
1042         (chdir_arg, chdir_do): Adjust to new semantics.  Do not report an
1043         error merely because save_cwd fails; report an error only if
1044         save_cwd's result is needed later.
1045         * tests/extrac09.at: New file, to test for bug that was fixed.
1046         * tests/testsuite.at: Include it.
1047         * tests/Makefile.am (TESTSUITE_AT): Add it.
1048
1049         tar: go back to absolutifying filenames in normalize_filename
1050         for now
1051         * src/misc.c (normalize_filename): For now, go back to making
1052         filenames absolute, even though this causes 'tar' to fail when
1053         getcwd fails.  However, do not attempt to resolve ".." as this
1054         does not work with symlinks.  Also, do the right thing with
1055         leading file system prefixes and on hosts where // != /.
1056
1057 2010-07-17  Sergey Poznyakoff  <gray@gnu.org.ua>
1058
1059         Allow for size suffixes in -L and --record-size options.
1060         * src/tar.c (TAR_SIZE_SUFFIXES): New define.
1061         (parse_opt): Allow for size suffixes in arguments to
1062         -L and --record-size options.
1063         * NEWS, doc/tar.texi: Update.
1064
1065 2010-07-15  Paul R. Eggert  <eggert@cs.ucla.edu>
1066
1067         tar: don't crash if getcwd fails
1068         * src/extract.c: Don't include xgetcwd.h.
1069         (extract_dir): stat "." rather than statting getcwd's output.
1070         * src/misc.c (normalize_filename_x): Rewrite so as not to resolve
1071         /../, which can't be done reliably in the presence of symlinks.
1072         Don't reject valid names such as ".".
1073         (normalize_filename): Don't make it absolute; that way, we don't
1074         have to invoke xgetcwd which might fail.  Don't bother to realloc
1075         at the end, since that uses time and now saves little space.
1076         (chdir_do): Don't crash if xgetcwd fails.
1077         * tests/Makefile.am (TESTSUITE_AT): Add listed03.at.
1078         * tests/listed03.at: New file.
1079         * tests/testsuite.at: Include listed03.at.
1080
1081 2010-07-11  Sergey Poznyakoff  <gray@gnu.org.ua>
1082
1083         Keep a detailed map of archive members stored in the record
1084         buffer.
1085         A separate map (bufmap) provides information for creating
1086         multi-volume continuation headers.
1087
1088         * src/buffer.c (bufmap): New struct.
1089         (bufmap_head, bufmap_tail, inhibit_map): New variables.
1090         (mv_begin_write): New function.
1091         (mv_begin): Rename to mv_begin_read. Rewrite using mv_begin_write.
1092         All callers changed.
1093         (mv_total_size): Remove.
1094         (bufmap_locate, bufmap_free, bufmap_reset): New functions.
1095         (_flush_write): Update bufmap.
1096         (close_archive): Free bufmap.
1097         (add_chunk_header): Take a bufmap argument.
1098         (gnu_add_multi_volume_header): Likewise.
1099         (add_multi_volume_header): Likewise.
1100         (_gnu_flush_write): Rewrite using bufmap.
1101         (real_s_name, real_s_totsize)
1102         (real_s_sizeleft)
1103         (save_name, save_totsize, save_sizeleft): Removed. All
1104         uses updated.
1105         (mv_size_left): Update bufmap_head.
1106         (mv_end): Rewrite.
1107         (multi_volume_sync): Remove.
1108
1109         * src/common.h (mv_begin_write): New prototype.
1110         (mv_begin): Rename to mv_begin_read.
1111         * src/create.c: Use mv_begin_write instead of mv_begin.
1112         Remove calls to mv_size_left and mv_end.
1113         * src/sparse.c: Likewise.
1114
1115         * tests/multiv07.at: Close stdin.
1116         * tests/spmvp00.at: Update AT_KEYWORDS.
1117         * tests/spmvp10.at: Likewise.
1118
1119         * tests/multiv08.at: New testcase.
1120         * tests/Makefile.am, tests/testsuite.at: Add multiv08.at.
1121
1122         Version 1.23.90
1123         * NEWS, configure.ac: Version 1.23.90
1124         * doc/tar.texi: Document the use of lbzip2.
1125
1126 2010-06-28  Sergey Poznyakoff  <gray@gnu.org.ua>
1127
1128         Fix exclusion of long file names when extracting from pax format
1129         archives.
1130         * src/list.c (read_and): Call decode_header before attempting
1131         name_match.
1132         (list_archive): Remove call to decode_header.
1133
1134         * src/compare.c (diff_archive): Remove call to decode_header.
1135         * src/extract.c (extract_archive): Likewise.
1136
1137         * test/exclude06.at: New test case.
1138         * tests/testsuite.at: Include exclude06.at.
1139         * tests/Makefile.am (TESTSUITE_AT): Add exclude06.at.
1140
1141         Minor fix.
1142         * src/buffer.c (magic): Split the character constant to help
1143         cc recognize character boundaries (7 is a valid hex character).
1144
1145 2010-06-27  Sergey Poznyakoff  <gray@gnu.org.ua>
1146
1147         Minor fix.
1148         * src/buffer.c (magic): Fix xz magic.
1149
1150 2010-06-16  Paul Eggert  <eggert@cs.ucla.edu>
1151
1152         Remove some lint, found by gcc -W etc.
1153         * src/common.h (label_notfound): New decl.
1154         * src/buffer.c (set_volume_start_time, compress_type):
1155         (guess_seekable_archive, open_compressed_archive, init_buffer):
1156         (_flush_write, archive_is-dev, increase_volume_number):
1157         (change_tape_menu, try_new_volume, add_chunk_header):
1158         (multi_volume_sync):
1159         Declare as 'static' if it's not exported.
1160         Use function prototype (void) rather than old-style ().
1161         * src/checkpoint.c (expand_checkpoint_string): Likewise.
1162         * src/incremen.c (dirlist_replace_prefix, makedumpdir,
1163         read_incr_db_2):
1164         Likewise.
1165         * src/list.c (print_volume_label): Likewise.
1166         * src/misc.c (normalize_filename_x): Likewise.
1167         * src/names.c (make_name, free_name, check_name_alloc,
1168         name_next_elt):
1169         Likewise.
1170         * src/tar.c (tar_list_quoting_style, add_exclude_array):
1171         (set_stat_signal): Likewise.
1172         * src/transform.c (new_transform,
1173         _single_transform_name_to_obstack):
1174         (_transform_name_to_obstack): Likewise.
1175         * src/unlink.c (dunlink_alloc): Likewise.
1176
1177         * src/buffer.c (struct zip_magic): Use const when appropriate.
1178         * src/incremen.c (obstack_code_rename,
1179         write_directory_file_entry):
1180         Likewise.
1181         * src/sparse.c (COPY_STRING): Likewise.
1182         * src/system.c (dec_to_env, time_to_env, oct_to_env, str_to_env):
1183         (chr_to_env): Likewise.
1184         * src/tar.c (tar_list_quoting_style, set_stat_signal): Likewise.
1185
1186         * src/extract.c (extract_node): Don't return garbage.
1187
1188         * src/names.c: Remove old-style declarations of getgrnam etc.
1189         All modern systems declare these, and it's not worth the hassle
1190         of ignoring the warnings on modern systems for old-style decls.
1191
1192 2010-05-17  Sergey Poznyakoff  <gray@gnu.org.ua>
1193
1194         Bugfix.
1195         * src/incremen.c (make_directory): Retain the slash if it is the
1196         only character in a filename.
1197
1198 2010-04-02  Sergey Poznyakoff  <gray@gnu.org.ua>
1199
1200         Recode NEWS back to UTF-8
1201
1202 2010-04-01  Sergey Poznyakoff  <gray@gnu.org.ua>
1203
1204         Fix the gzip.at test case.
1205         * tests/gzip.at: Suppress gzip error output, as it can differ
1206         depending on its version etc. Bug reported by Ludovic Courtès.
1207
1208 2010-03-28  Sergey Poznyakoff  <gray@gnu.org.ua>
1209
1210         New option --full-time.
1211         * src/common.h (full_time_option): New global.
1212         * src/tar.c (FULL_TIME_OPTION): New constant.
1213         (options): New option --full-time.
1214         (parse_opt): Handle the --full-time option.
1215         * src/list.c (simple_print_header): Pass full_time_option
1216         as the 2nd argument to tartime.
1217         * doc/tar.texi: Update.
1218         * NEWS: Update.
1219
1220 2010-03-27  Sergey Poznyakoff  <gray@gnu.org.ua>
1221
1222         Minor fixes in the testsuite.
1223         * tests/extrac07.at: Fix a typo (invalid number
1224         of arguments before format list).
1225         * tests/link02.at: Use `ln' instead of `link'.
1226         * tests/link03.at: Likewise.
1227
1228         Fix coredump.
1229         * src/names.c (collect_and_sort_names): Remove
1230         entry from the table before freeing it.
1231
1232         Fix dead loop on extracting existing symlinks with the -k option.
1233         * src/extract.c (create_placeholder_file)
1234         (extract_link, extract_symlink)
1235         (extract_node, extract_fifo): Handle all possible
1236         return values from maybe_recoverable. This complements
1237         8f390db92fc. Reported by Ico Doornekamp <bug-tar@zevv.nl>.
1238         * NEWS: Update.
1239
1240 2010-03-20  Sergey Poznyakoff  <gray@gnu.org.ua>
1241
1242         Fix undesired error exit on receiving SIGPIPE.
1243         * src/tar.c: Do not ignore SIGPIPE.
1244         * tests/sigpipe.at: New testcase.
1245         * tests/Makefile.am, tests/testsuite.at: Add sigpipe.at
1246         * tests/remfiles01.at: Fix error code expectation.
1247         * NEWS: Update.
1248
1249 2010-03-17  Sergey Poznyakoff  <gray@gnu.org.ua>
1250
1251         Fix --remove-files.
1252         Tar --remove-files relied on canonicalize_file_name,
1253         which replaces symlinks in file name components with
1254         the directories they point to. Due to this, tar
1255         effectively ignored existence of symbolic links and
1256         was unable to remove a directory that contained any
1257         (Alexander Kozlov <akozlov@nada.kth.se>, 2010-03-15).
1258
1259         * gnulib.modules: Remove canonicalize.
1260         * src/misc.c (normalize_filename): Rewrite
1261         from scratch. The function operates only on
1262         its input string, it makes no attempt to test
1263         components for existence or to resolve symbolic
1264         links.
1265         * tests/Makefile.am (TESTSUITE_AT): Add remfiles03.at.
1266         * tests/testsuite.at: Likewise.
1267         * tests/remfiles03.at: New test case.
1268         * NEWS: Update.
1269
1270 2010-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>
1271
1272         Bugfixes.
1273         * src/buffer.c (check_label_pattern): Initialize result.
1274         * tests/remfiles01.at: Skip if run with root privileges.
1275
1276 2010-03-11  Sergey Poznyakoff  <gray@gnu.org.ua>
1277
1278         Fix `--test-label' and `--label -r' behavior.
1279         * doc/tar.texi (Including a Label in the Archive): Revise
1280         the section.
1281         * NEWS: Update
1282
1283         * src/buffer.c (open_archive): Check volume label on
1284         ACCESS_UPDATE as well.
1285         * src/list.c (test_archive_label): Rewrite to match the
1286         documentation.
1287         * src/names.c (regex_usage_warning): Return int.
1288         (names_notfound): Rewrite the conditional.
1289         (label_notfound): New function.
1290
1291         * tests/label03.at: New testcase.
1292         * tests/label04.at: New testcase.
1293         * tests/label05.at: New testcase.
1294         * tests/Makefile.am: Add new testcases.
1295         * tests/testsuite.at: Likewise.
1296
1297         Doc fixes.
1298         * doc/tar.texi: Consistently use lowercase `see' within sentences.
1299         More fixes spotted by Denis Excoffier.
1300         * THANKS: Update.
1301
1302         Shut up a gcc warning message.
1303         * src/tar.c (tar_help_filter): Use a separate const
1304         variable to hold returns from gettext. Reported by
1305         Peter Breitenlohner.
1306
1307         Bugfix.
1308         * src/names.c (collect_and_sort_names): Initialize prev_name.
1309         Reported by Dmitry V. Levin.
1310
1311 2010-03-10  Sergey Poznyakoff  <gray@gnu.org.ua>
1312
1313         Version 1.23
1314         * configure.ac, NEWS: Update version number.
1315
1316         Doc changes.
1317         * NEWS: Update.
1318         * THANKS: Update.
1319         * doc/snapshot.texi, doc/snapshot.texi,
1320         doc/sparse.texi, doc/tar-snapshot-edit.texi,
1321         doc/tar.texi: Spellchecked and proof-read. Thanks
1322         to Denis Excoffier.
1323         * gnulib.modules: Remove utime.
1324
1325 2010-03-08  Kamil Dudka  <kdudka@redhat.com>
1326
1327         Fix possible overflow in code_timespec (tiny change)
1328         * src/misc.c (code_timespec): ignore invalid values of ns
1329
1330 2010-03-08  Sergey Poznyakoff  <gray@gnu.org.ua>
1331
1332         Minor fix in the testsuite.
1333         * tests/extrac05.at: Skip test if creating
1334         sparse file fails.
1335
1336         Fix eventual memory override and fd exhaustion in create.c Both
1337         bugs reported by Kamil Dudka.
1338         * src/create.c (check_exclusion_tags): Do not keep
1339         pointer to a location within tagname: it may change
1340         after xrealloc. Use byte offset instead.
1341         (dump_file0): Close fd before returning without
1342         dumping the directory.
1343
1344 2010-03-02  Sergey Poznyakoff  <gray@gnu.org.ua>
1345
1346         Minor change.
1347         * doc/tar.texi: Improve some wording.
1348
1349 2010-03-02  Antonio Diaz Diaz  <ant_diaz@teleline.es>
1350
1351         Add Lzip support
1352         * configure.ac: Add TAR_COMPR_PROGRAM(lzip)
1353         * doc/tar.texi: Reflect lzip support.
1354         * src/buffer.c (compress_type) <ct_lzip>: New constant.
1355         (magic): Add magic for lzip.
1356         * src/suffix.c (compression_suffixes): Add lz.
1357         * src/tar.c: New option --lzip.
1358
1359 2010-03-02  Sergey Poznyakoff  <gray@gnu.org.ua>
1360
1361         Minor fix.
1362         * tests/exclude05.at: Rewrite awk invocation to avoid
1363         overflowing awk's file table on Solaris.
1364
1365 2010-03-02  Eric Blake  <ebb9@byu.net>
1366
1367         Fix large file support.
1368         * scripts/xsparse.c (read_map): Use fseeko.
1369         * src/incremen.c (write_directory_file): Likewise.
1370
1371 2010-03-02  Sergey Poznyakoff  <gray@gnu.org.ua>
1372
1373         Bugfix
1374         * src/buffer.c (seek_archive): Rewrite size computation
1375         to prevent it from reaching negative values. Based on
1376         report by Denis Excoffier <Denis.Excoffier@free.fr>.
1377
1378 2010-02-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1379
1380         Supply more information to the --to-command script.
1381         * src/system.c (stat_to_env): Pass information about the current
1382         volume in variables TAR_ARCHIVE, TAR_VOLUME, TAR_BLOCKING_FACTOR,
1383         TAR_FORMAT.
1384         * doc/tar.texi: Document new environment variables.
1385         * NEWS: Likewise.
1386         * configure.ac: Version number 1.22.91.
1387
1388 2010-02-17  Sergey Poznyakoff  <gray@gnu.org.ua>
1389
1390         Minor change.
1391         * src/names.c (regex_usage_warning): Fix warning message.
1392
1393 2010-02-05  Sergey Poznyakoff  <gray@gnu.org.ua>
1394
1395         Update THANKS
1396
1397 2010-02-05  OndÅ™ej Vašík  <ovasik@redhat.com>
1398
1399         Bugfix (tiny change)
1400         * src/xheader.c (xheader_read): Remove unnecessary call
1401         to xheader_init.
1402
1403 2010-01-26  Sergey Poznyakoff  <gray@gnu.org.ua>
1404
1405         Enable silent build mode.
1406         * configure.ac: Require automake 1.11, autoconf 2.63. Enable
1407         silent rules.
1408         * NEWS: Update.
1409         * lib/Makefile.am (rmt-command.h): Silent the rule.
1410
1411 2010-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1412
1413         Read POSIX multivolume archives split at the header boundary.
1414         * src/common.h (read_header_mode): New enum.
1415         (read_header): Change type of the 3rd argument.
1416         * src/list.c (read_header): Change type of the 3rd argument.
1417         All callers updated.
1418         * src/buffer.c (try_new_volume): Allow for volumes split at the
1419         extended/ustar header boundary. This is against POSIX specs, but
1420         we must be able to read such archives anyway.
1421
1422         * tests/multiv07.at: New test case.
1423         * tests/Makefile.am: Add multiv07.at
1424         * tests/testsuite.at: Likewise.
1425
1426         * src/compare.c: Update calls to read_header.
1427         * src/delete.c: Likewise.
1428         * src/update.c: Likewise.
1429
1430 2010-01-24  Sergey Poznyakoff  <gray@gnu.org.ua>
1431
1432         Minor change.
1433         * NEWS: Update.
1434         * doc/tar.texi: Update.
1435         * src/create.c (finish_header): Minor change.
1436
1437 2010-01-24  Rob Vermaas  <rob.vermaas@gmail.com>
1438
1439         Bugfix (tiny change).
1440         * src/tar.c (format_default_settings)[REMOTE_SHELL]: Fix
1441         misplaced comma.
1442
1443 2010-01-24  Sergey Poznyakoff  <gray@gnu.org.ua>
1444
1445         Minor fix.
1446         * src/incremen.c (read_incr_db_01)
1447         (read_directory_file): Initialize bufsize to 0.
1448         Suggested by noordsij@cs.helsinki.fi.
1449
1450         Improve handling of --test-label.
1451         * src/list.c (print_volume_label): New function.
1452         (print_header): Call print_volume_label.
1453         (test_archive_label): New function.
1454         * src/buffer.c (VOLUME_LABEL_APPEND): Remove.
1455         (VOLUME_TEXT, VOLUME_TEXT_LEN): New macros
1456         (drop_volume_label_suffix): New function.
1457         (check_label_pattern): Use drop_volume_label_suffix.
1458         * src/common.h (subcommand): New constant TEST_LABEL_SUBCOMMAND.
1459         (test_label_option): Remove.
1460         (drop_volume_label_suffix): New proto.
1461         (test_archive_label): New proto.
1462         * src/names.c (all_names_found): Remove test for
1463         test_label_option.
1464         * src/tar.c (subcommand_string): Handle TEST_LABEL_SUBCOMMAND.
1465         (set_subcommand_option): Improve diagnostics.
1466         (parse_opt): Set subcommand if --test-label is given.
1467         (main): Handle TEST_LABEL_SUBCOMMAND.
1468
1469         Fix listing of volume labels (in particular in PAX archives).
1470         * src/buffer.c (match_volume_label): Call set_volume_label.
1471         (check_label_pattern): Get label string
1472         as argument.
1473         (match_volume_label): Handle volume labels stored in
1474         global PAX headers.
1475         * src/common.c (print_header,read_header): Change signature.
1476         (read_header_primitive): Remove prototype.
1477         * src/list.c (recent_global_header): New static.
1478         (list_archive): Always print volume labels.
1479         (read_header_primitive): Remove.
1480         (read_header): Change the signature (all callers updated)
1481         Save the recent global header.
1482         (volume_label_printed): New static.
1483         (simple_print_header): New function (ex-print_header).
1484         (print_header): Change the signature (all callers updated).
1485         For POSIX formats, print first volume header (if set).
1486         * src/xheader.c (xheader_write_global): Write the data
1487         accumulated in xhdr->stk even if keyword_global_override_list
1488         is empty.
1489         (xheader_read): On unexpected EOF, report error instead of
1490         coredumping.
1491         (XHDR_PROTECTED, XHDR_GLOBAL): New defines.
1492         (struct xhdr_tab): Remove `protected' with `flags'. All uses
1493         updated.
1494         (decg): If XHDR_GLOBAL bit is set, call the keyword's decode
1495         method instead of adding it to `kwl'.
1496
1497         * src/compare.c: Update calls to read_header.
1498         * src/create.c: Likewise.
1499         * src/delete.c: Likewise.
1500         * src/update.c: Likewise.
1501         * src/extract.c: Likewise.
1502         (extract_volhdr): Do not print "Reading <label>" statement,
1503         because
1504         it is inconsistent: it is not printed if the volume begins with a
1505         member continued from the previous volume.
1506
1507         * tests/label01.at: New testcase.
1508         * tests/label02.at: New testcase.
1509         * tests/Makefile.am, tests/testsuite.at: Add new testcases.
1510
1511 2010-01-22  Sergey Poznyakoff  <gray@gnu.org.ua>
1512
1513         Fix prefix length calculation in ustar mode.
1514         * src/create.c (split_long_name): Fix prefix length
1515         calculation.
1516         (write_ustar_long_name): Improve ustar mode compatibility
1517         with the Sun version.
1518
1519 2009-10-14  Sergey Poznyakoff  <gray@gnu.org.ua>
1520
1521         Rewrite update algorithm.
1522         * src/common.h (namebuf_t): New typedef.
1523         (namebuf_create, namebuf_free)
1524         (namebuf_name): New prototypes.
1525         (remname): New prototype.
1526         * src/misc.c (struct namebuf): New structure.
1527         (namebuf_create, namebuf_free)
1528         (namebuf_name): New functions.
1529         * src/create.c (dup_dir0): Remove is_avoided_name
1530         checks. This is taken care of in update_archive.
1531         * src/incremen.c (scan_directory): Use namebuf
1532         to produce full file names.
1533         * src/names.c (nametail): Remove extra level of
1534         indirection. All uses updated.
1535         (avoided_name_table, add_avoided_name)
1536         (is_avoided_name): Remove.
1537         * src/update.c (update_archive): Change algorithm.
1538         Instead of adding unmodified files to the avoided_name
1539         table, create namelist so that it contains only
1540         modified files.
1541
1542         * tests/Makefile.am: Add update01.at, update02.at
1543         * tests/testsuite.at: Likewise.
1544         * tests/update.at (AT_KEYWORDS): Add update00.
1545
1546         Minor changes.
1547         * src/tar.c (main): Ignore SIGPIPE.
1548         * src/system.c (sys_child_open_for_compress)
1549         (sys_child_open_for_uncompress): Reset SIGPIPE
1550         in child to default.
1551         * tests/remfiles01.at: Avoid race conditions.
1552         * tests/remfiles02.at: Likewise.
1553
1554         Bugfix.
1555         * src/buffer.c (_open_archive): Call guess_seekable_archive
1556         only if the call to open_compressed_archive succeeded.
1557
1558 2009-10-10  Sergey Poznyakoff  <gray@gnu.org.ua>
1559
1560         Improve previous changes.
1561         * acinclude.m4: Fix typos.
1562         * gnulib.modules: Add xvasprintf.
1563         * src/common.h: Include xvasprintf.h.
1564         * src/tar.c (options): Remove docstrings for --gzip, --bzip2,
1565         --compress, --lzop, --lzma and --xz.
1566         (tar_help_filter): Generate these using actual values of
1567         *_PROGRAM constants.
1568         (format_default_settings): Use xasprintf.
1569         (parse_opt): Use *_PROGRAM defines instead of hardcoded
1570         program names.
1571
1572         Allow installers to specify alternative program names for
1573         compression programs.
1574         This adds --with-gzip, --with-bzip2 etc. switches to the
1575         configure, so that
1576         one can do, e.g. ./configure --with-bzip2=lbzip2 and have
1577         lbzip2 executed
1578         whenever user calls `tar --bzip2'.
1579
1580         * acinclude.m4: New file.
1581         * configure.ac: Add TAR_COMPR_PROGRAM invocations for
1582         the supported compressors.
1583         * src/buffer.c (magic): Use *_COMPRESSOR defines instead
1584         of hardcoded program names.
1585         * src/suffix.c (compression_suffixes): Likewise.
1586
1587 2009-10-09  Sergey Poznyakoff  <gray@gnu.org.ua>
1588
1589         Minor fix.
1590         * src/buffer.c (magic): Fix `xz' entry: add the name of the
1591         program.
1592         * src/suffix.c (compression_suffixes, nsuffixes): Mark as static.
1593
1594 2009-10-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1595
1596         Provide a way to explicitly set mtime for extended header
1597         ustar blocks.
1598         * src/tar.c (struct textual_date): ts is a copy of the structure,
1599         not a pointer to it. Date is a copy as well, hence the `const' is
1600         taken away.
1601         (get_date_or_file): Return 0/1 depending on success/failure.
1602         Copy timestamp to the `ts' member. Store a copy of the string
1603         in `date'.
1604         (report_textual_dates): Report only if verbose_option is set,
1605         but always free the list.
1606         (expand_pax_option): New function.
1607         (parse_opt): Preprocess the argument to xheader_set_option with
1608         expand_pax_option.
1609         (decode_options): Call report_textual_dates unconditionally.
1610         * src/xheader.c (exthdr_mtime_option, exthdr_mtime)
1611         (globexthdr_mtime_option, globexthdr_mtime): New statics.
1612         (xheader_set_keyword_equal): handle exthdr.mtime and
1613         globexthdr.mtime.
1614         (xheader_write): Override `t' argument if a corresponding
1615         exthdr.mtime or globexthdr.mtime option is set.
1616         * NEWS: Update
1617         * doc/tar.texi: Document the changes.
1618
1619         Use file's mtime as mtime for its extended header.
1620         This makes two pax archives binary equivalent if they
1621         have the same contents and care is taken to make extended
1622         headers otherwise reproducible, e.g. by using:
1623
1624           --pax-option=exthdr.name=%d/PaxHeaders/%f,atime:=0
1625
1626         Proposed by Michael D. Adams <mdmkolbe@gmail.com>.
1627
1628         * src/common.h (start_private_header): Take time_t as 3rd param.
1629         (xheader_write): Likewise.
1630         * src/create.c (start_private_header): Take time_t as 3rd param.
1631         All callers updated.
1632         (write_extended): Use file's mtime as mtime for its extended
1633         header,
1634         Use current time stamp as mtime for global headers.
1635         (xheader_write): Take time_t as 3rd param.
1636
1637         Fix bugs in handling the --remove-files option.
1638         Make sure the files are deleted only if they were succesfully
1639         stored
1640         to the archive.
1641
1642         * src/exit.c: New file.
1643         * src/unlink.c: New file.
1644         * src/Makefile.am (tar_SOURCES): Add exit.c and unlink.c.
1645         * src/common.h: Include progname.h
1646         (program_name): Remove global.
1647         (records_written): New extern.
1648         (queue_deferred_unlink, finish_deferred_unlinks): New prototypes.
1649         (fatal_exit_hook): New extern.
1650         * src/create.c (create_archive): Call finish_deferred_unlinks.
1651         (dump_hard_link, dump_file0): Don't actually unlink the file,
1652         queue it to deferred_unlinks instead.
1653         * src/delete.c (records_written): Remove extern: declared in
1654         common.h.
1655         * src/extract.c (extract_archive): Set fatal_exit_hook.
1656         (fatal_exit, xalloc_die): Move to exit.c
1657         * src/system.c (sys_wait_for_child): Exit immediately
1658         if the child dies or exits with a non-zero status.
1659         (sys_child_open_for_compress)
1660         (sys_child_open_for_uncompress): Use set_program_name,
1661         instead of setting program_name directly.
1662         * src/tar.c (main): Use set_program_name,
1663         instead of setting program_name directly.
1664
1665         * tests/Makefile.am (TESTSUITE_AT): Add remfiles01.at
1666         and remfiles02.at.
1667         * tests/testsuite.at: Likewise.
1668         * tests/gzip.at: Reflect the above changes.
1669
1670 2009-10-04  Sergey Poznyakoff  <gray@gnu.org.ua>
1671
1672         Fix bug in OLDGNU format creation.
1673         See tests/append02.at for a detailed description
1674
1675         * src/common.h (MODE_FROM_HEADER): Take additional argument.
1676         (mode_from_header): Likewise.
1677         * src/create.c (mode_to_chars): Store all mode bits if
1678         using OLDGNU_FORMAT. This reverses f4e4adea80a.
1679         * src/list.c (decode_header): Use header mode field
1680         to discern between GNU and OLDGNU formats.
1681         (mode_from_header): Store unrecognized mode bits (from 10th up)
1682         in the location pointed to by the third parameter.
1683         * tests/append02.at: Update documentation and references.
1684
1685 2009-09-16  Sergey Poznyakoff  <gray@gnu.org.ua>
1686
1687         Restore extra help output.
1688         * src/tar.c (tar_list_quoting_styles): Change first argument to
1689         struct obstack.
1690         (format_default_settings): New function.
1691         (show_default_settings)
1692         (show_default_settings_fs): Removed.
1693         (tar_help): Removed.
1694         (tar_help_filter): New function.
1695         (argp): Set help_filter.
1696         (parse_opt): Fix error message.
1697
1698 2009-09-08  Sergey Poznyakoff  <gray@gnu.org.ua>
1699
1700         Improve command line option handling.
1701         * gnulib.modules: Add argp-version-etc and progname,
1702         use getopt-gnu instead of getopt.
1703         * src/tar.c (HANG_OPTION, USAGE_OPTION)
1704         (VERSION_OPTION): Remove.
1705         (options): Remove corresponding options. Let argp
1706         handle them.
1707         (parse_opt): Likewise.
1708         (_argp_hang): Removed.
1709         (tar_authors): New variable.
1710         (decode_options): Call argp_version_setup.
1711         Do not use ARGP_NO_HELP flag in the call to argp_parse.
1712
1713         Avoid overwriting exit_status with a value indicating less
1714         important condition.
1715         * src/tar.c (set_exit_status): New function.
1716         * src/common.h (set_exit_status): New prototype.
1717         * src/compare.c: Use set_exit_status instead of
1718         exit_status assignments.
1719         * src/create.c: Likewise.
1720         * src/misc.c: Likewise.
1721
1722         * src/system.c (wait_for_grandchild): Use auto variable
1723         instead of the global exit_status.
1724         * src/incremen.c (scan_directory): Use file_removed_diag
1725         instead of stat_diag.
1726
1727         Automatic detection of seekable archives.
1728         * src/buffer.c (guess_seekable_archive): New function.
1729         (_open_archive): Call guess_seekable_archive for archives
1730         open for reading.
1731         (new_volume): Likewise.
1732         * src/common.h (seek_option): New global.
1733         * src/tar.c (options): New option --no-seek.
1734         (parse_opt): --seek and --no-seek set seek_option,
1735         not seekable_archive.
1736         (decode_options): Initialize seek_option to -1.
1737
1738         * NEWS: Update.
1739         * doc/tar.texi: Update.
1740
1741 2009-08-27  Sergey Poznyakoff  <gray@gnu.org.ua>
1742
1743         Fix testcases.
1744         * tests/extrac08.at: Ensure a predictable umask value.
1745         * tests/xform-h.at (xform): do not depend on file name
1746         ordering.
1747
1748 2009-08-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1749
1750         Fix interaction between --listed-incremental and -C
1751         * src/incremen.c (read_directory_file): Execute eventual -C dir
1752         after opening the snapshot file.
1753         (collect_and_sort_names): Remove call to chdir_do
1754         * tests/incr05.at, tests/incr06.at: Use relative file names for
1755         snapshot files.
1756
1757 2009-08-12  Sergey Poznyakoff  <gray@gnu.org.ua>
1758
1759         Update for new exclude module from gnulib. Add testcases by
1760         Phil Proudman.
1761         * src/names.c (is_pattern): Remove.
1762         (regex_usage_warning): Use fnmatch_pattern_has_wildcards
1763         instead of
1764         is_pattern.
1765         * src/tar.c: New option --exclude-backups.
1766         (vcs_file_table, backup_file_table): New globals.
1767         (add_exclude_array): New function.
1768         * tests/exclude01.at, tests/exclude02.at,
1769         tests/exclude03.at, tests/exclude04.at,
1770         tests/exclude05.at: New testcases. Supplied by Phil Proudman.
1771         * tests/Makefile.am (TESTSUITE_AT): Add new tests.
1772         * tests/testsuite.at: Add new tests.
1773         * THANKS: Update.
1774
1775 2009-08-10  Sergey Poznyakoff  <gray@gnu.org.ua>
1776
1777         Remove src/version.c (reappeared after migration to Git)
1778
1779 2009-08-09  Sergey Poznyakoff  <gray@gnu.org.ua>
1780
1781         Minor fixes.
1782         * src/misc.c (file_removed_diag): Set exit code to
1783         TAREXIT_DIFFERS.
1784
1785 2009-08-08  Sergey Poznyakoff  <gray@gnu.org.ua>
1786
1787         Minor fixes
1788
1789         Fix handling of files removed during incremental dumps.
1790         Changes to src/create.c and src/incremen.c are partially
1791         based on patch from Alexander Peslyak <solar at openwall.com>.
1792
1793         The new testcases require paxutils commit f653a2b or later.
1794
1795         * src/common.h (struct name): New member `cmdline'.
1796         (dump_file): Change type of the 2nd argument to bool.
1797         (file_removed_diag, dir_removed_diag): New prototypes.
1798         (addname): New argument `cmdline'.
1799         (name_from_list): Change return value.
1800         * src/create.c (dump_dir0, dump_dir): top_level is bool.
1801         (create_archive): Update calls to name_from_list.
1802         Take advantage of the name->cmdline to set top_level argument
1803         during incremental backups.
1804         (dump_file0): top_level is bool.
1805         Do not bail out if a no-top-level file disappears during
1806         incremental
1807         backup, use file_removed_diag instead.
1808         (dump_filed): top_level is bool.
1809         * src/incremen.c (update_parent_directory): Silently ignore
1810         ENOENT.  It should have already been reported elsewhere.
1811         (scan_directory): Use dir_removed_diag to report missing
1812         directories.
1813         * src/misc.c (file_removed_diag, dir_removed_diag): New functions.
1814         * src/names.c (name_gather): Set ->cmdname.
1815         (addname): Likewise. All uses updated.
1816         (name_from_list): Return struct name const *. All uses updated.
1817
1818         * tests/filerem01.at: New testcase.
1819         * tests/filerem02.at: New testcase.
1820         * tests/Makefile.am, tests/testsuite.at: Add filerem01.at,
1821         filerem02.at
1822         * tests/grow.at, test/truncate.at: Use new syntax for genfile
1823         --run.
1824
1825         * NEWS: Update.
1826         * doc/tar.texi: Minor fix.
1827
1828         Optimize searches for directory structures by keeping a pointer
1829         to struct directory in struct name.
1830         * src/common.h (struct name): New member `directory' replaces
1831         dir_contents. Rearrange members.
1832         (rebase_directory): Change signature.
1833         (scan_directory): Change signature.
1834         (name_fill_directory)
1835         (directory_contents, safe_directory_contents): New prototypes.
1836         (append_incremental_renames): Change signature.
1837         (replace_prefix): New proto.
1838         * src/compare.c (diff_dumpdir): Use directory_contents +
1839         scan_directory.
1840         * src/create.c
1841         * src/incremen.c (replace_prefix): Move to misc.c
1842         (rebase_directory): Rewrite.
1843         (scan_directory): Return pointer to struct directory.
1844         (directory_contents, safe_directory_contents): New functions.
1845         (get_directory_contents): Remove.
1846         (name_fill_directory): New function.
1847         (append_incremental_renames): Rewrite. This also fixes a memory
1848         leak.
1849         * src/names.c (name_gather, addname): Reflect changes in struct
1850         name.
1851         (add_hierarchy_to_namelist): Rewrite using name_fill_directory and
1852         directory_contents.
1853         (rebase_child_list): Update call to rebase_directory.
1854         (collect_and_sort_names): Optimize
1855
1856         * src/misc.c (replace_prefix): New function.
1857         * src/names.c (add_hierarchy_to_namelist): Use new
1858         get_directory_contents.
1859
1860         * tests/incr05.at: New test case.
1861         * tests/incr06.at: New test case.
1862         * tests/Makefile.am, test/testsuite.at: Add incr05.at and
1863         incr06.at.
1864
1865         * doc/Makefile.am (check-options): Improve rule.
1866         * doc/tar.texi, NEWS: Update.
1867
1868 2009-08-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1869
1870         Minor fixes.
1871         * src/common.h (rebase_directory): New prototype.
1872         * src/incremen.c (rebase_directory): Use replace_prefix.
1873         * src/names.c (collect_and_sort_names): Abort if
1874         hash_insert fails.
1875
1876         Improve listed incremental dumps.
1877         The modified algorithm tries to avoid dumping the same
1878         directory twice and ensures the order of the directories
1879         in the resulting archive is the same, whatever their order
1880         on the command line.  It also fixes the operation of
1881         --listed-incremental -C.
1882
1883         * gnulib.modules: Add canonicalize
1884         * src/common.h (incremental_level): New global.
1885         (check_exclusion_tags): first argument is const.
1886         (get_directory_contents): Add third argument.
1887         (zap_slashes, normalize_filename): New prototypes.
1888         (chdir_count): New prototype.
1889         (WARN_VERBOSE_WARNINGS): New define.
1890         (WARN_ALL): Exclude WARN_VERBOSE_WARNINGS.
1891         * src/compare.c (diff_dumpdir): Update the call to
1892         get_directory_contents.
1893         * src/create.c (check_exclusion_tags): First argument is const.
1894         Use ISSLASH and DIRECTORY_SEPARATOR instead of referring to '/'.
1895
1896         * src/incremen.c (struct directory): New member `caname'.
1897         (hash_directory_name): Rename to
1898         hash_directory_canonical_name. Operate
1899         on the canonical name.
1900         (compare_directory_names): Rename to
1901         compare_directory_canonical_names.
1902         Operate on the canonical name.
1903         (make_directory): Take two arguments.
1904         (free_directory): Free caname.
1905         (attach_directory): Create caname.
1906         (find_directory): Use caname for lookups.
1907         (PD_VERBOSE): Remove.
1908         (PD_FORCE_INIT): New define.
1909         (procdir): First argument is const.
1910         Reinitialize directory if PD_FORCE_INIT bit is set.
1911         Do not use PD_VERBOSE or verbose_option for issuing warnings.
1912         Rely on WARNOPT instead.
1913         Always set *entry.
1914         (scan_directory): Take three arguments. The third one is a boolean
1915         which is true if the directory is explicitly mentioned on
1916         the command
1917         line.
1918         (get_directory_contents): Remove.  Use scan_directory instead.
1919         All callers updated.
1920         (read_directory_file): Truncate the file if --level=0 is given.
1921         * src/misc.c: Include canonicalize.h
1922         (zap_slashes, normalize_filename): New functions.
1923         (chdir_count): New function.
1924         * src/names.c (add_hierarchy_to_namelist): Take three arguments,
1925         as
1926         get_directory_contents and scan_directory.
1927         (collect_and_sort_names): Allow at most one -C, before file name
1928         arguments.
1929         Read directory file after eventual changing to another directory.
1930         Avoid adding the same directory under different pathnames to
1931         the list.
1932         * src/tar.c: New option --level.
1933
1934         * tests/incr03.at, tests/incr04.at, tests/listed01.at,
1935         tests/listed02.at, tests/rename01.at, tests/rename02.at,
1936         tests/rename03.at: Update for new tar behavior.
1937         * tests/multiv01.at: Do not use --listed-incremental.
1938
1939 2009-08-05  Sergey Poznyakoff  <gray@gnu.org.ua>
1940
1941         Forgotten to push src/warning.c
1942
1943         Implement the --warning option.
1944         * src/warning.c: New file.
1945         * src/Makefile.am: Add warning.c
1946         * src/common.h: Provide definitions for warning classes.
1947         (warning_option): New global.
1948         (WARNOPT): New define.
1949         (set_warning_option): New prototype.
1950         * src/tar.c: New option `--warning'.
1951         * src/compare.c: When applicable WARNOPT instead of WARN.
1952         * src/create.c: Likewise.
1953         * src/extract.c: Likewise.
1954         * src/incremen.c: Likewise.
1955         * src/list.c: Likewise.
1956
1957         * NEWS, doc/tar.texi: Update.
1958
1959 2009-08-05  Carl Worth  <cworth@cworth.org>
1960
1961         Fix descriptions of some options (tiny change)
1962
1963 2009-08-05  Sergey Poznyakoff  <gray@gnu.org.ua>
1964
1965         Fix backup handling and restoring file modes of existing
1966         directories
1967         * NEWS, THANKS: Update
1968         * src/extract.c (extract_dir): reset status to 0 if the
1969         directory already exists.
1970         * src/misc.c (maybe_backup_file): Assign before_backup_name
1971         and clear after_backup_name before checking if we really need
1972         to backup the file.
1973         * tests/backup01.at: New testcase.
1974         * tests/extrac08.at: New testcase.
1975         * tests/Makefile.am, tests/testsuite.at: Add extrac08.at and
1976         backup01.at
1977
1978 2009-07-30  Sergey Poznyakoff  <gray@gnu.org.ua>
1979
1980         Fix hard links recognition with -c --remove-files
1981         * src/create.c (dump_hard_link): Always look up in the link table
1982         if remove_files_option is set. Patch suggested by Theodore Ts'o
1983         <tytso@mit.edu>.
1984         (check_links): Remove extra newline from the warning message.
1985         * tests/link02.at, tests/link03.at: New testcases.
1986         * tests/Makefile.am (TESTSUITE_AT): Add link02.at and link03.at
1987         * tests/testsuite.at: Include link02.at and link03.at
1988
1989         Fix handling of hard link targets by -c --transform
1990         * src/create.c (file_count_links): Transform link target
1991         before the look up.
1992         * tests/xform-h.at: New test case.
1993         * tests/Makefile.am (TESTSUITE_AT): Add xform-h.at.
1994         * tests/testsuite.at: Add xform-h.at
1995
1996 2009-06-23  Sergey Poznyakoff  <gray@gnu.org.ua>
1997
1998         Minor fix.
1999         * src/extract.c (file_newer_p): Do not report error on ENOENT
2000
2001 2009-06-19  Sergey Poznyakoff  <gray@gnu.org.ua>
2002
2003         Remove rebox.el (reappeared after migration to Git)
2004
2005 2009-06-18  Sergey Poznyakoff  <gray@gnu.org.ua>
2006
2007         Remove files that were removed in CVS, but reappeared after
2008         migration to Git
2009
2010 2009-06-18  David Bartley  <dtbartle@csclub.uwaterloo.ca>
2011
2012         Fix Solaris bug where chmod fails if we don't have
2013         PRIV_SYS_LINKDIR
2014         * gnulib.modules: Add priv-set.
2015         * src/extract.c (set_mode, extract_archive): Restore
2016         PRIV_SYS_LINKDIR on chmod failure.
2017         * src/tar.c (main): Drop PRIV_SYS_LINKDIR on startup.
2018
2019 2009-06-18  Sergey Poznyakoff  <gray@gnu.org.ua>
2020
2021         Ensure default behavior for SIGPIPE
2022         * src/tar.c (main): Install default handler for SIGPIPE.
2023         Proposed by Bastian Blank.
2024
2025 2009-06-18  Eric Blake  <ebb9@byu.net>
2026
2027         Follow autoconf recommendation for TESTSUITEFLAGS.
2028         * tests/Makefile.am (check-local, installcheck-local): Honor
2029         TESTSUITEFLAGS.
2030
2031 2009-06-18  Sergey Poznyakoff  <gray@gnu.org.ua>
2032
2033         Fix handling of sub-subprocess returns.
2034         * src/system.c (wait_for_grandchild): New function.
2035         (sys_child_open_for_compress)
2036         (sys_child_open_for_uncompress): Use wait_for_grandchild
2037         to manage grandchild return.
2038
2039 2009-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
2040
2041         Report record size only if the archive refers to a device.
2042         * Makefile.am (INCLUDES): Add ../lib, for rmt-command.h
2043         * src/buffer.c (short_read): Report the actual record size
2044         only if the archive descriptor refers to a device.
2045         * tests/pipe.at, tests/shortrec.at,
2046         tests/sparsemvp.at: Reflect the above change.
2047         * NEWS, configure.ac: Version 1.22.90
2048
2049 2009-05-14  Sergey Poznyakoff  <gray@gnu.org.ua>
2050
2051         Do not issue errors on existing files when given the -k option
2052         * Makefile.am (dist-hook): Fix rule.
2053         * src/extract.c (maybe_recoverable): Return three-state value.
2054         (extract_dir): Skip extraction if maybe_recoverable indicates so.
2055         (extract_file): Likewise.
2056
2057 2009-05-12  Eric Blake  <ebb9@byu.net>
2058
2059         Avoid undefined behavior
2060         * src/xheader.c (xheader_set_keyword_equal): Pass correct type to
2061         ctype macros.
2062         * src/transform.c (run_case_conv): Likewise.
2063
2064 2009-05-12  Sergey Poznyakoff  <gray@gnu.org.ua>
2065
2066         Remove src/Makefile.in
2067
2068 2009-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>
2069
2070         Bugfixes.
2071         * bootstrap (symlink_to_dir): Fix symlink calculation.
2072         * doc/tar.texi: Minor fixes by Victor Villa and Stepan Kasal.
2073
2074 2009-03-07  Sergey Poznyakoff  <gray@gnu.org.ua>
2075
2076         Remove Makefile.in
2077
2078         Migrate to Git
2079
2080 2009-03-05  Sergey Poznyakoff  <gray@gnu.org.ua>
2081
2082         * src/incremen.c: --no-recursive works with --incremental.
2083
2084 2009-03-04  Sergey Poznyakoff  <gray@gnu.org.ua>
2085
2086         Add xz support.
2087
2088         * src/buffer.c, src/suffix.c: Add support for xz compression.
2089         * src/tar.c: New option --xz, for compression/decompression using xz.
2090         Re-assign -J as a short equivalent of --xz.
2091
2092 2009-01-19  Sergey Poznyakoff  <gray@gnu.org.ua>
2093
2094         * doc/tar.texi: Fix typo.
2095
2096 2008-12-29  Sergey Poznyakoff  <gray@gnu.org.ua>
2097
2098         * bootstrap.conf: Include size_max.
2099         * gnulib.modules: Remove memset, rmdir. Replace strdup with
2100         strdup-posix. Patch by Eric Blake.
2101         * src/tar.c: Implement -I as a shorthand for --use-compress-program.
2102         * doc/tar.texi: Document -I.
2103         * tests/pipe.at, tests/shortrec.at: Account for eventual 'Record
2104         size' output.
2105         * tests/testsuite.at (AT_TAR_CHECK_HOOK): New define
2106         (AT_TAR_WITH_HOOK, TAR_IGNREC_HOOK): New macros.
2107
2108 2008-11-30  Sergey Poznyakoff  <gray@gnu.org.ua>
2109
2110         * src/xheader.c: Remove duplicate inclusion of fnmatch.h. Reported
2111         by Jim Meyering.
2112
2113 2008-11-25  Sergey Poznyakoff  <gray@gnu.org.ua>
2114
2115         Do not try to drain the input pipe before closing the
2116         archive.
2117
2118         * src/buffer.c (close_archive): Remove call to
2119         sys_drain_input_pipe. Pass hit_eof as the second
2120         argument to sys_wait_for_child.
2121         * src/common.h (sys_drain_input_pipe): Remove
2122         (sys_wait_for_child): Declare second argument.
2123         * src/system.c (sys_drain_input_pipe): Remove.
2124         (sys_wait_for_child): Take two arguments. The second one helps to
2125         decide whether to tolerate child termination on SIGPIPE.
2126
2127 2008-11-03  Sergey Poznyakoff  <gray@gnu.org.ua>
2128
2129         * src/buffer.c (_write_volume_label): Fix typo, which prevented
2130         `-V label -M' from working.
2131
2132 2008-10-30  Sergey Poznyakoff  <gray@gnu.org.ua>
2133
2134         * NEWS, configure.ac: Version 1.20.91
2135         * doc/tar.texi: Document transformation scope flags.
2136         * src/common.h (transform_symlinks_option): Remove in favor of
2137         transformation scope flags.
2138         (XFORM_REGFILE, XFORM_LINK, XFORM_SYMLINK, XFORM_ALL): New macros.
2139         (transform_name, transform_member_name, transform_name_fp): Take
2140         an additional argument, specifying scope flags.
2141         * src/create.c: Reflect changes to transform_name.
2142         * src/extract.c (extract_link, extract_symlink): Remove calls to
2143         transform_member_name. It is done in read_header.
2144         * src/list.c (decode_xform): Reflect change in data type of 2nd
2145         argument.
2146         (transform_member_name): 2nd arg is int.
2147         (decode_header): Transform file name and link target names.
2148         * src/tar.c: Remove --transform-symlinks.
2149         * src/transform.c (struct transform): New member `flags'.
2150         (transform_flags): New variable.
2151         (parse_transform_expr): Parse transformation scope flags. Allow to
2152         set global flags using `flags=' syntax.
2153         (_transform_name_to_obstack, transform_name_fp)
2154         (transform_name): Take an additional argument, specifying scope
2155         flags.
2156
2157 2008-10-19  Sergey Poznyakoff  <gray@gnu.org.ua>
2158
2159         * THANKS: Add Ed Leaver.
2160         * src/buffer.c (short_read): Remove !read_full_records condition,
2161         which was always false on a first record and thus disabled record
2162         size autodetection.  Thanks Ed Leaver for the patch.
2163         (_gnu_flush_read): Handle blocking_factor == 1.
2164         * tests/sparsemv.at: Reflect changes to buffer.c.
2165         * tests/sparsemvp.at: Likewise.
2166         * tests/volsize.at: Likewise.
2167         * NEWS: Update.
2168
2169 2008-10-16  Sergey Poznyakoff  <gray@gnu.org.ua>
2170
2171         * src/common.h (transform_symlinks_option): New global.
2172         * src/create.c (dump_file0): Transform symlink targets only if
2173         explicitly required.  Thanks Cyril Strejc for reporting the
2174         problem.
2175         * src/tar.c (parse_opt): New options --transform-symlinks and
2176         --no-transform-symlinks. New alias --xform to the --transform
2177         option.
2178         * doc/tar.texi: Document --transform-symlinks
2179         * NEWS: Update.
2180         * THANKS: Update.
2181
2182         * src/names.c (name_gather): Use xzalloc.
2183         * src/buffer.c (short_read): Move record size detection before
2184         the loop.
2185
2186 2008-10-07  Sergey Poznyakoff  <gray@gnu.org.ua>
2187
2188         * src/tar.c (options): Add --lzop option.
2189
2190 2008-10-05  Xavier Hienne <xavier.hienne@free.fr> (tiny change)
2191
2192         * src/checkpoint.c (checkpoint_compile_action): Add missing
2193         `else'.
2194
2195 2008-09-24  Sergey Poznyakoff  <gray@gnu.org.ua>
2196
2197         * NEWS: Update.
2198         * doc/tar.texi: Update.
2199         * src/tar.c: New option --no-null.
2200
2201 2008-09-23  Sergey Poznyakoff  <gray@gnu.org.ua>
2202
2203         * src/common.h (filename_terminator): Remove global.
2204         * src/tar.c (filename_terminator): New static.
2205         * src/names.c (name_next_elt): Do not depend on
2206         filename_terminator, this was a leftover from 1.13.
2207
2208 2008-09-18  Sergey Poznyakoff  <gray@gnu.org.ua>
2209
2210         * doc/tar.texi: Remove incorrect example.
2211
2212 2008-09-07  Sergey Poznyakoff  <gray@gnu.org.ua>
2213
2214         * src/incremen.c (dumpdir_create0): Eliminate gcc warning.
2215         (attach_directory): Bugfix - add missing return statement.
2216         * THANKS: Add Enric Hernandez
2217
2218 2008-07-31  Sergey Poznyakoff  <gray@gnu.org.ua>
2219
2220         * src/incremen.c (struct directory): New member `next'.  Change
2221         type of `name'.
2222         (dirhead, dirtail): New statics.
2223         (make_directory): Reflect changes to struct directory.
2224         (free_directory, attach_directory): New functions.
2225         (dirlist_replace_prefix): New function.
2226         (note_directory): Use attach_directory, instead of make_directory,
2227         (find_directory, find_directory_meta): Use free_directory.
2228         (procdir): Replace directory prefixes in directory list to avoid
2229         marking subdirectories as renamed after renaming their parent
2230         directory.
2231         (append_incremental_renames): Iterate over directory list, not
2232         hash table, to preserve logical ordering of renames.
2233         * tests/rename04.at, tests/rename05.at: New test cases.
2234         * tests/Makefile.am, tests/testsuite.at: Add rename04.at and
2235         rename05.at.
2236         * tests/atlocal.in (decho): New function.
2237         * tests/multiv06.at: Use decho instead of echo2.
2238         * tests/incremental.at: Raise wait interval to 2 seconds.
2239
2240 2008-07-24  Sergey Poznyakoff  <gray@gnu.org.ua>
2241
2242         * src/tar.c (decode_options): Do not allow volume length less
2243         than record size.
2244         * src/buffer.c (_gnu_flush_write): Compensate for the effect
2245         of eventual flush_archive occurring in the middle of buffer
2246         move.
2247         Increment records_written only if _flush_write was able to write
2248         something.
2249         * tests/multiv06.at: New testcase.
2250         * tests/Makefile.am, test/testsuite.at: Add tests/multiv06.at
2251
2252 2008-06-26  Sergey Poznyakoff  <gray@gnu.org.ua>
2253
2254         * configure.ac, NEWS: Version 1.20.90
2255         * doc/tar.texi: Document -J, --no-auto-compress, etc.
2256         * src/buffer.c (ct_tar): New constant.
2257         (magic): Add lzop support.  Proposed by Kevin Day
2258         <thekevinday@gmail.com>.
2259         (check_compressed_archive): Do not use autodetect if the
2260         compression program was specified explicitly.
2261         Fall back to analyzing archive name, if the autodetection fails.
2262         * src/suffix.c: Add .lzo
2263         * src/tar.c: New options --lzop and --no-auto-compress.
2264         New short option -J (alias for --lzma).
2265
2266         * src/buffer.c (try_new_volume): Print more information with error
2267         diagnostics.
2268         (_gnu_flush_write): Improve error checking.  Adjust
2269         real_s_sizeleft before calling new_volume to avoid creating
2270         malformed multivolume headers.
2271         * tests/delete05.at, tests/gzip.at, tests/ignfail.at,
2272         tests/longv7.at, tests/lustar01.at, tests/lustar02.at,
2273         tests/shortfile.at: Update to match new diagnostic wording
2274         (see 2008-05-06).
2275
2276         * NEWS: Update.
2277
2278 2008-06-14  Sergey Poznyakoff  <gray@gnu.org.ua>
2279
2280         * doc/tar.texi (exclude): Document support for new VCS.
2281         * THANKS: Update.
2282         * NEWS: Update.
2283         * tests/multiv05.at: Fix typos.
2284         * tests/volsize.at: Remove a TZ dependency.
2285
2286 2008-06-14  Dan Drake <dan@dandrake.org> (tiny change)
2287
2288         * src/tar.c (exclude_vcs_files): Support for Bazaar, Mercurial and
2289         Darcs.
2290
2291 2008-05-06  Sergey Poznyakoff  <gray@gnu.org.ua>
2292
2293         * src/tar.c (main): Reword the "delayed error" message. New
2294         wording proposed by Karl Berry.
2295
2296 2008-02-20  Sergey Poznyakoff  <gray@gnu.org.ua>
2297
2298         * configure.ac: Raise version number to 1.20
2299         * src/compare.c (diff_dumpdir): const.
2300         * src/common.h (dumpdir_t,dumpdir_iter_t): New data types.
2301         (dumpdir_create0,dumpdir_create,dumpdir_free,dumpdir_locate)
2302         (dumpdir_first,dumpdir_next): New functions.
2303         * src/incremen.c (dumpdir_create0,dumpdir_create,dumpdir_free)
2304         (dumpdir_first,dumpdir_next): New functions.
2305         (dumpdir_locate): Rewrite using binary search.
2306         (struct directory): Change members char *contents, *icontents to
2307         struct dumpdir *dump, *idump. All references updated.
2308         (note_directory): Last arg is const.
2309         * src/names.c (add_hierarchy_to_namelist): buffer is const.
2310         * tests/incr03.at, tests/incr04.at, tests/rename02.at,
2311         tests/rename03.at: Insert calls to sleep between creation of files
2312         and adding them to the archive.
2313
2314 2008-03-31  Sergey Poznyakoff  <gray@gnu.org.ua>
2315
2316         * src/create.c (dump_file0): Count links only for actually dumped
2317         files.
2318
2319 2008-03-27  Sergey Poznyakoff  <gray@gnu.org.ua>
2320
2321         * NEWS: Document --no-check-device and --check-device.
2322         * doc/rendition.texi: Change the way FIXME-*refs are handled in
2323         !PROOF.
2324         * doc/intern.texi, doc/tar.texi: Update.
2325         * doc/untabify.el: New file.
2326         * doc/Makefile.am (EXTRA_DIST): Add untabify.el
2327         (untabify, final, check-format, check-refs, check-fixmes)
2328         (check-unrevised, all-check-docs, check-docs): New rules.
2329
2330         * src/common.h (check_device_option): New global.
2331         * src/incremen.c (procdir): Use boolean and instead of bitwise
2332         one. Patch by Jean-Louis Martineau.
2333         Compare device numbers only if check_device_option is set.
2334         * src/tar.c: New command line options --no-check-device and
2335         --check-device. Proposed by Jean-Louis Martineau.
2336         (parse_opt): Hanlde new options.
2337         (decode_options): Initialize check_device_option to true.
2338
2339         * THANKS: Update
2340
2341 2008-03-06  Sergey Poznyakoff  <gray@gnu.org.ua>
2342
2343         * bootstrap: Use rsync to get translations.
2344         * doc/tar.texi: Minor change.
2345         * lib/.cvsignore: Update
2346         * po/.cvsignore: Update
2347         * src/system.c: Remove include setenv.h.
2348         * tests/atlocal.in (STAR_DATA_URL): Update.
2349         * tests/star/README: Update URL.
2350
2351 2008-02-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2352
2353         * doc/tar.texi: Fix a typo. Reported by Denis Excoffier.
2354
2355 2008-02-08  Sergey Poznyakoff  <gray@gnu.org.ua>
2356
2357         * NEWS: Update.
2358         * configure.ac: Version 1.19.90
2359         * po/POTFILES.in: Add missing files.
2360         * src/compare.c (verify_volume): Honor --ignore-zeros.
2361         Proposed by Jan-Benedict Glaw.
2362         * tests/shortfile.at (AT_KEYWORDS): Add shortfile0.
2363
2364 2008-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
2365
2366         * NEWS: Update.
2367         * src/create.c (dump_file0): Apply transform_name to symlink
2368         targets.
2369
2370 2008-02-04  Sergey Poznyakoff  <gray@gnu.org.ua>
2371
2372         * src/transform.c: Support multiple --transform options. Support
2373         semicolon-separated lists of replace expressions.
2374         * NEWS, tar.texi: Document changes to the --transform option.
2375
2376 2008-01-30  Paul Eggert  <eggert@cs.ucla.edu>
2377
2378         * doc/tar.texi: Update Back-Cover text to reflect new GNU wording.
2379
2380 2007-12-17  Paul Eggert  <eggert@cs.ucla.edu>
2381
2382         Exit with nonzero status if a close fails on an archive.
2383         Problem (and initial trivial fix)
2384         * src/buffer.c (close_archive, new_volume): close_error, not
2385         close_warn.
2386
2387 2007-12-05  Sergey Poznyakoff  <gray@gnu.org.ua>
2388
2389         * src/buffer.c (check_compressed_archive): Do not bail out if the
2390         file is too short, set boolean flag, passed as an argument
2391         instead.  This fixes a bug introduced on 2007-08-24. See also
2392         tests/shortupd.at.
2393
2394         * tests/Makefile.am, tests/testsuite.at: Add shortupd.at.
2395         * tests/shortupd.at: New test.
2396
2397 2007-11-12  Jim Meyering  <meyering@redhat.com>
2398
2399         Don't read from name[-1].
2400         * src/incremen.c (make_directory): Handle namelen == 0, since
2401         find_directory_meta calls make_directory ("").
2402
2403 2007-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>
2404
2405         * bootstrap (checkout): Use URL of the gnulib CVS mirror.
2406         * gnulib.modules: Add fseeko and snprintf.
2407
2408 2007-10-31  Sergey Poznyakoff  <gray@gnu.org.ua>
2409
2410         * src/checkpoint.c: New actions: bell and ttyout
2411         * src/system.c (sys_exec_info_script)
2412         (sys_exec_checkpoint_script): pass the current blocking factor in
2413         TAR_BLOCKING_FACTOR environment variable.
2414         * doc/tar.texi: Update
2415         * NEWS: Update
2416
2417 2007-10-30  Sergey Poznyakoff  <gray@gnu.org.ua>
2418
2419         * doc/Makefile.am: Use texi2html and the CVS version of gendocs.sh
2420         to create HTML versions of the manual.
2421         * doc/gendocs_template: Likewise.
2422         * doc/tar.texi: Document --hard-dereference and
2423         --checkpoint-action options. Improve documentation of
2424         --check-links.
2425
2426 2007-10-29  Sergey Poznyakoff  <gray@gnu.org.ua>
2427
2428         * NEWS: Update
2429         * configure.ac: Version 1.19.1
2430         * po/POTFILES.in: Add src/checkpoint.c
2431         * src/Makefile.am (tar_SOURCES): add checkpoint.c
2432         * src/checkpoint.c: New file - checkpoint handling.
2433         * src/buffer.c (checkpoint, do_checkpoint): Remove.
2434         (_flush_write, simple_flush_read, _gnu_flush_read): Use
2435         checkpoint_run.
2436         * src/common.h (enum checkpoint_style): Remove.
2437         (checkpoint_style): Remove.
2438         (DEFAULT_CHECKPOINT): New define.
2439         (hard_dereference_option): New variable.
2440         (sys_exec_checkpoint_script): New declaration.
2441         * src/create.c (file_count_links): do nothing if
2442         hard_dereference_option is set.
2443         * src/system.c (sys_exec_checkpoint_script): New function.
2444         (sys_exec_info_script): Restore SIGPIPE handler.
2445         * src/tar.c: (parse_opt): New options --hard-dereference,
2446         --checkpoint-action.
2447         (decode_options): Call checkpoint_finish_compile.
2448
2449         * src/system.c (sys_exec_info_script): Initialize buf. Problem
2450         reported by Bengt-Arne Fjellner.
2451
2452 2007-10-18  Jim Meyering  <jim@meyering.net>
2453
2454         Avoid compiler warnings.
2455         * src/list.c (read_header_primitive): Define two locals, to
2456         avoid incorrect "may be used uninitialized" warnings.
2457         * src/incremen.c (procdir): Remove decl of unused local, "len".
2458
2459 2007-10-18  Sergey Poznyakoff  <gray@gnu.org.ua>
2460
2461         * doc/tar.texi (gzip): Remove compression patent
2462         warning. According to Brett Smith, the patent is
2463         expired.
2464
2465 2007-10-17  Sergey Poznyakoff  <gray@gnu.org.ua>
2466
2467         * src/suffix.c: New file. Compress format detection by archive
2468         suffix (when creating). Suggested by Jean-Pierre Demailly.
2469         * src/Makefile.am: Add suffix.c
2470         * src/buffer.c (magic): Add an entry for new lzma format. Proposed
2471         by Lasse Collin.
2472         * src/common.h (set_comression_program_by_suffix): New prototype.
2473         * src/tar.c: New options --auto-compress (-a) and --lzma
2474         * THANKS: Add Lasse Collin and Jean-Pierre Demailly.
2475         * NEWS: Update
2476         * doc/tar.texi: Update
2477
2478 2007-10-12  Paul Eggert  <eggert@cs.ucla.edu>
2479
2480         * src/utf8.c (string_ascii_p): Recode to avoid bogus GCC 4.2.1
2481         warning about "comparison is always true due to limited range of
2482         data type" when char is unsigned.
2483
2484 2007-10-11  Paul Eggert  <eggert@cs.ucla.edu>
2485
2486         Adjust to recent gnulib changes.
2487         * configure.ac: Dont' check for strerror, since gnulib now does this.
2488         * .cvsignore: Add m4, tar-[0-9]*.
2489         * lib/.cvsignore: Adjust to various gnulib file name changes.
2490         Add .deps, rmt-command.h.
2491
2492 2007-10-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2493
2494         * configure.ac, NEWS: Raise version number to 1.19
2495         * tests/star/README: Update
2496
2497 2007-10-05  Sergey Poznyakoff  <gray@gnu.org.ua>
2498
2499         * src/create.c (dump_regular_file): Fix file padding in case of
2500         truncation to zero size.
2501         * NEWS: Update
2502
2503 2007-10-04  Sergey Poznyakoff  <gray@gnu.org.ua>
2504
2505         * tests/T-null.at: Use AT_DATA for sample output.
2506
2507 2007-10-03  Sergey Poznyakoff  <gray@gnu.org.ua>
2508
2509         * src/incremen.c (try_purge_directory): Ensure that arguments to T
2510         and R are safe.
2511
2512 2007-09-29  Sergey Poznyakoff  <gray@gnu.org.ua>
2513
2514         * src/incremen.c (obstack_code_rename): Apply safer_name_suffix to
2515         name arguments before storing them in T and R records. Reported by
2516         Nicholas Cole.
2517
2518 2007-09-27  Sergey Poznyakoff  <gray@gnu.org.ua>
2519
2520         * configure.ac: Raise version number to 1.18.90
2521         * NEWS: Likewise
2522
2523         * doc/snapshot.texi: Document version 2.
2524         * doc/dumpdir.texi: Update.
2525
2526         Implement --exclude-tag* and --exclude-cache* options for listed
2527         incremental archives.
2528         New option --exclude-vcs to exclude VCS-specific files and
2529         directories.
2530
2531         * NEWS: Update
2532         * doc/tar.texi: Document --exclude-vcs option
2533         * src/common.h (exclusion_tag_warning, check_exclusion_tags): New
2534         prototypes.
2535         * src/create.c (exclusion_tag_warning, check_exclusion_tags):
2536         Remove static qualifier.
2537         (check_exclusion_tags): account for dirname without terminating
2538         slash.
2539         (dump_dir0): exclusion_tag_all is handled elsewhere.
2540         * src/incremen.c (struct directory): New member tagfile
2541         (make_directory): Initialize tagfile to NULL
2542         (procdir): New argument: entry
2543         Hanlde exclusion tags.
2544         (makedumpdir): Take into account directory->tagfile.
2545         (scan_directory): Hanlde exclusion tags.
2546         * src/tar.c: New option --exclude-vcs
2547         (exclude_vcs_files): New function
2548
2549 2007-09-14  Paul Eggert  <eggert@cs.ucla.edu>
2550
2551         * AUTHORS: Remove unnecessary information.  Just list the
2552         principal authors.
2553         * THANKS: Remove info duplicated from AUTHORS.
2554
2555 2007-08-25  Jim Meyering  <jim@meyering.net>
2556
2557         Don't include <getline.h>.  No longer needed.
2558         * src/incremen.c: Don't include <getline.h>.  No longer needed.
2559         * src/buffer.c: Likewise.
2560         * src/system.c: Likewise.
2561         * src/tar.c: Likewise.
2562
2563         Avoid shadowing and unused-variable warnings.
2564         * src/create.c (check_exclusion_tags): Remove declaration of unused
2565         local, "ret".
2566         * src/compare.c (diff_dumpdir): Rename stat->stat_data to avoid
2567         shadowing the syscall.
2568         * src/buffer.c (do_checkpoint): Don't shadow the write syscall.
2569         (try_new_volume): Avoid shadowing "access".
2570         * src/tar.c (decode_options): Rename index->idx to avoid shadowing.
2571         (find_argp_option): Rename option->o to avoid shadowing.
2572         * src/incremen.c (scan_directory): Rename local, dir_name->dir,
2573         to avoid shadowing the function.
2574         (get_directory_contents): Likewise.
2575         * src/system.c (global_pid): Rename from "pid", to avoid being
2576         shadowed by locals.
2577         * src/extract.c (apply_nonancestor_delayed_set_stat):
2578         Rename st->sb to avoid shadowing another local.
2579
2580 2007-08-24  Sergey Poznyakoff  <gray@gnu.org.ua>
2581
2582         * configure.ac, NEWS: Raise version number to 1.18.1
2583
2584         * src/buffer.c (check_compressed_archive): Detect files smaller
2585         than 512 bytes.
2586         * tests/shortfile.at: New test case for the above change.
2587         * tests/testsuite.at, tests/Makefile.am: Add shortfile.at
2588
2589 2007-08-19  Sergey Poznyakoff  <gray@gnu.org.ua>
2590
2591         * bootstrap: Gnulib initialization destroyed paxutils m4 files.
2592         Initialize paxutils structure after that of gnulib.
2593
2594 2007-08-12  Sergey Poznyakoff  <gray@gnu.org.ua>
2595
2596         * src/names.c (contains_dot_dot): Fix double-dot recognition in
2597         case of duplicate /. Patch by Dmitry V. Levin.
2598
2599         * bootstrap (symlink_to_gnulib): Make sure the target directory
2600         exists and create it if it does not.
2601
2602         * doc/tar.texi: Fix a typo.
2603
2604 2007-06-28  Sergey Poznyakoff  <gray@gnu.org.ua>
2605
2606         * bootstrap: Update for the change of the TP URL
2607
2608 2007-06-27  Sergey Poznyakoff  <gray@gnu.org.ua>
2609
2610         Relicense under GPLv3
2611
2612 2007-06-21  Sergey Poznyakoff  <gray@gnu.org.ua>
2613
2614         * tests/testsuite.at (AT_TAR_MKHIER): Skip test if genfile is
2615         unable to create the file
2616         * tests/lustar01.at: Likewise
2617
2618 2007-06-21  Eric Blake  <ebb9@byu.net>
2619
2620         Resolve testsuite failures 40-42 on cygwin.
2621         * tests/testsuite.at (AT_TAR_MKHIER): Skip tests when long
2622         file names cannot be created.
2623
2624 2007-06-16  Sergey Poznyakoff  <gray@gnu.org.ua>
2625
2626         * doc/Makefile.am (tar_TEXINFOS): Add tar-snapshot-edit.texi
2627         * doc/tar-snapshot-edit.texi: New file
2628         * doc/tar.texi (Fixing Snapshot Files): New appendix
2629
2630         * scripts/tar-snapshot-edit: New file
2631         * tests/extrac07.at: Add back write permissions on dir
2632
2633 2007-06-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2634
2635         * tests/exclude.at: Sort the output.
2636
2637 2007-06-08  Sergey Poznyakoff  <gray@gnu.org.ua>
2638
2639         * configure.ac, NEWS: Raise version number to 1.17
2640
2641         * doc/tar.texi, doc/intern.texi: Replace: s/filename/file name/;
2642         s/(ASCII|ID|BSD)/@acronym{&}/;s/"[^"]+"/``&''/
2643         Use `path' only when it refers to search paths, use
2644         `file name' otherwise.
2645         Fix various errors (based on patch by Benno Schulenberg)
2646
2647         * doc/tar.texi (Operation Summary): Restore alphabetical order of
2648         the options.
2649
2650 2007-06-02  Sergey Poznyakoff  <gray@gnu.org.ua>
2651
2652         Fix bug, introduced on 2007-03-30.
2653
2654         * src/common.h (xform_type): New data type
2655         (transform_member_name): Last argument is of xform_type type
2656         All callers updated
2657
2658         * src/extract.c: Update calls to transform_member_name
2659         * src/list.c (decode_xform): Exempt symbolic links from component
2660         stripping and name suffix normalization.
2661
2662         * tests/extrac07.at: Update
2663
2664 2007-05-30  Sergey Poznyakoff  <gray@gnu.org.ua>
2665
2666         * src/xheader.c (decx): Unknown pax keywords produce a warning,
2667         not error.
2668
2669 2007-05-29  Paul Eggert  <eggert@cs.ucla.edu>
2670
2671         * src/misc.c (set_file_atime): Use gl_futimens, not futimens,
2672         due to gnulib change.
2673
2674 2007-05-19  Sergey Poznyakoff  <gray@gnu.org.ua>
2675
2676         * src/common.h (buffer_write_global_xheader): New function
2677         (struct xheader): Move definition to tar.h
2678         (extended_header): Remove global
2679         (xheader_init): New function
2680         (xheader_decode_global,xheader_store,xheader_read)
2681         (xheader_write_global,xheader_write,xheader_string_begin)
2682         (xheader_string_add,xheader_string_end): Take xhdr as first
2683         argument.
2684         * src/tar.h (struct xheader): New definition
2685         (struct tar_stat_info): New member xhdr (extended header).
2686
2687         * src/xheader.c (xheader_init): New function
2688         (xheader_decode_global,xheader_store,xheader_read)
2689         (xheader_write_global,xheader_write,xheader_string_begin)
2690         (xheader_string_add,xheader_string_end): Take xhdr as first
2691         argument.
2692
2693         * src/buffer.c (buffer_write_global_xheader): New function
2694         Update to use new xheader calls.
2695
2696         * src/compare.c, src/create.c, src/delete.c, src/list.c,
2697         src/sparse.c, src/tar.c, src/update.c: Global extended_header
2698         removed, use new xheader calls instead.
2699
2700         * tests/T-null.at: Minor fix
2701         * tests/atlocal.in (tarball_prereq): Discard eventual md5sum
2702         output.
2703
2704 2007-05-18  Sergey Poznyakoff  <gray@gnu.org.ua>
2705
2706         * src/create.c (dump_file0): Original ctime cannot be used as a
2707         directory change indicator if --remove-files is given.
2708
2709 2007-04-12  Paul Eggert  <eggert@cs.ucla.edu>
2710
2711         Adjust to latest Gnulib.
2712         * lib/.cvsignore: Add dirfd.c, dirfd.h, float+.h, mbscasecmp.c,
2713         stdio.h, stdio_.h, stdlib.h, stdlib_.h, time.h, time_.h, unistd.h.
2714         Remove exit.h, getcwd.h, mempcpy.h, memrchr.h, mkdtemp.h, stpcpy.h,
2715         strcase.h, strchrnul.h, strdup.h, strndup.h, strnlen.h, time_r.h,
2716         vsnprintf.h.
2717         * m4/.cvsignore: Remove localedir.h.  Sort.
2718
2719 2007-04-03  Paul Eggert  <eggert@cs.ucla.edu>
2720
2721         * src/common.h (closeopen): Remove decl.
2722         * src/misc.c: Don't include <sys/time.h>, <sys/resource.h>; no longer
2723         needed.
2724         (get_max_open_files, closeopen): Remove.  All callers removed.
2725         (chdir_dir): Use a different technique, which doesn't rely on closing
2726         all open files.
2727         * src/tar.c (main): Don't call closeopen.
2728
2729 2007-04-04  Sergey Poznyakoff  <gray@gnu.org.ua>
2730
2731         * NEWS: Update
2732         * doc/tar.texi: Update
2733         * src/system.c (sys_exec_info_script): Store the
2734         inter-communication fd in the environment variable TAR_FD
2735
2736 2007-04-03  Sergey Poznyakoff  <gray@gnu.org.ua>
2737
2738         * src/tar.c (main): Move closeopen after decode_options to
2739         allow shell process substitution to work.
2740         * tests/extrac07.at: Expect a warning on stderr.
2741
2742 2007-03-30  Sergey Poznyakoff  <gray@gnu.org.ua>
2743
2744         * src/common.h (transform_name_fp): Change signature
2745         (transform_member_name): New function
2746         * src/extract.c (extract_link, extract_symlink): Use
2747         transform_member_name instead of safer_name_suffix so that
2748         --transform and --strip-components affect links as well.
2749         * src/list.c (transform_member_name): New function
2750         (decode_header): Use transform_member_name
2751         * src/names.c (all_names_found): Remove check for matching_flags.
2752         * NEWS: Update
2753
2754         * TODO: Update
2755         * bootstrap (slurp): Remove any occurrences of $bt from the
2756         generated gnulib.mk
2757         * src/incremen.c: Do not include mkdtemp.h
2758
2759 2007-01-26  Paul Eggert  <eggert@cs.ucla.edu>
2760
2761         Adjust to recent gnulib changes.
2762         * lib/.cvsignore: Add fchownat.c, rmt-command.h, strerror.c, string.h,
2763         string_.h, sys, sys_time_.h, unistd_.h, wchar_.h, wctype_.h.
2764         Remove localedir.h, size_max.h, xsize.h.
2765         * src/xheader.c: Don't include stpcpy.h; no longer needed, now that
2766         gnulib string.h defines stpcpy on all platforms.
2767
2768 2007-01-23  Sergey Poznyakoff  <gray@gnu.org.ua>
2769
2770         * doc/tar.texi: Document --exclude-caches* and --exclude-tag*
2771         options.
2772         * src/common.h (exclude_caches_option): Remove
2773         (enum exclusion_tag_type): New data type
2774         (add_exclude_tag): Rename to add_exclusion_tag
2775         (cachedir_file_p): New prototype
2776         * src/create.c (struct exclude_tag): rename to exclusion_tag
2777         (check_exclusion_tags): New function
2778         (cachedir_file_p): New function (from check_cache_directory)
2779         (dump_dir0,dump_file0): Use check_exclusion_tags
2780         * src/tar.c: New options --exclude-caches-all,
2781         --exclude-caches-under, --exclude-tag-all, --exclude-tag-under
2782         * tests/exclude.at: New file
2783         * tests/Makefile.am (TESTSUITE_AT): Add exclude.at
2784         * tests/testsuite.at: Add exclude.at
2785
2786 2007-01-19  Sergey Poznyakoff  <gray@gnu.org.ua>
2787
2788         * gnulib.modules: Require strerror
2789         * doc/gendocs_template: Fix typos
2790         * scripts/xsparse.c (expand_sparse): use ftruncate to handle the
2791         trailing hole
2792         * src/sparse.c (sparse_skip_file,pax_dump_header_1)
2793         (pax_decode_header): Keep track of the number of bytes
2794         written.
2795         * configure.ac: Version 1.16.2
2796         * NEWS: Update
2797
2798 2007-01-04  Sergey Poznyakoff  <gray@gnu.org.ua>
2799
2800         * src/compare.c (diff_dumpdir): Compare directory contents using
2801         dumpdir_cmp.  Do not free dumpdir_buffer, it will leave the
2802         incremental directory table in the inconsistent state and trigger
2803         full dump.
2804         (read_and_process): Process dumpdirs no matter what the archive
2805         format.
2806         * src/incremen.c (list_dumpdir): Minor fixes.
2807
2808         * src/compare.c (read_and_process): Fix type of "size"
2809
2810 2006-12-13  Sergey Poznyakoff  <gray@gnu.org.ua>
2811
2812         * tests/T-null.at: Skip the test if genfile is not able to create
2813         the filename with an embedded newline.
2814
2815 2006-12-12  Paul Eggert  <eggert@cs.ucla.edu>
2816
2817         Port to Forte Developer 7 C 5.4 and C99.
2818         * src/common.h (add_exclude_tag): Add decl; C99 requires this
2819         and Forte warns about it.
2820         * src/incremen.c: Include <mkdtemp.h> for mkdtemp prototype,
2821         for same reason.
2822         * src/misc.c (get_max_open_files): Rewrite to avoid code that
2823         Forte C complains about as being unreachable.
2824         * src/xheader.c (mtime_code): Rewrite to avoid Forte error
2825         reported by Trond Hasle Amundsen.
2826
2827         * src/incremen.c (compare_dirnames): Rewrite to avoid casts.
2828         * src/utf8.c (string_ascii_p): Likewise.
2829         * src/xheader.c (mtime_coder, volume_size_coder, volume_offset_coder):
2830         Likewise.
2831
2832 2006-12-08  Sergey Poznyakoff  <gray@gnu.org.ua>
2833
2834         * bootstrap: Add paxutils files to dot_ignore.
2835
2836         * configure.ac: Raise version number to 1.16.1
2837         * bootstrap (slurp): Create .(cvs|git)ignore if not present
2838         * po/.cvsignore, m4/.cvsignore: Remove automatically generated
2839         files.
2840
2841 2006-12-07  Sergey Poznyakoff  <gray@gnu.org.ua>
2842
2843         * NEWS: Update
2844         * Makefile.am (distclean-local): Fixed
2845         * doc/tar.texi: Update documentation of --exclude-tag
2846         * src/create.c (dump_dir0): Move checks for exclude tags to
2847         dump_file0.
2848         (dump_dir): Move calls to ensure_slash to dump_file0
2849         * src/extract.c (extract_file): Call skip_member if open fails.
2850         Patch proposed by Jan-Benedict Glaw <jbglaw@lug-owl.de>
2851         * tests/truncate.at: Use genfile instead of dd, because on some
2852         systems /dev/zero is not available.
2853
2854 2006-12-04  Paul Eggert  <eggert@cs.ucla.edu>
2855
2856         * NEWS: Fix some race conditions with tar -x --same-owner.
2857         * src/extract.c (ARCHIVED_PERMSTATS): Add a comment saying that
2858         S_IRWXG | S_IRWXO might be masked out.
2859         (set_mode): Set the mode if some bits were masked out originally.
2860         (set_stat): Don't chmod before chown, as that might temporarily
2861         grant permissions that we don't want to grant.  The chmod was
2862         there only to work around broken hosts, so add a comment advising
2863         users not to use those broken hosts instead.
2864         (repair_delayed_set_stat, extract_dir):
2865         Remember to mask out current umask before inverting permissions.
2866         (extract_dir): If the owner might change, or if the mode has
2867         special bits, create the directory 700 at first, but restore it later.
2868         (open_output_file): New arg mode; all uses changed.
2869         (extract_file, extract_node, extract_fifo): If the owner might
2870         change, omit group and other bits at first, but restore them after
2871         changing the owner.
2872
2873 2006-12-04  Jim Meyering  <jim@meyering.net>
2874
2875         * doc/tar.texi (Long Options): Remove doubled word.
2876
2877 2006-11-30  Sergey Poznyakoff  <gray@gnu.org.ua>
2878
2879         * src/xheader.c (xheader_read): Remove unused variable
2880
2881         * po/POTFILES.in: Remove src/mangle.c
2882
2883         * bootstrap: Implement --update-po and .bootstrap
2884
2885         * src/create.c (dump_dir0): Implement --exclude-tag option
2886         * src/tar.c: Likewise
2887         * doc/tar.texi (exclude): Document --exclude-tag
2888
2889 2006-11-29  Paul Eggert  <eggert@cs.ucla.edu>
2890
2891         * NEWS: Remove support for mangled names.
2892         * doc/tar.texi (verbose tutorial): Likewise.
2893         * src/Makefile.am (tar_SOURCES): Remove mangle.c.
2894         * src/common.h (extract_mangle): Remove decl.
2895         * src/extract.c (extract_mangle_wrapper): Remove.
2896         (prepare_to_extract): Remove support for mangled names.
2897         * src/list.c (read_and, print_header): Likewise.
2898         * src/mangle.c: Remove.
2899         * src/tar.h (GNUTYPE_NAMES): Remove.
2900
2901         Port to latest gnulib.  There were a lot of changes, so the
2902         simplest way to get this up and running was to switch to coreutils
2903         bootstrap procedure.  I noticed one feature missing after this
2904         merge: the ability to update a single .po file.  I can add that
2905         later if need be.
2906         * README-cvs, bootstrap.conf: New files.
2907         * lib/.cvsignore: Remove Makefile.am, printf-parse.c, vasnprintf.c.
2908         Add fstatat.c, gnulib.mk, openat-proc.c, same-inode.h, stat_.h,
2909         tempname.c, tempname.h, uinttostr.c.
2910         * lib/printf-parse.c, lib/vasnprintf.c: New files, from coreutils,
2911         to override gnulib, so that we don't need xsize.h.
2912         * bootstrap: Replace with coreutils bootstrap, except add support
2913         for paxutils.
2914         * configure.ac (gl_USE_SYSTEM_EXTENSIONS): Remove, as gl_EARLY now
2915         does this.
2916         (gl_EARLY, gl_INIT): Add.
2917         (tar_GNULIB): Remove.
2918         * gnulib.modules: Add configmake.
2919         * lib/Makefile.tmpl: Remove, replacing with....
2920         * lib/Makefile.am: New file.
2921         * src/Makefile.am (tar.o): Remove dependency: Automake does this
2922         for us.
2923         * src/tar.c: Include <configmake.h> and <rmt-command.h>, not
2924         <localedir.h>.
2925
2926 2006-11-13  Sergey Poznyakoff  <gray@gnu.org.ua>
2927
2928         * src/xheader.c (mtime_coder): Treat non-null data as a pointer to
2929         struct timespec, overriding st->mtime
2930         * src/create.c (start_header): Pass mtime as a call-specific data
2931         to xheader_store.
2932
2933         * tests/truncate.at: Do not use 'k' modifier in dd options.
2934         * tests/append02.at: Do not depend on command timing.
2935
2936 2006-11-01  Sergey Poznyakoff  <gray@gnu.org.ua>
2937
2938         * src/tar.c (enum read_file_list_state.file_list_skip): New value
2939         (read_name_from_file): Skip zero-length entries
2940
2941         * tests/T-empty.at: New test case
2942         * tests/T-null.at: New test case
2943         * tests/extrac07.at: New test case
2944         * tests/Makefile.am: Add new test cases.
2945         * tests/testsuite.at: Add new test cases.
2946         * tests/extrac02.at: Add more keywords
2947         * tests/extrac04.at: Likewise
2948         * tests/extrac06.at: Likewise
2949         * tests/shortrec.at: Do not assume tar's default archive is stdout
2950
2951 2006-10-31  Sergey Poznyakoff  <gray@gnu.org.ua>
2952
2953         * src/extract.c, src/xheader.c: Call last_component instead of
2954         base_name. The latter returns a malloced string since 2006-03-11.
2955
2956 2006-10-21  Sergey Poznyakoff  <gray@gnu.org.ua>
2957
2958         * NEWS, configure.ac: Version 1.16
2959         * Makefile.am (distclean-local): New rule
2960
2961 2006-10-17  Sergey Poznyakoff  <gray@gnu.org.ua>
2962
2963         * src/tar.c: Fix help output formatting.  Thanks Benno
2964         Schulenberg.
2965
2966 2006-10-16  Sergey Poznyakoff  <gray@gnu.org.ua>
2967
2968         * Makefile.am (dist-hook): Create a cpio archive.
2969         * NEWS: Update
2970
2971 2006-10-14  Sergey Poznyakoff  <gray@gnu.org.ua>
2972
2973         * doc/tar.texi (Synopsis): Document tar exit codes.
2974         * src/create.c (dump_regular_file,dump_file0): Set exit_status to
2975         TAREXIT_DIFFERS if the file being dumped was truncated or
2976         otherwise changed.
2977         * src/tar.c: Do not attempt to close stderr after call to
2978         close_stdout.
2979         * tests/grow.at: New test case
2980         * tests/Makefile.am: New test grow.at
2981         * tests/testsuite.at: Likewise
2982         * tests/truncate.at (AT_KEYWORDS): Keyword `filechange'
2983         Test tar exit status.
2984
2985         * src/buffer.c (_open_archive): Make sure stdlis is set to stderr
2986         when we are writing archive to stdout (unless --index-file is
2987         used). Bug introduced on 2006-07-06.
2988         * tests/Makefile.am: New test verbose.at
2989         * tests/testsuite.at: Likewise
2990         * tests/indexfile.at (AT_KEYWORDS): Add stdout keyword
2991         * tests/verbose.at: New test case
2992
2993 2006-10-02  Sergey Poznyakoff  <gray@gnu.org.ua>
2994
2995         * THANKS: Add Joerg Weilbier
2996         * src/buffer.c (new_volume): Initialize current_block
2997         * src/xheader.c (xheader_string_end): Fix diagnostic message.
2998         * tests/multiv05.at: New testcase.
2999         * tests/Makefile.am, tests/testsuite.at: Add multiv05.at
3000
3001 2006-09-27  Sergey Poznyakoff  <gray@gnu.org.ua>
3002
3003         * bootstrap: Use ${package} instead of hardcoding package name
3004         * doc/tar.texi: Minor fix
3005         * src/tar.c (doc0, doc1, initialize_argp_doc): Removed.  Rely on
3006         the new argp method instead.
3007
3008 2006-09-12  Sergey Poznyakoff  <gray@gnu.org.ua>
3009
3010         * README: Fix a typo
3011
3012 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
3013
3014         Adjust to latest gnulib.
3015         * lib/.cvsignore: Add at-func.c, configmake.h, fchmodat.c,
3016         fcntl.h, fcntl_.h, inttypes_.h, lstat.c, lstat.h.
3017         * tests/testsuite.at (AT_TAR_MKHIER): Use install-sh -d
3018         rather than the no-longer-included mkinstalldirs.
3019
3020 2006-09-08  Sergey Poznyakoff  <gray@gnu.org.ua>
3021
3022         * src/incremen.c (try_purge_directory): Initialize struct st.  Fix
3023         condition for selecting candidates for removal.
3024         * README-alpha: List texinfo among build prerequisites for the CVS
3025         version.
3026
3027         * bootstrap (intl_files_to_remove): Do not remove m4/inttypes-h.m4
3028         and m4/inttypes-pri.m4
3029
3030 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
3031
3032         * bootstrap: Set XGETTEXT_OPTIONS to flag our printf-format functions,
3033         so that translators are warned about strings that are formats but
3034         don't look like formats.  This might help prevent core dumps.
3035         * configure.ac (AM_GNU_GETTEXT): Upgrade to need-formatstring-macros.
3036         Suggested by Eric Blake to avoid problems like
3037         <http://lists.gnu.org/archive/html/bug-coreutils/2006-07/msg00087.html>.
3038         (AM_GNU_GETTEXT_VERSION): Upgrade from 0.12.1 to 0.15.  The gettext
3039         manual says we should use the version number normally expected of
3040         maintainers, neither more nor less.
3041
3042         * bootstrap (get_translations):
3043         Don't exclude ky.po; it is working again.
3044
3045 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
3046
3047         * bootstrap (get_translations):
3048         Don't exclude ja.po; it is working again.
3049         Don't remove all old .po files if we're merely updating one.
3050         * po/.cvsignore: Add Makevars.
3051
3052 2006-08-07  Paul Eggert  <eggert@cs.ucla.edu>
3053
3054         * src/tar.c: Work around limitation imposed by gettext 0.15
3055         by concatenating strings with "\v" after translation.
3056         (doc): Remove, splitting into:
3057         (doc0, doc1): New constants.
3058         (argp): Don't use doc; just initialize to NULL.
3059         (initialize_argp_doc): New function.
3060         (decode_options): Use it.
3061
3062         * bootstrap: Redo po file retrieval to match Bison's method,
3063         since the translation project changed its index format.
3064         Don't use --assume-autoconf; it's now replaced
3065         by looking in configure.ac.
3066         (m4/codeset.m4, m4/intdiv.m4, m4/inttypes-pri.m4, m4/isc-posix.m4):
3067         (m4/lcmessage.m4, m4/onceonly_2_57.m4, m4/gettext.m4, m4/glibc21.m4):
3068         (m4/inttypes_h.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4):
3069         (m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4):
3070         Don't rename to ..._gl.m4, as this is no longer needed.
3071         (m4/geteext.m4): Patch to remove the need for intl/*.
3072         Use autopoint manually, then remove the intl files,
3073         then undo changes to gnulib files that autoreconf made,
3074         and then run aclocal/autoconf/autoheader/automake.
3075         This makes our bootstrap procedure closer to Bison's.
3076         (po/Makevars): Generate automatically.
3077         * configure.ac (AC_PREREQ): Update from 2.59 to 2.60.
3078         (gl_AC_TYPE_INTMAX_T, jm_AC_TYPE_UINTMAX_T): Remove.
3079         * gnulib.modules: Add inttypes, stdint.
3080         * lib/.cvsignore: Add close-stream.c, close-stream.h,
3081         stdint.h, stdint_.h.
3082         * po/Makefile: Remove; now automatically generated.
3083
3084         * src/incremen.c (read_incr_db_01): Check input strings more
3085         carefully.  Do not pass arbitrary char values to isspace, as
3086         this has undefined behavior.  Likewise for assigning arbitrary
3087         uintmax_t values to other types.
3088         (read_negative_num, read_unsigned_num, read_timespec):
3089         New functions, to check input values a bit more carefuly.
3090         (read_num): Use read_unsigned_num.  New arg MAX_VAL;
3091         all callers changed.
3092         (read_incr_db_2): Use these new functions.
3093         Use a consistent diagnostic for unexpected EOF.
3094         (read_directory_file): Do not assign arbitrary uintmax_t value
3095         to int.
3096         (read_timespec, write_directory_file_entry, write_directory_file):
3097         Handle negative time_t values correctly.  We don't bother to do
3098         this with pre-2 formats, since presumably the time stamps were
3099         output incorrectly.
3100
3101         * src/tar.c (doc): Don't use \v in an argument to gettext;
3102         gettext 0.15 rejects this.
3103
3104 2006-07-24  Sergey Poznyakoff  <gray@gnu.org.ua>
3105
3106         * src/tar.c (decode_options): Do not require -L with -M -Hpax.
3107         It could be needed in future, but currently it is not.
3108         * src/create.c (to_chars_subst): Update comment regarding OLDGNU
3109         vs. GNU format differences.
3110         (mode_to_chars): Treat OLDGNU_FORMAT same as GNU_FORMAT. Fixes bug
3111         reported by TAMUKI Shoichi <tamuki@linet.gr.jp>, which caused
3112         equivalent `tar cf ...' and `tar rf ...' commands to produce
3113         different archives.
3114
3115         * tests/append02.at: New test case
3116         * tests/Makefile.am, tests/testsuite.at: Add append02.at
3117
3118 2006-07-20  Paul Eggert  <eggert@cs.ucla.edu>
3119
3120         * bootstrap: Adjust to today's change to gnulib-tool by invoking
3121         it with --assume-autoconf='latest-stable'.
3122
3123 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
3124
3125         Adjust to recent gnulib changes.
3126         * lib/.cvsignore: Remove atexit.c, exit.c, getndelim2.c, getndelim2.h,
3127         pathmax.h, paxconvert.c, paxerror.h, xstrdup.c.
3128         Add inttypes.h, mktime.c, wcwidth.h, xstrndup.c, xstrndup.h.
3129         * src/create.c (start_header): Adjust to API change to mode_adjust.
3130
3131 2006-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3132
3133         * THANKS: Add Ralf Wildenhues
3134         * NEWS: Update
3135
3136 2006-07-09  Ralf Wildenhues   <Ralf.Wildenhues@gmx.de>
3137
3138         * doc/dumpdir.texi, doc/snapshot.texi, doc/sparse.texi,
3139         doc/tar.texi: Fix some typos.
3140
3141 2006-07-06  Sergey Poznyakoff  <gray@gnu.org.ua>
3142
3143         tar --index-file=FILE --file=- sent the archive to FILE, and
3144         the listing to stderr. Bug reported by Marcin Gryszkalis
3145         <mg@fork.pl>
3146
3147         * src/buffer.c (_open_archive): Remove stdlis initialization
3148         * src/tar.c (decode_options): Initialize stdlis
3149         * tests/indexfile.at: New test case
3150         * tests/testsuite.at: Include indexfile.at
3151         * tests/Makefile.am (TESTSUITE_AT): Add indexfile.at
3152
3153 2006-07-05  Sergey Poznyakoff  <gray@gnu.org.ua>
3154
3155         * doc/Makefile.am (manual): Fix TEXINPUTS
3156         * doc/rendition.texi (FIXME): Do not use deprecated @quote-args.
3157         Do not use @allow-recursion. In its current form the macro is not
3158         recursive.
3159
3160 2006-07-03  Sergey Poznyakoff  <gray@gnu.org.ua>
3161
3162         * bootstrap (update_po): Fix single translation update
3163
3164 2006-07-03  Sergey Poznyakoff  <gray@gnu.org.ua>
3165
3166         * configure.ac (AC_CHECK_FUNCS): Check for getdtablesize
3167         * src/common.h (closeopen): New function
3168         * src/misc.c (chdir_arg): Use x2nrealloc to reallocate wd.
3169         (get_max_open_files,closeopen): New functions
3170         (chdir_do): Do not use save_cwd if it was already used more than
3171         max_open_files-4 times to avoid running off the file
3172         descriptors.
3173         * src/tar.c (main): Call closeopen
3174         * doc/tar.texi: Update --directory description
3175         * NEWS: Update
3176
3177 2006-06-26  Sergey Poznyakoff  <gray@gnu.org.ua>
3178
3179         * doc/tar.texi: Update. Add cross-references.
3180         * doc/sparse.texi: Add cross-references.
3181
3182 2006-06-25  Sergey Poznyakoff  <gray@gnu.org.ua>
3183
3184         * scripts/xsparse.c: A sample utility to expand sparse files
3185         extracted by third-party tars. It is not meant to be installed nor
3186         to be included in the distribution. It is here, so that it can be
3187         obtained either from CVS or from the tar web site.
3188         * doc/Makefile.am (tar_TEXINFOS): Sorted
3189         * doc/tar.texi (Other Tars): New node describing how to extract
3190         GNU-specific member formats using third-party tars.
3191         * src/common.h (sparse_file_p): Remove
3192         * src/sparse.c: Likewise
3193         * src/create.c: Use ST_IS_SPARSE instead of sparse_file_p (update
3194         paxutils first)
3195         * src/tar.c: --sparse-version turns on --sparse
3196
3197 2006-06-24  Sergey Poznyakoff  <gray@gnu.org.ua>
3198
3199         * src/buffer.c (print_total_stats): Add default case.
3200         * src/common.h (name_init): New prototype.
3201         (xheader_string_end): Return bool.
3202         * src/extract.c (extract_volhdr): Add missing return
3203         * src/incremen.c: Remove not used variables
3204         * src/sparse.c (pax_dump_header_0): Return false if
3205         xheader_string_end fails (for 0.1 formats).
3206         (pax_dump_header): Return meaningful value
3207         * src/transform.c (segm_count): Change type to size_t
3208         * src/xheader.c (xhdr_tab.decoder): pass keyword as a second
3209         argument. All callers changed.
3210         (decode_record): Check for numeric overflow
3211         (xheader_string_end): Return boolean value. Check for possible
3212         numeric overflow
3213
3214 2006-06-23  Sergey Poznyakoff  <gray@gnu.org.ua>
3215
3216         * doc/sparse.texi: New file
3217         * doc/Makefile.am (tar_TEXINFOS): Add sparse.texi
3218         * doc/intern.texi (Sparse Formats): New node
3219         * doc/tar.texi: Update master menu
3220
3221         * src/common.h (tar_sparse_major,tar_sparse_minor): New globals.
3222         * src/sparse.c: Implement sparse format versioning. Implement new
3223         version (1.0) of PAX sparse format.
3224         (pax_sparse_member_p): Fix condition
3225         (pax_dump_header): A dispatcher function
3226         (pax_dump_header_0,pax_dump_header_1): New functions.
3227         (pax_optab): Update
3228         (oldgnu_dump_header): Minor fix: make sure
3229         sparse_header.isextended is set before calling
3230         set_next_block_after
3231         * src/tar.c: New option --sparse-version
3232         * src/tar.h (struct tar_stat_info.sparse_major,sparse_minor): New
3233         members.
3234         * src/xheader.c: Implement new keywords: GNU.sparse.name,
3235         GNU.sparse.major, GNU.sparse.minor, GNU.sparse.realsize
3236
3237         * tests/spmpv00.at, tests/spmvp01.at, tests/spmvp10.at: New
3238         testcases.
3239
3240         * tests/Makefile.am: Add spmvp00.at, spmpv01.at, spmpv10.at
3241         * tests/shortrec.at: Explicitely give `-f -' to the tar invocation
3242         * tests/sparsemvp.at: Rewritten as an include file.
3243         (TAR_MVP_TEST): New macro
3244         * tests/testsuite.at: Include sparsemvp.at, spmvp00.at,
3245         spmvp01.at, spmvp10.at
3246
3247 2006-06-21  Sergey Poznyakoff  <gray@gnu.org.ua>
3248
3249         * doc/tar.texi (Overriding File Metadata): New node
3250         Document --mtime option.
3251         * src/common.h (set_mtime_option,mtime_option): New globals
3252         * src/create.c (start_header): Override mtime if requested
3253         * src/tar.c: Implement new option, --mtime, allowing to set
3254         modification times for all archive members during creation.
3255         (struct tar_args): textual_date_option replaced with a linked list
3256         textual_date. All references updated.
3257         (get_date_or_file,report_textual_dates): New functions.
3258         * configure.ac: Raise version number to 1.15.92
3259         * NEWS: Update
3260
3261 2006-06-20  Sergey Poznyakoff  <gray@gnu.org.ua>
3262
3263         * src/common.h (struct name.explicit): Remove
3264         Use variable names in all declarations
3265         (name_scan): Remove second argument
3266         * src/delete.c: Remove second argument from calls to name_scan
3267         * src/update.c: Likewise
3268         * src/incremen.c (procdir): Use is_individual_file to check for
3269         files explicitely specified in the command line. Fixes bug
3270         reported by Dat Head on 19 Jun 2006 (descending into mountpoints
3271         with --one-file-system in use)
3272         * src/misc.c (maybe_backup_file): Second argument is bool
3273         * src/names.c (name_next_elt): Call register_individual_file
3274         (namelist_match): Remove third argument
3275         (name_match): Change return type to bool
3276         (name_scan): Remove second argument
3277         * src/sparse.c (pax_dump_header): Store original sparse file name
3278         in GNU.sparse.name variable. The name field in the ustar header
3279         now contains generated name (%d/GNUSparseFile.%p/%f), so that
3280         non-pax-aware tars won't extract the file under the original
3281         filename.
3282         * src/xheader.c (GNU.sparse.name): New variable for storing sparse
3283         file name.
3284
3285 2006-06-13  Sergey Poznyakoff  <gray@gnu.org.ua>
3286
3287         * doc/Makefile.am (check-options): Expand macros before grepping
3288         in $(info_TEXINFOS)
3289         * doc/rendition.texi (FIXME) [!PROOF_FOOTNOTED]: Enclose in a
3290         cartouche
3291         * doc/tar.texi: Define op as codeindex. Use special macros to
3292         populate it
3293         Consequently prefer @dfn{long options} over @dfn{mnemonic
3294         options}.
3295         Document --unquote, --no-unquote
3296         (Short Option Summary): Build a table of cross-references to the
3297         corresponding long options.
3298         (Using Multiple Tapes,Multi-Volume Archives): Rewritten
3299
3300         * doc/value.texi (xopindex,opsummary): New macros
3301
3302         * doc/Makefile.am (check-options): New goal
3303         * doc/tar.texi: Update
3304         * src/tar.c: Implement --overwrite-dir option (long ago
3305         documented).
3306
3307 2006-06-12  Sergey Poznyakoff  <gray@gnu.org.ua>
3308
3309         * doc/tar.texi: Document better the --totals option
3310         * NEWS: Update
3311         * src/buffer.c (total_blocks_deleted): New variable
3312         (set_start_time): Set volume_start_time and last_stat_time as well
3313         (set_volume_start_time): New function
3314         (compute_duration): Do not call set_start_time, update
3315         last_stat_time instead. Use it in calculation instead of
3316         start_time, which is now set only once, upon startup.
3317         (print_total_written): Removed.
3318         (print_total_stats): New function for printing byte/speed statistics.
3319         (_open_archive): Detect attempts to update compressed archives.
3320         (_gnu_flush_write): Always update prev_written.
3321         (open_archive): Call set_volume_start_time.
3322         * src/common.h (volume_start_time,last_stat_time): New globals
3323         (print_total_written): Replaced with:
3324         (print_total_stats): New function
3325         * src/delete.c (records_skipped): Remove static qualifier, the
3326         variable is used by print_total_stats in buffer.c
3327         * src/extract.c (check_time): Use volume_start_time when checking
3328         for timestamp plausability.
3329         * src/tar.c: (options, parse_opt): Allow for optional argument to
3330         the --totals option, which specifies a signal upon delivery of which
3331         the statistics must be output.
3332         (main): Call print_total_stats if total_option is set.
3333
3334 2006-06-11  Sergey Poznyakoff  <gray@gnu.org.ua>
3335
3336         * src/xheader.c (xheader_set_single_keyword): Fix typo.
3337         (decode_time): Avoid using gotos.
3338
3339         * doc/mastermenu.el: New file
3340         * doc/Makefile.am (master-menu): New goal
3341         * doc/tar.texi: Update master menu
3342
3343 2006-06-10  Sergey Poznyakoff  <gray@gnu.org.ua>
3344
3345         * doc/tar.texi: Remove leftover include
3346
3347 2006-06-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3348
3349         * doc/Makefile.am (tar_TEXINFOS): Add intern.texi
3350         (EXTRA_DIST): Remove convtexi.pl, add texify.sed
3351         * doc/intern.texi: New file
3352         * doc/convtexi.pl: Remove
3353         * doc/texify.sed: Auxiliary script to convert ../src/tar.h to
3354         header.texi
3355         * doc/rendition.texi: Fix typo
3356         * doc/tar.texi: Update
3357         * src/tar.h: Fix indentation, introduce end-of-format marker for
3358         texify.sed
3359
3360         * THANKS: Add Jason Armistead
3361         * doc/tar.texi: Update
3362         * NEWS: Update
3363         * src/buffer.c: Implement more flexible checkpoint style
3364         * src/common.h (checkpoint_option): Change type to unsigned
3365         (checkpoint_style): New variable.
3366         * src/tar.c: --checkpoint takes an optional argument specifying
3367         number of records between two successive checkpoints (proposed
3368         by Jason Armistead on 2004-06-22).  Optional dot starting the
3369         argument means "print dots instead of textual checkpoints".
3370         (tar_help): New function
3371         * src/transform.c: Minor fixes.
3372
3373 2006-06-08  Sergey Poznyakoff  <gray@gnu.org.ua>
3374
3375         * gnulib.modules: Add mkdtemp
3376         * doc/dumpdir.texi: New file
3377         * doc/Makefile.am (tar_TEXINFOS): Add dumpdir.texi
3378         * doc/tar.texi: Document dumpdir format
3379         * src/incremen.c (dumpdir_locate,obstack_code_rename):
3380         (purge_directory): Re-implement renaming. Introduce
3381         'X' control code.
3382         (make_tmp_dir_name): Remove
3383
3384         * src/transform.c (set_transform_expr,_transform_name_to_obstack):
3385         Implement NUMBER flag.
3386         (add_char_segment): Fix length assignement
3387
3388         * doc/tar.texi: Update
3389
3390 2006-06-07  Sergey Poznyakoff  <gray@gnu.org.ua>
3391
3392         * src/transform.c (transform_name_fp): Run fun even if
3393         _transform_name_to_obstack returns false.
3394         (_transform_name_to_obstack,set_transform_expr): Implement GNU
3395         extension case conversion operations.
3396
3397         * doc/tar.texi (transform): Document the option.
3398
3399 2006-06-02  Sergey Poznyakoff  <gray@gnu.org.ua>
3400
3401         * NEWS: Update
3402         * src/common.h (set_transform_expr): New function
3403         * tests/Makefile.am: Add incr04.at
3404         * tests/testsuite.at: Likewise
3405         * tests/incr04.at: New test case
3406         * tests/long01.at: Fix typo in the comment
3407         * tests/multiv04.at: Use genfile --files-from
3408
3409         (Above changes need new genfile.c from paxutils)
3410
3411         * TODO: Update
3412         * NEWS: Update
3413         * doc/tar.texi: Update
3414         * src/transform.c: New file
3415         * src/Makefile.am (tar_SOURCES): New module transform.c
3416         * src/common.h (transform_name, transform_name_fp): New functions
3417         (show_stored_names_option): Renamed to
3418         show_transformed_names_option. All uses changed
3419         * src/create.c (dump_file0): Transform file name
3420         * src/extract.c (extract_archive): safer_name_suffix and
3421         stripped_prefix_len are now called by decode_header
3422         * src/list.c (print_header): Update displayable name selection.
3423         * src/tar.c: New option --transform
3424         New option --show-transformed-names generalizes
3425         --show-stored-names. The latter is retained as an alias.
3426
3427 2006-05-31  Sergey Poznyakoff  <gray@gnu.org.ua>
3428
3429         * src/incremen.c (make_directory): Fix initialization of struct
3430         directory.
3431
3432 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
3433
3434         * doc/tar.texi: Document use of globbing patterns.
3435         * src/tar.c (parse_opt): Add comment before --preserve case.
3436
3437 2006-05-24  Sergey Poznyakoff  <gray@gnu.org.ua>
3438
3439         * NEWS: Update
3440         * doc/tar.texi: Update
3441         * configure.ac (AM_INIT_AUTOMAKE): Use tar-ustar option. Raise
3442         version requirement to 1.9
3443         * src/common.h (struct name): Refactured
3444         (warn_regex_usage): New variable.
3445         (dump_file): First argument is const char*.
3446         (name_init,name_add): Removed
3447         (name_add_name,name_add_dir): New functions
3448         (name_next): Return const char*.
3449         * src/create.c: (dump_file,dump_file0): First argument is const
3450         char*. All callers updated.
3451         * src/names.c: Rewritten handling of member names in the command
3452         line. Tar no longer attempts to guess globbing patterns, instead
3453         it relies on --wildcard option.
3454         (init_names): Removed.
3455         (struct name_elt): New structure.
3456         (name_array): Change type to struct name_elt. All references updated
3457         (name_add_name,name_add_dir): New functions
3458         (name_next_elt): New function
3459         (name_next): Rewritten using name_next_elt.
3460         (namelist_match): Rewritten pattern matching using
3461         exclude_fnmatch.
3462         (names_notfound): Warn if globbing patterns were used without
3463         --wildcards option
3464         * src/tar.c (options): Move globbing-related options into a
3465         separate group. Set -l as an alias to --check-links, as required
3466         by UNIX98
3467         (struct tar_args): New fields
3468         wildcards,matching_flags,include_anchored
3469         (MAKE_EXCL_OPTIONS,MAKE_INCL_OPTIONS): New macros
3470         (parse_opt): Use x2nrealloc to grow archive_name_array.
3471         Use MAKE_EXCL_OPTIONS,MAKE_INCL_OPTIONS to create appropriate
3472         fnmatch options, and name_add_name,name_add_dir to handle member
3473         name and -C arguments.
3474         (decode_options): Likewise
3475         (main): Remove call to init_names.
3476
3477         * tests/append.at, tests/append01.at, tests/extrac01.at,
3478         tests/options.at, tests/options02.at, tests/same-order01.at,
3479         tests/same-order02.at: Make AT_SETUP more readable.
3480
3481 2006-05-23  Sergey Poznyakoff  <gray@gnu.org.ua>
3482
3483         * src/buffer.c (change_tape_menu): Fix typo (uninitialized
3484         variable) introduced yesterday.
3485
3486 2006-05-22  Sergey Poznyakoff  <gray@gnu.org.ua>
3487
3488         * doc/tar.texi: Use @var{file_name} instead of @var{file name}
3489         * src/buffer.c (change_tape_menu): Break the loop after obtaining
3490         new archive name. Check for empty input line.
3491
3492 2006-05-15  Sergey Poznyakoff  <gray@gnu.org.ua>
3493
3494         * tests/atlocal.in (XFAILFILE): New variable
3495         * tests/version.at: Create $XFAILFILE on failure
3496         * tests/testsuite.at (AT_TAR_CHECK): Declare expected failure if
3497         $XFAILFILE exists.
3498
3499 2006-05-13  Sergey Poznyakoff  <gray@gnu.org.ua>
3500
3501         * THANKS: Update
3502         * src/buffer.c (read_header0): Use read_header_primitive to avoid
3503         clubbering current_tar_info. All callers updated.
3504         * src/common.h (read_header_primitive): New function
3505         * src/extract.c (extract_volhdr): New function
3506         (prepare_to_extract): Use extract_volhdr as extractor for volume
3507         names.
3508         * src/list.c (read_header_primitive): New function
3509         (read_header): Front end for read_header_primitive
3510         * tests/chtype.at: New file
3511         * tests/volsize.at: New file
3512         * tests/Makefile.am (TESTSUITE_AT): Add chtype.at, volsize.at
3513         (check-full): New target.
3514         * tests/atlocal.in (TEST_DATA_URL,STAR_DATA_URL)
3515         (STAR_TESTSCRIPTS): Provide default values.
3516         (tarball_prereq): New function
3517         * tests/testsuite.at (AT_TARBALL_PREREQ): New defun
3518         (AT_STAR_PREREQ): Rewrite using tarball_prereq
3519         Include chtype.at and volsize.at
3520         * tests/volume.at: Add keywords.
3521
3522         * tests/star/gtarfail.at, tests/star/gtarfail2.at,
3523         tests/star/multi-fail.at, tests/star/pax-big-10g.at,
3524         tests/star/ustar-big-2g.at, tests/star/ustar-big-8g.at
3525         (AT_STAR_PREREQ): Provide md5 sum.
3526
3527         * lib/.cvsignore: Update
3528
3529 2006-05-08  Sergey Poznyakoff  <gray@gnu.org.ua>
3530
3531         * tests/testsuite.at (AT_SORT_PREREQ, AT_UNPRIVILEGED_PREREQ): New
3532         defines
3533
3534         * tests/extrac04.at, tests/incr03.at, tests/listed02.at,
3535         tests/pipe.at, tests/rename01.at, tests/rename02.at,
3536         tests/rename03.at, tests/same-order01.at: Call
3537         AT_SORT_PREREQ. Remove fd 2 redirection after calls to sort
3538         * ignfail.at: Call AT_UNPRIVILEGED_PREREQ
3539
3540 2006-05-08  Sergey Poznyakoff  <gray@gnu.org.ua>
3541
3542         Listed incremental backups: keep more information about
3543         directories. Handle renamed directories more effectively
3544         (initial implementation, more updates to follow).
3545         Source tree before this point is tagged
3546         alpha_1_15_90_incremental_1.
3547
3548         * NEWS: Update
3549         * configure.ac: Raise version number to 1.15.91
3550         * src/common.h (rename_directory,append_incremental_renames): New
3551         functions.
3552         * src/extract.c (rename_directory): New function
3553         * src/incremen.c (struct directory.contents, flags): New members
3554         (nfs,found,new): Remove. Replaced by appropriate bitmask values in
3555         `flags' field. All uses updated.
3556         (directory_meta_table): New table.
3557         (hash_directory): Rename to hash_directory_name
3558         (compare_directories): Rename to compare_directory_names
3559         (hash_directory_meta,compare_directory_meta,find_directory_meta):
3560         New functions
3561         (compare_dirents): Removed
3562         (note_directory): Get 7th argument: directory contents.
3563         All callers updated
3564         (dumpdir_locate,makedumpdir): New functions
3565         (scan_directory): Rewritten. Use makedumpdir to create a sorted
3566         dumpdir array. This makes the obstack argument unnecessary. Besides,
3567         ALL_CHILDREN flag is set only for new directories.
3568         (procdir): Change return type to struct directory. Return
3569         immediately if the directory was already initialized. Discover
3570         directory renames using directory_meta_table.
3571         (append_incremental_renames): New function.
3572         (read_directory_file, write_directory_file): Use new snapshot file
3573         format.
3574         * src/names.c (collect_and_sort_names): Update dir_contents of the
3575         first non-fake name entry when in listed incremental mode.
3576
3577         * tests/incr03.at: New testcase
3578         * tests/rename01.at: New testcase
3579         * tests/rename02.at: New testcase
3580         * tests/rename03.at: New testcase
3581         * tests/Makefile.am: Add
3582         incr03.at,rename01.at,rename02.at,rename03.at
3583         * tests/testsuite.at: Likewise.
3584         * tests/listed02.at: Update for the new behavior
3585         * tests/multiv04.at (AT_KEYWORDS): Add missing incremental kw.
3586
3587 2006-05-02  Sergey Poznyakoff  <gray@gnu.org.ua>
3588
3589         * src/buffer.c (try_new_volume): Attempt to continue if the name
3590         is apparently truncated in a GNU format volume.
3591
3592         * tests/comprec.at, tests/delete01.at, tests/delete02.at,
3593         tests/delete04.at, tests/delete05.at, tests/extrac05.at,
3594         tests/listed01.at, tests/multiv01.at, tests/multiv02.at,
3595         tests/pipe.at, tests/same-order01.at, tests/same-order02.at,
3596         tests/sparse01.at, tests/sparse03.at: Always use genfile --file,
3597         this enables extra error checking.
3598
3599         * tests/multiv03.at: Attempt to extract a member with truncated
3600         file name from the archive.
3601
3602         * src/buffer.c (_open_archive): Remove unnecessary argument to
3603         check_compressed_archive.
3604
3605 2006-04-25  Sergey Poznyakoff  <gray@gnu.org.ua>
3606
3607         * tests/sparse01.at, tests/sparse02.at, tests/sparse03.at,
3608         tests/sparsemv.at, tests/sparsemvp.at: Skip the test if the file
3609         system does not support sparse files.
3610         * doc/tar.texi (@copying): Remove the reference to not existing
3611         invariant section.
3612
3613 2006-04-11  Sergey Poznyakoff  <gray@gnu.org.ua>
3614
3615         * src/extract.c (extract_dir): Fix toggling existing directory
3616         permissions (Debian bug #361077). Use parts of patch provided by
3617         Ian Jackson <iwj@ubuntu.com>.
3618         * src/compare.c: Minor changes
3619         * src/incremen.c (directory.new): New member
3620         (note_directory,find_directory: Use make_directory to create
3621         struct directory entries
3622         (procdir): Avoid duplicating  directories in the incremental
3623         backup map.
3624         * tests/Makefile.am (TESTSUITE_AT): Add extrac06.at
3625         * tests/testsuite.at: Include extrac06.at
3626
3627 2006-03-18  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de> (trivial change)
3628
3629         * tests/atlocal.in (PATH): Add build-aux from the source tree,
3630         not the build tree.
3631
3632 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
3633
3634         * THANKS: Add Benno Schulenberg
3635
3636 2006-03-13  Jim Meyering <jim@meyering.net>
3637
3638         * tests/listed02.at:  Sort the two lines of stderr from the
3639         first `tar -v --listed-incremental'.  They would come out
3640         reversed and provoke a test failure on a tmpfs
3641         file system.
3642
3643 2006-03-13  Benno Schulenberg <benno@nietvergeten.nl>
3644
3645         * doc/tar.texi: Minor fixes.
3646         * src/tar.c (options): Consistently begin help messages with a
3647         lowercase letter.
3648
3649 2006-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>
3650
3651         * tests/Makefile.am (AM_CPPFLAGS): Define LOCALEDIR
3652
3653 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
3654
3655         * src/buffer.c (record_buffer_aligned): New var.
3656         (init_buffer): Use it to ensure that the buffer is aligned.
3657         This doesn't result in any measurable performance improvement
3658         on my host (Debian GNU/Linux 3.1 stable, with default block size),
3659         but I assume it does help on some hosts.
3660
3661         * lib/.cvsignore: Sort.
3662
3663 2006-03-04  Sergey Poznyakoff  <gray@gnu.org.ua>
3664
3665         * tests/shortrec.at: Use -f - to read from stdin.
3666
3667 2006-02-21  Sergey Poznyakoff  <gray@gnu.org.ua>
3668
3669         * doc/tar.texi: Fix typo: --to-command instead of --to-program
3670
3671 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
3672
3673         * tests/multiv04.at (split directory members in a MV archive):
3674         Don't use %X in an awk printf format; this doesn't work with
3675         Solaris 10 /usr/bin/awk.  Use %x instead.
3676
3677 2006-02-20  Sergey Poznyakoff  <gray@gnu.org.ua>
3678
3679         * src/create.c (split_long_name): Fix maximum length estimation.
3680         Patch by Jim Lowe.
3681         * tests/Makefile.am (lustar01.at,lustar02.at,lustar03.at): New
3682         tests.
3683         * tests/atlocal.in: Add build-aux to the PATH
3684         * tests/long01.at: Remove mkhier, use AT_TAR_MKHIER instead
3685         * tests/longv7.at: Reword test title
3686         * tests/lustar01.at: New test
3687         * tests/lustar02.at: New test
3688         * tests/lustar03.at: New test
3689         * tests/testsuite.at (AT_TAR_MKHIER): New macro
3690         (lustar01.at,lustar02.at,lustar03.at): New tests.
3691
3692 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
3693
3694         * bootstrap: Don't claim lib/Makefile.am is generated automatically
3695         from itself.
3696
3697         Avoid installation glitches on Solaris 8 with Sun C 5.4.
3698         * lib/.cvsignore: Add system-ioctl.h.
3699         * lib/Makefile.tmpl (noinst_HEADERS): Add system-ioctl.h.
3700         * src/buffer.c: Include system-ioctl.h.
3701         * src/compare.c: Likewise.
3702         * src/delete.c: Likewise.
3703         * src/system.c: Include <getline.h>, <setenv.h>.
3704         * src/tar.c: Include <getline.h>.
3705
3706 2006-02-19  Sergey Poznyakoff  <gray@gnu.org.ua>
3707
3708         * src/buffer.c (add_chunk_header): Free st.orig_file_name after
3709         calling finish_header().
3710         (new_volume): Prompt the user for archive name if unable to open
3711         next archive.
3712
3713         * src/create.c (dump_file0): Restore file_count_links,
3714         accidentally removed on 2005-11-29.
3715         * configure.ac: Raise version number to 1.15.90
3716         * NEWS: Likewise.
3717
3718 2006-02-08  Sergey Poznyakoff  <gray@gnu.org.ua>
3719
3720         * src/tar.c (tar_set_quoting_style): Provide second argument to
3721         the format spec: program_invocation_short_name. Reported by Jim
3722         Meyering.
3723
3724 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
3725
3726         * gnulib.modules: Add closeout, exitfial.
3727         * lib/.cvsignore: Add __fpending.c, __fpending.h, closeout.c,
3728         closeout.h.
3729         * src/buffer.c: Incluse closeout.h.
3730         (_open_archive): Use freopen rather than fopen, so
3731         that stdlis is always either stdout or stderr.  Use
3732         close_stdout_set_file_name to report its name.
3733         * src/tar.c: Include closeout.h and exitfail.h.
3734         (parse_opt, usage): Call close_stdout as appropriate, to check for
3735         write errors.
3736         (decode_options): Exit with status TAREXIT_FAILURE, not 1.
3737         (main): Set exit_failure, to exit with proper status on memory
3738         allocation failure and the like.
3739         Use close_stdout rather than rolling our own test.
3740
3741         * NEWS: --version now outputs copyright etc., to conform to the
3742         GNU coding standards.  Remove --license.
3743         * gnulib.modules: Add version-etc-fsf.
3744         * doc/tar.texi: Document the change.
3745         * lib/.cvsignore: Add version-etc-fsf.c, version-etc.c, version-etc.h.
3746         * scripts/Makefile.am (SED_CMD): Update PAKCAGE_NAME, not PACKAGE.
3747         * scripts/backup.in: Remove --license.  Change --version to conform
3748         to GCS.
3749         * scripts/restore.in: Likewise.
3750         * scripts/backup.sh.in (license): Output briefer license in the
3751         style of coreutils, for consistency with other changes.
3752         * src/tar.c: Include <version-etc.h>.
3753         (LICENSE_OPTION): Remove.
3754         (options): Remove --license.
3755         (license): Remove.
3756         (parse_opt): Use version_etc instead of rolling it ourselves.
3757         Remove --license.
3758         * tests/version.at (tar --version): Check only the first line of
3759         output.
3760
3761         * ChangeLog, NEWS, src/common.h, src/extract.c, src/incremen.c:
3762         * src/list.c, src/names.c, src/tar.h, src/xheader.c:
3763         Update copyright year to 2006.
3764
3765 2006-02-07  Jim Meyering  <jim@meyering.net>
3766
3767         * src/xheader.c (sparse_map_decoder): Fix misleading diagnostic.
3768
3769 2006-01-31  Sergey Poznyakoff  <gray@gnu.org.ua>
3770
3771         * src/common.h (get_gnu_dumpdir): Remove prototype
3772         (is_dumpdir): New function
3773         * src/extract.c (prepare_to_extract): Use is_dumpdir member to
3774         check for dumpdirs.
3775         * src/incremen.c (get_gnu_dumpdir): Static
3776         (is_dumpdir): New function
3777         (purge_directory): Use is_dumpdir
3778         * src/list.c (list_archive): Use is_dumpdir
3779         Do not wrap skip_member in mv_begin/mv_end, the function itself
3780         takes care of it.
3781         (decode_header): Set stat_info->is_dumpdir
3782         (skip_member): Do nothing if skipped is true
3783         * src/tar.h (struct tar_stat_info): New members is_dumpdir and skipped.
3784
3785 2006-01-22  Sergey Poznyakoff  <gray@gnu.org.ua>
3786
3787         * src/tar.c (decode_options): Refuse using --delete with
3788         compression options.
3789
3790 2006-01-18  Sergey Poznyakoff  <gray@gnu.org.ua>
3791
3792         * NEWS: Updated.
3793         * configure.ac (DEFAULT_QUOTING_STYLE): New configuration variable
3794         * doc/tar.texi: Initial documentation for --quoting-style,
3795         --quote-chars and --no-quote-chars option.
3796         * src/tar.c: Implement new options --quoting-style, --quote-chars
3797         and --no-quote-chars.
3798
3799 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
3800
3801         * bootstrap: Default to pserver, and switch to cvs.sv.gnu.org,
3802         to accommodate recent changes to the GNU CVS server.
3803         * lib/.cvsignore: Add argp-pin.c, mkdirat.c, openat-priv.h.
3804
3805 2005-12-14  Sergey Poznyakoff  <gray@gnu.org.ua>
3806
3807         * src/names.c (name_scan): Take an additional argument requesting
3808         exact matching.
3809         * src/common.h (name_scan): Change prototype.
3810         * src/delete.c, src/incremen.c, src/update.c: Update invocations
3811         of name_scan.
3812
3813 2005-12-13  Sergey Poznyakoff  <gray@gnu.org.ua>
3814
3815         * src/common.h (struct name): New member `explicit'. Remove unused
3816         member `isdir'.
3817         * src/incremen.c (procdir): If name_scan() returns something,
3818         check if it was explicitely given in the command line
3819         * src/names.c (addname,add_hierarchy_to_namelist): Initialize
3820         explicit member appropriately.
3821
3822         * src/incremen.c (procdir): If --one-file-system is given and a
3823         directory is found to be on another device, *and* this directory
3824         is explicitely given in the command line, then do not omit it.
3825
3826 2005-12-11  Sergey Poznyakoff  <gray@gnu.org.ua>
3827
3828         * NEWS: Update
3829         * doc/tar.texi: Document --delay-directory-restore option.
3830         (Configuring Help Summary): Document usage of ARGP_HELP_FMT
3831         variable to customize help output.
3832         * src/common.h (delay_directory_restore_option): New global.
3833         * src/extract.c (directories_first): Replaced by
3834         delay_directory_restore_option. All uses changed.
3835         * src/tar.c (options,parse_opt): New options
3836         --delay-directory-restore and --no-delay-directory-restore
3837
3838 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3839
3840         * src/buffer.c (open_archive): Add default case to shut up gcc.
3841         * src/common.h (set_file_atime): Add prototype.
3842         * src/create.c (to_chars_subst): Remove unused variable
3843         Make sure useful result code is returned.
3844         * src/incremen.c (read_directory_file): Fix format string
3845         Thanks Eric Blake for reporting.
3846
3847 2005-12-08  Sergey Poznyakoff  <gray@gnu.org.ua>
3848
3849         * doc/tar.texi (Current status): Renamed to 'Changes' and moved to
3850         appendices.
3851         (Large or Negative Values): Rewritten
3852         * src/common.h (gid_to_chars, major_to_chars, minor_to_chars)
3853         (mode_to_chars, off_to_chars, size_to_chars, time_to_chars)
3854         (uid_to_chars, uintmax_to_chars): Return bool
3855         * src/create.c (gid_to_chars, major_to_chars, minor_to_chars)
3856         (mode_to_chars, off_to_chars, size_to_chars, time_to_chars)
3857         (uid_to_chars, uintmax_to_chars): Return bool
3858         (to_chars): Return bool
3859         (start_header): Check return values of convertion routines. Fail
3860         if unable to store data in the header.
3861
3862 2005-12-07  Sergey Poznyakoff  <gray@gnu.org.ua>
3863
3864         * doc/tar.texi: Following the discussion with Karl Berry,
3865         discontinue using @value{} substitutions for Texinfo commands.
3866         Properly index all long options. Print a
3867         separate long option index.
3868         * doc/value.texi: Remove @set's
3869
3870         * doc/tar.texi: Update --info-script documentation
3871         Resolve some more FIXMEs.
3872         * scripts/dump-remind.in: Use TAR_VOLUME instead of reading volno
3873         file.
3874         * src/buffer.c (new_volume): Update invocation
3875         (change_tape_menu): New function. Disable '!' command if given
3876         --restrict option.
3877         * src/common.h (sys_exec_info_script): Update declaration
3878         (restrict_option): New global
3879         * src/system.c (sys_exec_info_script): The script can supply new
3880         archive name to use by writing it to file descriptor 3.
3881         * src/tar.c (options): Add --restrict option. Use macros for
3882         option grouping.
3883         (license): Print full list of copyright years
3884         * NEWS: Update
3885
3886 2005-12-06  Eric Blake  <ebb9@byu.net> (trivial changes)
3887
3888         * configure.ac (DENSITY_LETTER): Fix m4 overquoting.
3889         * .cvsignore: Ignore .bootstrap.
3890
3891 2005-12-06  Sergey Poznyakoff  <gray@gnu.org.ua>
3892
3893         * doc/tar.texi: Document --to-command and --info-script
3894         options. Add missing xrefs.
3895         * src/buffer.c (new_volume): Use sys_exec_info_script() instead of
3896         system().
3897         * src/common.h (archive_format_string,subcommand_string)
3898         (sys_exec_info_script): New prototypes.
3899         * src/system.c (sys_exec_info_script): New function.
3900         * src/tar.c (archive_format_string): Remove static qualifier.
3901         (subcommand_string): New function.
3902
3903 2005-12-01  Sergey Poznyakoff  <gray@gnu.org.ua>
3904
3905         * src/extract.c: Fix restoring of directory timestamps from
3906         incremental archives.
3907         (directories_first): New variable.
3908         (prepare_to_extract): Set directories_first
3909         (extract_archive): Call apply_nonancestor_delayed_set_stat() only
3910         if not extracting from an incremental archive
3911         (extract_dir): Obtain root_device here, to make sure it works
3912         correctly with -C.
3913
3914         * src/incremen.c (purge_directory): Skip the member and return if
3915         the archive is not in incremental format.
3916         * tests/incr02.at: New testcase
3917         * tests/Makefile.am: Add incr02.at
3918         * tests/testsuite.at: Likewise
3919
3920         * THANKS: Add Guerkan Karaman.
3921         * NEWS: Update
3922
3923 2005-11-30  Paul Eggert  <eggert@cs.ucla.edu>
3924
3925         * doc/tar.texi (Option Summary): Rewrite the
3926         --atime-preserve=system description in response to Ian Turner's
3927         proposed patch.
3928
3929 2005-11-30  Ian Turner  <ian@zmanda.com>
3930
3931         * doc/tar.texi (Extracting Specific Files): Remove obsolescent
3932         FIXME.
3933
3934 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
3935
3936         * NEWS: New option --atime-preserve=system, which uses O_NOATIME.
3937         * THANKS: Add Ian Turner.
3938
3939         * configure.ac: Prefer AC_CHECK_HEADERS_ONCE to AC_CHECK_HEADERS.
3940         Check for stropts.h and sys/filio.h too, for _FIOSATIME.
3941         * doc/tar.texi: Change "modification time" to "data modification
3942         time", "change time" to "status change time", and "filesystem" to
3943         "file system", so that we use terminology consistent with POSIX.
3944         Use American spacing rather than French for sentence ends.
3945         "non-dependable" -> "undependable".
3946         (Option Summary, Attributes): Explain better the pitfalls of the
3947         --atime-preserve option, and suggest read-only mounts,loopback
3948         mounts, and noatime mounts for older systems.
3949         * doc/value.texi (op-atime-preserve-system): Renamed from
3950         op-atime-preserver-system to fix a misspelling.
3951         * src/common.h (enum atime_preserve): Use lower case for enum values.
3952         * src/compare.c: Don't include utimens.h; no longer needed.
3953         (diff_file): Use set_file_atime rather than utimens; avoid closing
3954         diff_handle until after this, so that we can set the file time stamp
3955         via the file descriptor rather than via its name.
3956         * src/create.c: Don't include utimens.h; no longer needed.
3957         (dump_regular_finish): Remove.  All callers now do its work inline.
3958         (dump_dir): New arg FD.  All callers changed.
3959         Use fdsavedir rather than savedir.
3960         (unknown_file_error): Arg is a const pointer now.
3961         (dump_file0): 2nd arg is a const pointer now.
3962         Treat directories more like files, with respect to --atime-preserve.
3963         For example, also warn if a directory changes while we are dumping it.
3964         Prefer file descriptors to file names when retrieving/setting file
3965         attributes; this saves path-resolution time and allows us to avoid
3966         changing mtime/ctime on Solaris when restoring atime as root.
3967         Use O_DIRECTORY when opening directories, to avoid some race conditions.
3968         Do not reset atime if mtime has changed.  Report an error if
3969         we cannot reset atime.
3970
3971         * lib/.cvsignore: Add malloc.h, regcomp.c, regex.c, regex.h,
3972         regex_internal.c, regex_internal.h, regexc.c; used by rpmatch.
3973
3974 2005-11-29  Ian Turner  <ian@zmanda.com>
3975
3976         First cut at adding support for --atime-preserve=system.
3977         * doc/tar.texi (Option Summary): First cut at documenting it.
3978         All other uses of --atime-preserve changed to --atime-preserve=replace.
3979         * doc/value.texi (op-atime-preserve-replace, op-atime-preserver-system):
3980         New.
3981         (op-atime-preserve): Mention METHOD.
3982         * src/common.h (atime_preserve): New enum.
3983         (atime_preserve_option): Now of the enum type rather than bool.
3984         All uses changed.
3985         * src/compare.c (diff_file): Read with O_NOATIME if asked for.
3986         * src/create.c (dump_file0): Read regular and CTG files with O_NOATIME
3987         if asked for.
3988         * src/tar.c (usage): Mention new usage.
3989         (parse_opt): Parse new usage.
3990
3991 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
3992
3993         * THANKS: Convert back to UTF-8, sort (using LC_ALL=C on Debian
3994         stable), and consistently use tabs rather than spaces.
3995
3996 2005-11-27  Sergey Poznyakoff  <gray@gnu.org.ua>
3997
3998         * src/xheader.c: Remove parts of code prematurely introduced
3999         yesterday. Thanks Eric Blake.
4000
4001 2005-11-26  Sergey Poznyakoff  <gray@gnu.org.ua>
4002
4003         * src/xheader.c (xheader_format_name): Fix memory leak.
4004
4005 2005-11-11  Sergey Poznyakoff  <gray@gnu.org.ua>
4006
4007         * gnulib.modules: Add rpmatch
4008         * lib/stdopen.h, lib/stdopen.c: New file. Imported from coreutils.
4009         * lib/Makefile.tmpl: Add stdopen.h, stdopen.c
4010         * po/POTFILES.in: Add rpmatch.c
4011         * src/tar.c (confirm): Rewritten using rpmatch.
4012         (decode_options): Minor optimizations
4013         (main): Call stdopen() to ensure the first three descriptors are
4014         open.
4015
4016         * tests/multiv01.at, tests/multiv02.at, tests/multiv03.at,
4017         tests/multiv04.at, tests/sparsemv.at, tests/sparsemvp.at,
4018         tests/star/multi-fail.at: Close stdin so that if something fails
4019         causing tar to ask for the next volume, it won't hang the
4020         testsuite.
4021
4022         * src/buffer.c (flush_write,flush_read): Change data type.
4023         (flush_archive): Compute actual buffer fill level before calling
4024         low level function.
4025         (close_archive): Call flush_archive again if the first call
4026         resulted in partially filled buffer.
4027         (try_new_volume): Rewritten handling of initial headers.
4028         (add_chunk_header): New function. Write an additional header
4029         before the continuation chunk. The purpose of the header is to
4030         allow third-party tars to extract the member.
4031         (simple_flush_write): Take an argument.
4032         (_gnu_flush_write): Correctly handle partially filled buffers.
4033         * src/common.h (flush_read,flush_write): Functions, again.
4034         (write_extended): Changed declaration
4035         (xheader_format_name): New declaration
4036         * src/create.c (write_extended): Change type and meaning of
4037         the first argument. All callers updated
4038         * src/xheader.c (xheader_format_name): Remove static
4039         qualifier. Change last argument.
4040         Correct buffer size calculation (allocated too much space).
4041         (xheader_write): Increase global_header_count here ...
4042         (xheader_write_global): ... instead of here
4043
4044         * tests/testsuite.at (AT_TAR_CHECK): Define TEST_TAR_FORMAT
4045         * tests/multiv01.at: Update
4046         * tests/multiv02.at: Update
4047         * tests/multiv03.at: Update
4048         * tests/sparsemvp.at: Update
4049         * tests/star/multi-fail.at: Update
4050
4051         * scripts/tarcat: Handle archives in pax format. Improve handling
4052         of traditional archives.
4053         * doc/tar.texi (Tarcat): New node
4054
4055 2005-11-10  Sergey Poznyakoff  <gray@gnu.org.ua>
4056
4057         Fix splitting of sparse files between the volumes.
4058
4059         * src/buffer.c (try_new_volume): Bugfix. Always check
4060         continued_file_name. If it is absent, the volume is out
4061         of sync.
4062         (add_multi_volume_header): Create GNU.volume.filename keyword in
4063         the extended header.
4064         * src/sparse.c (sparse_dump_region): Call mv_size_left.
4065         (sparse_dump_file): Enclose the loop in mv_begin/mv_end.
4066         * src/system.c: Do not pad compressed output if it goes to
4067         stdout.
4068         * src/xheader.c (xhdr_tab): New keyword GNU.volume.filename.
4069
4070         * tests/sparsemv.at: New testcase
4071         * tests/sparsemvp.at: New testcase
4072         * tests/Makefile.am: Add sparsemv.at and sparsemvp.at.
4073         * tests/testsuite.at: Likewise.
4074
4075 2005-11-09  Sergey Poznyakoff  <gray@gnu.org.ua>
4076
4077         * src/buffer.c: Rewritten in a more modular fashion to provide
4078         GNU extensions (multi-volume archives and archive labels) in
4079         pax format.
4080         NOTICE, that some of the aspects (e.g. splitting the archive
4081         on the extended header boundary) are still not solved, others
4082         (splitting a sparse file between the volume) require additional
4083         testing. Wait for the next commit.
4084
4085         (volume_label,continued_file_name,continued_file_size)
4086         (continued_file_offset): New globals.
4087         (save_name,save_totsize,save_sizeleft): Make static
4088         (mv_begin,mv_end,mv_total_size,mv_size_left): New functions
4089         (open_archive,flush_write,flush_read): Rewritten
4090
4091         * src/common.h (save_name,save_sizeleft,save_totsize): Remove
4092         globals.
4093         (volume_label,continued_file_name,continued_file_size): New
4094         variables.
4095         (flush_read,flush_write): Pointers to functions
4096         (mv_begin,mv_end,mv_total_size,mv_size_left): New functions
4097         (write_extended): New function.
4098
4099         * src/compare.c, src/create.c, src/extract.c, src/incremen.c,
4100         src/list.c: Use mv_.* functions uniformly instead of fiddling
4101         with the global variables.
4102         * src/sparse.c: Use mv_.* functions where necessary.
4103         * src/tar.c (decode_options): Allow to use --multi-volume and
4104         --label with pax archives.
4105         * src/xheader.c (xhdr_tab): Support for new GNU keywords.
4106
4107         * tests/delete01.at, tests/delete02.at, tests/delete03.at,
4108         tests/delete04.at, tests/delete05.at, tests/extrac01.at,
4109         tests/extrac02.at, tests/extrac03.at, tests/extrac04.at,
4110         tests/extrac05.at, tests/incr01.at, tests/incremental.at,
4111         tests/listed01.at, tests/listed02.at, tests/long01.at,
4112         tests/longv7.at, tests/multiv01.at, tests/multiv02.at,
4113         tests/multiv03.at, tests/multiv04.at, tests/options.at,
4114         tests/options02.at, tests/same-order01.at, tests/same-order02.at,
4115         tests/sparse01.at, tests/sparse02.at, tests/sparse03.at,
4116         tests/star/multi-fail.at (AT_KEYWORDS): Improve to allow execution
4117         of related tests in groups.
4118
4119         * doc/tar.texi: Update
4120
4121 2005-11-07  Paul Eggert  <eggert@cs.ucla.edu>
4122
4123         * src/xheader.c (struct xhdr_tab.coder): Last arg is void const *,
4124         not void *, to avoid create.c warning from GCC "passing argument 3
4125         of 'xheader_store' discards qualifiers from pointer target type".
4126         (dummy_coder, atime_coder, gid_coder, gname_coder, linkpath_coder):
4127         (ctime_coder, mtime_coder, path_coder, size_coder, uid_coder):
4128         (uname_coder, sparse_size_coder, sparse_numblocks_coder):
4129         (sparse_offset_coder, sparse_numbytes_coder, dumpdir_coder):
4130         (xheader_store): Likewise.
4131         * src/common.h (xheader_store): Likewise.
4132
4133 2005-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>
4134        and  Paul Eggert  <eggert@cs.ucla.edu>
4135
4136         * src/tar.c (NS_PRECISION_FORMAT_MASK): New macro.
4137         (tar_timespec_cmp): New function. Wrapper over
4138         timespec_cmp using the timespec precision provided by the
4139         current archive format.
4140         * src/common.h (tar_timespec_cmp): New declaration.
4141         * src/compare.c (diff_file): Use tar_timespec_cmp.
4142         * src/extract.c (file_newer_p): Likewise.
4143         * src/update.c (update_archive): Likewise.
4144         * tests/truncate.at: Reverted changes
4145         * tests/update.at: Reverted changes
4146
4147 2005-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>
4148
4149         Support for incremental formats in pax archives.
4150         Fixed POSIX compatibility of `sparse' extended header keywords.
4151
4152         * src/common.h (dumpdir_size,get_gnu_dumpdir)
4153         (xheader_string_begin,xheader_string_add)
4154         (xheader_string_end): New functions.
4155         * src/create.c (dump_dir0): Handle incremental backups in pax
4156         archives.
4157         * src/incremen.c (dumpdir_size, get_gnu_dumpdir): New functions.
4158         (purge_directory): Use stat_info.dumpdir instead of getting its
4159         value explicitely.
4160         * src/list.c (list_archive): Handle incremental backups in pax
4161         format.
4162         (decode_header): Initialize stat_info.dumpdir
4163         * src/sparse.c (sparse_diff_file): Bugfix: set seekable.
4164         (pax_dump_header): Store sparse map in GNU.sparse.map. If this
4165         variable has been explicitely deleted, use GNU.sparse.offset/
4166         GNU.sparse.numbytes variables.
4167         * src/tar.c (decode_options): Incremental options are allowed with
4168         --format=pax
4169         (tar_stat_destroy): Free dumpdir
4170         * src/tar.h (struct tar_stat_info.dumpdir): New member.
4171         * src/xheader.c (xheader_keyword_deleted_p): Remove static
4172         qualifier.
4173         (struct xhdr_tab.decoder): Change prototype. POSIX allows string
4174         values to contain embedded nulls, so take an extra argument
4175         specifying the length of the string.
4176         (decx,decg,dummy_decoder,atime_decoder,gid_decoder)
4177         (gname_decoder,linkpath_decoder,ctime_decoder,mtime_decoder)
4178         (path_decoder,size_decoder,uid_decoder,uname_decoder)
4179         (sparse_size_decoder,sparse_numblocks_decoder)
4180         (sparse_offset_decoder,sparse_numbytes_decoder): Likewise.
4181         (decode_record): Pass value length to the handler
4182         (run_override_list): Pass value length to the decoder
4183         (xheader_print_n): New function
4184         (xheader_print): Rewritten using xheader_print_n
4185         (xheader_finish): Do not rely om strlen to compute the length of
4186         the collected string: it can contain embedded nulls
4187         (xheader_string_begin,xheader_string_add,xheader_string_end): New
4188         functions.
4189         (sparse_map_decoder,dumpdir_coder,dumpdir_decoder): New
4190         functions. Handle GNU.sparse.map and GNU.dumpdir variables.
4191         (xhdr_tab): Add new variables.
4192
4193         * tests/incr01.at: Test gnu, oldgnu, and posix formats
4194         * tests/incremental.at: Likewise
4195
4196 2005-11-06  Paul Eggert  <eggert@cs.ucla.edu>
4197
4198         * NEWS: Minor language and white space fixes.
4199
4200         * tests/truncate.at: Create files whose time stamps must fall on
4201         1-second boundaries.  This prevents tests from failing on hosts
4202         like Solaris 8 that have nanosecond-resolution file time stamps.
4203         * tests/update.at: Likewise.
4204
4205         * src/xheader.c (strtoimax, strtoumax): Remove decls; now done
4206         in system.h.
4207
4208 2005-11-06  Sergey Poznyakoff  <gray@gnu.org.ua>
4209
4210         * doc/tar.texi: Properly document incremental dumps
4211         * doc/value.texi: Likewise.
4212         * doc/snapshot.texi: Likewise.
4213
4214 2005-11-05  Sergey Poznyakoff  <gray@gnu.org.ua>
4215
4216         Improve listed incremental format:
4217
4218         * src/common.h (update_parent_directory): New prototype.
4219         * src/create.c (dump_file): Call update_parent_directory.
4220         * src/incremen.c (struct directory.mtime): New member.
4221         (note_directory): Take additional arguments. All callers updated.
4222         (scan_directory): Updated to use more metadata. In particular,
4223         this allows to correctly detect renamed files.
4224         (read_directory_file,write_directory_file)
4225         (write_directory_file_entry): Support new directory file format.
4226         * tests/listed01.at: Sleep 1 sec before creating second file.
4227         * tests/listed02.at: Never skip the test. It should work on any
4228         filesystem.
4229
4230         * doc/snapshot.texi: New file
4231         * doc/tar.texi: Update.
4232         * doc/Makefile.am: Update.
4233
4234 2005-11-04  Paul Eggert  <eggert@cs.ucla.edu>
4235
4236         * src/extract.c (set_stat): Rewrite to avoid bug in Forte
4237         Developer 7 C 5.4 Patch 111708-09 (2004-02-19).
4238
4239 2005-11-04  Sergey Poznyakoff  <gray@gnu.org.ua>
4240
4241         * bootstrap: Fix quoting in help output.
4242         (update_po): Use backward-compatible wget option --cache instead
4243         of deprecated -C to accomodate for wget 1.10.
4244         Changes proposed by Eric Blake
4245         * THANKS: Add Eric Blake
4246
4247 2005-11-02  Paul Eggert  <eggert@cs.ucla.edu>
4248
4249         * doc/tar.texi: Consistently put two spaces after sentences,
4250         and put commas after "i.e." and "e.g.".  This is the usual GNU
4251         style in manuals.
4252
4253         * lib/.cvsignore: Add creat-safer.c, fcntl--.h, fcntl-safer.h,
4254         open-safer.c, openat-die.c, verify.h, to accommodate recent gnulib
4255         changes.
4256
4257 2005-10-27  Sergey Poznyakoff  <gray@gnu.org.ua>
4258
4259         * src/compare.c (diff_dumpdir): Pass a valid device number to
4260         get_directory_contents.
4261
4262         * THANKS: Add John Thomas McDole
4263
4264         * bootstrap: If file `.bootstrap' exists in the cwd and is
4265         readable, prepend its contents to the command line
4266
4267 2005-10-21  Sergey Poznyakoff  <gray@gnu.org.ua>
4268
4269         * tests/link01.at: Skip test if ln fails (suppose the OS does
4270         not support hard links).
4271
4272 2005-10-04  Sergey Poznyakoff  <gray@gnu.org.ua>
4273
4274         * src/tar.c (decode_options): Report error if -A or -r is used
4275         together with compression option.
4276
4277 2005-09-29  Sergey Poznyakoff  <gray@gnu.org.ua>
4278
4279         * doc/tar.texi: Use @option and @kbd consistently.
4280         Document new options.
4281
4282 2005-09-28  Sergey Poznyakoff  <gray@gnu.org.ua>
4283
4284         * NEWS: Updated
4285         * src/common.h (show_stored_names_option): New variable
4286         * src/list.c (print_header): If show_stored_names_option is given,
4287         list member names as stored in the archive. Patch proposed by Erik
4288         Cumps <erik.cumps@icos.be>
4289         * src/tar.c: Implement --show-stored-names option
4290
4291         * src/common.h (test_label_option): New variable;
4292         * src/list.c (print_header): Special handling if test_label_option
4293         is set.
4294         * src/names.c (all_names_found): If test_label_option is set
4295         return true.
4296         * src/tar.c: New option --test-label tests the archive volume
4297         label. The option proposed by Wouter Verhelst <wouter@nixsys.be>
4298
4299 2005-09-21  Paul Eggert  <eggert@cs.ucla.edu>
4300
4301         * tests/Makefile.am (clean-local): Don't attempt to run
4302         $(TESTSUITE) if it doesn't exist.  Problem reported by
4303         Eric Blake.
4304
4305 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
4306
4307         Don't filter time stamps through the resolution supported
4308         by struct stat; keep them to full nanosecond resolution.
4309         This affects behavior only on older hosts or file systems
4310         that have lower-resolution time stamps.
4311         * src/common.h (OLDER_STAT_TIME): Parenthesize arg.
4312         (OLDER_TAR_STAT_TIME): New macro.
4313         (code_timespec): New function.
4314         (BILLION, LOG10_BILLION, TIMESPEC_STRSIZE_BOUND): New constants.
4315         * src/compare.c (diff_file): Use full time stamp resolution.
4316         * src/create.c (start_header, dump_file0): Likewise.
4317         (start_header, dump_file0): Adjust to new structure layout.
4318         (dump_regular_finish): Simplify by using timespec_cmp.
4319         * src/extract.c (struct delayed_set_stat): Don't store stat info
4320         that we don't need, to save space.  All uses changed.
4321         (struct delayed_set_stat, struct delayed_link, file_newer_p):
4322         (create_placeholder_file, extract_link, apply_delayed_links):
4323         Use full time stamp resolution.
4324         (check_time): Use code_timespec rather than rolling our own code.
4325         (set_stat, delay_set_stat): Arg now points to tar_stat_info to
4326         avoid losing time information.  All callers changed.
4327         * src/list.c (read_and, decode_header, print_heaeder):
4328         Use full time stamp resolution.
4329         * src/misc.c (code_timespec): New function.
4330         * src/tar.h (struct tar_stat_info): Record atime, mtime, ctime
4331         separately, for benefit of hosts with lower resolution.
4332         * src/update.c (update_archive): Use full time stamp resolution.
4333         * src/xheader.c (code_time): Use new code_timespec function
4334         to simplify code.
4335         (atime_coder, atime_decoder, ctime_coder, ctime_decoder):
4336         (mtime_coder, mtime_decoder): Use full time stamp resolution.
4337
4338         Report time stamps to full resolution in environment.
4339         Report memory allocation failures rather than ignoring them.
4340         * src/system.c (time_to_env): New function.
4341         (oct_to_env, str_to_env, chr_to_env): Report memory allocation failures.
4342         (stat_to_env): Report full resolution in time stamps.
4343
4344 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
4345
4346         Merge changes from gnulib for file system sub-second time stamps.
4347         * configure.ac: Remove checks for struct stat.st_spare1, struct
4348         stat.st_atim.tv_nsec, struct stat.st_atimespec.tv_nsec, struct
4349         stat.st_atimensec, as gnulib now does this for us.
4350         Similarly for LIB_CLOCK_GETTIME.
4351         * gnulib.modules: Add stat-time.
4352         * lib/.cvsignore: Add stat-time.h.
4353         * src/common.h: Include stat-time.h.
4354         (timespec_lt): Remove.  All callers changed to use timespec_cmp.
4355         (get_stat_atime, get_stat_ctime, get_stat_mtime):
4356         (set_stat_atime, set_stat_ctime, set_stat_mtime):
4357         Remove; now defined by stat-time.h.
4358
4359 2005-09-14  Sergey Poznyakoff  <gray@gnu.org.ua>
4360
4361         * src/incremen.c (list_dumpdir): New function. Used to dump
4362         contents of GNUTYPE_DUMPDIR blocks.
4363         * src/common.h (list_dumpdir): Likewise.
4364         * src/list.c (list_archive): Use list_dumpdir() to display
4365         GNUTYPE_DUMPDIR blocks. Do that only if two or more -v options are
4366         given.
4367
4368 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
4369
4370         * lib/.cvsignore: Adjust to current gnulib and modules used.
4371         Add getdelim.c, getdelim.h, mbchar.c, mbchar.h, mbuiter.h, memchr.c,
4372         pipe-safer.c, size_max.h, strdup.c, strdup.h, strnlen.h, strnlen1.c,
4373         strnlen1.h, unistd--.h.
4374         Remove getndelim2.c, getndelim2.h, pathmax.h, sysexits.h, xstrdup.c.
4375
4376         Treat fishy-looking hard links like fishy-looking symlinks.
4377         * src/extract.c (struct delayed_set_stat): Rename after_symlinks
4378         member to after_links.  All uses changed.
4379         (struct delayed_link): Renamed from struct delayed_symlink.
4380         All uses changed.  New member is_symlink.
4381         (delayed_link_head): Renamed from delayed_symlink_head.  All uses
4382         changed.
4383         (create_placeholder_file): New function, taken from extract_symlink.
4384         (extract_link): Create placeholders for fishy-looking hard links.
4385         (extract_symlink): Move code into create_placeholder_file.
4386         (apply_delayed_links): Renamed from apply_delayed_symlinks.
4387         All uses changed.  Create both hard links and symlinks.
4388
4389 2005-09-03  Paul Eggert  <eggert@cs.ucla.edu>
4390
4391         * README-alpha: Modernize description of software required for
4392         developers.
4393
4394 2005-09-03  Sergey Poznyakoff  <gray@gnu.org.ua>
4395
4396         * gnulib.modules: Add strdup
4397         * src/incremen.c (purge_directory): Do not dereference symbolic
4398         links. Bug reported by Ralph Corderoy <ralph@inputplus.co.uk> and
4399         David Brown <davidb@davidb.org>
4400         * tests/incr01.at: New test.
4401         * tests/Makefile.am: Add incr01.at
4402         * tests/testsuite.at: Likewise
4403         * THANKS: Updated
4404
4405 2005-08-17  Sergey Poznyakoff  <gray@gnu.org.ua>
4406
4407         * src/incremen.c (read_directory_file): Use strtoumax to read
4408         snapshot file contents.
4409         (write_directory_file_entry): Use umaxtostr().
4410
4411 2005-07-31  Sergey Poznyakoff  <gray@gnu.org.ua>
4412
4413         * src/create.c (file_dumpable_p,dump_file0): Fix handling of
4414         sparse files to /dev/null with --totals option.
4415         * tests/update.at: Remove dependency on file order.
4416
4417 2005-07-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4418
4419         * doc/tar.texi: Fix typo.
4420
4421 2005-07-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4422
4423         * tests/pipe.at: Pipe the output from `tar xfv' through sort.
4424
4425 2005-06-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4426
4427         * src/sparse.c (tar_sparse_init): Fill structure with zeros. Call
4428         sparse_select_optab(). All callers updated.
4429         (sparse_member_p, sparse_fixup_header): Use tar_sparse_init().
4430
4431 2005-06-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4432
4433         * src/sparse.c (pax_sparse_member_p): Checking member size
4434         vs. file size is not reliable enough. Use sparse_map_avail.
4435
4436         * tests/star/gtarfail.at: Adapt to the new output format
4437         * tests/star/gtarfail2.at: Likewise
4438         * tests/star/multi-fail.at: Likewise
4439         * tests/star/pax-big-10g.at: Likewise
4440         * tests/star/ustar-big-2g.at: Likewise
4441         * tests/star/ustar-big-8g.at: Likewise
4442
4443         * tests/sparse03.at: New test.
4444         * tests/Makefile.am: Add sparse03.at
4445         * tests/testsuite.at: Likewise
4446
4447         * src/xheader.c (size_decoder): Do not set archive_file_size.
4448
4449         Fix bugs introduced yesterday:
4450
4451         * src/sparse.c (tar_sparse_init):  Initialize
4452         dimped_size to 0.
4453         (sparse_scan_file): Initialize archive_file_size to 0. The
4454         variable keeps size of the file *as stored in the archive*, not
4455         the size reported by stat.
4456
4457 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
4458
4459         A sweep of the sparse code prompted by a bug report by Jim Meyering.
4460         * src/sparse.c: Include <inttostr.h>.
4461         (struct tar_sparse_file): offset and dumped_size are off_t, not
4462         size_t.  optab is now const *.
4463         (dump_zeros): Return bool success flag, not off_t.
4464         All callers changed.
4465         Use a constant-zero buffer rather than clearing a buffer each time.
4466         Don't mess up if write fails.
4467         (dump_zeros, check_sparse_region):
4468         Don't assume off_t is no wider than size_t.
4469         (tar_sparse_init): Don't bother clearing a field that is already clear.
4470         (zero_block_p): First arg is const *, not *.
4471         (clear_block, SPARSES_INIT_COUNT): Remove.
4472         (sparse_add_map): First arg is now struct start_stat_info *, not
4473         struct tar_sparse_file *.  All callers changed.
4474         Use x2nrealloc to check for size_t overflow.
4475         (parse_scan_file): Cache commonly-used parts of file.
4476         Use an auto buffer, not a static one.
4477         Don't bother clearing the buffer; not needed.
4478         Don't bother clearing items that are already clear.
4479         (oldgnu_optab, star_optab, pax_optab): Now const.
4480         (sparse_dump_region): Don't bother clearing the buffer before
4481         reading into it; just clear the parts that aren't read into.
4482         (sparse_dump_file): Clear the whole local variable 'file'.
4483         (diff_buffer): Remove; now a local var.
4484         (check_sparse_region): Don't bother clearing buffer before
4485         reading into it.  Don't assume off_t is promoted to long.
4486         (oldgnu_get_sparse_info, star_get_sparse_info):
4487         Use an auto status, not static.
4488         * src/tar.h (struct tar_stat_info): had_trailing_slash is
4489         now bool, not int.
4490         * src/xheader.c (sparse_offset_coder, sparse_numbytes_coder):
4491         Rewrite to avoid cast.
4492         (sparse_offset_decoder, sparse_numbytes_decoder):
4493         Diagnose excess entries rather than crashing.
4494
4495 2005-06-22  Jim Meyering  <jim@meyering.net>
4496
4497         * src/common.h (timespec_lt): Add a return type: bool.
4498
4499 2005-06-21  Paul Eggert  <eggert@cs.ucla.edu>
4500
4501         Further improvements inspired by Jim Meyering's fixes.
4502
4503         * NEWS: Better support for full-resolution time stamps.
4504         The -v option now prints time stamps only to 1-minute resolution.
4505         * gnulib.modules: Add utimens.
4506         * lib/.cvsignore: Add imaxtostr.c, inttostr.c, inttostr.h,
4507         offtostr.c, umaxtostr.c, utimens.c, utimens.h.  Remove paxconvert.c.
4508         * lib/Makefile.tmpl (libtar_a_SOURCES): Remove paxconvert.c.
4509         * lib/paxconvert.c: Remove; superseded by umaxtostr.c.
4510         * po/POTFILES.in: Remove lib/paxconvert.c.  Add lib/xalloc-die.c,
4511         lib/obstack.c.
4512         * src/buffer.c (set_start_time, compute_duration, start_time):
4513         Use gettime rather than rolling our own code.
4514         * src/common.h (OLDGNU_NAME_FIELD_SIZE, MAXOCTAL11, MAXOCTAL7): Remove.
4515         (newer_ctime_option): Remove.
4516         (timespec_lt): New function.
4517         (OLDER_STAT_TIME): Use it.
4518         (string_to_chars): First arg is char const *, not char *.
4519         (tartime): Time arg is now struct timespec.  New bool arg.
4520         All callers changed.
4521         (code_ns_fraction): New decl.
4522         (sys_stat_nanoseconds): Remove decl.
4523         (get_stat_atime, get_stat_ctime, get_stat_mtime): New functions.
4524         (set_stat_atime, set_stat_ctime, set_stat_mtime): New functions.
4525         * src/compare.c: Include utimens.h rather than rolling our own.
4526         (diff_dir, diff_file, diff_link, diff_symlink, diff_special):
4527         Prototype.
4528         (diff_dumpdir, diff_multivol): Prototype.
4529         (diff_file): Support higher-resolution time stamps.
4530         * src/create.c: Include utimens.h rather than rolling our own.
4531         (MAX_OCTAL_VAL): New macro.
4532         (tar_copy_str, string_to_chars): Don't bother to zero-fill;
4533         the destination is already zeroed.
4534         (string_to_chars): First arg is char const *.
4535         (start_private_header): Use MINOR_TO_CHARS, not MAJOR_TO_CHARS,
4536         for minor device number.
4537         (write_header_name, dump_hard_link, dump_file0):
4538         Simplify test for old GNU format.
4539         (start_header): Put in placeholders for uid, etc., even when
4540         using extended headers, for benefit of older "tar" implementations.
4541         Don't assume uintmax_t is wider than 32 bits.
4542         Output extended header for mtime if needed.
4543         (dump_regular_finish, dump_file0):
4544         Support extended time stamp resolution.
4545         * src/extract.c: Include utimens.h rather than rolling our own.
4546         (check_time): Support extended time stamp resolution.
4547         * src/list.c: Include <inttostr.h>.
4548         (tartime): Use umaxtostr rather than stringify_uintmax_t_backwards.
4549         * src/xheader.c: Include <inttostr.h>.
4550         Do not include <xstrtol.h>.
4551         (strtoimax) [!HAVE_DECL_STRTOIMAX && !defined strtoimax]: New decl.
4552         (strtoumax) [!HAVE_DECL_STRTOUMAX && !defined strtoumax]: New decl.
4553         (BILLION, LOG10_BILLION): New constants.
4554         (to_decimal): Remove; superseded by inttostr.  All callers changed
4555         to use umaxtostr.
4556         (xheader_format_name): Don't assume pids and uintmax_t values
4557         fit in 63 bytes (!) when printed.
4558         (decode_record): Don't bother to check for ERANGE; an out of range
4559         value must be treater than len_max anyway.
4560         If the length is out of range, output it in the diagnostic.
4561         (format_uintmax): Remove; all callers changed to use umaxtostr.
4562         (xheader_print): Don't assume sizes can be printed in 99 bytes (!).
4563         (out_of_range_header): New function.
4564         (decode_time): Use it.
4565         (code_time): Accept struct timespec, not time_t and unsigned long.
4566         All callers changed.  Size sbuf properly, and remove unnecessary check.
4567         Don't assume time stamps can fit in 199 bytes.
4568         Handle negative time stamps.  Handle fractional time stamps
4569         more consistently.  Don't output unnecessary trailing zeros.
4570         (decode_time): Yield struct timespec, not time_t and unsigned long.
4571         All callers changed.
4572         Handle negative time stamps.  Truncate towards minus infinity
4573         consistently.  Improve overflow checks, and output a better
4574         diagnostic on overflow.
4575         (code_num): Don't assume uintmax_t can be printed in 99 bytes (!).
4576         (decode_num): New function, for better diagnostics.
4577         (atime_coder, atime_decoder, gid_decoder, ctime_coder):
4578         (ctime_decoder, mtime_coder, mtime_decoder, size_decoder):
4579         (uid_decoder, sparse_size_decoder, sparse_numblocks_decoder):
4580         (sparse_offset_decoder, sparse_numbytes_decoder):
4581         Use decode_num, etc., instead of xstrtoumax, etc.
4582
4583 2005-06-21  Jim Meyering  <jim@meyering.net>
4584
4585         Carefully crafted invalid headers can cause buffer overrun.
4586         Invalid header fields go undiagnosed.
4587         Some valid time strings are ignored.
4588
4589         * src/xheader.c (sparse_numblocks_decoder): Remove unchecked use
4590         of `calloc'.  Use xcalloc instead.
4591         (decode_time, gid_decoder, size_decoder, uid_decoder):
4592         (sparse_size_decoder, sparse_offset_decoder, sparse_numblocks_decoder):
4593         Ensure that the result of calling xstrtoumax is no larger than
4594         the maximum value for the target type.  Upon any failure, exit with
4595         a diagnostic.
4596         (sparse_numblocks_decoder): Avoid buffer overrun/heap corruption:
4597         use x2nrealloc, rather than `n *= 2' and xrealloc(p, n,....
4598         (decode_time): Rewrite to accept time strings like
4599         1119018481.000000000.  Before, such strings were always ignored.
4600
4601 2005-06-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4602
4603         * src/create.c (dump_file0): Check for is_avoided_name()
4604         first. Fixes bug reported by Martin Lohmeier
4605         <martin@mein-horde.de>
4606         * tests/update.at: New file
4607         * tests/Makefile.am (TESTSUITE_AT): Add update.at
4608         * tests/testsuite.at: Likewise
4609
4610 2005-06-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4611
4612         * configure.ac (AC_STRUCT_ST_BLKSIZE)
4613         (AC_STRUCT_ST_BLOCKS): Removed. Handled by system.m4.
4614
4615 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
4616
4617         * src/names.c (excluded_name): excluded_filename ->
4618         excluded_file_name, because the name was changed in gnulib.
4619
4620 2005-05-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4621
4622         * src/tar.c (read_name_from_file,update_argv): Automatically
4623         detect nul-terminated list files.
4624         * NEWS: Updated
4625
4626 2005-05-27  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4627
4628         * scripts/backup.sh.in: Bugfixes.
4629
4630 2005-05-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4631
4632         * scripts/backup.in: Minor fixes
4633         * scripts/backup.sh.in (mt_begin,mt_rewind)
4634         (mt_offline,mt_status): Use $MT to invoke mt
4635         (init_common): Set --rsh-command option for mt if TAPE_FILE is a
4636         remote archive.
4637         * doc/tar.texi: Document new backup scripts behavior
4638
4639 2005-05-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4640
4641         * lib/.cvsignore: Updated
4642         * lib/Makefile.tmpl: Add new paxutils files
4643         * po/POTFILES.in: Likewise
4644         * src/buffer.c: Update invocations of safer_name_suffix()
4645         * src/create.c: Likewise
4646         * src/extract.c: Likewise
4647         * src/xheader.c: Likewise
4648         * src/common.h: Include paxlib.h instead of paxerror.h
4649         (safer_name_suffix,removed_prefixes_p): Removed. The functions are
4650         imported from paxutils
4651         * src/names.c (hash_string_hasher,hash_string_compare)
4652         (hash_string_insert,hash_string_lookup,removed_prefixes_p)
4653         (safer_name_suffix): Moved to paxutils
4654
4655 2005-05-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4656
4657         * bootstrap (copy_files): Accept optional third argument: a prefix
4658         to be appended to destination file names.
4659         Import paxutils/paxlib files.
4660         * configure.ac: Remove checking for LIB_SETSOCKOPT, it is handled
4661         by paxutils.
4662         * lib/Makefile.tmpl (libtar_a_SOURCES): Add paxerror.c paxexit.c
4663         paxconvert.c
4664         * po/POTFILES.in: Likewise.
4665         * src/common.h: Remove defines and declarations imported from
4666         paxutils
4667         * src/misc.c: Likewise
4668         * src/list.c (stringify_uintmax_t_backwards): Moved to paxutils
4669
4670 2005-05-17  Paul Eggert  <eggert@cs.ucla.edu>
4671
4672         * src/misc.c (remove_any_file): Fix typo in previous change.
4673
4674 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
4675
4676         Port to Solaris 10's treatment of unlinking directories.
4677         * gnulib-modules: Add unlinkdir.
4678         * lib/.cvsignore: Add unlinkdir.h, unlinkdir.c.
4679         * src/common.h (we_are_root): Remove extern decl; it's now static.
4680         * src/extract.c (we_are_root): Now static.
4681         * src/misc.c: Include <unlinkdir.h>.
4682         (remove_any_file): Use cannot_unlink_dir () rather than we_are_root.
4683
4684         * ChangeLog, ChangeLog.1, Makefile.am, NEWS, PORTS, README,
4685         README-alpha, TODO, bootstrap, configure.ac, doc/Makefile.am,
4686         doc/convtexi.pl, doc/fdl.texi, doc/gendocs_template,
4687         lib/Makefile.tmpl, lib/prepargs.c, lib/waitpid.c, po/POTFILES.in,
4688         scripts/Makefile.am, scripts/backup-specs, scripts/backup.in,
4689         scripts/backup.sh.in, scripts/restore.in, src/Makefile.am,
4690         src/arith.h, src/buffer.c, src/common.h, src/compare.c,
4691         src/create.c, src/delete.c, src/extract.c, src/incremen.c,
4692         src/list.c, src/mangle.c, src/misc.c, src/names.c, src/sparse.c,
4693         src/system.c, src/tar.c, src/tar.h, src/update.c, src/utf8.c,
4694         src/xheader.c, tests/Makefile.am, tests/append.at,
4695         tests/append01.at, tests/comprec.at, tests/delete01.at,
4696         tests/delete02.at, tests/delete03.at, tests/delete04.at,
4697         tests/delete05.at, tests/extrac01.at, tests/extrac02.at,
4698         tests/extrac03.at, tests/extrac04.at, tests/extrac05.at,
4699         tests/gzip.at, tests/ignfail.at, tests/incremental.at,
4700         tests/link01.at, tests/listed01.at, tests/listed02.at,
4701         tests/long01.at, tests/longv7.at, tests/multiv01.at,
4702         tests/multiv02.at, tests/multiv03.at, tests/multiv04.at,
4703         tests/old.at, tests/options.at, tests/options02.at, tests/pipe.at,
4704         tests/recurse.at, tests/same-order01.at, tests/same-order02.at,
4705         tests/shortrec.at, tests/sparse01.at, tests/sparse02.at,
4706         tests/testsuite.at, tests/truncate.at, tests/version.at,
4707         tests/volume.at, tests/star/gtarfail.at, tests/star/gtarfail2.at,
4708         tests/star/multi-fail.at, tests/star/pax-big-10g.at,
4709         tests/star/quicktest.sh, tests/star/ustar-big-2g.at,
4710         tests/star/ustar-big-8g.at:
4711         Update FSF postal mail address.
4712
4713 2005-05-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4714
4715         * NEWS: Updated
4716         * THANKS: Updated
4717         * bootstrap: Install files from paxutils/doc
4718         * doc/Makefile.am (tar_TEXINFOS): Add genfile.texi
4719         * doc/tar.texi (Genfile): New appendix
4720         * src/compare.c (diff_file): diff_handle was not initialized
4721         * src/create.c (dump_regular_file): Correctly pad archive members
4722         that shrunk during archiving. Repored by Frank Heckenbach.
4723         * src/extract.c (file_newer_p): Return false if file does not
4724         exist
4725         (prepare_to_extract): Correct warning wording.
4726         * tests/truncate.at: New test case
4727         * tests/Makefile.am: Add truncate.at
4728         * tests/testsuite.at: Likewise.
4729
4730         * doc/.cvsignore: Updated
4731         * lib/.cvsignore: Updated
4732         * tests/.cvsignore: Updated
4733
4734 2005-05-02  Paul Eggert  <eggert@cs.ucla.edu>
4735
4736         * tests/multivol04.at: Tell awk to read from /dev/null.
4737
4738         Adjust to recent gnulib changes.
4739         * lib/.cvsignore: Add dup-safer.c, fd-safer.c, unistd-safer.h.
4740         * src/common.h (initial_umask): New var.
4741         * src/create.c (start_ueader): Use it, and adjust to new modechange
4742         API.
4743         (hash_link): unsigned -> size_t parameters and result.
4744         * src/incremen.c (hash_directory): Likewise.
4745         * src/names.c (hash_string_hasher): Likewise.
4746         * src/tar.c (parse_opt): Set it, and adjust to new modechange API.
4747
4748 2005-04-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4749
4750         * tests/Makefile.am: Add shortrec.at.
4751
4752 2005-04-18  Paul Eggert  <eggert@cs.ucla.edu>
4753
4754         * src/buffer.c (reading_from_pipe): Remove.  All uses removed.
4755         (short_read): Don't warn about short reads; they're normal.
4756         * tests/shortrec.at: New file.
4757         * tests/testsuite.at: Include it.
4758
4759         * bootstrap (gnulib_modules): Don't create a file modlist.tmp, as
4760         it is sometimes left behind as a garbage file (maybe due to the
4761         multiple traps?).
4762
4763 2005-04-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4764
4765         * src/list.c: Handle Solaris 'X' type flag
4766         * src/tar.h (SOLARIS_XHDTYPE): New define
4767
4768 2005-04-06  Sergey Poznyakoff  <gray@mirddin.farlep.net>
4769
4770         * src/tar.c: Minor fixes to text messages. Proposed by Benno
4771         Schulenberg.
4772         * src/extract.c: Likewise
4773         (extract_file): Assign orig_file_name
4774         to save_name uniformly over the program. This fixes matching
4775         directory names at the start of an archive volume.
4776         * src/buffer.c (flush_write): Warn when the name of the archive
4777         straddling volume boundary is longer than 100 characters. Earlier
4778         behavior was to issue a fatal error.
4779         (struct zip_magic): Reverted part of changes from 2005-04-04.
4780         They make the maintenance too costly. Removing `unsigned'
4781         qualifier from `magic' member should be enough.
4782         * src/compare.c (diff_init): Read directory file if in listed
4783         incremental. This prevents spurious 'Contents differ' diagnostics.
4784         (diff_archive): Minor fixes to text messages
4785         (diff_file,diff_dumpdir,diff_multivol): Assign orig_file_name
4786         to save_name uniformly over the program. This fixes matching
4787         directory names at the start of an archive volume.
4788         * src/create.c: Assign orig_file_name
4789         to save_name uniformly over the program. This fixes matching
4790         directory names at the start of an archive volume.
4791         * src/list.c: Likewise
4792
4793         * tests/multiv03.at: Modified to match the new behavior
4794         * tests/multiv04.at: New file. Test splittind directory members between
4795         the archive volumes.
4796         * tests/Makefile.am: Add multiv04.at
4797         * tests/testsuite.at: Likewise.
4798
4799 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
4800
4801         * configure.ac (AC_CONFIG_AUX_DIR): Rename from config to build-aux,
4802         for reasons discussed in the thread beginning at
4803         <http://lists.gnu.org/archive/html/bug-gnulib/2005-03/msg00119.html>.
4804         * .cvsignore: Remove config; add build-aux.
4805
4806         * src/buffer.c (struct zip_magic): Use char arrays, not pointers.
4807         The unsigned char * pointer ran afoul of pedantic C compilers, and
4808         we didn't need pointers anyway.  Put the size field before the
4809         data to avoid unnecessary padding.  All uses changed.
4810         (magic) Make it const, since it doesn't change.  All uses changed.
4811
4812 2005-04-02  Paul Eggert  <eggert@cs.ucla.edu>
4813
4814         * src/xheader.c (decode_record): Don't dump core when given
4815         a corrupted extended header.  Problem reported by Jim Meyering.
4816         Also, check for other ways that the header might be invalid,
4817         e.g., missing newline at end.  Do not allow keys with nulls.
4818         Allow blanks before and after length, as POSIX requires.
4819         Do not allow leading "-" in length.  Check for length overflow.
4820         (xheader_decode, xheader_decode_global): Let decode_record
4821         check for exhaustion of record.
4822         (xheader_read): Null-terminate the extended record;
4823         decode_record relies on this.
4824
4825 2005-03-21  Paul Eggert  <eggert@cs.ucla.edu>
4826
4827         * bootstrap (TP_URL): Change from
4828         <http://www2.iro.umontreal.ca/~gnutra/po/maint/tar/> to
4829         <http://www.iro.umontreal.ca/translation/maint/tar/> to avoid
4830         some redirection glitches.
4831         Use "trap - 0" rather than "trap 0" to fix a POSIX-conformance bug.
4832         * doc/.cvsignore: Change "tar.info" to "tar.info*".  Sort.
4833         * lib/.cvsignore: Add intprops.h (new gnulib file).
4834
4835 2005-03-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4836
4837         * src/list.c (print_header): Print UID/GID in case of
4838         empty user/group name. This could occur when dumping
4839         files belonging to non-existing users and when listing
4840         broken archives.
4841         Reported by Igor Lautar.
4842
4843         * src/create.c: Correctly parse empty uname/gname
4844         * src/sparse.c (sparse_scan_file): Bugfix. offset had
4845         incorrect type.
4846
4847         * scripts/backup.in: Use `head -n 1'. Provide missing
4848         argument to ${MT_STATUS}. Proposed by Jan Merka.
4849         * scripts/backup.sh.in: Likewise. Fixed typo in
4850         MT_OFFLINE assignment.
4851         * scripts/restore.in (restore_fs): Use root_fs
4852
4853 2005-02-15  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4854
4855         * src/create.c: Replace strdup with xstrdup
4856         * src/names.c: Likewise
4857         * src/tar.c: Likewise
4858
4859         * tests/append01.at: Added reference to bug-tar archive
4860         * tests/listed02.at: Use -print with find.
4861
4862 2005-02-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4863
4864         * THANKS: Added Tim Adye. Fixed UTF.
4865         * src/list.c (read_header): Removed assignment to
4866         oldgnu_header.isextended. It was breaking append mode.
4867
4868         * tests/append01.at: New test.
4869         * tests/Makefile.am: Added append01.at
4870         * tests/testsuite.at: Likewise
4871
4872 2005-02-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4873
4874         * gnulib.modules: New file. List of required gnulib
4875         modules.
4876         * bootstrap: Merge list of required modules from
4877         paxutils with that from tar proper.
4878         * src/tar.c: Various fixes in help and diagnostic messages.
4879
4880 2005-02-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4881
4882         * src/common.h (EXTRACT_OVER_PIPE): New macro
4883         * src/compare.c: Code clean up.
4884         * src/extract.c (extract_archive): Do not check for
4885         EXTRACT_OVER_PIPE, decode_options() does this.
4886         * src/misc.c (exec_error,fork_error,dup2_error)
4887         (pipe_error): Removed unneeded functions.
4888         * src/system.c (sys_exec_command): Use xclose, xpipe,
4889         xfork, xdup2 and exec_fatal.
4890         * src/tar.c (options): Improved sorting. Document --backup=off.
4891         (decode_options): Clear backup_option if necessary.
4892
4893 2005-02-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4894
4895         Initial implementation of --to-command option proposed
4896         by Hansjoerg Lipp.
4897
4898         * bootstrap: Get setenv module from gnulib
4899         * src/buffer.c: Do not use 8-bit chars in comments
4900         * src/common.h (to_command_option)
4901         (ignore_command_error_option): New globals
4902         (sys_exec_command,sys_wait_command): New commands
4903         * src/extract.c (extract_file): Handle to_command_option
4904         Fix error recovery: decrease `size' by `written', not
4905         by `count', otherwise tar misses the next header
4906         Do not diagnose write error if to_command_option
4907         is set, since the command may have exited prematurely.
4908         It would be better to check for sigpipe, though.
4909         (prepare_to_extract): Handle to_command_option
4910         * src/misc.c (exec_error, fork_error, dup_error)
4911         (pipe_error): New functions
4912         * src/system.c (sys_exec_command)
4913         (sys_wait_command): New functions
4914         * src/tar.c: Handle new options --to-command,
4915         --ignore-command-error
4916         * THANKS: Added Hansjoerg Lipp
4917
4918 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
4919
4920         * src/list.c (from_header): New arg OCTAL_ONLY, normally false.
4921         All uses changed.  Fix typo that sometimes suppressed all "Archive
4922         contains obsolescent base-64 headers" warnings, not just the first
4923         one.
4924         (tar_checksum): Accept only octal checksums, since they aren't
4925         supposed to overflow into weird formats.
4926
4927         Adjust to gnulib changes.
4928         * lib/.cvsignore: Add chdir-long.c, chdir-long.h, memrchr.c,
4929         memrchr.h, openat.c, openat.h.  Remove pathmax.h (added by
4930         mistake, perhaps?), sysexit.h (my typo), xstrdup.c (gnulib removed
4931         this file).  Sort entries.
4932
4933 2005-02-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4934
4935         * src/extract.c: Further rewrite.
4936         * src/buffer.c: Removed unused variables.
4937         * src/list.c: Likewise
4938         * src/tar.c (update_argv): Changed type to void
4939
4940         * src/common.h (OLDGNU_NAME_FIELD_SIZE): New constant
4941         * src/create.c (start_private_header,write_header_name)
4942         (dump_hard_link): Restore compatibility with 1.13.25
4943         * src/extract.c (extract_archive): Rewritten
4944         * src/list.c: Add translators' comments
4945         * src/tar.c (options) Minor spelling fix
4946         * tests/star/quicktest.sh: Determine path to the tar executable.
4947
4948 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4949
4950         * po/POTFILES.in: Added tests/genfile.c
4951         * src/buffer.c (short_read): Use ngettext()
4952         (new_volume): use quote().
4953         * src/create.c: Use quote()
4954         * src/extract.c: Likewise
4955         * src/xheader.c: Likewise
4956         * src/misc.c: Add comments to translators
4957
4958         * tests/same-order01.at: sort ls output
4959         * tests/sparse01.at (RE_CHECK): Added missing space
4960
4961         * tests/sparse02.at: Test extracting sparse files over a pipe.
4962         * tests/Makefile.am: Added sparse02.at
4963         * tests/testsuite.at: Likewise
4964         * tests/listed02.at: Skip the test on filesystems that do not
4965         update ctime of a file when renaming it. To be reverted when
4966         the new incremental mode is ready.
4967         * tests/sparse01.at: Extract and compare sparse file
4968
4969 2005-02-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4970
4971         * src/sparse.c: Extract sparse files even if the output
4972         fd is not seekable.
4973
4974 2005-02-01  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4975
4976         * bootstrap: Add a comment to lib/Makefile.am saying that this
4977         is an autogenerated file.
4978         Exit with code 1 if any of autotools fails.
4979         * lib/Makefile.tmpl: Insert Emacs magic to the first line.
4980         * tests/Makefile.am: Add append.at
4981
4982         * m4/.cvsignore: Ignore all *.m4 files
4983
4984 2005-01-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4985
4986         Rewritten handling of -T (--files-from) option. Now it
4987         inserts the file names immediately into argv array which allows
4988         for:
4989         1) any valid tar options (including another -T) to be used in the file
4990         2) any number of -T options to be given in command line
4991
4992         * configure.ac: Raised version number to 1.15.2
4993         * src/common.h: Include obstack.h
4994         (files_from_option): Removed
4995         (unquote_option): New variable
4996         (stat_fatal): New function
4997         (name_close): Removed function.
4998         * src/incremen.c: Remove inclusion of obstack.h
4999         * src/xheader.c: Likewise.
5000         * src/misc.c (stat_fatal): New function
5001         * src/names.c (name_file): Removed variable.
5002         (read_name_from_file): Removed function. All callers changed.
5003         (name_close): Removed function. All callers changed.
5004         * src/tar.c: New options --unquote (--no-unquote) and
5005         --add-file
5006         (add_file_id,read_name_from_file,update_argv): New functions
5007         (parse_opt): Rewritten handling of -T option. Handle hidden
5008         --HANG option for debugging purposes.
5009         (decode_options): Init unquote_option to true. Init argv_stk.
5010         Remove unneeded references to files_from_option
5011
5012         * doc/tar.texi: Document new options.
5013         Moved rendition macros and option value definitions into
5014         separate files
5015         * doc/rendition.texi: New file
5016         * doc/value.texi: New file
5017         * doc/Makefile.am: Updated
5018
5019 2005-01-13  Paul Eggert  <eggert@cs.ucla.edu>
5020
5021         * tests/testsuite.at (RE_CHECK): Use "join - file", not
5022         "join file -", to work around a bug in Solaris 8 join.
5023         Problem reported by Tomohiro Suzuki.
5024
5025 2005-01-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5026
5027         * src/list.c (read_header): Fixed calculation of the
5028         size for GNU long name/link. Tar was reading one block
5029         more if name_size was divisible by 512. Thanks Josef
5030         Bauer.
5031         * tests/long01.at: New file. Test listing of GNU long names
5032         divisible by 512.
5033         * tests/pipe.at: Sort tar output.
5034         * tests/Makefile.am: Added long01.at
5035         * tests/testsuite.at: Likewise.
5036         * THANKS: Added Josef Bauer
5037         * lib/.cvsignore: Updated
5038         * m4/.cvsignore: Updated
5039         * NEWS: Updated
5040
5041 2005-01-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5042
5043         * directory: Updated for 1.15.1
5044         * doc/Makefile.am: Use gendocs.sh to generate web documentation
5045         * doc/gendocs_template: Template file for gendocs.sh
5046         * doc/tar.texi: Updated docs for --[no-]same-permissions
5047         * src/tar.c: Reworded docstrings for --[no-]same-permissions
5048
5049 2005-01-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5050
5051         * bootstrap: Create m4/paxutils.m4
5052         * configure.ac: Call tar_PAXUTILS
5053         * tests/options02.at: Test that tar correctly handles non-option
5054         arguments interspersed with options.
5055         * tests/Makefile.am: Add options02.at
5056         * tests/testsuite.at: Likewise
5057         * tests/listed02.at: Do not create useless directory
5058
5059 2005-01-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5060
5061         * src/tar.c (parse_opt): Bugfix: Use ARGP_KEY_ARG. Thanks
5062         Mike Frysinger <vapier@gentoo.org> for reporting.
5063
5064 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
5065
5066         * lib/Makefile.tmpl (localedir.h): Omit needless quotes and a
5067         needless sed command.  Problem reported by Paul Jarc.
5068
5069 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
5070
5071         Accommodate latest gnulib.
5072         * doc/.cvsignore: Add getdate.texi.
5073         * bootstrap: Do not treat alloca-opt specially; this is no
5074         longer needed (and breaks builds) with latest gnulib.
5075
5076 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5077
5078         * src/tar.c (main): Reverted recent changes (#ifdef).
5079
5080 2004-12-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5081
5082         * configure.ac: Raise version number to 1.15.1
5083         Check for locale.h
5084         * NEWS: Entry for 1.15.1
5085         * src/buffer.c: Bugfix. Changes introduced 2004-11-26
5086         broke extraction from stdin.
5087         * src/list.c (from_header, tar_checksum): Changed declaration.
5088         All callers updated.
5089         * src/common.h: Likewise
5090         * src/tar.c (main): Protect invocation of setlocale by
5091         ifdef.
5092
5093         * tests/comprec.at: New test
5094         * tests/pipe.at: New test
5095         * tests/Makefile.am (comprec.at,pipe.at): New tests
5096         * tests/testsuite.at: Likewise
5097         * tests/gzip.at: Use AT_GZIP_PREREQ
5098         * tests/star/pax-big-10g.at: Likewise
5099         * tests/star/ustar-big-2g.at: Likewise
5100         * tests/star/ustar-big-8g.at: Likewise
5101
5102         * tests/extrac04.at: Discard stderr from sort, on some
5103         systems it spits out lots of irrelevant info.
5104         * tests/listed02.at: Likewise
5105
5106         * doc/index.html.in: Rewritten in xhtml to follow recent
5107         GNU site standards.
5108         * THANKS: Updated
5109
5110 2004-12-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5111
5112         Released version 1.15. Sources up to this point are
5113         tagged release_1_15.
5114
5115         * configure.ac: Raised version number to 1.15
5116         * NEWS: Likewise
5117         * directory: Updated
5118         * bootstrap (update_po): Give -r to wget. Always remove index.html
5119         Ignore alloca-opt module (it duplicates alloca)
5120
5121         * tests/Makefile.am: Distribute star/quicktest.sh
5122         * tests/star/README: Document quicktest.sh
5123         * tests/star/qucktest.sh: Removed.
5124         * tests/star/quicktest.sh: New file.
5125
5126 2004-12-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5127
5128         * NEWS: Updated
5129         * doc/tar.texi: Document auto-detection of compressed archive
5130         formats.
5131         * src/tar.c (decode_options): Ignore --seek if used with --delete.
5132         Delete.c is based on the assumption that the archive is being
5133         actually read, not lseeked.
5134
5135         * tests/delete05.at: New file
5136         * tests/extrac02.at: Fixed typo in AT_SETUP
5137         * tests/Makefile.am: Added delete05.at
5138         * tests/testsuite.at: Likewise.
5139
5140 2004-12-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5141
5142         * src/delete.c (delete_archive_members): Bugfix: when
5143         attempting to delete an nonexistent member, the last
5144         blocking_factor blocks were zeroed.
5145
5146 2004-12-14  Paul Eggert  <eggert@cs.ucla.edu>
5147
5148         * TODO: Mention sub-second resolution, lutimes, lchmod.
5149
5150 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
5151
5152         Adjust to recent gnulib changes.
5153         * doc/getdate.texi: Remove, since bootstrap gets it from gnulib now.
5154         * .cvsignore: Add rmt, rmt/*, rmt/*/*.
5155         * lib/.cvsignore: Add allocsa.c, allocsa.h, allocsa.valgrind,
5156         charset.alias, config.charset, getcwd.c, getcwd.h, localcharset.c,
5157         localcharset.h, ref-add.sed, ref-add.sin, ref-del.sed,
5158         ref-del.sin, setenv.c, setenv.h, unsetenv.c.  Remove pathmax.h,
5159         xstrdup.c.
5160         * m4/.cvsignore: Add allocsa.m4, eealloc.m4, getcwd-path-max.m4,
5161         localcharset.m4, realloc.m4, setenv.m4.  Remove malloc.m4,
5162         pathmax.m4, realloc.m4.
5163
5164 2004-11-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5165
5166         * configure.ac: Raised version number to 1.14.91
5167         * scripts/tarcat: New file
5168         * scripts/Makefile.am: Added tarcat
5169         * src/buffer.c (hit_eof): Changed type to boolean
5170         (read_full_records,reading_from_pipe): New variables
5171         (check_compressed_archive,open_compressed_archive): New functions
5172         (open_archive): Autodetect compressed archives and act accordingly.
5173         Set reading_from_pipe. This fixes controversial set of changes
5174         introduced 2004-05-11,2004-03-22.
5175         * src/list.c (tar_checksum): New function
5176         (read_header): Use tar_checksum().
5177         * src/common.h (tar_checksum): New function
5178
5179         * tests/star/README: Updated
5180         * NEWS: Updated
5181         * PORTS: Updated
5182
5183 2004-11-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5184
5185         * src/tar.c (decode_options): Fixed -o semantics. Thanks
5186         Jean Delvare <khali@linux-fr.org>
5187
5188 2004-10-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5189
5190         * bootstrap: Add localcharset
5191         * lib/Makefile.tmpl: Initialize SUFFIXES and CLEANFILES since the
5192         makefile snippet from localcharset uses '+=' on them.
5193         * src/Makefile.am (LDADD): Add LIBICONV
5194         * src/list.c (decode_header): Set uname/gname to NULL if their
5195         header counterparts are empty
5196         * src/tar.c (options): Use OPTION_NO_TRANS
5197         * src/utf8.c: Use locale_charset() from gnulib
5198
5199         * tests/star/README: Updated
5200
5201         * NEWS: Updated
5202         * TODO: Minor fix
5203
5204 2004-10-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5205
5206         * THANKS: Added Bryan Ford
5207         * doc/Makefile.am (.text): Fixed rule
5208         * po/POTFILES.in: Added argp-help.c
5209
5210 2004-10-04  Bryan Ford  <baford@mit.edu>
5211
5212         * src/tar.c: New option --exclude-caches, to exclude
5213         cache directories automatically on archive creation.
5214         Cache directories are directories containing a
5215         standardized tag file, as specified at:
5216                 http://www.brynosaurus.com/cachedir/spec.html
5217         * src/common.h: New variable exclude_caches_option.
5218         * src/create.c: New function check_cache_directory(),
5219         called from dump_dir0() if exclude_caches_option is set,
5220         to check for a cache directory tag and exclude the directory
5221         if such a tag is found.
5222         * doc/tar.texi: Updated accordingly.
5223
5224 2004-09-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5225
5226         * doc/tar.texi: Minor fix
5227         * src/tar.c (options): Minor fix
5228
5229 2004-09-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5230
5231         * TODO: Updated
5232         * lib/Makefile.tmpl: Added 'rtapelib.o: localedir.h' dependency
5233         * src/common.h: Comment WANT_DIRECTORY_REMOVE_OPTION.
5234         * src/extract.c: Normalized use of remove_any_file().
5235         * src/misc.c: Likewise.
5236         * src/tar.c (parse_opt): Emit warning if -l option is used.
5237         (show_default_settings): REMOTE_SHELL may be undefined
5238
5239 2004-09-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5240
5241         Test suite rewritten in autotest.
5242
5243         * configure.ac: Updated for autotest
5244         * src/tar.c (argp_program_version): Modified.
5245         * tests/Makefile.am: Rewritten for autotest.
5246
5247         * tests/.cvsignore: Updated
5248         * tests/append.at: New file
5249         * tests/atlocal.in: New file
5250         * tests/delete01.at: New file
5251         * tests/delete02.at: New file
5252         * tests/delete03.at: New file
5253         * tests/delete04.at: New file
5254         * tests/extrac01.at: New file
5255         * tests/extrac02.at: New file
5256         * tests/extrac03.at: New file
5257         * tests/extrac04.at: New file
5258         * tests/extrac05.at: New file
5259         * tests/gzip.at: New file
5260         * tests/ignfail.at: New file
5261         * tests/incremental.at: New file
5262         * tests/link01.at: New file
5263         * tests/listed01.at: New file
5264         * tests/listed02.at: New file
5265         * tests/longv7.at: New file
5266         * tests/multiv01.at: New file
5267         * tests/multiv02.at: New file
5268         * tests/multiv03.at: New file
5269         * tests/old.at: New file
5270         * tests/options.at: New file
5271         * tests/recurse.at: New file
5272         * tests/same-order01.at: New file
5273         * tests/same-order02.at: New file
5274         * tests/sparse01.at: New file
5275         * tests/testsuite.at: New file
5276         * tests/version.at: New file
5277         * tests/volume.at: New file
5278         * tests/star/gtarfail.at: New file
5279         * tests/star/gtarfail2.at: New file
5280         * tests/star/multi-fail.at: New file
5281         * tests/star/pax-big-10g.at: New file
5282         * tests/star/ustar-big-2g.at: New file
5283         * tests/star/ustar-big-8g.at: New file
5284
5285         * tests/preset.in: Removed
5286         * tests/before: Removed
5287         * tests/after: Removed
5288         * tests/version.sh: Removed.
5289         * tests/append.sh: Removed.
5290         * tests/delete01.sh: Removed.
5291         * tests/delete02.sh: Removed.
5292         * tests/delete03.sh: Removed.
5293         * tests/delete04.sh: Removed.
5294         * tests/extrac01.sh: Removed.
5295         * tests/extrac02.sh: Removed.
5296         * tests/extrac03.sh: Removed.
5297         * tests/extrac04.sh: Removed.
5298         * tests/extrac05.sh: Removed.
5299         * tests/gzip.sh: Removed.
5300         * tests/incremen.sh: Removed.
5301         * tests/ignfail.sh: Removed.
5302         * tests/link01.sh: Removed.
5303         * tests/listed01.sh: Removed.
5304         * tests/listed02.sh: Removed.
5305         * tests/longv7.sh: Removed.
5306         * tests/multiv01.sh: Removed.
5307         * tests/multiv02.sh: Removed.
5308         * tests/multiv03.sh: Removed.
5309         * tests/old.sh: Removed.
5310         * tests/options.sh: Removed.
5311         * tests/same-order01.sh: Removed.
5312         * tests/same-order02.sh: Removed.
5313         * tests/volume.sh: Removed.
5314         * tests/recurse.sh: Removed.
5315         * tests/sparse01.sh: Removed.
5316         * tests/star/gtarfail.sh: Removed.
5317         * tests/star/gtarfail2.sh: Removed.
5318         * tests/star/multi-fail.sh: Removed.
5319         * tests/star/ustar-big-2g.sh: Removed.
5320         * tests/star/ustar-big-8g.sh: Removed.
5321         * tests/star/pax-big-10g.sh: Removed.
5322
5323 2004-09-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5324
5325         * bootstrap: Install genfile.c from paxutils
5326         * tests/genfile.c: Removed. Integrated into
5327         paxutils.
5328         * tests/mksparse.c: Removed. Integrated into
5329         (paxutils) genfile.c
5330         * tests/Makefile.am: Removed mksparse
5331         * tests/sparse01.sh: Use genfile instead of mksparse
5332
5333 2004-09-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5334
5335         Started merging with cpio into paxutils. Sources before
5336         this point are tagged alpha-1_14_90
5337
5338         * Makefile.am: Updated for use with paxutils
5339         * README-alpha: Likewise
5340         * bootstrap: Likewise
5341         * configure.ac: Likewise
5342         * lib/Makefile.tmpl: Likewise
5343         * po/POTFILES.in: Likewise
5344         * src/Makefile.am: Likewise
5345         * src/buffer.c: Likewise
5346         * src/common.h: Likewise
5347         * src/compare.c: Likewise
5348         * src/create.c: Likewise
5349         * src/delete.c: Likewise
5350         * src/extract.c: Likewise
5351         * src/incremen.c: Likewise
5352         * src/list.c: Likewise
5353         * src/mangle.c: Likewise
5354         * src/misc.c: Likewise
5355         * src/names.c: Likewise
5356         * src/sparse.c: Likewise
5357         * src/system.c: Likewise
5358         * src/tar.c: Likewise
5359         * src/update.c: Likewise
5360         * src/utf8.c: Likewise
5361         * src/xheader.c: Likewise
5362
5363         * src/system.h: Removed
5364         * src/rmt.c: Removed
5365         * src/rmt.h: Removed
5366         * src/rtapelib.c: Removed
5367
5368 2004-09-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5369
5370         * tests/listed02.sh: Do not depend on any particular ordering
5371         of output.
5372
5373 2004-09-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5374
5375         * doc/tar.texi: Document the use of -C option in
5376         file lists. Document --seek option.
5377         * configure.ac: New option --with-rmt. New configuration variable
5378         DEFAULT_RMT_DIR. Removed DEFAULT_RMT_COMMAND.
5379         * src/Makefile.am: Install rmt into rmtdir
5380         * src/tar.c (usage): Minor fix.
5381         * NEWS: Updated.
5382         * README: Updated.
5383
5384 2004-09-01  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5385
5386         * configure.ac: Raised version number to 1.14.90
5387         * src/common.h (is_individual_file): New prototype
5388         * src/create.c (dump_file0): Fix bug introduced
5389         2004-02-21.
5390         * src/names.c (register_individual_file)
5391         (is_individual_file): New functions.
5392         * tests/listed01.sh: Use genfile instead of dd.
5393         * tests/listed02.sh: New file.
5394         * tests/Makefile.am: Added listed02.sh
5395
5396         * NEWS: Updated
5397
5398 2004-08-31  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5399
5400         * src/sparse.c (sparse_add_map): Fixed improper initializations
5401         of sparse_map_size. We assume that whatever number it contains
5402         describes adequately the current size of sparse_map. The only
5403         number we need to reset is sparse_map_avail.
5404         * src/compare.c (verify_volume): Call set_next_block_after
5405         if read_header returns HEADER_FAILURE
5406         Destroy and reinitialize content of current_stat_info and
5407         extended_header after each iteration (bug reported by
5408         John L. Males <jlmales@yahoo.com>).
5409         Issue a warning if the created archive contains some members
5410         whose file names were stripped off their leading prefixes.
5411         This is a temporary fix of the issue reported by Bdale Garbee
5412         <bdale@gag.com> (Refs: Debian bug 230064, Message-Id
5413         <87n07kyzhi.fsf@rover.gag.com>, Sun, 15 Feb 2004 11:22:17 -0700)
5414
5415         * src/names.c (removed_prefixes_p): New function.
5416
5417         * src/buffer.c: When computing write rate do not take
5418         into account the time needed to verify the archive(s).
5419         The bug reported by John L. Males <jlmales@yahoo.com>
5420         (set_start_time,compute_duration): New functions.
5421         (print_total_written): Use the result of compute_duration().
5422         (close_archive): Call compute_duration.
5423         * src/common.h (set_start_time, removed_prefixes_p): New prototypes.
5424         * src/list.c (decode_header): Fixed initialization
5425         of stat_info->is_sparse
5426         * src/tar.c (main): Call set_start_time().
5427
5428         * src/misc.c (unquote_string): Unquote '\a' and '\v'.
5429         Reported by Helmut Waitzmann <helmut.waitzmann@web.de>.
5430
5431         * NEWS: Updated
5432         * THANKS: Updated
5433
5434 2004-08-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5435
5436         * src/tar.c: Fix copy-n-paste errors in the license
5437
5438 2004-08-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5439
5440         * scripts/backup.in: Renamed LIBPATH to LIBDIR.
5441         Use ROOT_FS with -C option. Do not send mail
5442         if ADMINISTRATOR is set to NONE.
5443         * scripts/backup.sh.in (test_root): Append / to
5444         ROOT_FS if it does not already end in it.
5445         * scripts/restore.in: Renamed LIBPATH to LIBDIR.
5446         New option -a (--all). Do not start restore unless
5447         -a or patterns are given.
5448         (restore_fs,restore_files): Fixed use of --listed option.
5449         * doc/tar.texi: Updated
5450         * NEWS: Updated
5451
5452 2004-08-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5453
5454         * src/tar.c (find_argp_option): Fixed typo
5455
5456 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
5457
5458         Merge argp, getopt, xalloc changes from gnulib.
5459         * bootstrap (gnulib_modules): Add xalloc-die.
5460         Remove code to test for patches; we don't have patches now.
5461         Set LC_ALL=C so that file names sort consistently.
5462         Prefer the gnulib copies of gettext.m4, glibc21.m4,
5463         lib-ld.m4, lib-prefix.m4, po.m4 too.
5464
5465         * patches/getopt.diff: Remove; gnulib now works unpatched.
5466         * configure.ac (_getopt_long_only_r): Remove check.
5467         gl_ARGP now does this for us.
5468         * lib/.cvsignore: Add fnmatch.h, getopt_.h, sysexit.h,
5469         xalloc-die.c.
5470         * src/extract.c: Adjust to changes to gnulib xalloc module.
5471         (extr_init): Remove assignment to xalloc_fail_func; no longer needed.
5472         (xalloc_die): New function.
5473
5474 2004-08-10  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5475
5476         * NEWS: Updated
5477
5478         * src/buffer.c (flush_write): Limit filenames
5479         of the members that straddle multivolume archive
5480         boundary to 100 characters.
5481         (flush_read): Use strncmp when comparing multivolume member
5482         names.
5483         * tests/multiv03.sh: New file
5484         * tests/Makefile.am: Added multiv03.sh
5485
5486 2004-08-09  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5487
5488         * src/list.c (read_and): Call decode_header before
5489         calling skip_member()
5490         (skip_member): Use is_sparse field to determine if the
5491         member is a sparse file.
5492
5493         * tests/Makefile.am: Added extrac05.sh
5494         * tests/extrac05.sh: New file
5495         * tests/append.sh: Rearranged leading comments. Added explicit
5496         references to report messages wherever available.
5497         * tests/delete01.sh: Likewise
5498         * tests/delete02.sh: Likewise
5499         * tests/delete03.sh: Likewise
5500         * tests/delete04.sh: Likewise
5501         * tests/extrac01.sh: Likewise
5502         * tests/extrac02.sh: Likewise
5503         * tests/extrac03.sh: Likewise
5504         * tests/extrac04.sh: Likewise
5505         * tests/gzip.sh: Likewise
5506         * tests/ignfail.sh: Likewise
5507         * tests/incremen.sh: Likewise
5508         * tests/link01.sh: Likewise
5509         * tests/listed01.sh: Likewise
5510         * tests/longv7.sh: Likewise
5511         * tests/multiv01.sh: Likewise
5512         * tests/multiv02.sh: Likewise
5513         * tests/old.sh: Likewise
5514         * tests/options.sh: Likewise
5515         * tests/recurse.sh: Likewise
5516         * tests/same-order01.sh: Likewise
5517         * tests/same-order02.sh: Likewise
5518         * tests/sparse01.sh: Likewise
5519         * tests/version.sh: Likewise
5520         * tests/volume.sh: Likewise
5521
5522 2004-08-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5523
5524         * bootstrap: Extended --update-po option to take an
5525         optional argument specifying the po file to update.
5526         * src/create.c: Improved compatibility with 1.13.25
5527         * tests/link01.sh: New file.
5528         * tests/Makefile.am: Added link01.sh
5529
5530 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
5531
5532         Merge from gnulib.
5533
5534         * patches/argp.diff: Remove; no longer needed.
5535
5536         * lib/.cvsignore: Add stat-macros.h.
5537         Remove addext.c, malloc.c, realloc.c.
5538
5539         * src/extract.c: Include <getcwd.h>.
5540         (extract_archive): Rewrite with new macro IS_ABSOLUTE_FILE_NAME.
5541         * src/extract.c (make_directories):
5542         FILESYSTEM_PREFIX_LEN -> FILE_SYSTEM_PREFIX_LEN.
5543         * src/misc.c (must_be_dot_or_slash): Likewise.
5544         * src/names.c (excluded_name, safer_name_suffix, stripped_prefix_len):
5545         Likewise.
5546         * src/tar.c (parse_opt): Likewise.
5547         * src/incremen.c (purge_directory): Fix format buffer typos in warning
5548         strings.
5549         * src/tar.c (options): Add missing initializers to pacify gcc.
5550         (decode_options): Remove unused var.
5551
5552 2004-08-02  Paul Eggert  <eggert@cs.ucla.edu>
5553
5554         * bootstrap (gnulib_modules): Add getpagesize.
5555         * configure.ac (valloc): Remove check; valloc no longer used.
5556         * lib/.cvsignore: Add getpagesize.h.
5557         * m4/.cvsignore: Add getpagesize.m4.
5558         * src/buffer.c (record_buffer): New var.
5559         (open_archive): Don't use valloc; on older or buggy hosts, you can't
5560         free the result.  Use page_aligned_alloc instead.
5561         * src/compare.c (diff_init): Likewise.
5562         * src/buffer.c (open_archive): Record the pointer to be freed
5563         into record_buffer.
5564         (close_archive): Free record_buffer.
5565         * src/common.h (page_aligned_alloc): New decl.
5566         * src/misc.c (quote_n, quote): Remove these redundant functions.
5567         (ptr_align): New function, from coreutils/src/system.h.
5568         (page_aligned_alloc): New function.
5569         * src/system.h (valloc): Remove.
5570
5571 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
5572
5573         * src/extract.c (extract_archive): Do not report an error
5574         when hard-linking X to X when X exists.  Problem reported by
5575         Toby Peterson.
5576         * lib/.cvsignore: Add fchown-stub.c.
5577
5578 2004-06-29  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5579
5580         * NEWS: Updated
5581         * src/common.h (root_device): New global.
5582         (gnu_restore): Renamed to purge_directory().
5583         * src/extract.c (extr_init): Save the device number
5584         of the root device.
5585         (extract_archive): Renamed gnu_restore() to purge_directory().
5586         * src/incremen.c (gnu_restore): Renamed to purge_directory().
5587         Do not attempt to purge the directory if it is on a different
5588         device and one_file_system_option is set.
5589
5590 2004-06-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5591
5592         * doc/tar.texi: The actual default for exclude patterns
5593         is --no-anchored. Fixed.
5594         * src/tar.c (options): Likewise.
5595         Thanks "Felix Natter" <felix.natter@ldc.de> for noticing.
5596
5597 2004-06-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5598
5599         * doc/tar.texi: Fixed several inconsistencies.
5600         * src/tar.c: Fixed docstring for --checkpoint option.
5601
5602 2004-05-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5603
5604         * src/buffer.c (seek_archive): New function
5605         * src/common.h (seek_archive): New function
5606         (seekable_archive): New global.
5607         * src/list.c (skip_file): Use seek_archive() if
5608         possible.
5609         * src/tar.c (struct fmttab): Accept 'pax' as alias
5610         for 'posix'
5611         (options): New option -n (--seek).
5612         * src/update.c: Determine type of the archive before
5613         appending to it.
5614
5615         * TODO: Updated.
5616
5617 2004-05-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5618
5619         * bootstrap: New option --update-po
5620         * src/tar.c: New option -H (short alias to --format)
5621         * doc/tar.texi: Document -H option
5622         * src/names.c (safer_name_suffix): Fixed bug introduced
5623         2004-05-11.
5624
5625 2004-05-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5626
5627         * bootstrap: Apply patches from patch subdirectory
5628         * patches: New dir
5629         * patches/argp.diff: New file
5630         * patches/getopt.diff: New file
5631         * configure.ac: Check for _getopt_long_only_r and
5632         force using included version of getopt if the function
5633         is not available.
5634         * src/tar.c: Use argp for command line parsing.
5635         * src/system.h: Minor formatting fix
5636         * m4/.cvsignore: Updated
5637         * lib/.cvsignore: Updated
5638         * doc/tar.texi: Minor fix.
5639         * src/extract.c: Fix improper use of 'path' term
5640         * src/incremen.c: Likewise
5641         * src/list.c: Likewise
5642         * src/misc.c: Likewise
5643         * src/names.c: Likewise
5644         * src/rmt.h: Likewise
5645         * src/rtapelib.c: Likewise
5646         * src/update.c: Likewise
5647         * src/xheader.c: Likewise
5648         * tests/star/README: Minor fix
5649
5650 2004-05-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5651
5652         * configure.ac: Raised version number to 1.14.1
5653         * src/tar.c: Renamed --strip-path to --strip-components
5654         Changed improper use of _() to ngettext().
5655         * src/extract.c: Renamed strip_path_option to strip_components_option
5656         * src/common.h: Likewise.
5657         * NEWS: Updated.
5658         * doc/tar.texi: Updated
5659
5660 2004-05-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5661
5662         * src/system.c (sys_child_open_for_uncompress): Do not
5663         set read_full_records_option: the compressed archive is
5664         likely not to contain integer number of records. Should
5665         the user wish to use reblocking, he may always give tar
5666         -B option. This is a minor improvement over the change
5667         dated 2004-03-22.
5668         * src/buffer.c (open_archive): Removed assignment to
5669         read_full_records_option.
5670
5671         * src/names.c (safer_name_suffix): (safer_name_suffix): Use "%s"
5672         as the format argument, rather than a possibly-translated variable
5673         string. Patch provided by Jim Meyering  <jim@meyering.net>
5674         * src/tar.c (decode_options): Fixed typo in the comment.
5675         * tests/star/README: Minor correction
5676
5677 2004-05-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5678
5679         * directory: New file. GNU directory entry for tar.
5680         * doc/Makefile.am: Rewritten. Added rules for generating
5681         documentation for the project's website.
5682         * doc/.cvsignore: Updated
5683         * doc/index.html.in: New file.
5684
5685 2004-05-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5686
5687         * configure.ac: Raised version number to 1.14
5688         * NEWS: Updated.
5689         * tests/after: Added copyleft statement
5690         * tests/before: Added copyleft statement
5691         * tests/preset.in: Added copyleft statement
5692
5693         Tar 1.14 is released. Sources up to this point are tagged
5694         release_1_14
5695
5696 2004-05-10  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5697
5698         * configure.ac: Fixed prerequisite headers for sys/buf.h
5699         (needed on FreeBSD)
5700         * src/system.h: Likewise.
5701         * tests/after (compare): Fixed argument quoting under eval
5702         * tests/before: Quote TAR_ARCHIVE_FORMATS
5703
5704 2004-05-10  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5705
5706         * NEWS: Updated
5707         * README: Updated
5708         * PORTS: Updated
5709         * configure.ac: Call gl_AC_TYPE_INTMAX_T. Document
5710         DEFAULT_.* variables. Use DEFAULT_RMT_COMMAND to set
5711         the pathname of the rmt utility.
5712         New option --enable-backup-scripts.
5713         * doc/tar.texi: Updated
5714         * scripts/Makefile.am: Install the scripts only if requested
5715         by the configure.
5716         * scripts/backup.in: Fixed --version output.
5717         Fixed initialization of the listing files and printing
5718         the time of the last previous level dump.
5719         * scripts/restore.in: Fixed --version output.
5720         * src/Makefile.am (localedir.h rule): Generate correct
5721         DEFAULT_RMT_COMMAND variable.
5722         * src/common.h (rmt_command_option): New variable.
5723         * src/list.c (read_and): Print block number before
5724         issuing 'Skipping to next header' diagnostics, if
5725         requested by block_number_option.
5726         * src/rtapelib.c: Use rmt_command_option instead of
5727         hardcoded "/etc/rmt".
5728         * src/tar.c: New option --rmt-command.
5729         (decode_options): Handle --rmt-command. Initialize
5730         rmt_command_option to DEFAULT_RMT_COMMAND.
5731
5732 2004-05-09  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5733
5734         * doc/tar.texi: Further update.
5735
5736 2004-05-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5737
5738         * configure.ac: Minor fix
5739         * scripts/Makefile.am: Updated
5740         * scripts/backup-specs: Updated
5741         * scripts/backup.in: Minor fixes
5742         * scripts/backup.sh: Removed
5743         * scripts/backup.sh.in: New file. Source for backup.sh
5744         * scripts/restore.in: New file
5745         * scripts/.cvsignore: Updated
5746         * scripts/WARNING: Removed
5747         * doc/tar.texi: Updated
5748         * NEWS: Updated
5749
5750 2004-05-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5751
5752         * src/names.c (name_gather): Bugfix: Honor single -C with
5753         --same-order.
5754         * tests/same-order01.sh: New file
5755         * tests/same-order02.sh: New file
5756         * tests/Makefile.am: Updated
5757
5758         * tests/append.sh: Added copyleft header
5759         * tests/delete01.sh: Likewise
5760         * tests/delete02.sh: Likewise
5761         * tests/delete04.sh: Likewise
5762         * tests/extrac01.sh: Likewise
5763         * tests/extrac02.sh: Likewise
5764         * tests/extrac03.sh: Likewise
5765         * tests/extrac04.sh: Likewise
5766         * tests/gzip.sh: Likewise
5767         * tests/ignfail.sh: Likewise
5768         * tests/incremen.sh: Likewise
5769         * tests/multiv01.sh: Likewise
5770         * tests/old.sh: Likewise
5771         * tests/options.sh: Likewise
5772         * tests/recurse.sh: Likewise
5773         * tests/version.sh: Likewise
5774         * tests/volume.sh: Likewise
5775         * tests/star/gtarfail.sh: Likewise
5776         * tests/star/gtarfail2.sh: Likewise
5777         * tests/star/multi-fail.sh: Likewise
5778         * tests/star/pax-big-10g.sh: Likewise
5779         * tests/star/qucktest.sh: Likewise
5780         * tests/star/ustar-big-2g.sh: Likewise
5781         * tests/star/ustar-big-8g.sh: Likewise
5782
5783         * doc/.cvsignore: Updated
5784
5785 2004-05-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5786
5787         * configure.ac: Check whether date accepts +format argument
5788         (for backup scripts).
5789         * scripts/level-0: Removed
5790         * scripts/level-1: Removed
5791         * scripts/weekly.new: Removed
5792         * scripts/dump-remind: Removed
5793         * scripts/backup.in: New file
5794         * scripts/backup.sh: New file
5795         * scripts/dump-remind.in: New file
5796         * scripts/backup-specs: Updated
5797         * scripts/Makefile.am: Updated for new directory contents.
5798         * scripts/.cvsignore: Updated
5799
5800 2004-05-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5801
5802         * TODO: Updated
5803         * doc/tar.texi: Updated
5804         * src/tar.c: --utc implies -vv
5805
5806 2004-04-28  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5807
5808         * src/utf8.c: Make sure ICONV_CONST is defined. AM_ICONV
5809         does not define it if it fails to find iconv.h.
5810
5811 2004-04-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5812
5813         * bootstrap: Use gnulib-tool to generate lib/Makefile.am
5814         and parts of configure.ac
5815         * configure.ac: Invoke tar_GNULIB to configure gnulib stuff.
5816         * lib/Makefile.am: Removed
5817         * lib/Makefile.tmpl: New file.
5818         * lib/.cvsignore: Updated
5819         * m4/.cvsignore: Updated
5820         * src/xheader.c: Include stpcpy.h
5821
5822         * src/create.c: Produce an error, not warning, if the
5823         filename is too long.
5824         * tests/longv7.sh: Synchronized with the recent changes.
5825
5826 2004-04-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5827
5828         * configure.ac: Fixed test for iconv_t
5829         * src/rmt.h: Bugfix by Jürgen Weigert
5830         * THANKS: Add Jürgen Weigert
5831         * tests/star/README: Fixed typo
5832
5833 2004-04-04  Paul Eggert  <eggert@twinsun.com>
5834
5835         Merge getdate documentation changes from coreutils.
5836
5837         * doc/getdate.texi: Update from coreutils CVS.
5838         * doc/tar.texi: Fix getdate menu to match getdate.texi's.
5839
5840         Merge recent gnulib changes, and remove some lint.
5841
5842         Improve support for nanosecond-resolution time stamps.
5843         * bootstrap: Add gettime, timespec modules.
5844         * configure.ac (gl_GETTIME, gl_TIMESPEC): Add.
5845         * lib/.cvsignore (getopt_int.h, gettime.c, gettimeofday.c,
5846         timespec.h): Add.
5847         * lib/Makefile.am (libtar_a_SOURCES): Add gettime.c, timespec.h.
5848         * m4/.cvsignore: Add clock_time.m4, gettime.m4, gettimeofday.m4,
5849         st_mtim.m4, timespec.m4.  Remove malloc.m4, realloc.m4.
5850         * src/common.h (newer_mtime_option): Now a struct timespec, not
5851         time_t.  All uses changed.
5852         (NEWER_OPTION_INITIALIZED, OLDER_STAT_MTIME): New macros.
5853         * src/create.c (dump_file0): Use OLDER_STAT_TIME to compare times.
5854         * src/incremen.c (scan_path): Likewise.
5855         * src/list.c (read_and): Likewise.
5856         * src/list.c (read_and): Use NEWER_OPTION_INITIALIZED to decide
5857         whether newer_mtime_option is initialized.
5858         * src/tar.c (decode_options): Likewise.
5859         * src/tar.c (decode_options): Adjust to new signature for get_date.
5860
5861         * src/buffer.c (short_read, flush_read): Use size_t, not ssize_t, for
5862         result of safe_read, full_write, and similar functions.
5863         Detect safe_read error by comparing to SAFE_READ_ERROR;
5864         detect full_write error by comparing to 0.
5865         All uses changed.
5866         * src/common.h (write_error_details, sys_write_archive_buffer):
5867         Likewise.
5868         * src/misc.c (write_error_details): Likewise.
5869         * src/rmt.c (main): Likewise.
5870         * src/rmt.h (rmt_read__, rmt_write__): Likewise.
5871         * src/rtapelib.c (rmt_read__, rmt_write__, rmt_ioctl__): Likewise.
5872         * src/sparse.c (sparse_scan_file, sparse_dump_region,
5873         check_sparse_region, check_data_region): Likewise.
5874         * src/system.c (sys_write_archive_buffer, sys_drain_input_pipe,
5875         sys_child_open_for_compress, sys_child_open_for_uncompress): Likewise.
5876         * src/update.c (append_file): Likewise.
5877
5878         * src/buffer.c (clear_read_error_count): Use explicit (void)
5879         to indicate a function with no arguments.
5880         * src/create.c (check_links): Likewise.
5881         * src/system.c (sys_get_archive_stat, sys_save_archive_dev_ino,
5882         sys_detect_dev_null_output, sys_drain_input_pipe, sys_spawn_shell,
5883         sys_reset_uid_gid, sys_get_archive_stat, sys_save_archive_dev_ino,
5884         sys_detect_dev_null_output, sys_drain_input_pipe, sys_spawn_shell):
5885         Likewise.
5886         * src/utf8.c (get_input_charset): Likewise.
5887         * src/xheader.c (xheader_ghdr_name, xheader_write_global,
5888         xheader_decode_global, extended_header_init): Likewise.
5889         * tests/mksparse.c (usage): Likewise.
5890
5891         * src/buffer.c (new_volume): Rename local variables to avoid
5892         shadowing warnings.
5893         * src/common.h (file_dumpable_p, sys_stat_nanoseconds,
5894         sparse_file_p, sparse_member_p, sparse_fixup_header,
5895         sparse_dump_file, sparce_extract_file, sparse_skip_file,
5896         sparse_diff_file): Likewise.
5897         * src/compare.c (diff_archive): Likewise.
5898         * src/create.c (file_dumpable_p, dump_regular_file, dump_dir0,
5899         dump_dir, dump_hard_link, file_count_links, dump_file0, dump_file):
5900         Likewise.
5901         * src/extract.c (repair_delayed_set_stat): Likewise.
5902         * src/misc.c (maybe_backup_file, add_hierarchy_to_namelist):
5903         Likewise.
5904         * src/sparse.c (struct tar_sparse_optab, tar_sparse_dump_region,
5905         tar_sparse_extract_region, sparse_dump_region, sparse_extract_region,
5906         sparse_dump_file, sparse_file_p, sparse_member_p,
5907         sparse_fixup_header, sparse_extract_file, sparse_skip_file,
5908         check_data_region, sparse_diff_file): Likewise.
5909         * src/system.c (sys_stat_nanoseconds): Likewise.
5910         * src/xheader.c (xheader_format_name): Likewise.
5911
5912         * src/common.h (enum old_files): Remove comma before }; not portable.
5913
5914         * src/common.h (read_fatal_details): Add __attribute__ ((noreturn)).
5915         * src/rmt.c (usage): Likewise.
5916         * src/xheader.c (xheader_set_single_keyword): Likewise.
5917         * tests/genfile.c (usage): Likewise.
5918         * tests/mksparse.c (die, usage): Likewise.  Also add printf attribute
5919         to die.
5920
5921         * src/common.h (gname_to_gid, uname_to_uid): Add const to avoid
5922         some gcc warnings.
5923         * src/names.c (uname_to_uid, gname_to_gid): Likewise.
5924         * src/utf8.c (struct langtab.lang, struct langtab.terr, struct
5925         langtab.charset, charset_lookup): Likewise.
5926
5927         * src/common.h (name_init): Remove unused args.  All callers changed.
5928         * src/names.c (name_init): Likewise.
5929
5930         * src/common.h (usage, xheader_write, xheader_write_global,
5931         sys_reset_uid_gid): New decls.
5932
5933         * src/compare.c (report_difference, process_noop): Add
5934         __attribute__ ((unused)) for unused attributes.
5935         * src/sparse.c (oldgnu_sparse_member_p, star_sparse_member_p):
5936         Likewise.
5937         * src/xheader.c (dummy_coder, dummy_decoder, atime_coder,
5938         gid_coder, gname_coder, linkpath_coder, ctime_coder, mtime_coder,
5939         path_coder, size_coder, uid_coder, uname_coder,
5940         sparse_numblocks_coder): Likewise.
5941
5942         * src/create.c (dump_regular_finish, dump_dir0, dump_dir,
5943         dump_file0): Now static.
5944         * src/utf8.c (charset_lookup): Likewise.
5945         * src/xheader.c (xheader_protected_pattern_p,
5946         xheader_protected_keyword_p, xheader_set_single_keyword,
5947         xheader_keyword_deleted_p, xheader_keyword_override_p,
5948         xheader_list_append, xheader_list_destroy, xheader_set_keyword_equal):
5949         Likewise.
5950         * tests/genfile.c (usage): Likewise.
5951         * tests/mksparse.c (die, mkhole, mksparse, usage, xlat_suffix):
5952         Likewise.
5953
5954         * src/create.c (hash_link): Rewrite to avoid cast.
5955
5956         * src/extract.c (file_newer_p): Use parameter, not global var.
5957         * src/misc.c (write_error_details): Likewise.
5958
5959         * src/extract.c (prepare_to_extract): Remove directory arg; not
5960         used.  All callers changed.
5961
5962         * src/misc.c (close_fatal): Remove; not used.
5963         * src/system.c (sys_utimes): Likewise.
5964
5965         * src/rmt.c (get_string): Avoid buffer overrun (off by 1 error).
5966
5967         * src/rmt.c (main): Update copyright date to 2004.
5968         * src/tar.c (decode_options): Likewise.
5969
5970         * src/rtapelib.c (get_status_string): Don't lose errno when
5971         skipping the error messages.
5972         (get_status): Report an error if atol returns a negative number.
5973
5974         * src/utf8.c (struct langtab, langtab, charset_lookup,
5975         get_input_charset) [!defined HAVE_LIBCONV]: Omit unused
5976         definitions.
5977         (iconv_open, iconv, iconv_close) [!defined HAVE_LIBCONV]:
5978         Use macros, not definitions, to avoid type clashes with system
5979         headers.
5980         (charset_lookup): Local var is now auto, not static.
5981         (utf8_convert): Use ICONV_CONST instead of const, to avoid
5982         type clashes.
5983
5984         * src/utf8.c (langtab): Initialize all elements of struct, to
5985         avoid gcc warning.
5986         * src/xheader.c (xhdr_tab): Likewise.
5987
5988         * src/xheader.c: Include fnmatch.h, since we use fnmatch.
5989
5990         * tests/mksparse.c (mkhole): Fix typo: bool was assigned to off_t.
5991
5992 2004-04-04  Sergey Poznyakoff  <gray@Noldor.runasimi.org>
5993
5994         * NEWS: Updated
5995         * configure.ac: Raised version number to 1.13.94
5996         * src/system.h: Protect inclusion of <sys/time.h>
5997         by ifdef.
5998         Declare time() if HAVE_DECL_TIME is 0
5999         * tests/.cvsignore: Added mksparse
6000
6001         * tests/sparse01.sh: New file
6002         * tests/multiv02.sh: New file
6003         * tests/Makefile.am: Add sparse01.sh and multiv02.sh
6004         * tests/longv7.sh: Added missing call to 'after'
6005
6006         * src/common.h: Added missing prototypes
6007         * src/compare.c (diff_archive): Use is_sparse member
6008         instead of GNUTYPE_SPARSE.
6009         * src/create.c: Removed unused variables
6010         * src/extract.c (extract_archive): Use sparse_member_p instead
6011         of GNUTYPE_SPARSE.
6012         Removed unused variables
6013         * src/list.c (decode_header): Use sparse_fixup_header to correct
6014         the st_size value.
6015         (print_header): Do not rely on GNUTYPE_SPARSE type.
6016         Use st->stat.st_size to print real file size.
6017         (skip_member): Assign stat_info.file_name to save_name. This fixes
6018         bug reported by Mads Martin Joergensen <mmj@suse.de>
6019         Use sparse_skip_file() to skip sparse members.
6020         * src/rtapelib.c: include "common.h"
6021         * src/sparse.c (struct tar_sparse_optab.sparse_member_p)
6022         (struct tar_sparse_optab.fixup_header): New member
6023         (tar_sparse_member_p): New function.
6024         (tar_sparse_init): Return true if decode_header is not provided
6025         (tar_sparse_fixup_header)
6026         (sparse_member_p,sparse_fixup_header)
6027         (sparse_skip_file)
6028         (oldgnu_sparse_member_p,oldgnu_fixup_header,star_sparse_member_p)
6029         (star_fixup_header, pax_sparse_member_p): New function
6030         (pax_decode_header): Remove
6031         * src/system.h: Include <sys/time.h> and <utime.h> when available
6032         * src/tar.c (usage): Prototype moved to common.h
6033         * src/tar.h (struct tar_stat_info.is_sparse): New member
6034         * src/utf8.c (utf8_convert): Changed prototype
6035         (get_input_charset): Removed unused variable
6036         * src/xheader.c: include <fnmatch.h>
6037         (size_decoder): Assign to both st->archive_file_size and
6038         st->stat.st_size.
6039         (st->stat.st_size): Assign to st->stat.st_size
6040         (sparse_numbytes_decoder): Removed unused variable
6041         * src/.cvsignore: Added .gdbinit
6042         * THANKS: Added Mads Martin Joergensen
6043
6044 2004-03-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6045
6046         * src/create.c (write_long_name): Do not allow more than
6047         NAME_FIELD_SIZE-1 characters in a file name for V7 format
6048         archives.
6049         * tests/longv7.sh: New file.
6050         * tests/Makefile.am: Add longv7.sh
6051
6052 2004-03-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6053
6054         * src/buffer.c (open_archive): Clear read_full_records_option
6055         if reading from a pipe.
6056         (short_read): Display warning about the deduced record size
6057         if version > 1
6058         * tests/star/pax-big-10g.sh: Updated to match the above changes.
6059         * tests/star/ustar-big-2g.sh: Likewise.
6060         * tests/star/ustar-big-8g.sh: Likewise.
6061
6062         * configure.ac: Added gl_FUNC_STRTOULL
6063         * src/create.c (start_header): Check for GNU_FORMAT
6064         if incremental_option is set.
6065         * src/xheader.c (to_decimal): New function.
6066         (xheader_format_name): Use to_decimal() instead of snprintf.
6067         * tests/listed01.sh: Use genfile instead of dd
6068         * tests/multiv01.sh: Likewise.
6069
6070 2004-03-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6071
6072         * src/list.c (read_and): Stop processing the archive after
6073         encountering a single zero record. Many old archives contain
6074         arbitrary garbage after it.
6075         The warning is issued anyway.
6076
6077 2004-03-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6078
6079         * src/rtapelib.c (rmt_lseek__,rmt_ioctl__): Bugfix. The
6080         conversion buffer was not null terminated. Fix provided
6081         by Leland Lucius <llucius@tiny.net>
6082         * THANKS: Added Leland Lucius
6083         * src/utf8.c (utf8_convert): Indentation fix.
6084
6085 2004-02-29  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6086
6087         * src/buffer.c (flush_read): Bugfix: the
6088         condition at line 714 included
6089
6090               || (status > 0 && !read_full_records_option)
6091
6092         which is grossly wrong, since even if new_volume() below succeeds,
6093         the subsequent call to rmtread will overwrite the chunk of data
6094         already read in the buffer and thus spoil everything.
6095         * src/system.c (sys_child_open_for_uncompress): Minor stylistic
6096         fix.
6097         * tests/star/multi-fail.sh: New test.
6098         * tests/Makefile.am: Added multi-fail.sh
6099         * tests/star/README: Updated
6100
6101 2004-02-29  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6102
6103         * NEWS: Updated
6104         * configure.ac: Removed spurious AC_CHECK_LIB(iconv)
6105         * src/common.h (utc_option): new global
6106         (enum old_files.KEEP_NEWER_FILES): New element
6107         * src/extract.c: Handle --keep-newer-files option
6108         * src/list.c (tartime): Print UTC if --utc was given.
6109         * src/tar.c: New options: --utc and keep-newer-files
6110
6111         * tests/Makefile.am: Added new tests
6112         * tests/after: Rewritten
6113         * tests/before: Rewritten
6114         * tests/preset.in: Rewritten
6115         * tests/delete03.sh: Accommodate for the new testsuite logic
6116         * tests/gzip.sh: Likewise
6117         * tests/incremen.sh: Likewise
6118         * tests/listed01.sh: Likewise
6119         * tests/multiv01.sh: Likewise
6120         * tests/old.sh: Likewise
6121         * tests/options.sh: Likewise
6122         * tests/version.sh: Likewise
6123         * tests/volume.sh: Likewise
6124
6125         * tests/star: New directory
6126         * tests/star/README: New file
6127         * tests/star/gtarfail.sh: New file
6128         * tests/star/gtarfail2.sh: New file
6129         * tests/star/pax-big-10g.sh: New file
6130         * tests/star/qucktest.sh: New file
6131         * tests/star/ustar-big-2g.sh: New file
6132         * tests/star/ustar-big-8g.sh: New file
6133
6134 2004-02-26  Paul Eggert  <eggert@twinsun.com>
6135
6136         * doc/tar.texi (dircategory Individual utilities): Append period,
6137         as suggested by Karl Berry.
6138
6139 2004-02-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6140
6141         * src/list.c (decode_header): Call xheader_decode before
6142         the assignment to current_stat_info.archive_file_size.
6143
6144 2004-02-23  Paul Eggert  <eggert@twinsun.com>
6145
6146         * configure.ac: Invoke AM_ICONV, to define ICONV_CONST if needed.
6147
6148 2004-02-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6149
6150         1.13.93 released.
6151
6152         * NEWS: Updated
6153         * tests/before: Move testing of the prerequisite archive formats
6154         to the separate function 'prereq'. Do not expect any arguments
6155         * tests/delete03.sh: Use prereq() instead of passing arguments
6156         to 'before'.
6157         * tests/incremen.sh: Likewise.
6158         * tests/listed01.sh: Likewise.
6159         * tests/multiv01.sh: Likewise.
6160
6161 2004-02-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6162
6163         Added UTF-8 support. Finished global extended header
6164         support.
6165
6166         * NEWS: Minor fix
6167         * configure.ac: Detect libiconv
6168         * src/utf8.c: New file. Conversions to and from utf-8.
6169         * src/Makefile.am: Added utf8.c
6170         * src/create.c (write_header_name) In pax format, use
6171         "path" keyword if the file name is not ASCII
6172         (start_header): Likewise for uname and gname.
6173         * src/list.c: Decode encountered global headers.
6174         * src/xheader.c: Use keywords from the global
6175         headers.
6176         Correctly handle UTF-8 conversions.
6177         (xheader_list_destroy): New function.
6178         (xheader_set_single_keyword,xheader_set_keyword_equal): Added
6179         missing gettext markers
6180         (decode_record): Rewritten using caller-provided handler and
6181         data closure.
6182         * tests/listed01.sh: Give credit to Andreas Schuldei.
6183
6184 2004-02-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6185
6186         * src/create.c (dump_file0): The conditional at line
6187         1296 prevented incremental backups on individual files
6188         from working, as reported by Andreas Schuldei
6189         <andreas@schuldei.org>.
6190
6191         This is due to the condition
6192
6193           (0 < top_level || !incremental_option)
6194
6195         Removing it makes incremental backups work for individual
6196         files as well as for directories. On the other hand, it does
6197         not affect other functionality, as shown by the reasoning below:
6198
6199         To begin with, the two parts of this condition are mutually
6200         superfluous, because
6201
6202           1) when top_level < 0, incremental_option == 1
6203           so the condition yields false
6204           2) when top_level >= 0, incremental_option == 0
6205           so the condition yields true.
6206
6207         In other words, it is completely equivalent to
6208
6209               (!incremental_option)
6210
6211         Now, let's consider the effect of its removal. There are two cases:
6212
6213         1) when incremental_option==1
6214         This means incremental backup in progress. In this case dump_file
6215         is invoked only for directories or for files marked with 'Y' by
6216         get_directory_contents. The latter are those that did not meet the
6217         condition in incremen.c:242, which is exactly the same condition
6218         as this at create.c:1296. So, for these files the check
6219         (!incremental_option) is useless, since the rest of the
6220         conditional will yield false anyway. On the other hand, if
6221         dump_file is invoked on a directory, the conditional will yield
6222         false due to !S_ISDIR assertion, so these will be processed as usual.
6223
6224         Thus, for this case the extra condition (!incremental_option) is
6225         irrelevant, and its removal won't alter the behavior of tar,
6226         *except* that it will enable incremental backups on individual
6227         files, which is the wanted effect.
6228
6229         2) when incremental_option==0
6230         In this case the condition yields true and its removal does not
6231         affect the functionality.
6232
6233         * THANKS: Updated
6234         * configure.ac: Raised patchlevel to 93
6235         * src/incremen.c: Minor stylistic fixes.
6236         * tests/listed01.sh: New test. Check listed incremental
6237         backups on individual files.
6238         * tests/Makefile.am: Added listed01.sh
6239
6240 2004-02-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6241
6242         * src/common.h (simple_finish_header,start_private_header): New
6243         declarations
6244         (xheader_ghdr_name): Changed declaration
6245         * src/create.c (start_private_header): Removed static qualifier.
6246         (write_extended): Removed superfluous last argument. Use
6247         xheader_write()
6248         (simple_finish_header): New function.
6249         (finish_header): Use simple_finish_header() to break recursive
6250         dependency between this function and write_extended().
6251         * src/tar.c (assert_format): Do not bail out if several
6252         --format arguments are given. This is a common case when
6253         TAR_OPTIONS are used.
6254         (decode_options): New option --show-defaults displays the
6255         compiled-in defaults.
6256         Use POSIX format if no --format option was given and
6257         --pax-option was specified.
6258         Do not allow to use --pax-option unless the archive format is
6259         set to POSIX (or reading subcommand is requested).
6260
6261         * src/update.c (update_archive): Write global extended header if
6262         constructed.
6263         * src/xheader.c (xheader_format_name): Bugfix.
6264         (xheader_xhdr_name): Changed the default extended header name
6265         to '%d/PaxHeaders.%p/%f', as POSIX requires.
6266         (xheader_ghdr_name): Removed unused argument.
6267         (xheader_write,xheader_write_global): New function.
6268         (xheader_decode): Modified to honor overrides whatever
6269         the current archive format is.
6270
6271         * src/delete.c (delete_archive_members): Call xheader_decode
6272         unconditionally.
6273         * src/list.c (decode_header): Likewise.
6274         * src/incremen.c (sort_obstack): Fixed typo in the comment
6275
6276         * doc/tar.texi: Document new default for extended
6277         header names.
6278
6279         * tests/before: Accept an optional list of allowed archive
6280         formats. Exit with the status 77 if the current archive
6281         format does not match any of them.
6282         * tests/delete03.sh: Require gnu, oldgnu or posix format
6283         * tests/incremen.sh: Require gnu or oldgnu format
6284         * tests/multiv01.sh: Likewise
6285
6286 2004-02-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6287
6288         * doc/tar.texi (Option Summary): Documented --pax-option
6289         * src/tar.c: Likewise.
6290         * NEWS: Likewise.
6291         * src/create.c (to_chars): Added a comment.
6292         * src/tar.h: Comment to GNU_FORMAT
6293
6294 2004-02-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6295
6296         * README: Updated
6297         * configure.ac: Added stpcpy
6298         * bootstrap: Likewise
6299         * lib/Makefile.am: Likewise
6300         * src/common.h (xheader_xhdr_name,xheader_ghdr_name): New
6301         functions
6302         * src/create.c (write_extended): Call xheader_xhdr_name
6303         instead of using hardcoded "././@PaxHeader" name.
6304         * src/tar.c: New option --pax-option (equivalent to -o option
6305         of pax).
6306         * src/xheader.c: Implement pax -o option. Fixed misleading
6307         heading comment (introduced 2003-09-02).
6308         * src/incremen.c: Minor fixes
6309         * m4/.cvsignore: Updated
6310
6311 2004-02-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6312
6313         * src/incremen.c: Removed accumulator stuff in favor of obstack.
6314         (get_directory_contents): Split into two functions
6315         * src/update.c: Minor changes
6316         * doc/tar.texi: Fixed typo
6317
6318 2004-02-15  Paul Eggert  <eggert@twinsun.com>
6319
6320         Fix Debian bug 230872, originally reported by Jeff King in
6321         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=230872>.
6322
6323         * doc/tar.texi (posix compliance): Remove.  The whole section
6324         was a misunderstanding of what POSIXLY_CORRECT is supposed to
6325         mean.  The GNU Coding Standards says that POSIXLY_CORRECT
6326         is for disabling extensions that are incompatible with POSIX:
6327         it is not for disabling compatible extensions.  All references
6328         to this section removed.
6329         (posix): This format is created only if the posix format is
6330         specified; it is no longer created if gnu format is specified
6331         and POSIXLY_CORRECT is set.
6332         * src/tar.c (decode_options): Ignore POSIXLY_CORRECT.
6333         POSIX does not specify the behavior of tar, so we should
6334         not worry about POSIXLY_CORRECT here.
6335
6336 2004-01-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6337
6338         * Makefile.am: Removed m4
6339         * configure.ac: Require automake-1.8/autoconf-2.59. Removed
6340         m4/Makefile.
6341         * README-alpha: Updated
6342         * bootstrap: Updated TP URL, improved help output. Default
6343         to :ext:anoncvs and set CVS_RSH, unless already set.
6344         * m4/Makefile.am: Removed
6345
6346 2004-01-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6347
6348         * bootstrap: Bugfix by Marco Gerards <metgerards@student.han.nl>:
6349         Use $option instead of $1 so all options will be parsed.
6350
6351 2004-01-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6352
6353         Started rewriting buffer.c ...
6354
6355         * bootstrap: New option --no-po
6356         * src/buffer.c (new_volume,check_label_pattern): Changed return type.
6357         (time_to_start_writing): Changed data type
6358         (file_to_switch_to): Removed. Variable never assigned to.
6359         (open_archive) Moved option compatibility checks to tar.c
6360         Other minor changes.
6361         * src/common.h (maybe_backup_file): Changed return type
6362         * src/misc.c: Likewise.
6363         * src/create.c: Updated invocations of safer_name_suffix
6364         * src/extract.c: Likewise
6365         * src/delete.c: Updated assignment to write_archive_to_stdout
6366         * src/tar.c (decode_options): More option compatibility checks
6367         (moved from buffer.c)
6368         * src/update.c (time_to_start_writing): Changed data type.
6369         * tests/recurse.sh: New test case.
6370         * tests/mksparse.c: New file.
6371         * tests/Makefile.am: Added recurse.sh and mksparse.c
6372
6373 2004-01-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6374
6375         * src/sparse.c (sparse_diff_file): Bugfix. Thanks
6376         Martin Simmons for the patch.
6377         * src/create.c (dump_dir0): Bugfix. Thanks Piotr Czerwinski
6378         <pius@pld-linux.org> for the patch.
6379
6380 2003-12-26  Paul Eggert  <eggert@twinsun.com>
6381
6382         Synchronize with Gettext 0.13.1, Automake 1.8, Autoconf 2.59,
6383         and translation website.
6384
6385         * bootstrap: Don't bother skipping codeset.m4, glibc21.m4,
6386         intdiv0.m4, inttypes_h.m4, inttypes.m4, inttypes-pri.m4,
6387         isc-posix.m4, and lcmessage.m4 from gnulib.  This list of files is
6388         a bit obsolete anyway, now that gettext 0.13.1 is out.  Also, the
6389         files are replaced by autoreconf.  Also, there seems to be a bug
6390         in gettext/autoconf/automake if we try to omit these files after
6391         autoreconf has replaced them, even though the gettext manual says
6392         they're optional.  So give up and just include them for now, even
6393         though they make 'configure' longer and slower.
6394
6395         Change translation URL from
6396         <http://www.iro.umontreal.ca/contrib/po/maint/tar/> to
6397         <http://www2.iro.umontreal.ca/~gnutra/po/maint/tar/> to
6398         accommodate translator website revamp.
6399
6400         Fail if autoreconf fails.
6401
6402         * m4/.cvsignore: Add intmax.m4, longdouble.m4, printf-posix.m4,
6403         signed.m4, size_max.m4, wchar_t.m4, wint_t.m4, xsize.m4, to
6404         ignore files now supplied by gettext 0.13.1.
6405
6406 2003-12-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6407
6408         Synchronized with the backup repository on Mirddin
6409
6410 2003-12-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6411
6412         * configure.ac: Check for varios members of struct stat
6413         that may represent file modification times with a subsecond
6414         precision.
6415         Check for utimes (for future use)
6416         * src/buffer.c (short_read): Issue a warning on short reads.
6417         * src/common.h (sys_stat_nanoseconds): New function
6418         * src/create.c (dump_file0): Use sys_stat_nanoseconds().
6419         * src/list.c (read_and): Treat only two successive zero
6420         filled blocks as an EOF indicator. Issue a warning if
6421         a single one is encountered.
6422         * src/system.c (sys_stat_nanoseconds): New function
6423         * src/tar.h (tar_stat_info.atime_nsec,mtime_nsec,ctime_nsec): New
6424         members.
6425         * src/xheader.c (code_time,decode_time): Support for subsecond
6426         precision.
6427         (atime_coder,atime_decoder,ctime_coder,ctime_decoder)
6428         (mtime_coder,mtime_decoder): Update invocations of code_time and
6429         decode_time.
6430         (gid_decoder,size_decoder,uid_decoder,sparse_size_decoder)
6431         (sparse_numblocks_decoder,sparse_offset_decoder)
6432         (sparse_numbytes_decoder): Updated
6433
6434 2003-12-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6435
6436         * src/names.c (safer_name_suffix): Reverted change made
6437         2003-11-14. Reason: Discussion with Paul Eggert and
6438         Jean-Louis Martineau. See also ChangeLog entry from
6439         1999-08-14.
6440         * tests/delete03.sh: Likewise.
6441         * tests/extrac04.sh: Likewise.
6442         * tests/multiv01.sh: Likewise.
6443
6444 2003-12-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6445
6446         * src/incremen.c (write_directory_file): Use sys_truncate
6447         * src/list.c (print_header): Use archive_file_size member
6448         when printing real file size.
6449         * src/sparse.c (sparse_scan_file): Correctly handle files with
6450         a hole at the end.
6451         (sparse_dump_region,sparse_extract_region): Allow for zero size
6452         trailing blocks
6453
6454 2003-12-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6455
6456         * configure.ac: Raised version number to 1.13.92
6457         * src/list.c (decode_header): Discern between pax and ustar
6458         formats
6459         Initialize current_stat_info.archive_file_size.
6460
6461         NOTE: Modifications from this date on are temporarily
6462         stored on local CVS on mirddin. This repository will
6463         be synchronized with Savannah as soon as the latter
6464         becomes operational again.
6465
6466 2003-12-01  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6467
6468         * TODO: Updated
6469         * src/sparse.c: Initial implementation of GNU/pax sparse
6470         file format.
6471         * src/common.h (xheader_store): Changed prototype.
6472         * src/create.c: Update calls to xheader_store
6473         * src/extract.c (extract_archive): Check reported size vs.
6474         archive file size to determine if we have to do with a
6475         sparse file.
6476         * src/tar.c (usage): Cleaned up the sample argument to --newer
6477         option.
6478         (decode_options): Allow --sparse for POSIX_FORMAT archives.
6479         * src/xheader.c (struct xhdr_tab.coder; all coder function): Added
6480         extra argument
6481         Implemented GNU.sparse.* keywords.
6482
6483 2003-11-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6484
6485         * configure.ac: Check for setlocale. Thanks Bruno Haible for
6486         reporting.
6487
6488 2003-11-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6489
6490         * src/create.c (write_gnu_long_link): Use oldgnu
6491         magic with @LongLink blocks.
6492
6493 2003-11-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6494
6495         * src/tar.h: Support for star sparse format.
6496         * src/sparse.c: Likewise.
6497
6498 2003-11-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6499
6500         * src/sparse.c (sparse_diff_file): New function
6501         * src/common.h (sys_compare_uid,sys_compare_gid): New functions
6502         (sys_compare_uid_gid): Removed.
6503         (sys_compare_links,report_difference): Changed prototype
6504         (sparse_diff_file): New function
6505         * src/system.c (sys_compare_uid,sys_compare_gid): New functions
6506         (sys_compare_uid_gid): Removed.
6507         (sys_compare_links): Changed declaration
6508         * src/compare.c (diff_archive): Use sparse_diff_file.
6509
6510 2003-11-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6511
6512         Rewritten sparse file handling.
6513
6514         * src/sparse.c: New file. Provides a universal framework
6515         for various methods for sparse files handling.
6516         * src/Makefile.am: Added sparse.c
6517         * src/common.h (struct sp_array,sparsearray,sp_array_size)
6518         (init_sparsearray,fill_in_sparse_array): Removed
6519         (enum dump_status): New data type
6520         (pad_archive,close_diag,open_diag,read_diag_details)
6521         (readlink_diag,savedir_diag,seek_diag_details,stat_diag): New
6522         functions.
6523         (sparse_file_p,sparse_dump_file,sparse_extract_file): New
6524         functions.
6525         (print_header): Changed prototype declaration.
6526         * src/tar.h (struct sp_array): Declaration from common.h
6527         (struct tar_stat_info): New members archive_file_size,
6528         sparse_map_avail,sparse_map.
6529         * src/create.c: Major rewrite.
6530         * src/extract.c: Use new sparse file interface.
6531         * src/compare.c (diff_sparse_files): Temporary placeholder.
6532
6533         * src/buffer.c: Minor changes
6534         * src/tar.c: Likewise.
6535         * src/list.c: Likewise.
6536         * src/misc.c (close_diag,open_diag,read_diag_details)
6537         (readlink_diag,savedir_diag,seek_diag_details,stat_diag): New
6538         diagnostics functions.
6539         * src/incremen.c: Use new diagnostics functions.
6540         * src/names.c: Likewise.
6541
6542 2003-11-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6543
6544         * configure.ac: Fixed check for setsockopt
6545
6546         * src/create.c: Do not zero-terminate name field if
6547         the name is exactly 100 characters long.
6548         (write_ustar_long_name): Fixed cheking for unsplittable
6549         names.
6550
6551 2003-11-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6552
6553         * src/create.c (start_header): Removed debugging hook
6554         (dump_file): Fixed handling of linkname field.
6555         * src/names.c (safer_name_suffix): If the input
6556         file name ends with a slash, output one should do so
6557         as well.
6558         * doc/tar.texi: Documented --format=ustar
6559
6560 2003-11-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6561
6562         * src/tar.h (archive_format): USTAR_FORMAT: New type.
6563         * src/create.c: Added POSIX.1-1988 support.
6564         * src/names.c (safer_name_suffix): Skip leading ./
6565         * src/tar.c: New option --format=ustar forces
6566         POSIX.1-1988 archive format.
6567         * tests/delete03.sh: Updated.
6568         * tests/extrac04.sh: Updated.
6569         * tests/multiv01.sh: Updated.
6570
6571 2003-11-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6572
6573         * src/list.c (read_and): Initialize current_stat_info
6574         and extended_header at the start of the loop.
6575         * src/names.c (all_names_found): Check if the argument
6576         contains valid filename. Fixes coredump on `not_a_tar_file'
6577         * src/xheader.c (atime_decoder,gid_decoder,ctime_decoder)
6578         (mtime_decoder,size_decoder,uid_decoder): Use xstrtoumax.
6579         Fixes `pax-big-10g' bug.
6580
6581 2003-11-12  Paul Eggert  <eggert@twinsun.com>
6582
6583         Fix some C compatibility bugs reported by Joerg Schilling.
6584
6585         * src/common.h (stripped_prefix_len): Fix misspelling
6586         "stripped_path_len" in declaration.
6587         * src/rmt.c (main): Use "return FOO;" rather than
6588         "exit (FOO);"; we no longer have to worry about
6589         pre-ANSI hosts that mishandled returned values from "main".
6590         * src/tar.c (main): Likewise.  This avoids warnings on some
6591         compilers.
6592         * src/system.c: Include signal.h, for 'kill'.
6593         * src/system.h (DEV_BSIZE): Remove.
6594         (DEFAULT_ST_BLKSIZE): New macro.
6595         (ST_BLKSIZE): Use it, instead of DEV_BSIZE.
6596         * src/tar.c (enum): Remove comma just before }.
6597
6598 2003-11-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6599
6600         * src/list.c (decode_header): Initialize st_atime and
6601         st_ctime.
6602
6603 2003-11-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6604
6605         * configure.ac (tar_save_LIBS): Bugfix. Thanks Adrian
6606         Bunk <bunk@fs.tum.de> for reporting.
6607         * doc/tar.texi: Fixed spelling. Thanks Martin Buchholz
6608         <martin@xemacs.org> for spotting.
6609
6610 2003-11-04  Paul Eggert  <eggert@twinsun.com>
6611
6612         * src/xheader.c (xhdr_tab): Make it extern, not static, as C89 and
6613         C99 require this.
6614
6615 2003-10-26  Paul Eggert  <eggert@twinsun.com>
6616
6617         * src/system.c (sys_spawn_shell): Cast trailing null to (char *).
6618         Bug reported by Christian Weisgerber.
6619
6620 2003-10-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6621
6622         * AUTHORS: Updated
6623         * NEWS: Updated
6624         * src/tar.c (decode_options): Removed superfluous archive format
6625         check
6626         * doc/tar.texi: Documented new features.
6627
6628 2003-10-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6629
6630         * NEWS: Updated
6631         * THANKS: Added Wojciech Polak
6632         * configure.ac: Added checks for missing functions. Raised
6633         version number to indicate alpha release.
6634         * lib/Makefile.am: Added missing headers
6635         * lib/waitpid.c: Added missing includes.
6636         * src/extract.c: Likewise.
6637         * src/names.c: Removed spurious includes.
6638         * src/xheader.c: Likewise.
6639         * src/system.h [MSDOS]: Fixed spelling of EACCES. Added
6640         macro overriding broken mkdir prototypes.
6641
6642 2003-10-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6643
6644         * configure.ac: Check for dev_t and ino_t.
6645         * m4/Makefile.am: Added missing files.
6646         * src/system.c: New file.
6647         * src/Makefile.am: Added system.c
6648         * src/common.h: Prototypes for functions from system.c
6649         * src/system.h (SET_BINARY_MODE, ERRNO_IS_EACCESS): New defines
6650         * src/buffer.c: Moved system dependencies to system.c
6651         * src/compare.c: Likewise.
6652         * src/create.c: Likewise.
6653         * src/delete.c: Likewise.
6654         * src/extract.c: Likewise.
6655         * src/rtapelib.c: Likewise.
6656
6657 2003-10-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6658
6659         Implemented --occurrence option.
6660
6661         * NEWS: Updated.
6662         * src/tar.c: New option --occurrence.
6663         * src/common.h (occurrence_option): New global
6664         (struct name): Changed `found' member to `uintmax_t
6665         found_count'.
6666         (names_done): Removed
6667         (all_names_found): Changed prototype.
6668         (ISFOUND,WASFOUND): New macros
6669         * src/delete.c (delete_archive_members): Honor --occurrence
6670         option.
6671         * src/list.c (read_and): Likewise.
6672         * src/names.c: Count number of occurrences of each name in the
6673         archive.
6674         (name_match): Honor --occurrence option.
6675         (names_done): Removed
6676         (all_names_found,names_notfound): Rewritten.
6677
6678 2003-10-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6679
6680         * src/tar.c: Removed extra precaution regarding
6681         subcommand_option == CAT_SUBCOMMAND
6682         * lib/Makefile.am: Updated
6683
6684 2003-10-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6685
6686         * src/common.h (names_done): New function.
6687         * src/names.c: Likewise.
6688         * src/list.c (read_and): Use all_names_found() as `while'
6689         condition.
6690         * src/tar.c: New option --first-copy
6691         * NEWS: Updated
6692
6693 2003-09-24  Paul Eggert  <eggert@twinsun.com>
6694
6695         * src/rmt.c (main): Don't translate Copyright string; international
6696         law says the word "Copyright" should be in English.
6697         * src/tar.c (decode_options): Likewise.
6698
6699 2003-09-22  Paul Eggert  <eggert@twinsun.com>
6700
6701         * doc/tar.texi (extracting untrusted archives): New section.
6702
6703         * src/common.h (stripped_path_len): Renamed from cut_path_elements.
6704         Return size_t, not pointer, so that we don't have to worry about
6705         violating the C standard by converting char const * to char *.
6706         All callers changed.
6707         * src/names.c (stripped_path_len): Likewise.  Strip file system
6708         prefix, too.  Count adjacent slashes as if they were one slash;
6709         that is the POSIX standard.
6710
6711 2003-09-17  Paul Eggert  <eggert@twinsun.com>
6712
6713         * README-alpha: Document maintainer tool assumptions a bit.  GNU
6714         'sed' is no longer required.  For GNU m4 1.4, suggest the patch in
6715         Debian bug 211447.  Fix minor misspellings/whitespace nits.
6716
6717         * configure.ac (AC_AIX, AC_MINIX): Remove; subsumed by
6718         gl_USE_SYSTEM_EXTENSIONS.
6719
6720         * lib/.cvsignore: Add exit.h, time_r.c, time_r.h.
6721         * m4/.cvsignore: Add restrict.m4, time_r.m4.
6722
6723 2003-09-17  Paul Eggert  <eggert@twinsun.com>
6724
6725         * bootstrap: Don't use "for option; do";
6726         Solaris 8 /bin/sh doesn't like that.
6727
6728 2003-09-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6729
6730         * README-alpha: Updated
6731         * bootstrap: Updated
6732
6733 2003-09-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6734
6735         * README-alpha: Updated
6736         * bootstrap: Updated
6737         * po/POTFILES.in: Added src/xheader.c
6738         * src/common.h (cut_path_elements): Added proto.
6739
6740 2003-09-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6741
6742         * src/buffer.c: Use ngettext where appropriate.
6743         * src/compare.c: Likewise.
6744         * src/create.c: Likewise.
6745         * src/misc.c: Likewise.
6746         * src/tar.c: Likewise.
6747         * src/update.c: Likewise.
6748
6749 2003-09-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6750
6751         * .cvsignore: Added *.shar.gz
6752         * NEWS: Updated
6753         * TODO: Updated
6754         * src/common.h (strip_path_elements): New variable.
6755         * src/extract.c (extract_archive): Implemented --strip-path
6756         * src/names.c (cut_path_elements): New function.
6757         * src/tar.c: New option --strip-path=NUM.
6758         (decode_options) Assign boolean values to bool variables.
6759
6760 2003-09-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6761
6762         * src/delete.c: Fixed deletion from the POSIX archives.
6763         * src/list.c (read_header): Minor change.
6764         * src/tar.c (main): Do not check for volume_label_option
6765         if subcommand_option is not CREATE_SUBCOMMAND.
6766         * src/xheader.c (xheader_decode): Store the header as
6767         well (for eventual delete).
6768
6769         * tests/incremen.sh: Explicitly request GNU format. This will
6770         disappear when GNU extended header keywords are working.
6771         * tests/multiv01.sh: Likewise
6772         * tests/volume.sh: Likewise
6773
6774 2003-09-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6775
6776         * src/create.c: Support for "linkpath" extended keyword.
6777         * src/xheader.c (decode_record): Reversed the return
6778         condition.
6779
6780 2003-09-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6781
6782         * configure.ac: Allow to redefine the default output format.
6783         * src/tar.c: Use DEFAULT_ARCHIVE_FORMAT macro
6784         (archive_format_string): New function.
6785         (usage): Updated help output.
6786         * README: Updated.
6787         * NEWS: Updated.
6788         * TODO: Updated.
6789
6790 2003-09-02  Paul Eggert  <eggert@twinsun.com>
6791
6792         * src/common.h (destroy_stat, xheader_decode, xheader_store,
6793         xheader_read, xheader_finish, xheader_destroy): Add decls;
6794         C99 requires this.
6795
6796         * src/create.c (write_extended): Remove unused local 'bufsize'.
6797
6798         * src/delete.c (delete_archive_members): Handle case of
6799         HEADER_SUCCESS_EXTENDED followed by HEADER_FAILURE.
6800         * src/list.c (read_and): Abort if HEADER_SUCCESS_EXTENDED
6801         occurs, as it's not possible.
6802         * src/update.c (update_archive): Likewise.
6803
6804         Use "const" when possible in new code.
6805         * src/tar.c (struct fmttab.name): Now char const *.  All uses changed.
6806         (fmttab): Now const.  All uses changed.
6807         * src/xheader.c (struct xhdr_tab.keyword): Now pointer to const.
6808         (struct xhdr_tab.coder, struct xhdr_tab.decoder, locate_handler,
6809         decode_record, xheader_store, xheader_print, code_string, code_time,
6810         code_num, dummy_coder, dummy_decoder, atime_coder, atime_decoder,
6811         gid_coder, gid_decoder, gname_coder, gname_decoder, linkpath_coder,
6812         linkpath_decoder, ctime_coder, ctime_decoder, mtime_coder,
6813         mtime_decoder, path_coder, path_decoder, size_coder, size_decoder,
6814         uid_coder, uid_decoder, uname_coder, uname_decoder):
6815         Use pointers to const when possible.
6816         (xhdr_tab): Now const.
6817
6818         * src/tar.c (fmttab): Avoid GCC warning by not eliding initializers.
6819         (set_archive_format): Report an error if no format name matches,
6820         instead of returning an undefined value.
6821
6822         * src/xheader.c (struct xhdr_tab.decoder, dummy_decoder,
6823         atime_decoder, gid_decoder, gname_decoder, linkpath_decoder,
6824         ctime_decoder, mtime_decoder, path_decoder, size_decoder,
6825         uid_decoder, uname_decoder): Remove unused keyword arg.
6826         All uses changed.
6827
6828         * src/tar.c (set_archive_format): Now static.
6829         * src/xheader.c (xhdr_tab, format_uintmax): Now static.
6830
6831         * src/xheader.c (dummy_coder, dummy_decoder, atime_coder,
6832         atime_decoder, gid_coder, gid_decoder, gname_coder, gname_decoder,
6833         linkpath_coder, linkpath_decoder, mtime_coder, mtime_decoder,
6834         ctime_coder, ctime_decoder, path_coder, path_decoder, size_coder,
6835         size_decoder, uid_coder, uid_decoder, uname_coder, uname_decoder):
6836         Remove forward decls; no longer needed.
6837         (xhdr_tab): Move to end, so that the forward decls aren't needed.
6838         Add a forward declaration.
6839
6840         Use 'bool' in new code, when appropriate.
6841         * src/xheader.c (decode_record): Return bool, not int.
6842         * src/common.h (read_header): Since it accepts bool, change
6843         all callers to use false and true rather than 0 and 1.
6844
6845         * src/xheader.c (decode_record): Fix misspelling in diagnostic
6846         "extended headed" -> "extended header".
6847
6848         GNU coding style fixes.
6849         * src/xheader.c (decode_record, xheader_decode):
6850         Do not use decls like "char *p, *q;".
6851
6852         Minor style fixes.
6853         (xheader_store): Avoid parentheses around object operand of sizeof.
6854
6855 2003-09-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6856
6857         * src/create.c (start_header): Store long file names
6858         in "path" keyword of an extended header if in POSIX
6859         mode.
6860         (finish_header): print header before calling write_extended().
6861         * src/list.c (list_archive): Always decode the header. This
6862         is necessary so the extended header is processed and the correct
6863         filename is printed no matter what the state of verbose_option.
6864         * src/xheader.c (xhdr_tab): Reserved GNU keywords (commented out
6865         for the time being).
6866
6867 2003-09-01  Paul Eggert  <eggert@twinsun.com>
6868
6869         Update from gnulib, and correct fnmatch to fnmatch-gnu.
6870         * bootstrap (gnulib_modules): Change fnmatch to fnmatch-gnu.
6871         Sort.
6872         * configure.ac (gl_USE_SYSTEM_EXTENSIONS): Use this instead
6873         of AC_GNU_SOURCE.
6874         * lib/.cvsignore: Add alloca.h, stdbool.h.  Sort.  Append newline.
6875         * lib/Makefile.am (lib_OBJECTS): New macro, for convenience when
6876         copying rules from gnulib module descriptions.
6877         (BUILT_SOURCES, EXTRA_DIST, all-local, alloca.h):
6878         Update from gnulib modules alloca, fnmatch, getline, stdbool.
6879         * m4/.cvsignore: Add utimes-null.m4.  Sort.
6880
6881 2003-09-01  Sergey Poznyakoff
6882
6883         Added initial support for creating POSIX headers.
6884
6885         * src/common.h (MAXOCTAL11,MAXOCTAL7): New defines
6886         (string_to_chars): New functions
6887         (struct xheader): Changed structure
6888         (gid_to_gname,gname_to_gid,uid_to_uname,uname_to_uid): Changed
6889         prototypes.
6890         * src/create.c (string_to_chars): New function.
6891         (write_extended): New function
6892         (start_header): Create extended POSIX headers if necessary.
6893         (finish_header): Likewise.
6894         * src/list.c (print_header): Take user/group from
6895         current_stat_info.
6896         * src/names.c (gid_to_gname,gname_to_gid)
6897         (uid_to_uname,uname_to_uid): Changed prototypes.
6898         * src/tar.c: New option --format.
6899         * src/tar.h (OLDGNU_COMPATIBILITY): Removed
6900         (struct extra_header): Removed unused structure.
6901         (union block.extra_header): Removed unused member.
6902         * src/xheader.c: Implemented coder functions.
6903         * bootstrap: Added obstack.
6904         * lib/.cvsignore: Likewise.
6905         * configure.ac: Added 'gl_OBSTACK'
6906         * m4/Makefile.am: Added new files.
6907         * m4/.cvsignore: Likewise.
6908         * TODO: Minor formatting change
6909
6910 2003-08-31  Sergey Poznyakoff
6911
6912         Added initial support for POSIX extended and STAR headers
6913         (only for listing/extracting).
6914
6915         * src/xheader.c: New file.
6916         * src/Makefile.am: Added xheader.c
6917         * src/tar.h (struct star_header): New datatype
6918         (XHDTYPE,XGLTYPE): New defines
6919         (enum archive_format:STAR_FORMAT): New member
6920         (struct tar_stat_info): New datatype.
6921         (union block.star_header): New member.
6922         * src/common.h (orig_file_name,current_file_name)
6923         (current_trailing_slash,current_link_name): Removed variables.
6924         (current_stat_info): New variable
6925         (current_stat): Removed
6926         (extended_header): New variable
6927         (decode_header): Changed prototype.
6928         * src/list.c (decode_header): Added initial support for POSIX extended
6929         and STAR headers.
6930         (skip_member): Check oldgnu_header only if current_format is set
6931         to OLDGNU_FORMAT.
6932         * src/buffer.c: Use current_stat_info
6933         * src/compare.c: Likewise.
6934         * src/create.c: Likewise.
6935         * src/delete.c: Likewise.
6936         * src/incremen.c: Likewise.
6937         * src/mangle.c: Likewise.
6938         * src/update.c: Likewise.
6939         * src/extract.c: Likewise.
6940         (make_directories): Improved check for the existence of the directory
6941         * src/tar.c (destroy_stat): New function.
6942
6943 2003-08-29  Paul Eggert  <eggert@twinsun.com>
6944
6945         * NEWS, bootstrap: Drop en_GB locale; it was more trouble than it
6946         was worth (e.g., different users in en_GB disagree about -ize
6947         versus -ise).
6948         * po/en_GB.po: Remove.
6949
6950 2003-07-28  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6951
6952         * TODO: Updated
6953         * NEWS: Updated
6954         * src/tar.c: Removed support for the obsolete command line
6955         options.
6956         * doc/tar.texi: Removed references to the obsolete command
6957         line options.
6958
6959 2003-07-27  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6960
6961         * TODO: Updated
6962         * NEWS: Updated
6963         * doc/tar.texi: Updated
6964         * src/common.h (check_links_option): New variable
6965         (orig_file_name): New variable
6966         (check_links): New proto.
6967         * src/create.c (struct link.nlink): New member
6968         (link_table): Static for the module.
6969         (dump_file): Update `link' member when adding new links
6970         to the link_table.
6971         (check_links): New function.
6972         * src/list.c (print_header): Use orig_file_name.
6973         * src/tar.c: New option --check-links. Changed semantics of
6974         -o to comply to UNIX98 when extracting and to its previous
6975         semantics otherwise.
6976         (main): Call check_links if --check-links. was given.
6977
6978 2003-07-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6979
6980         * src/list.c (print_header): Revised
6981         * NEWS: Started the entry for 1.13.26
6982         * doc/Makefile.am (tar.dvi): Fixed TEXINPUTS value.
6983
6984 2003-07-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6985
6986         * .cvsignore: Added to the repository.
6987         * doc/.cvsignore: Likewise.
6988         * lib/.cvsignore: Likewise.
6989         * m4/.cvsignore: Likewise.
6990         * po/.cvsignore: Likewise.
6991         * scripts/.cvsignore: Likewise.
6992         * src/.cvsignore: Likewise.
6993         * tests/.cvsignore: Likewise.
6994
6995         * lib/Makefile.am: Added exitfail.[hc]
6996         * src/misc.c (chdir_do): Fixed call to restore_cwd
6997         * src/buffer.c (flush_read): Fixed behavior on short
6998         reads right after opening the new archive (multiv01.sh test).
6999         (new_volume): Special handling for "-".
7000         * src/list.c (print_header): Print trailing slash if
7001         current_trailing_slash was set (extrac03.sh,extrac04.sh tests).
7002         * tests/multiv01.sh: Minor changes.
7003         * m4/Makefile.am: Added missing files.
7004
7005 2003-07-05  Paul Eggert  <eggert@twinsun.com>
7006
7007         Finish the checkin begin yesterday.
7008
7009         * NEWS: Document the user-visible changes installed in the last
7010         two days.
7011
7012         * TODO: New file (actually, resurrected; but with new contents).
7013
7014         * src/list.c (read_and): Give full type for procedure arg.
7015         (read_header): Strip trailing slashes, setting current_trailing_slash.
7016         (tartime): Avoid int overflow when printing year (!).
7017         (print_header): New arg specifying block ordinal.  All uses changed.
7018         Print link as 'h' type.  Give labels for long links and names.
7019
7020         * src/misc.c (contains_dot_dot): Moved to names.c
7021         (must_be_dot_or_slash): New function.
7022         (safer_rmdir): Use it.
7023         (remove_any_file): Now takes enum as option, not boolean.
7024         Check for (Linux) EISDIR as well as (POSIX) EPERM when attempting
7025         to unlink a directory.
7026         (deref_stat): Accept bool, not int.
7027
7028         * src/names.c (namelist_match): Allow partial matches only if
7029         recursive.
7030         (hash_string_hasher): Renamed from hash_avoided_name.
7031         (hash_string_compare): Renamed from compare_avoided_anames.
7032         (hash_string_insert, hash_string_lookup): New functions.
7033         (add_avoided_name, is_avoided_name): Use them.
7034         (safer_name_suffix): New function.
7035         (contains_dot_dot): Moved here from misc.c.  Now returns bool, not int.
7036
7037         * src/rmt.c: Don't include print-copyr.h.
7038         (prepare_input_buffer): New arg FD.
7039         Do not read more than INT_MAX bytes at once,
7040         since it breaks on some brain damaged Tru64 hosts.
7041         Divide size by two
7042         when retrying instead of subtracting 1024; for speed.
7043         (main): Use gettext to translate (C), not print_copyright.
7044
7045         * src/system.h: Include <alloca.h> and <stdbool.h> unconditionally,
7046         now that gnulib handles this.
7047         Include <stddef.h> and <limits.h> unconditionally, now that we assume
7048         C89 or better.
7049         Assume that offsetof is defined in stddef.h.
7050         Do not include <sys/param.h>.
7051         (realloc, lseek): Do not declare.
7052         (HAVE_DECL_VALLOC): Renamed from HAVE_VALLOC.
7053         (CHAR_BIT, CHAR_MAX, UCHAR_MAX, LONG_MAX): Remove
7054         declarations, since we now assume C89 or better.
7055         (PARAMS): Remove, as we now assume C89.  All uses changed.
7056         (bindtextdomain, textdomain): Include <gettext.h> to define.
7057         Include <unlocked-io.h>.
7058         (valloc): Define if not defined, and if valloc is not declared.
7059         (xstrdup): Remove decl.
7060
7061         * src/tar.c: Do not include <print-copyr.h>.
7062         Include <getdate.h>.
7063         (get_date): Remove decl.
7064         (ATIME_PRESERVE_OPTION, CHECKPOINT_OPTION, FORCE_LOCAL_OPTION,
7065         IGNORE_FAILED_READ_OPTION, INDEX_FILE_OPTION, NO_OVERWRITE_DIR_OPTION,
7066         NUMERIC_OWNER_OPTION, RECURSIVE_UNLINK_OPTION, REMOVE_FILES_OPTION,
7067         SHOW_OMITTED_DIRS_OPTION, TOTALS_OPTION): New constants.
7068         (long_options, decode_options): Use them.
7069         (OVERWRITE_DIR_OPTION): Remove.
7070         (long_options): New options --index-file, --no-overwrite-dir.
7071         Remove --overwrite-dir option.
7072         (usage): Use PACKAGE_BUGREPORT.
7073         (decode_options): Terminate new argv properly.
7074         Use PACKAGE_NAME, PACKAGE_VERSION.
7075         If verbose, report how we grokked any textual date option.
7076         (main): Add support for index-file.
7077
7078         * tests/Makefile.am: Convert to UTF-8.
7079         (AUTOMAKE_OPTIONS): Remove.
7080         (TESTS): Add delete04.sh, multiv01.sh, options.sh.
7081         (INCLUDES): Remove ../intl.
7082         (LDADD): Don't link libtar.a twice.
7083
7084         * tests/genfile.c: Convert to UTF-8.
7085         Don't include <print-copyr.h>.
7086         (DEFAULT_PATTERN): Renamed from DEFAULT.
7087         (ZEROS_PATTERN): Renamed from ZEROS.
7088         (main): Use gettext to translate (C), not print_copyright.
7089
7090 2003-07-04  Paul Eggert  <eggert@twinsun.com>
7091
7092         Revamp to meet current standards of autoconf, automake,
7093         gettext, and gnulib, and incorporate new translations.
7094
7095         * config/config.guess, config/config.sub, config/depcomp,
7096         config/install-sh, config/mdate-sh, config/missing,
7097         config/mkinstalldirs, config/texinfo.texi:
7098         Moved here from parent directory, or from doc.
7099         * config.hin: Renamed from config.h.in.
7100         * config/config.rpath: New file.
7101
7102         * intl: Remove this subdirectory.
7103
7104         * lib/fnmatch_.h: Renamed from lib/fnmatch.hin.
7105
7106         * lib/getstr.c, lib/getstr.h, lib/msleep.c, lib/print-copyr.c,
7107         lib/print-copyr.h, lib/readutmp.c, lib/rename.c, lib/stpcpy.c,
7108         lib/strstr.c, lib/strtoimax.c, lib/strtoll.c, lib/strtoull.c,
7109         lib/strtoumax.c, lib/unicodeio.c, lib/unicodeio.h,
7110         lib/xstrtoimax.c, m4/c-bs-a.m4, m4/ccstdc.m4, m4/check-decl.m4,
7111         m4/decl.m4, m4/jm-mktime.m4, m4/prereq.m4, m4/xstrtoimax.m4,
7112         stamp-h.in: Remove.
7113
7114         * lib/alloca_.h, lib/fnmatch_loop.c, lib/gettext.h, lib/pathmax.h,
7115         lib/safe-write.c, lib/safe-write.h, lib/stdbool_.h, lib/strcase.h,
7116         lib/stripslash.c, lib/unlocked-io.h, lib/xgetcwd.h, m4/alloca.m4,
7117         m4/backupfile.m4, m4/bison.m4, m4/chown.m4, m4/dirname.m4,
7118         m4/dos.m4, m4/exclude.m4, m4/fileblocks.m4, m4/ftruncate.m4,
7119         m4/getdate.m4, m4/getopt.m4, m4/hash.m4, m4/human.m4,
7120         m4/intdiv0.m4, m4/intmax_t.m4, m4/inttypes-pri.m4,
7121         m4/inttypes_h.m4, m4/isc-posix.m4, m4/lchown.m4, m4/lib-ld.m4,
7122         m4/lib-link.m4, m4/lib-prefix.m4, m4/memset.m4, m4/mktime.m4,
7123         m4/modechange.m4, m4/nls.m4, m4/onceonly.m4, m4/pathmax.m4,
7124         m4/po.m4, m4/quote.m4, m4/quotearg.m4, m4/rmdir.m4,
7125         m4/safe-read.m4, m4/safe-write.m4, m4/save-cwd.m4, m4/savedir.m4,
7126         m4/ssize_t.m4, m4/stdbool.m4, m4/stdint_h.m4, m4/strcase.m4,
7127         m4/strtoimax.m4, m4/strtol.m4, m4/strtoll.m4, m4/strtoul.m4,
7128         m4/strtoull.m4, m4/strtoumax.m4, m4/tm_gmtoff.m4, m4/uintmax_t.m4,
7129         m4/unlocked-io.m4, m4/xalloc.m4, m4/xgetcwd.m4, m4/xstrtol.m4,
7130         po/LINGUAS, po/Makevars, po/Rules-quot, po/boldquot.sed,
7131         po/en@boldquot.header, po/en@quot.header, po/en_GB.po,
7132         po/insert-header.sin, po/remove-potcdate.sin, po/stamp-po: New files.
7133
7134         * ABOUT-NLS, INSTALL, lib/addext.c, lib/alloca.c, lib/argmatch.c,
7135         lib/argmatch.h, lib/backupfile.c, lib/backupfile.h, lib/dirname.c,
7136         lib/dirname.h, lib/error.c, lib/exclude.c, lib/exclude.h,
7137         lib/fnmatch.h, lib/full-write.c, lib/full-write.h, lib/getdate.h,
7138         lib/getdate.y, lib/getline.c, lib/getline.h, lib/getopt.c,
7139         lib/getopt.h, lib/getopt1.c, lib/hash.c, lib/hash.h, lib/human.c,
7140         lib/human.h, lib/lchown.c, lib/malloc.c, lib/mktime.c,
7141         lib/modechange.c, lib/modechange.h, lib/quote.c, lib/quote.h,
7142         lib/quotearg.c, lib/quotearg.h, lib/realloc.c, lib/safe-read.c,
7143         lib/safe-read.h, lib/save-cwd.c, lib/save-cwd.h, lib/savedir.c,
7144         lib/savedir.h, lib/strcasecmp.c, lib/utime.c, lib/xalloc.h,
7145         lib/xgetcwd.c, lib/xmalloc.c, lib/xstrdup.c, lib/xstrtol.c,
7146         lib/xstrtol.h, lib/xstrtoumax.c, m4/codeset.m4, m4/d-ino.m4,
7147         m4/error.m4, m4/fnmatch.m4, m4/getcwd.m4, m4/getline.m4, m4/gettext.m4,
7148         m4/glibc21.m4, m4/iconv.m4, m4/inttypes.m4, m4/lcmessage.m4,
7149         m4/longlong.m4, m4/malloc.m4, m4/mbrtowc.m4, m4/mbstate_t.m4,
7150         m4/progtest.m4, m4/realloc.m4, m4/strerror_r.m4, m4/ulonglong.m4,
7151         m4/utimbuf.m4, m4/utime.m4, m4/utimes.m4, m4/xstrtoumax.m4,
7152         po/Makefile.in.in:
7153         Upgrade to latest version from external source.  The file "bootstrap"
7154         now grabs these automatically, so we needn't keep track of them
7155         in this change long any longer.
7156
7157         * Makefile.am (AUTOMAKE_OPTIONS): Remove.  Now done by configure.ac.
7158         (SUBDIRS): Remove intl.
7159         * PORTS: Update for star, Macintosh.
7160         * README, README-alpha: Suggest Autoconf 2.57, Automake 1.7.5,
7161         Bison 1.875, gettext 0.12.1.
7162         * THANKS: Add Bernhard Rosenkraenzer, Solar Designer.
7163         * configure.ac (AC_INIT, AM_INIT_AUTOMAKE): Convert to modern form.
7164         (AC_CONFIG_AUX_DIR): New.
7165         (AC_CONFIG_HEADERS): Rename config.h.in to config.hin, to be more
7166         like coreutils.
7167         (AC_PREREQ): Bump from 2.52 to 2.57.
7168         (AC_GNU_SOURCE): New.
7169         (AC_PROG_GCC_TRADITIONAL, AM_C_PROTOTYPES, AC_C_CONST): Remove;
7170         we no longer support K&R C.
7171         (YACC): Remove.
7172         (AC_CHECK_HEADERS): Remove limits.h, poll.h, stdbool.h, stropts.h,
7173         sys/ioccom.h, sys/param.h, sys/time.h, sys/timeb.h, wchar.h, wctype.h.
7174         (AC_MBSTATE_T): Remove.
7175         (HAVE_UTIME_H, HAVE_DECL_FREE, HAVE_DECL_GETGRGID, HAVE_DECL_GETPWUID,
7176         HAVE_DECL_GETENV, HAVE_DECL_MALLOC, HAVE_DECL_STRTOUL,
7177         HAVE_DECL_STRTOULL, HAVE_MKNOD): Remove our special code.
7178         (AM_STDBOOL_H): Add.
7179         (AC_HEADER_TIME, AC_STRUCT_TIMEZONE,
7180         jm_CHECK_TYPE_STRUCT_DIRENT_D_INO): Remove.
7181         (AC_CHECK_TYPE): Remove ssize_t.
7182         (gt_TYPE_SSIZE_T): Add.
7183         (jm_AC_PREREQ_XSTRTOUMAX, jm_PREREQ_ADDEXT, jm_PREREQ_ERROR,
7184         jm_PREREQ_HUMAN, jm_PREREQ_QUOTEARG, jm_PREREQ_XGETCWD,
7185         AC_FUNC_ALLOCA, AC_FUNC_CLOSEDIR_VOID, AC_FUNC_STRERROR_R,
7186         AC_FUNC_FNMATCH, AC_FUNC_VPRINTF, AM_FUNC_GETLINE, jm_FUNC_MALLOC,
7187         jm_FUNC_MKTIME, jm_FUNC_REALLOC):
7188         Remove.  Switch to gnulib macros like gl_BACKUPFILE instead.
7189         (tar_LDADD): Rename to LIB_CLOCK_GETTIME.  All uses changed.
7190         (rmt_LDADD): Rename to LIB_SETSOCKOPT.  All uses changed.
7191         (AC_CHECK_FUNCS): Remove fchdir, ftime, getcwd, isascii, nap,
7192         napms, poll, select, strstr, usleep.
7193         (AC_REPLACE_FUNCS): Remove ftruncate, lchown, memset, rename,
7194         rmdir, strcasecmp, strncasecmp, strtol, strtoul.
7195         (AM_GNU_GETTEXT): Use external and need-ngettext options.
7196         (AM_GNU_GETTEXT_VERSION): New.
7197         (AC_OUTPUT): Remove intl/Makefile.
7198
7199         * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
7200         ($(srcdir)/tar.info, tar.dvi): Remove obsolete warnings.
7201         * doc/fdl.texi: Update to current GNU version.
7202         * doc/gettext.texi: Update to current coreutils version,
7203         plus a copyright notice.
7204         * doc/tar.texi: Switch to new method for doing copyright notices.
7205         Use @acronym instead of @sc where appropriate.
7206         Remove empty examples.  Give a few more examples.
7207
7208         * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
7209         (EXTRA_DIST, libtar_a_SOURCES): Switch to gnulib, so that they
7210         are built up in pieces with +=.
7211         (noinst_HEADERS, INCLUDES): Remove.
7212         (BUILT_SOURCES, MAINTAINERCLEANFILES, MOSTLYCLEANFILES): New.
7213         (libtar_a_LIBADD): Use $ rather than @.
7214         (all-local, alloca.h, fnmatch.h, stdbool.h): New rules, from gnulib.
7215
7216         * m4/Makefile.am (EXTRA_DIST): Add alloca.m4, backupfile.m4,
7217         bison.m4, chown.m4, dirname.m4, dos.m4, exclude.m4, fileblocks.m4,
7218         ftruncate.m4, getdate.m4, getopt.m4, hash.m4, human.m4,
7219         intdiv0.m4, intmax_t.m4, inttypes_h.m4, inttypes-pri.m4,
7220         isc-posix.m4, lcown.m4, lib-ld.m4, lib-link.m4, lib-prefix.m4,
7221         memset.m4, mktime.m4, modechange.m4, nls.m4, onceonly.m4,
7222         pathmax.m4, po.m4, quotearg.m4, quote.m4, rmdir.m4, safe-read.m4,
7223         safe-write.m4, save-cwd.m4, savedir.m4, ssize_t.m4, stdbool.m4,
7224         stdint_h.m4, strcase.m4, strtoimax.m4, strtoll.m4, strtol.m4,
7225         strtoull.m4, strtoul.m4, strtoumax.m4, tm_gmtoff.m4, uintmax_t.m4,
7226         unlocked-io.m4, xalloc.m4, xgetcwd.m4, xstrtol.m4.
7227         Remove c-bs-a.m4, ccstdc.m4, check-decl.m4, decl.m4, jm-mktime.m4,
7228         prereq.m4, xstrtoimax.m4.
7229
7230         * po/POTFILES.in: Remove tests/genfile.c; it doesn't need to
7231         be translated, since it's not a user-visible tool.
7232
7233         * scripts/Makefile.am (AUTOMAKE_OPTIONS): Remove.
7234
7235         * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
7236         (INCLUDES): Remove ../intl.  Put top-srcdir before ., for
7237         consistency with coreutils.
7238         (LDADD): Link LIBINTL after libtar.a, since
7239         it's now external and should stand by itself.
7240
7241         * src/buffer.c (print_total_written): Adjust to new human.h
7242         interface.
7243         (child_open_for_compress): Do not increase size to BLOCKSIZE.
7244         (open_archive): Open index file name.
7245         Strip trailing slahes from file names.
7246         (flush_write): Set size to 0 if not saving names.
7247         (flush_write, flush_read): Use safer_name_suffix rather than
7248         inline code.
7249
7250         * src/common.h: Include <quote.h>.
7251         (absolute_names_option, atime_preserve_option, backup_option,
7252         block_number_option, checkpoint_option, dereference_option,
7253         force_local_option, ignore_failed_read_option, ignore_zeros_option,
7254         incremental_option, interactive_option, multi_volume_option,
7255         numeric_owner_option, one_file_system_option, recursive_unlink_option,
7256         read_full_records_option, remove_files_option, same_order_option,
7257         show_omitted_dirs_option, sparse_option, starting_file_option,
7258         to_stdout_option, totals_option, touch_option, verify_option,
7259         dev_null_output, now_verifying, we_are_root): Now bool, not int.
7260         (current_trailing_slash, index_file_name, recent_long_name_blocks,
7261         recent_long_link_blocks): New vars.
7262         (NO_OVERWRITE_DIR_OLD_FILES): New constant.
7263         (OVERWRITE_OLD_DIRS): Remove.
7264         (enum remove_option): New enum.
7265         (remove_any_file): Use it as option arg, not int.
7266         (is_avoided_name, contains_dot_dot): Return bool, not int.
7267         (safer_name_suffix): New decl.
7268
7269         * src/compare.c (now_verifying): Now bool, not int.
7270         (fill_in_sparse_array): Move to extract.c.  Now returns bool;
7271         all callers changed to test for failure.
7272         (diff_sparse_files): Take size from current_stat, not from param.
7273         (diff_archive): Do not count trailing slashes in archives.
7274         (verify_volume): Test for header failure after loop, not before.
7275
7276         * src/create.c (relativize): Remove; replaced by safer_name_suffix.
7277         All callers changed.
7278         (start_header): Clear devmajor and devminor fields, too.
7279         (finish_header): New arg block_ordinal.
7280         (init_sparsearray): Now extern.  Set sp_array_size to
7281         SPARSES_IN_OLDGNU_HEADER if it is zero.
7282         (dump_file): Keep link table as a hash.
7283         Do not count "file changed as we read it" as a failure.
7284
7285         * src/delete.c (recent_long_name_blocks, recent_long_link_blocks):
7286         Move extern decl to common.h.
7287
7288         * src/extract.c (we_are_root): Now bool, not int.
7289         (check_time): Warn about implausibly old time stamps.
7290         (set_stat): Use utimbuf, not stat_info.
7291         (prepare_to_extract): New arg DIRECTORY.
7292         (fill_in_sparse_array): Moved here from compare.c.
7293         (extract_sparse_file): Now returns off_t, giving size left.
7294         Truncate file at end.
7295         (extract_archive): Use safer_name_suffix rather than rolling our own.
7296         Use fill_in_sparse_array rather than rolling our own.
7297         Strip trailing slashes more effectively.
7298         Check for unsafe names.
7299
7300         * src/incremen.c (struct directory): nfs and found are now of type
7301         bool, not int.
7302         (gnu_restore): Now takes directory name as argument, not offset
7303         of directory name in a global.  All uses changed.
7304         (CURRENT_FILE_NAME): Remove.
7305
7306         New tests.
7307         * tests/delete04.sh, tests/multiv01.sh, tests/options.sh: New
7308         files.
7309
7310 2002-09-30  Paul Eggert  <eggert@twinsun.com>
7311
7312         * src/rmt.c (prepare_input_buffer): Renamed form
7313         prepare_record_buffer.  All uses changed.  Do not assume that
7314         size_t is the same width as int.
7315
7316 2002-03-29  Paul Eggert  <eggert@twinsun.com>
7317
7318         * src/incremen.c (get_directory_contents):
7319         If ignore_failed_read_option, only warn about
7320         get_directory_contents failures.  Fix suggested by
7321         Mark Costlow.
7322
7323 2002-01-31  Mark W. Eichin  <eichin@thok.org>
7324
7325         * src/buffer.c (child_open_for_compress): Don't try to read
7326         past the end of the buffer.
7327
7328 2001-10-11  Jim Meyering  <meyering@lucent.com>
7329
7330         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
7331         and quote_n (1, ... to avoid clobbering a buffer.
7332
7333 2001-09-26  Paul Eggert  <eggert@twinsun.com>
7334
7335         * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 1.13.25.
7336
7337         * src/buffer.c (flush_read): Don't diagnose partial blocks before
7338         end of file; just ignore them silently.
7339
7340         * src/list.c (read_header): Don't keep around extended name
7341         and link info indefinitely; keep it only for the next file.
7342         This fixes a bug introduced in 1.13.24, and removes the need
7343         for some static variables.  Set recent_long_name and
7344         recent_long_link to zero if there were no long links; this
7345         avoids a violation of ANSI C rules for pointers in delete.c.
7346         * THANKS: Add Christian Laubscher.
7347
7348 2001-09-26  Jim Meyering  <meyering@lucent.com>
7349
7350         * doc/tar.texi (Remote Tape Server): is know -> is known
7351
7352 2001-09-25  Paul Eggert  <eggert@twinsun.com>
7353
7354         * lib/unicodeio.c (EILSEQ): Include <iconv.h> first, since
7355         <iconv.h> may define EILSEQ (e.g. libiconv).  Define a
7356         replacement EILSEQ to be ENOENT, not EINVAL, since callers may
7357         want to distinguish EINVAL and EILSEQ.
7358
7359 2001-09-24  Christophe Kalt  <Christophe.Kalt@kbcfp.com>
7360
7361         * src/extract.c (maybe_recoverable):
7362         Treat OVERWRITE_OLD_DIRS like DEFAULT_OLD_FILES.
7363
7364 2001-09-22  Paul Eggert  <eggert@twinsun.com>
7365
7366         * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 1.13.24.
7367
7368         * ABOUT-NLS, intl/*: Update to gettext-0.10.40, replacing LGPL
7369         with GPL.
7370
7371         * INSTALL, mkinstalldirs: Update to autoconf 2.52 version.
7372         * PORTS: Add copyright notice, 'star' reference.
7373         * README-alpha: Add copyright notice, autoconf 2.52 patch.
7374         * THANKS: Add Christophe Kalt.
7375         * config.sub: Upgrade to 2001-09-14 version.
7376
7377         * configure.ac (ALL_LINGUAS): Add ko.
7378         * po/ko.po: Resurrected file.
7379
7380         * doc/convtexi.pl: Add coding advice for Emacs.
7381
7382         * doc/getdate.texi: Add copyright notice.
7383
7384         * doc/mdate-sh: Upgrade to automake 1.5 version.
7385
7386         * doc/tar.texi (extracting files): Mention --to-stdout.
7387         (Option Summary, Dealing with Old Files): New option --overwrite-dir.
7388         (Overwrite Old Files): Likewise.
7389
7390         * lib/Makefile.am (noinst_HEADERS):
7391         Remove copysym.h.  Add print-copyr.h, unicodeio.h.
7392         (libtar_a_SOURCES): Remove copysym.c, Add print-copyr.c, unicodeio.c.
7393
7394         * lib/copysym.c, lib/copysym.h: Remove.
7395         * lib/print-copyr.c, lib/print-copyr.h, lib/unicodeio.c,
7396         lib/unicodeio.h: New files.
7397
7398         * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
7399         lib/mktime.c, lib/strtoll.c: Switch from LGPL to GPL.
7400
7401         * lib/quotearg.c (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
7402         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
7403
7404         * m4/Makefile.am (EXTRA_DIST): Remove isc-posix.m4.
7405         * m4/isc-posix.m4: Remove.
7406
7407         * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit.
7408
7409         * po/POTFILES.in: Add copyright notice.
7410
7411         * src/Makefile.am (LDADD): Like libtar.a before @INTLLIBS@ as
7412         well as after.
7413         * tests/Makefile.am (LDADD): Likewise.
7414
7415         * src/buffer.c (write_archive_buffer, close_archive):
7416         If an archive is a socket, treat it like a FIFO.
7417         (records_read, records_written): New vars.
7418         (write_archive_to_stdout): Now bool, not int.
7419         (open_archive, flush_write, flush_read): Keep records_read and
7420         records_written up to date.
7421
7422         * src/common.h (enum old_files): New value OVERWRITE_OLD_DIRS.
7423         (write_archive_to_stdout): Now bool, not int.
7424         (enum read_header): New value HEADER_SUCCESS_EXTENDED.
7425         (read_header): Now takes bool arg.  Existing callers modified
7426         to pass 0, unless otherwise specified.
7427
7428         * src/delete.c (records_read): Remove; now a global.
7429         (acting_as_filter): Now bool, not int.
7430         (recent_long_name, recent_long_link, recent_long_name_blocks,
7431         recent_long_link_blocks, records_read, records_written): New decls.
7432         (records_skipped): New var.
7433         (move_archive): Don't divide by zero if arg is 0.
7434         Use the above vars to compute how far to move.
7435         (write_recent_blocks): New function.
7436         (delete_archive_member): Pass 1 to read_header, so that it doesn't
7437         read more than 1 block.  Handle resulting HEADER_SUCCESS_EXTENDED code.
7438         Keep track of how many records have been skipped.
7439         Let the buffer code count records.
7440         When copying a header, copy any extended headers that came before it.
7441
7442         * src/extract.c (extract_archive): When marking a directory to be
7443         updated after symlinks, stat all directories after it in the
7444         delayed-set-stat list too, since they will be checked after
7445         symlinks.  Add support for --overwrite-dir.
7446
7447         * src/list.c (recent_long_name, recent_long_link,
7448         recent_long_name_blocks, recent_long_link_blocks): New vars.
7449         (read_and): Pass 0 to read_header.
7450         (read_header): New arg RAW_EXTENDED_HEADERS.  Store away extended
7451         headers into new vars.  Null-terminate incoming symbolic links.
7452
7453         * src/rmt.c: Include print-copyr.h, not copysym.h.
7454         (main): Use print_copyright, not copyright_symbol.
7455         * src/tar.c (decode_options): Likewise.
7456         (OVERWRITE_DIR_OPTION): New constant.
7457         (long_options, usage, decode_options): Add --overwrite-dir.
7458
7459         * src/tar.h: Put copyright notice into documentation.
7460
7461         * tests/Makefile.am (TESTS): Add delete03.sh.
7462         * tests/delete03.sh: New file.
7463
7464         * tests/genfile.c: Include print-copyr.h, not copysym.h.
7465         (main): Use print_copyright, not copyright_symbol.
7466         Include <argmatch.h>.
7467         (pattern_strings): Remove.
7468         (pattern_args, pattern_types): New constants.
7469         (main): Use XARGMATCH, not argmatch.
7470
7471 2001-09-20  Jim Meyering  <meyering@lucent.com>
7472
7473         * lib/xstrtol.c (strtoimax): Guard declaration with
7474         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
7475         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
7476         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
7477         (strtoumax): Likewise, for completeness (it wasn't necessary).
7478         * m4/xstrtoimax.m4 (jm_AC_PREREQ_XSTRTOIMAX):
7479         Check for declaration of strtoimax.
7480         * m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX):
7481         Check for declaration of strtoumax.
7482
7483 2001-09-16  Paul Eggert  <eggert@twinsun.com>
7484
7485         * fnmatch.m4 (jm_FUNC_FNMATCH): Fix typo in previous patch: yes -> no.
7486
7487 2001-09-14  Paul Eggert  <eggert@twinsun.com>
7488
7489         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.23.
7490
7491         * README-alpha: Describe automake patch.
7492
7493         * configure.ac (LIBOBJS):
7494         Remove automake 1.4 workaround, as we're using 1.5 now.
7495         (USE_INCLUDED_LIBINTL): New AC_DEFINE.
7496
7497         * lib/copysym.c: Include stddef.h, for size_t.
7498         Include langinfo.h if needed.
7499         Use locale_charset only if USE_INCLUDED_LIBINTL;
7500         if not, use nl_langinfo (CODESET) if available.
7501
7502 2001-09-13  Paul Eggert  <eggert@twinsun.com>
7503
7504         * config.guess, config.sub: Sync with canonical versions.
7505
7506         * configure.ac (jm_PREREQ_XGETCWD): Add.
7507
7508         * lib/Makefile.am (noinst_HEADERS): Add copysym.h.
7509         (libtar_a_SOURCES): Add copysym.c.
7510         * copysym.c, copysym.h: New files.
7511
7512         * lib/error.c: Sync with fileutils version.
7513
7514         * m4/Makefile.am (EXTRA_DIST): Add getcwd.m4; remove uintmax_t.m4.
7515         * m4/getcwd.m4: New file.
7516         * m4/uintmax_t.m4: Remove.
7517
7518         * m4/gettext.m4 (AM_WITH_NLS):
7519         Fix bug with calculating version of Bison 1.29.
7520         Reported by Karl Berry.
7521
7522         * src/Makefile.am (datadir): Remove.
7523
7524         * src/rmt.c: Include copysym.h.
7525         (main): Use copyright_symbol to translate copyright notice,
7526         instead of gettext.
7527         * src/tar.c: Likewise.
7528         * tests/genfile.c: Likewise.
7529
7530         * src/system.h (MB_LEN_MAX): New symbol.
7531
7532 2001-09-11  Paul Eggert  <eggert@twinsun.com>
7533
7534         * src/extract.c (struct delayed_set_stat): New member
7535         'after_symlinks'.
7536         (delay_set_stat): Initialize it to 0.
7537         (set_mode): New arg current_stat_info.  Use it (if nonnull) to avoid
7538         taking an extra stat ourselves.  All callers changed.
7539         (set_stat): Likewise.
7540         (apply_nonancestor_delayed_set_stat): New arg 'after_symlinks'.
7541         If false, stop when encountering a struct whose 'after_symlinks'
7542         member is true.  Otherwise, go through all structures but check
7543         them more carefully.  All callers changed.
7544         (extract_archive): When extracting a deferred symlink, if its parent
7545         directory's status needs fixing, then mark the directory as needing
7546         to be fixed after symlinks.
7547         (extract_finish): Fix status of ordinary directories, then apply
7548         delayed symlinks, then fix the status of directories that are
7549         ancestors of delayed symlinks.
7550
7551         * src/rtapelib.c (rexec):
7552         Remove declaration; it ran afoul of prototypes on Crays.
7553         Reported by Wendy Palm of Cray.
7554
7555 2001-09-06  Paul Eggert  <eggert@twinsun.com>
7556
7557         * lib/strtoimax.c (HAVE_LONG_LONG):
7558         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
7559         (strtoimax): Use sizeof (long), not
7560         sizeof strtol (ptr, endptr, base),
7561         to work around bug in IBM C compiler.
7562
7563 2001-09-04  Paul Eggert  <eggert@twinsun.com>
7564
7565         * lib/xgetcwd.c: Include "xalloc.h".
7566         (xgetcwd): Do not return NULL when memory is exhausted; instead,
7567         report an error and exit.
7568
7569         * m4/prereq.m4 (jm_PREREQ_XREADLINK): New macro.
7570         (jm_PREREQ): Use it.
7571
7572 2001-09-03  Paul Eggert  <eggert@twinsun.com>
7573
7574         * m4/prereq.m4 (jm_PREREQ): Add jm_PREREQ_XGETCWD.
7575         (jm_PREREQ_XGETCWD): New macro.
7576
7577         * lib/exclude.c (fnmatch_no_wildcards):
7578         Fix typo that caused us to do case-folding
7579         search even when that was not desired.  This occurred only in the
7580         no-wildcard case.
7581
7582         * lib/xgetcwd.c: Include pathmax.h if not HAVE_GETCWD.
7583         Do not include xalloc.h.
7584         (INITIAL_BUFFER_SIZE): New symbol.
7585         Do not use xmalloc / xrealloc, since the caller is responsible for
7586         handling errors.  Preserve errno around `free' during failure.
7587         Do not overrun buffer when using getwd.
7588
7589         * lib/xgetcwd.c (xgetcwd):
7590         Use HAVE_GETCWD_NULL, not defined __GLIBC__ && __GLIBC__ >= 2,
7591         to decide whether to use getcwd (NULL, 0).
7592
7593 2001-09-02  Paul Eggert  <eggert@twinsun.com>
7594
7595         * lib/xgetcwd.c: Fix typo in local var; from Jim Meyering.
7596
7597 2001-09-01  Jim Meyering  <meyering@lucent.com>
7598
7599         * exclude.c: Use `""', not `<>' to #include non-system header files.
7600         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
7601         and strncasecmp as r-values.  Unixware didn't have declarations.
7602
7603 2001-08-31  Jim Meyering  <meyering@lucent.com>
7604
7605         * lib/xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
7606         Use an initial, malloc'd, buffer of length 128 rather than
7607         a statically allocated one of length 1024.
7608
7609 2001-08-30  Paul Eggert  <eggert@twinsun.com>
7610
7611         * lib/utime.c: Include full-write.h.
7612         * lib/xstrtol.c (strtoimax): New decl.
7613
7614 2001-08-29  Paul Eggert  <eggert@twinsun.com>
7615
7616         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.22.
7617
7618         * src/create.c (dump_file): Relativize link names before dumping.
7619         This fixes a bug reported by Jose Pedro Oliveira.
7620
7621         * src/create.c (dump_file): Use offsetof when computing sizes for
7622         struct hack; this avoids wasted space in some cases.
7623         * src/incremen.c (note_directory, find_directory): Likewise.
7624         * src/names.c (name_gather, addname): Likewise.
7625
7626         * src/extract.c (extract_archive): Use strcpy, not memcpy,
7627         for consistency with other code that does similar things.
7628         * src/names.c (name_gather): Likewise.
7629
7630         * src/names.c (read_name_from_file, name_next, name_gather,
7631         add_hierarchy_to_namelist): Avoid quadratic behavior when
7632         reallocating buffers.  Check for buffer size overflow.
7633         (addname): Avoid unnecessary clearing of memory.
7634
7635 2001-08-29  "Jan D."  <Jan.Djarv@mbox200.swipnet.se>
7636
7637         * src/extract.c (delay_set_stat): Fix off-by-one error in file
7638         name size allocation that caused core dumps.
7639
7640 2001-08-28  Paul Eggert  <eggert@twinsun.com>
7641
7642         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.21.
7643
7644         * configure.ac (GNU_SOURCE): Define to 1, not /**/.
7645         (major_t, minor_t, ssize_t): Use new-style AC_CHECK_TYPE.
7646         (daddr_t): Remove; no longer used.
7647         (jm_PREREQ_HUMAN): Add.
7648
7649         * acconfig.h: Remove; no longer needed.
7650
7651         * config.guess, config.sub:
7652         New files, from automake 1.5.  Gettext 0.10.39 needs them.
7653         * depcomp, missing, mkinstalldirs: Upgrade to automake 1.5.
7654
7655         * Makefile.am (AUTOMAKE_OPTIONS): Add dist-bzip2.
7656         (SUBDIRS): Put intl before lib, as gettext requires.
7657
7658         * ABOUT-NLS: Upgrade to gettext 0.10.39.
7659         * intl: Upgrade entire directory to gettext 0.10.39.
7660         * m4/codeset.m4, m4/glibc21.m4, m4/iconv.m4:
7661         New files, from gettext 0.10.39.
7662         * m4/gettext.m4, m4/isc-posix.m4, m4/lcmessage.m4, m4/progtest.m4,
7663         Upgrade to gettext 0.10.39,
7664         * po/Makefile.in.in: Likewise, except fix a typo in its copying
7665         permissions.
7666         * po/cat-id-tbl.c, po/stamp-cat-id:
7667         Remove; no longer used by gettext 0.10.39.
7668         * po/ChangeLog: New file.
7669
7670         * doc/Makefile.am (EXTRA_DIST): Add freemanuals.texi.
7671         $(srcdir)/tar.texi: Likewise.
7672         * doc/freemanuals.texi: New file.
7673         * doc/tar.texi (Free Software Needs Free Documentation): New appendix.
7674         `fileds' -> `fields'
7675         * doc/texinfo.tex: Upgrade to version 2001-07-25.07.
7676
7677         * lib/Makefile.am (EXTRA_DIST): Add strtoll.c, strtoimax.c.
7678         (noinst_HEADERS): Add quote.h.
7679         (libtar_a_SOURCES): Add quote.c, xstrtoimax.c.
7680
7681         * lib/exclude.c: Fix typo in '#include <stdint.h>' directive.
7682
7683         * lib/full-write.c, lib/savedir.c: Comment fix.
7684
7685         * lib/pathmax.h: Remove.
7686
7687         * lib/quote.c, lib/quote.h: New files.
7688
7689         * lib/xgetcwd.c: Don't include pathmax.h.
7690         Include stdlib.h and unistd.h if available.
7691         Include xalloc.h.
7692         (xmalloc, xstrdup, free): Remove decls.
7693         (xgetcwd): Don't assume sizes fit in unsigned.
7694         Check for overflow when computing sizes.
7695         Simplify reallocation code.
7696
7697         * lib/xmalloc.c: Quote failure tests.
7698
7699         * lib/strtoumax.c, lib/xstrtoimax.c: New files.
7700
7701         * lib/strtoimax.c: Renamed from strtouxmax.c.  Make it more
7702         similar to strtol.c.
7703         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.
7704         (verify): New macro.
7705         (strtoumax, uintmax_t, strtoull, strtol): Remove.
7706         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
7707         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
7708         changed to signed values.  Check sizes at compile-time, not
7709         run-time.  Prefer strtol to strtoll if both work.
7710         (main): Remove.
7711
7712         * lib/xstrtol.h (xstrtoimax): New decl.
7713
7714         * m4/Makefile.am (EXTRA_DIST):
7715         Add codeset.m4, glibc21.m4, iconv.m4, inttypes.m4,
7716         longlong.m4, xstrtoimax.m4.
7717
7718         * m4/inttypes.m4 (jm_AC_HEADER_INTTYPES_H):
7719         Remove; now done by autoconf.
7720         (jm_AC_TYPE_INTMAX_T, jm_AC_TYPE_UINTMAX_T): Replace with
7721         Use AC_CHECK_TYPE instead of merely looking for the header.
7722
7723         * m4/uintmax_t.m4: Use shorter comment.
7724
7725         * m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX):
7726         Quote first arg of AC_DEFUN.
7727         Require jm_AC_TYPE_INTMAX_T and jm_AC_TYPE_LONG_LONG since they
7728         is needed to parse the include file.
7729         Simplify logic behind the args to AC_REPLACE.
7730
7731         * src/Makefile.am (OMIT_DEPENDENCIES): Remove.
7732
7733         * src/ansi2knr.1, src/ansi2knr.c: Remove; wasn't being used.
7734
7735         * src/rmt.c (main):
7736         Use "Copyright %d" to simplify the translator's job in the future.
7737         Advise translator about circle-C.
7738         * src/tar.c: (decode_options): Likewise.
7739         * tests/genfile.c (main): Likewise.
7740
7741 2001-08-28  Jim Meyering  <meyering@lucent.com>
7742
7743         * lib/argmatch.c: Include "quote.h".
7744         (argmatch_invalid): Quote the context.
7745
7746         * lib/dirname.c (dir_name): Fix typo on PC platforms.
7747
7748         * lib/backupfile.c, lib/basename.c, lib/dirname.c, lib/strtoul.c:
7749         Use single-quote for local .h files.
7750
7751         * lib/error.h (__attribute__): Don't depend on __STRICT_ANSI__.
7752
7753         * lib/getopt.c, lib/getopt.h, lib/getopt1.c: Upgrade to recent
7754         glibc versions.
7755
7756         * lib/getdate.y (get_date): Initialize tm_isdst to -1 before
7757         invoking mktime the last time.
7758
7759         * lib/pathmax.h: Use #if rather than #ifdef for HAVE_UNISTD_H.
7760
7761         * lib/rename.c: Major rewrite by Volker Borchert to use system
7762         rename function, but to work around problems with trailing
7763         slashes.
7764
7765         * lib/strtoll.c: New file, from glibc.
7766         * lib/strtoul.c: Update from glibc.
7767
7768         * lib/strtouxmax.c: Renamed from lib/strtoumax.c.
7769         Add support for signed numbers, too.
7770         (strtoul, strtoull): Do not declare if STRTOUXMAX_UNSIGNED
7771         is not defined.
7772         (strtol, strtoll): Declare as needed, if STRTOUXMAX_UNSIGNED is
7773         not defined.
7774         (strtoumax, uintmax_t, strtoull, strtoul): New macros.
7775         (main): Use generic names in debugging output.
7776         * lib/strtoimax.c: Plus add the following changes of my own:
7777         (main): Use accurate names in debugging output.
7778
7779         * lib/xgetcwd.c (xgetcwd): Use getcwd if glibc 2 or later.
7780         Don't use PATH_MAX.
7781
7782         * m4/c-bs-a.m4, m4/check-decl.m4, m4/d-ino.m4, m4/error.m4,
7783         m4/getline.m4, m4/jm-mktime.m4, m4/malloc.m4, m4/mbrtowc.m4,
7784         m4/mbstate_t.m4, m4/realloc.m4, m4/uintmax_t.m4, m4/utimbuf.m4,
7785         m4/utime.m4, m4/utimes.m4:
7786         Quote the first argument in each use of AC_DEFUN.
7787
7788         * m4/getline.m4: Don't use string.h.
7789
7790         * m4/inttypes.m4, m4/longlong.m4, m4/xstrtoimax.m4: New files.
7791
7792         * m4/mbrtowc.m4 (jm_FUNC_MBRTOWC): @%:@ -> #.
7793
7794 2001-08-27  Paul Eggert  <eggert@twinsun.com>
7795
7796         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.20.
7797
7798         The biggest change is the new --exclude semantics and options.
7799         The basic idea was suggested by Gerhard Poul; thanks!
7800
7801         * NEWS: Describe new --exclude semantics and options, and bug fixes.
7802         * README: ignfail.sh fails on some NFS hosts.
7803         * NEWS, README, lib/xstrtol.h: Add copyright notice.
7804
7805         * Makefile.am (ACLOCAL_AMFLAGS): Add -I m4.
7806         (M4DIR, ACINCLUDE_INPUTS, $(srcdir)/acinclude.m4):
7807         Remove; the automake bug has been fixed.
7808         * acinclude.m4: Remove.
7809
7810         * configure.ac: Renamed from configure.in.
7811         (AC_PREREQ): Bump from 2.13 to 2.52.
7812         (ALL_LINGUAS): Add id, tr.  Remove ko, as po/ko.po (dated
7813         1997-05-30) has an encoding error.
7814         (jm_AC_HEADER_INTTYPES_H): Remove; now done by autoconf.
7815         (AC_FUNC_FNMATCH): Use AC_CONFIG_LINKS, not AC_LINK_FILES.
7816
7817         * doc/fdl.texi: Update to current GNU version.
7818
7819         * doc/tar.texi: Put leading '*' in direntry.
7820         Accommodate new gfdl sectioning.
7821         New option --recursion (the default) that is the inverse of
7822         --no-recursion.
7823
7824         New options --anchored, --ignore-case, --wildcards,
7825         --wildcards-match-slash, and their negations (e.g., --no-anchored).
7826         Along with --recursion and --no-recursion, these control how exclude
7827         patterns are interpreted.  The default interpretation of exclude
7828         patterns is now --no-anchored --no-ignore-case --recursion
7829         --wildcards --wildcards-match-slash.
7830
7831         * lib/Makefile.am (OMIT_DEPENDENCIES): Remove.
7832
7833         * lib/exclude.c (bool): Declare, perhaps by including stdbool.h.
7834         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
7835         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
7836         Include if available.
7837         (<xalloc.h>): Include
7838         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
7839         (verify): New macro.  Use it to verify that EXCLUDE macros do not
7840         collide with FNM macros.
7841         (struct patopts): New struct.
7842         (struct exclude): Use it, as exclude patterns now come with options.
7843         (new_exclude): Support above changes.
7844         (new_exclude, add_exclude_file):
7845         Initial size must now be a power of two to simplify overflow checking.
7846         (free_exclude, fnmatch_no_wildcards): New function.
7847         (excluded_filename): No longer requires options arg, as the options
7848         are determined by add_exclude.  Now returns bool, not int.
7849         (excluded_filename, add_exclude):
7850         Add support for the fancy new exclusion options.
7851         (add_exclude, add_exclude_file): Now takes int options arg.
7852         Check for arithmetic overflow when computing sizes.
7853         (add_exclude_file): xrealloc might modify errno, so don't
7854         realloc until after errno might be used.
7855
7856         * lib/exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
7857         New macros.
7858         (free_exclude): New decl.
7859         (add_exclude, add_exclude_file): Now takes int options arg.
7860         (excluded_filename): No longer requires options arg, as the options
7861         are determined by add_exclude.  Now returns bool, not int.
7862
7863         * lib/prepargs.c: Include <string.h>; required for C99 since
7864         we use strlen.
7865
7866         * lib/quotearg.c:
7867         BSD/OS 4.1 wchar.h requires FILE and struct tm to be declared.
7868
7869         * lib/xstrtol.h (_DECLARE_XSTRTOL): Improve quality of
7870         diagnostic for LONGINT_INVALID_SUFFIX_CHAR.
7871
7872         * m4/Makefile.am (EXTRA_DIST): Add check-decl.m4, mbrtowc.m4.
7873         Remove inttypes_h.m4, largefile.m4, mktime.m4.
7874
7875         * m4/inttypes_h.m4, m4/largefile.m4, m4/mktime.m4: Remove;
7876         subsumed by Autoconf 2.50.
7877
7878         * m4/error.m4: Upgrade to serial 2.
7879
7880         * m4/fnmatch.m4 (jm_FUNC_FNMATCH): Upgrade to serial 4, but
7881         remove test for GNU C library.  It's not correct, as some
7882         older glibcs are buggy.
7883
7884         * m4/getline.m4, m4/malloc.m4: Upgrade to serial 4.
7885
7886         * m4/prereq.m4: Upgrade to serial 20, but then:
7887         (jm_PREREQ): Add jm_PREREQ_EXCLUDE.
7888         (jm_PREREQ_EXCLUDE): New macro.
7889         (jm_PREREQ_HUMAN): Remove jm_AC_HEADER_INTTYPES_H, as it is subsumed
7890         by autoconf 2.5x.
7891
7892         * m4/realloc.m4: Upgrade to serial 4.
7893
7894         * m4/strerror_r.m4: Revert to serial 1002.
7895
7896         * m4/uintmax_t.m4: Upgrade to autoconf 2.5x.
7897
7898         * m4/utimes.m4: Upgrade to latest version (still "serial 3").
7899
7900         * m4/xstrtoumax.m4: Upgrade to serial 3, but then:
7901         (jm_AC_PREREQ_XSTRTOUMAX): Remove jm_AC_HEADER_INTTYPES_H, as
7902         it is now subsumed by autoconf.  Add inttypes.h.
7903
7904         * po/cs.po, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
7905         po/it.po, po/pl.po, po/sl.po, po/sv.po: Sync with translation project.
7906
7907         * src/buffer.c (new_volume): Stop if the script exits with an error.
7908
7909         * src/common.h (excluded_with_slash, excluded_without_slash):
7910         Remove, replacing by:
7911         (excluded): New decl.
7912         (link_error): New decl.
7913         (excluded_name): Now returns bool.
7914
7915         * src/extract.c:
7916         (struct delayed_symlinks, extract_archive, apply_delayed_symlinks):
7917         Support hard links to symbolic links.
7918
7919         (struct delayed_symlink): Remove 'names' member, replacing it with
7920         'sources' and 'target' member.  All uses changed.
7921
7922         (struct string_list): New type.
7923
7924         (delayed_set_stat, extract_archive): Use offsetof when computing sizes
7925         for struct hack; this avoids wasted space in some cases.
7926
7927         (extract_archive): Fix test for absolute pathnames and/or "..".
7928         Use link_error to report errors for links.
7929         Remove redundant trailing '/' at "really_dir", for all uses, not
7930         just before invoking mkdir.
7931         If overwriting old files, do not worry so much about existing
7932         directories.
7933         Fix mode computation in the case where the directory exists.
7934
7935         (apply_delayed_symlinks): If we can't make a hard link to a symbolic
7936         link, make a copy of the symbolic link.
7937
7938         * src/incremen.c (get_directory_contents):
7939         If ignore_failed_read_option, only warn about
7940         stat failures.
7941
7942         * src/list.c (from_header): Do not issue a diagnostic if TYPE is zero.
7943         However, check for error even for '-' or '+' case.
7944
7945         (print_header): Try parsing uids and gids as unsigned integers first,
7946         and as a uid_t or gid_t only if that fails.  This adds support for
7947         listing positive uids and gids that are greater than UID_MAX and
7948         GID_MAX.
7949
7950         * src/misc.c (link_error): New function.
7951
7952         * src/names.c (collect_and_sort_names):
7953         If ignore_failed_read_option, only warn about
7954         stat errors.
7955
7956         (excluded_name): Now returns bool.  Simplify, as the fancy
7957         features are now all in excluded_filename.
7958
7959         * src/rtapelib.c (base_name): Remove decl, as system.h now
7960         declares it.
7961
7962         * src/system.h: Include stddef.h if available.
7963         (offsetof): Declare if stddef.h doesn't.
7964
7965         Include <dirname.h>.
7966         (FILESYSTEM_PREFIX_LEN, ISSLASH): Remove; now defined by dirname.h.
7967
7968         * src/tar.c (ANCHORED_OPTION, IGNORE_CASE_OPTION,
7969         NO_ANCHORED_OPTION, NO_IGNORE_CASE_OPTION, NO_WILDCARDS_OPTION,
7970         NO_WILDCARDS_MATCH_SLASH_OPTION, WILDCARDS_OPTION,
7971         WILDCARDS_MATCH_SLASH_OPTION):
7972         New enum values.
7973
7974         (long_options, usage, decode_options): Add support for --anchored,
7975         --ignore-case, --no-anchored, --no-ignore-case, --no-wildcards,
7976         --no-wildcards-match-slash, --recursion, --wildcards,
7977         --wildcards-match-slash.
7978
7979         (decode_options): Implement the new way of interpreting exclude
7980         patterns.
7981
7982         (usage): --newer-mtime takes a DATE operand.  DATE may be a file name.
7983
7984         (OPTION_STRING, decode_options): Add -I, -y.  Currently these options
7985         just print error messages suggesting alternatives.
7986
7987         (add_filtered_exclude): Remove.
7988
7989         * tests/Makefile.am (TESTS): Alphabetize, except put version.sh first.
7990
7991         * tests/extrac04.sh (out): Remove
7992         directory/subdirectory/file1, as the new semantics for
7993         --exclude exclude it.
7994
7995         * tests/genfile.c (main): Don't use non-ASCII char in msgid.
7996
7997 2001-08-12  Paul Eggert  <eggert@twinsun.com>
7998
7999         * lib/addext.c (<errno.h>): Include.
8000         (errno): Declare if not defined.
8001         (addext): Work correctly on the Hurd, where pathconf returns -1 and
8002         leaves errno alone, because there is no limit.  Also, work even if
8003         size_t is narrower than long.
8004
8005 2001-07-08  Paul Eggert  <eggert@twinsun.com>
8006
8007         * lib/alloca.c (alloca): Arg is of type size_t, not unsigned.
8008
8009 2001-05-10  Paul Eggert  <eggert@twinsun.com>
8010
8011         * lib/addext.c (ISSLASH, base_name): Remove decls; now in dirname.h.
8012         Include <backupfile.h> and <dirname.h> after size_t is defined.
8013         (addext): Use base_len to trim redundant trailing slashes instead of
8014         doing it ourselves.
8015
8016         * lib/backupfile.c (ISSLASH, base_name):
8017         Remove decls; now in dirname.h.
8018         Include <argmatch.h>, <backupfile.h>, <dirname.h> after size_t
8019         is defined.
8020         (find_backup_file_name): Rename locals to avoid new functions.
8021         Use base_len instead of rolling it ourselves.
8022         Work even if dirlen is 0.
8023         Use a dir of '.' if given the empty string.
8024
8025         * lib/basename.c:
8026         Do not include <stdio.h>, <assert.h>; no longer needed.
8027         (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Remove; now in dirname.h.
8028         Include <string.h>, <dirname.h>.
8029         (base_name): Allow file names ending in slashes, other than names
8030         that are all slashes.  In this case, return the basename followed
8031         by the slashes.
8032
8033         * lib/dirname.c: Include <string.h> instead of <stdlib.h>.
8034         (FILESYSTEM_PREFIX_LEN, ISSLASH): Remove; now in dirname.h.
8035         (dir_len): Renamed from dirlen.
8036         All callers changed.
8037
8038         * lib/dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
8039         New macros.
8040         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
8041
8042 2001-02-16  Paul Eggert  <eggert@twinsun.com>
8043
8044         * lib/quotearg.c (mbrtowc, mbrtowc, mbsinit):
8045         Do not declare or define if HAVE_MBRTOWC,
8046         since the test for HAVE_MBRTOWC now requires proper declarations.
8047
8048         * lib/alloca.c (malloc): Undef before defining.
8049
8050 2001-02-13  Paul Eggert  <eggert@twinsun.com>
8051
8052         * src/compare.c (read_and_process): Use off_t for size.
8053         From Maciej W. Rozycki.
8054
8055 2001-01-26  Paul Eggert  <eggert@twinsun.com>
8056
8057         * lib/quotearg.c: Include stddef.h.  From Jim Meyering.
8058
8059 2001-01-12  Paul Eggert  <eggert@twinsun.com>
8060
8061         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.19.
8062
8063         * lib/savedir.h (savedir): Remove size arg.
8064
8065         * doc/tar.texi: Add @setchapternewpage odd.
8066         Remove -I as an alias for -T, for now.
8067         Add @dircategory.
8068         Update copyright.  Remove "Published by".
8069         Dates beginning with / or . are taken to be file names.
8070
8071         * src/tar.c (<time.h>): Do not include;
8072         (time): Do not declare.
8073         (usage): Remove -I as an alias for -T.
8074         (OPTION_STRING): Remove -I.
8075         (decode_options): Dates that look like an absolute path name,
8076         or that start with '.', are presumed to be file names whose
8077         dates are taken.
8078         Remove 'I' as an aliase for 'T'.
8079         Update copyright.
8080
8081         * src/extract.c (<time.h>): Do not include; system.h now does this.
8082         (make_directories): Skip filesystem prefixes.
8083         Don't assume '/' is the only separator.
8084         (extract_sparse_file): Use new full_write semantics.
8085         On write error, return instead of invoking skip_file.
8086         Do not free sparsearray; caller does this now.
8087         (apply_nonancestor_delayed_set_stat): Do not assume '/' is the only
8088         separator.
8089         (extract_archive): Don't assume file name lengths fit in int.
8090         Report what got stripped from member name; it might be more than '/'.
8091         Use new full_write semantics.
8092         Do not pass redundant trailing "/" to mkdir, as POSIX does not allow
8093         mkdir to ignore it.
8094         Do not report mkdir error if old_files_option == KEEP_OLD_FILES.
8095
8096         * src/buffer.c (<time.h>): Do not include; system.h now does this.
8097         (time): Remove decl; likewise.
8098         (child_open_for_uncompress): Use new full_write semantics.
8099         (flush_write): Use ISSLASH instead of testing for '/'.
8100         (flush_read): Likewise.
8101
8102         * src/rmt.h (_remdev): Look for / anywhere in Path.
8103
8104         * src/misc.c (contains_dot_dot): Skip filesystem prefix.
8105         Don't assume '/' is the only separator.
8106         (safer_rmdir): Don't assume '/' is the only separator.
8107
8108         * src/compare.c (diff_archive): Don't assume '/' is the only separator.
8109
8110         * lib/dirname.h (dirlen): New decl.
8111
8112         * src/incremen.c (get_directory_contents):
8113         Remove path_size arg; all callers changed.
8114         Don't assume '/' is the only directory separator.
8115         (gnu_restore): Work even if file name length doesn't fit in int.
8116
8117         * lib/addext.c (ISSLASH): New macro.
8118         (addext): Trim any redundant trailing slashes.
8119
8120         * src/names.c (name_next):
8121         Don't assume '/' is the only directory separator.
8122         (namelist_match): Likewise.
8123         (add_hierarchy_to_namelist): Remove dirsize arg.
8124         Do not assume '/' is the only directory separator.
8125         (new_name): Likewise.
8126
8127         * lib/Makefile.am (noinst_HEADERS): Add dirname.h, full-write.h.
8128         (libtar_a_SOURCES): Add dirname.c.
8129
8130         * src/create.c (relativize):
8131         New function, with much of old start_header's guts.
8132         Handle filesystem prefixes.
8133         (start_header): Use this new function.
8134         (init_sparsearray): Don't bother to zero out the new array;
8135         it's not needed.
8136         (deal_with_sparse): Fix array allocation bug.
8137         (create_archive): Don't assume '/' is the only separator.
8138         (dump_file): Likewise.
8139         Don't worry about leading / in symlink targets.
8140
8141         * lib/savedir.c (savedir):
8142         Remove size arg; it wasn't portable.  All callers changed.
8143
8144         * lib/utime.c (utime_null): Adjust to new full_write convention.
8145
8146         * configure.in (YACC): Avoid portability problem with Ultrix sh.
8147
8148         * lib/backupfile.c: Include <dirname.h>.
8149         (ISSLASH): New macro.
8150         (find_backup_file_name): Use dirlen to calculate directory lengths.
8151         (max_backup_version): Strip redundant trailing slashes.
8152
8153         * src/common.h: Include <full-write.h>.
8154         (get_directory_contents): No longer has size arg.
8155         (gnu_restore): Arg is size_t, not int.
8156
8157         * src/system.h: Include <time.h>.
8158         (time): Declare if not defined.
8159
8160         * lib/full-write.c: Include full-write.h, not safe-read.h.
8161         full_write returns size_t, with short writes meaning failure.
8162         All callers changed.
8163
8164         * src/rtapelib.c: Include full-write.h.
8165
8166         * src/rmt.c: Include full-write.h.
8167         (main): Update copyright.
8168
8169         * doc/getdate.texi: Mention that only English is supported.
8170         Show how to use "date" so that the output is acceptable to getdate.
8171         Mention Z as an abbreviation for UTC.
8172
8173         * lib/full-write.h: New file.
8174
8175         * src/list.c: system.h now does time.h stuff.
8176
8177         * lib/dirname.c:
8178         Use HAVE_STDLIB_H, not STDC_HEADERS, to decide whether to include
8179         stdlib.h.
8180         Do not include string.h, strings.h, or assert.h; no longer needed.
8181         (strrchr, memrchr, malloc): Remove decls; no longer needed.
8182         Include <xalloc.h>.
8183         (base_name): New decl.
8184         (BACKSLASH_IS_PATH_SEPARATOR): Remove.
8185         (dir_name_r): Remove.
8186         (dirlen): New function.
8187         (dir_name): Use dirlen instead of dir_name_r.
8188         (<string.h>, <strings.h>): Include only if test program.
8189         (main): Use "return 0", not "exit (0)".
8190
8191 2000-12-08  Paul Eggert  <eggert@twinsun.com>
8192
8193         * lib/dirname.h: New file.
8194
8195 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
8196
8197         * lib/fnmatch.c: Do not comment out all the code if we are using
8198         the GNU C library, because in some cases we are replacing buggy
8199         code in the GNU C library itself.
8200
8201 2000-10-30  Paul Eggert  <eggert@twinsun.com>
8202
8203         * lib/fnmatch.c (FOLD): Do not assume that characters are unsigned.
8204
8205 2000-10-29  Paul Eggert  <eggert@twinsun.com>
8206
8207         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.18.
8208
8209         * src/tar.c: Include <fnmatch.h>, for FNM_LEADING_DIR.
8210
8211 2000-10-28  Paul Eggert  <eggert@twinsun.com>
8212
8213         * doc/tar.texi: --no-recursion now applies to extraction, too.
8214         * src/create.c (dump_file): no_recurse_option -> ! recursion_option
8215         * src/names.c (namelist_match, excluded_name):
8216         Do not match subfiles of a directory
8217         if --no-recursion is specified.
8218         * src/tar.c (NO_RECURSE_OPTION): Remove.
8219         (long_options): Have getopt set the --no-recursion flag.
8220         (decode_options): Initialize recursion_option to FNM_LEADING_DIR.
8221         Remove case for NO_RECURSE_OPTION.
8222         * src/common.h (recursion_option):
8223         Renamed from no_recurse_option, with sense
8224         negated, and with FNM_LEADING_DIR being the nonzero value.
8225
8226         * names.c (namelist_match): New function.
8227         (name_match, name_scan): Use it to eliminate duplicate code.
8228         (names_notfound): Remove special case for Amiga.
8229
8230 2000-10-27  Paul Eggert  <eggert@twinsun.com>
8231
8232         * src/misc.c (read_error_details, read_warn_details,
8233         read_fatal_details): Don't assume size_t is unsigned long.
8234
8235         * src/buffer.c (flush_read): If read_full_records_option, try to
8236         fill the input buffer, as --delete -f - needs this.
8237
8238 2000-10-24  Paul Eggert  <eggert@twinsun.com>
8239
8240         * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Port to autoconf 2.13.
8241
8242         * src/buffer.c (check_label_pattern):
8243         Make sure header name is a string before
8244         passing it to fnmatch.
8245         (init_volume_number): Check for global_volno overflow.
8246         (new_volume): Check for global_volno overflow.
8247
8248         * src/tar.c (decode_options):
8249         Check that volume label is not too long to overflow
8250         name in tar header block.
8251
8252         * Makefile.am (EXTRA_DIST): Remove rebox.el.
8253
8254         * configure.in (HAVE_DECL_STRERROR_R): Remove our handwritten code.
8255         (AC_FUNC_STRERROR_R): Use this instead.
8256
8257 2000-10-23  Paul Eggert  <eggert@twinsun.com>
8258
8259         * src/extract.c: Include <time.h>, since we invoke "time".
8260
8261         * lib/prepargs.c (prepend_default_options):
8262         Don't use NULL, for portability.
8263
8264         * m4/fnmatch.m4: Add "working" to message.
8265
8266         * src/names.c: (_GNU_SOURCE): Remove; autoconf now does this.
8267         Include <hash.h>.
8268         (getpwuid, getgrgid): Declare only if system headers don't.
8269         (gid_to_gname): Don't invoke setgrent.
8270         (namelist): Now static, not global.
8271         (nametail): New var.  All uses of namelast changed to use
8272         nametail, with one extra level of indirection.
8273         (name_gather): Use memcpy instead of strncpy + assignment of NUL.
8274         (name_match): Set nametail too, when setting namelist to null.
8275         (add_hierarchy_to_namelist): Change type of dir arg from char * to
8276         struct name *, so that we don't have to look up the name again
8277         here.  Get change_dir from dir rather than as a separate arg.  Add
8278         dirsize arg, and pass it along to get_directory_contents.  Remove
8279         unnecessary check of directory type.
8280         (new_name): Do not append a slash if PATH already ends in one.
8281         (avoided_names, struct avoided_name): Remove.
8282         (avoided_name_table): New var, replacing avoided_names.
8283         (hash_avoided_name, compare_avoided_names): New function.
8284         (add_avoided_name, is_avoided_name): Use hash table rather than
8285         linked list.
8286
8287         * src/buffer.c (_GNU_SOURCE): Remove; autoconf now does this.
8288         (child_open_for_compress, child_open_for_uncompress,
8289         close_archive): Propagate any failure of the compression process
8290         back to "tar".
8291         (open_archive, flush_write, flush_read, close_archive): Do not
8292         allocate an array of size PATH_MAX, as PATH_MAX might be (size_t)
8293         -1.  Instead, allocate an array with the size that's needed.
8294         (open_archive): Don't bother checking S_ISCHR of /dev/null.
8295         (backspace_output): Don't try to backspace past start of archive.
8296         (close_archive): Remove special case for DELETE_SUBCOMMAND.
8297
8298         * acconfig.h (_GNU_SOURCE, DEFAULT_ARCHIVE, DEFAULT_BLOCKING,
8299         DENSITY_LETTER, DEVICE_PREFIX, EMUL_OPEN3, HAVE_GETGRGID,
8300         HAVE_GETPWUID, HAVE_MKNOD, HAVE_RTAPELIB, HAVE_ST_FSTYPE_STRING,
8301         HAVE_UNION_WAIT, HAVE_UTIME_H, HAVE_VALLOC, MTIO_CHECK_FIELD, PACKAGE,
8302         PROTOTYPES, REMOTE_SHELL, STD_INC_PATH, VERSION, WITH_CATALOGS,
8303         WITH_DMALLOC, WITH_REGEX):
8304         Remove; now generated automatically.
8305
8306         * configure.in (_GNU_SOURCE): Define to empty, not 1, for
8307         compatibility for glibc fragments.
8308         (_GNU_SOURCE, HAVE_UTIME_H, MTIO_CHECK_FIELD,
8309         HAVE_ST_FSTYPE_STRING, HAVE_MKNOD, REMOTE_SHELL, DENSITY_LETTER,
8310         DEVICE_PREFIX, DEFAULT_ARCHIVE, DEFAULT_BLOCKING): Add comment so
8311         that we needn't put an entry into acconfig.h.
8312         (ALL_LINGUAS): Add da.
8313         (AC_C_BACKSLASH_A): Remove; jm_PREREQ_QUOTEARG now does this.
8314         (AC_CHECK_HEADERS): Add stdbool.h (for hash.h users), wctype.h
8315         (for strtol.c).
8316         (AC_MBSTATE_T): Add.
8317         (RMT): Append $(EXEEXT).
8318         (HAVE_GETGRGID, HAVE_GETPWUID, pe_AC_TYPE_SIGNED_CHAR): Remove.
8319         (HAVE_DECL_FREE, HAVE_DECL_GETGRGID, HAVE_DECL_GETPWUID,
8320         HAVE_DECL_GETENV, HAVE_DECL_MALLOC, HAVE_DECL_STRTOUL,
8321         HAVE_DECL_STRTOULL, HAVE_DECL_STRERROR_R): New macros.
8322         (jm_PREREQ_ADDEXT, jm_PREREQ_ERROR, jm_PREREQ_QUOTEARG): Add.
8323         (AC_REPLACE_FUNCS): Remove execlp; no longer needed.
8324         (AC_CHECK_FUNCS): Add clock_gettime; AC_SEARCH_LIBS wasn't enough.
8325         Remove mbrtowc; jm_PREREQ_QUOTEARG now does this.
8326         (EMUL_OPEN3): Remove; no longer needed.
8327         (DENSITY_LETTER, DEVICE_PREFIX): Simplify m4 quoting.
8328
8329         * m4/fnmatch.m4 (AC_FUNC_FNMATCH): Detect d*/*1 vs d/s/1 bug.
8330
8331         * src/common.h: Do not include basename.h.
8332         * src/rtapelib.c (base_name): Do not include basename.h;
8333         declare base_name instead.
8334
8335         * lib/basename.h, lib/execlp.c, lib/getpagesize.h, lib/mkdir.c:
8336         Remove these files.
8337         * lib/getstr.c, lib/getstr.h, lib/hash.h, lib/hash.h, lib/prepargs.c,
8338         lib/prepargs.h, lib/savedir.c, lib/savedir.h: New files.
8339         * lib/Makefile.am (EXTRA_DIST, noinst_HEADERS, libtar_a_SOURCES):
8340         Adjust to the above changes.
8341
8342         * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove ../src/ansi2knr.
8343
8344         * src/open3.c: Remove.
8345
8346         * src/Makefile.am (AUTOMAKE_OPTIONS): Remove ansi2knr.
8347         (tar_SOURCES): Remove open3.c.
8348         (INCLUDES): Remove -I.., as automake does that.
8349         (OMIT_DEPENDENCIES): ../lib/fnmatch.h -> fnmatch.h.  Add localedir.h.
8350
8351         The following changes are to put LOCALEDIR into localedir.h instead
8352         of passing it on the command line.
8353         (DEFS): Remove.
8354         (DISTCLEANFILES): New macro.
8355         (localedir.h): New rule.
8356         (rmt.o tar.o): Now depend on localedir.h.
8357
8358         * tests/delete02.sh, tests/extrac04.sh: New files.
8359
8360         * tests/Makefile.am (AUTOMAKE_OPTIONS): Remove ansi2knr.
8361         (TESTS): Add extrac04.sh, and restore delete02.sh.
8362         (DEFS): Remove; LOCALEDIR is now done via localedir.h.
8363         (INCLUDES): Remove -I.. as automake does this now.
8364
8365         * src/rtapelib.c (rexec): Don't declare unless using it.
8366         (do_command): Simplify signal-handling code slightly.
8367
8368         * src/delete.c (blocks_needed): Remove.  All uses changed to use
8369         blocking_factor - new_blocks.
8370         (acting_as_filter): New var.
8371         (write_record, delete_archive_members): Use acting_as_filter
8372         rather than archive == STDIN_FILENO to detect whether we're acting
8373         as a filter, as open can return STDIN_FILENO in some cases.
8374         (delete_archive_members): Ignore zero blocks if
8375         ignore_zeros_option is nonzero.  Fix bug that messed up last
8376         output block: write_eot can't be used here, as it gets confused
8377         when the input is at end of file.
8378
8379         * src/compare.c (diff_archive): Do not impose an arbitrary limit on
8380         symbolic link contents length.  Pass directory size to
8381         get_directory_contents.
8382
8383         * m4/decl.m4, m4/error.m4, m4/mbstate_t.m4, m4/prereq.m4,
8384         m4/strerror_r.m4: New files.
8385         * m4/signedchar.m4: Remove this file.
8386         * Makefile.am (ACINCLUDE_INPUTS): Adjust to above changes.
8387         * m4/Makefile.am (EXTRA_DIST): Likewise.
8388
8389         * Makefile.am (DISTCLEANFILES): Add intl/libintl.h.
8390
8391         * po/da.po: New translation file.
8392
8393         * src/mangle.c (extract_mangle):
8394         Fix diagnostic with wrong number of %s'es.
8395
8396         * lib/fnmatch.c (fnmatch):
8397         Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
8398         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
8399
8400         * lib/full-write.c (full_write): Some buggy drivers return 0 when you
8401         fall off a device's end.  Detect this.
8402
8403         * src/system.h (IN_CTYPE_DOMAIN): Renamed from CTYPE_DOMAIN.  All
8404         uses changed.
8405         (open): Remove macro; we no longer support EMUL_OPEN3.  Do not
8406         include <pathmax.h> and directory include files like <dirent.h>;
8407         no longer used.  Include <savedir.h> instead.
8408         (closedir, signed_char): remove macro; no longer used.
8409         (bool, false, true): Include <stdbool.h> if you have the include
8410         file, otherwise define.
8411
8412         * src/misc.c:
8413         (is_dot_or_dotdot, closedir_error, closedir_warn, opendir_error,
8414         opendir_warn, readdir_error): Remove; no longer needed.
8415         (safer_rmdir): Strip leading ./ (or .// or ./// or ././ or etc.)
8416         before deciding whether we're trying to remove ".".
8417         (remove_any_file): Try unlink first if we are not root.  Use
8418         savedir when recursively removing directories, to avoid exhausting
8419         file descriptors.
8420         (savedir_error, savedir_warn, symlink_error): New functions.
8421
8422         * src/list.c: (read_and): Do not invoke
8423         apply_nonancestor_delayed_set_stat; DO_SOMETHING is now
8424         responsible for that.  Do not invoke apply_delayed_set_stat; our
8425         caller is now responsible for that.
8426         (read_header): Use signed char instead of signed_char.  Prevent
8427         later references to current_header from mistakenly treating it as
8428         an old GNU header.
8429         (from_header): Quote invalid base-64 strings in diagnostics.
8430         (time_from_header): Do not warn about future timestamps in
8431         archive; check_time now does that.
8432         (print_header): Quote unknown file types.
8433         (skip_member): New function, replacing skip_extended_headers and
8434         now skipping the whole member instead of just the extended
8435         headers.  All callers changed.  This makes the code handle
8436         extended headers uniformly, and fixes some bugs.
8437
8438         * src/update.c (update_archive): Use skip_member.
8439
8440         * src/extract.c (we_are_root): Now global.
8441         (struct delayed_symlink): New type.
8442         (delayed_symlink_head): New var.
8443         (extr_init, fatal_exit): Invoke extract_finish on fatal errors,
8444         not apply_delayed_set_stat.
8445         (set_mode, set_stat): Pointer args are now const pointers.
8446         (check_time): New function.
8447         (set_stat): Warn if setting a file's timestamp to be the future.
8448         (make_directories): Do not save and restore errno.
8449         (maybe_recoverable): Set errno to ENOENT if we cannot make missing
8450         intermediate directories.
8451         (extract_archive): Invoke apply_nonancestor_delayed_set_stat here,
8452         not in caller.  Extract potentially dangerous symbolic links more
8453         carefully, deferring their creation until the end, and using a
8454         regular file placeholder in the meantime.  Do not remove trailing
8455         / and /. from file names.  Do not bother checking for ".." when
8456         checking whether a directory loops back on itself, as loopbacks
8457         can occur with symlinks too.  Also, in that case, do not bother
8458         saving and restoring errno; just set it to EEXIST.
8459         (apply_nonancestor_delayed_set_stat): A prefix is a potential
8460         ancestor if it ends in slash too (as well as ending in a char just
8461         before slash).
8462         (apply_delayed_set_stat): Remove.
8463         (apply_delayed_symlinks, extract_finish): New functions.
8464
8465         * doc/fdl.texi: New file.
8466         * doc/Makefile.am (EXTRA_DIST): Add fdl.texi.
8467         ($(srcdir)/tar.info): Add fdl.texi.  Invoke makeinfo with --no-split.
8468         * doc/tar.texi: Add Free Documentation License.  New section
8469         "Overwrite Old Files", and revamp that section to make it easier to
8470         follow.  "tar" -> "GNU tar" where appropriate.  Migrate getdate
8471         documentation into getdate.texi.  Fix several minor typos.  Describe
8472         TAR_OPTIONS.  Describe incompatibility between incremental backups and
8473         --atime-preserve.  Describe incompatibility between --verify and other
8474         options.  Mention that tar normally removes symbolic links rather than
8475         following them, when extracting a file of the same name.
8476
8477         * THANKS: Add gpoul.  Change skip's address.
8478
8479         * po/POTFILES.in: Add lib/human.c.
8480
8481         * src/common.h (namelist, namelast): Remove decls.
8482         (we_are_root, extract_finish, skip_member, savedir_error,
8483         savedir_warn, symlink_error, gnu_list_name): New decls.
8484         (apply_delayed_set_stat, apply_nonancestor_delayed_set_stat,
8485         skip_extended_headers, is_dot_or_dotdot, closedir_error,
8486         closedir_warn, opendir_error, opendir_warn, readdir_error,
8487         readdir_warn): Remove decls.
8488         (get_directory_contents): New off_t arg.
8489         (addname): Now returns struct name *.
8490
8491         * src/tar.h, tests/genfile.c: Fix comments.
8492
8493         * src/create.c: Include hash.h.
8494         (gnu_list_name): Remove decl.
8495         (struct link): Remove "next" member.
8496         (linklist): Remove.
8497         (start_header): Say "leading `FOO'" rather than "`FOO' prefix" for
8498         consistency with other diagnostics.
8499         (deal_with_sparse): Check for I/O error when closing the file.
8500         (create_archive): Do not allocate an array of size PATH_MAX, as
8501         PATH_MAX might be (size_t) -1.  Instead, allocate an array with
8502         the size that's needed.
8503         (hash_link, compare_links): New functions.
8504         (dump_file): Do not exhaust open file descriptors when descending
8505         deeply into a directory, by using savedir rather than
8506         opendir/readdir.  Do not zero-fill the name buffer unnecessarily.
8507         Hash the set of links already created, instead of using a linked
8508         list.  Fix some bugs in outputting sparse files which caused the
8509         sparse tables to be incorrect.  When a file unexpectedly shrinks,
8510         output zeros rather than garbage.  Do not allocate an array of
8511         size PATH_MAX, as PATH_MAX might be (size_t) -1.  Instead,
8512         allocate an array with the size that's needed.
8513
8514         * src/incremen.c: Include hash.h.
8515         (struct directory): Remove "next", "dir_text".  Change "name" to
8516         be char[1] with struct hack, not const char *.  Add "found".
8517         (directory_list): Remove.  Replaced by directory_table.
8518         (directory_table): New var.
8519         (nfs_string): Renamed from nfs.
8520         (hash_directory, compare_directories): New functions.
8521         (note_directory): Now returns struct directory *.  First arg is
8522         now const pointer.  struct stat arg is now dev_t, ino_t, nfs.
8523         Remove text arg.  New "found" arg, basically corresponding to the
8524         old text arg not being null.  All callers changed.
8525         (note_directory, find_directory): Use hash table rather than
8526         linked list.
8527         (get_directory_contents): New arg "device".  Use savedir to do the
8528         hard work.  Save the nfs-ness of stat_data, since it might change
8529         under us.  Use note_directory instead of find_directory to save
8530         some work.  When adding an "A" record, do it with
8531         add_to_accumulator instead of cheating with strcat.
8532         (read_directory_file): Use "+" flag before device to indicate
8533         whether it was NFS.  Fix typo in checking for strtoul error.
8534         (write_directory_file_entry): New function.
8535         (write_directory_file): Use it, and use the hash routines to
8536         traverse the directory table.
8537         (gnu_restore): Use savedir rather than opendir/readdir.
8538
8539         * src/tar.c: Include localedir.h, prepargs.h.
8540         (long_options): Now static.
8541         (long_options, usage, decode_options): -j is now short for
8542         --bzip2, and -I is now an alias for -T.
8543         (decode_options, main): argv is not const pointer now.
8544         (decode_options): Invoke prepend_default_options to support
8545         TAR_OPTIONS.  In diagnostic, mention the string that was the
8546         invalid blocking factor, tape length, group, owner, or record
8547         size.  --delete is no longer incompatible with -f -, undoing
8548         2000-01-07 change.
8549         (main): Invoke extract_finish at end of extraction.
8550
8551         * src/rmt.c: Include localedir.h.
8552         (main): Update copyright date to 2000.
8553
8554         * doc/getdate.texi: New file, taken from fileutils 4.0.27, with the
8555         following changes: Use @sc where appropriate.  Document the ranges of
8556         supported times more precisely.  Add Eggert to getdate authors.
8557         Document old Latin 12m/12pm tradition.  Remove list of alphabetic time
8558         zone names, as it wasn't correct and people shouldn't be relying on it
8559         anyway.  Relative items also account for non-DST adjustments.  Fix
8560         some misspellings.
8561
8562         * lib/prepargs.c, lib/prepargs.h, tests/extrac04.sh: New file.
8563
8564         * tests/ignfail.sh: opendir -> savedir in diagnostics.
8565
8566         * tests/preset.in: Set LANGUAGE to the empty string, for some
8567         brain damaged host.
8568
8569 2000-10-20  Paul Eggert  <eggert@twinsun.com>
8570
8571         * m4/fnmatch.m4: Mention the GNU C library.
8572
8573 2000-10-19  Paul Eggert  <eggert@twinsun.com>
8574
8575         * m4/fnmatch.m4: Add a couple more test cases to catch bugs in
8576         glibc 2.1.95.
8577
8578 2000-10-17  Paul Eggert  <eggert@twinsun.com>
8579
8580         * lib/human.c (<limits.h>): Do not include; human.h does it if needed.
8581         (CHAR_BIT): Remove.
8582
8583         * lib/human.h (<limits.h>): Include if HAVE_LIMITS_H.
8584         (CHAR_BIT): Define if not defined.
8585
8586 2000-09-09  Paul Eggert  <eggert@twinsun.com>
8587
8588         * lib/quotearg.c: From fileutils: rename ISASCII to IN_CTYPE_DOMAIN.
8589
8590 2000-08-07  Paul Eggert  <eggert@twinsun.com>
8591
8592         * lib/xmalloc.c: Memory exhausted -> memory exhausted
8593
8594         * lib/xalloc.h (xalloc_msg_memory_exhausted):
8595         change to array from char *.
8596
8597 2000-08-06  Paul Eggert  <eggert@twinsun.com>
8598
8599         * m4/mbstate_t.m4: Define mbstate_t to be int, not char, for
8600         compatibility with glibc 2.1.3 strftime.c.
8601
8602 2000-07-31  Paul Eggert  <eggert@twinsun.com>
8603
8604         * lib/quotearg.c (quotearg_n_options):
8605         Don't make the initial slot vector a constant,
8606         since it might get modified.
8607
8608         * lib/quotearg.c: Add support for more than one preallocated slot.
8609
8610 2000-07-30  Paul Eggert  <eggert@twinsun.com>
8611
8612         * lib/quotearg.c (quotearg_n_options):
8613         Preallocate a slot 0 buffer, so that the caller
8614         can always quote one small component of a "memory exhausted" message
8615         in slot 0.
8616
8617 2000-07-23  Paul Eggert  <eggert@twinsun.com>
8618
8619         * lib/quotearg.c:
8620         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX), so that
8621         mbstate_t is always defined.
8622
8623         Do not inspect MB_LEN_MAX, since it's incorrectly defined to be 1 in
8624         some GCC installations, and this configuration error is likely to be
8625         common.
8626
8627 2000-07-22  Paul Eggert  <eggert@twinsun.com>
8628
8629         * lib/quotearg.c:
8630         When the system forces us to redefine mbstate_t, shadow its mbsinit
8631         function.  From Bruno Haible.
8632
8633 2000-07-14  Paul Eggert  <eggert@twinsun.com>
8634
8635         * lib/xmalloc.c: Simplify exhausted message.
8636
8637         * lib/quotearg.h: Update copyright date; from Jim Meyering.
8638
8639 2000-07-13  Paul Eggert  <eggert@twinsun.com>
8640
8641         * lib/quotearg.h (enum quoting style):
8642         New constant clocale_quoting_style.
8643
8644         * lib/quotearg.c:
8645         (quoting_style_args, quoting_style_vals, quotearg_buffer_restyled):
8646         Add support for clocale_quoting_style, undoing previous change to
8647         locale_quoting_style.
8648
8649 2000-07-10  Paul Eggert  <eggert@twinsun.com>
8650
8651         * lib/quotearg.c:
8652         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX,
8653         since otherwise we don't need it.
8654         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
8655         since we don't do multibytes in that case.
8656         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
8657         invoke multibyte primitives.
8658
8659         * m4/mbstate_t.m4 (AC_MBSTATE_T):
8660         Renamed from AC_MBSTATE_T_OBJECT.  All uses changed.
8661         Change from a two-part test, which defines both HAVE_MBSTATE_T_OBJECT
8662         and mbstate_t, to a single-part test that simply defines mbstate_t.
8663
8664         * lib/quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
8665         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
8666         to decide whether to define the BeOS workaround macro;
8667         this adjusts to the change to AC_MBSTATE_T.
8668
8669         * m4/strerror_r.m4: New file.
8670
8671 2000-07-05  Paul Eggert  <eggert@twinsun.com>
8672
8673         * lib/quotearg.c: Use double-quote to quote.
8674
8675         * lib/quotearg.c (N_): New macro.
8676         (gettext_default): New function.
8677         (quotearg_buffer_restyled): Use gettext_default ("{LEFT QUOTATION MARK}",
8678         "\"") for left quote, and gettext_default ("{RIGHT QUOTATION MARK}", "\"")
8679         for right quote.
8680
8681         * lib/quotearg.c (struct quoting_options):
8682         Simplify quote_these_too dimension.
8683         From Bruno Haible  <haible@clisp.cons.org>.
8684
8685         * m4/mbstate_t.m4 (AC_MBSTATE_T_OBJECT):
8686         Test for mbstate_t only if the test
8687         for an object-type mbstate_t fails.
8688
8689         * lib/quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
8690
8691 2000-07-03  Paul Eggert  <eggert@twinsun.com>
8692
8693         * m4/mbstate_t.m4 (AC_MBSTATE_T_OBJECT): Port to autoconf 2.13.
8694         Add AC_CHECK_HEADERS(stdlib.h), since we use HAVE_STDLIB_H.
8695
8696         * lib/quotearg.c (mbrtowc):
8697         Assign to *pwc, and return 1 only if result is nonzero.
8698         (iswprint): Define to ISPRINT if we are substituting our own mbrtowc.
8699
8700 2000-07-02  Paul Eggert  <eggert@twinsun.com>
8701
8702         * lib/quotearg.c (mbstate_t):
8703         Do not define; it should be defined with AC_CHECK_TYPE.
8704
8705 2000-06-26  Paul Eggert  <eggert@twinsun.com>
8706
8707         * m4/mbstate_t.m4: Include stdio.h before wchar.h, to work around
8708         a bug in glibc 2.1.3.
8709
8710         * lib/xmalloc.c: Fix inaccurate comment for xrealloc.
8711
8712 2000-06-19  Paul Eggert  <eggert@twinsun.com>
8713
8714         * lib/quotearg.c (ISASCII): Add #undef and move definition to follow
8715         inclusion of wctype.h to work around solaris2.6 namespace pollution.
8716         (ISPRINT): Likewise.
8717         Reported by Tom Tromey.
8718
8719 2000-06-15  Paul Eggert  <eggert@twinsun.com>
8720
8721         * lib/human.c (adjust_value): New function.
8722         (human_readable_inexact): Apply rounding style even when printing
8723         approximate values.
8724
8725         * lib/human.c: Avoid shadowing warnings.
8726         From Jim Meyering.
8727
8728 2000-06-14  Paul Eggert  <eggert@twinsun.com>
8729
8730         * lib/human.c (human_readable_inexact): Allow an input block size
8731         that is not a multiple of the output block size, and vice versa.
8732
8733         * lib/getdate.y (get_date): Apply relative times after time zone
8734         indicator, not before.
8735
8736 2000-05-31  Paul Eggert  <eggert@twinsun.com>
8737
8738         * m4/largefile.m4: Rewrite so that we don't need to run getconf,
8739         and thus don't need AC_CANONICAL_HOST.
8740
8741         (AC_SYS_LARGEFILE_FLAGS, AC_SYS_LARGEFILE_SPACE_APPEND): Remove.
8742         (AC_SYS_LARGEFILE_TEST_INCLUDES): New macro.
8743         (AC_SYS_LARGEFILE_MACRO_VALUE): Change arguments from
8744         CODE-TO-SET-DEFAULT to VALUE, INCLUDES, FUNCTION-BODY.  All uses
8745         changed.  Instead of inspecting the output of getconf, try to
8746         compile the test program without and with the macro definition.
8747         (AC_SYS_LARGEFILE): Do not require AC_CANONICAL_HOST or check for
8748         getconf.  Instead, check for the needed flags by compiling test
8749         programs.
8750
8751         * configure.in (AC_CANONICAL_HOST): Remove; the largefile stuff no
8752         longer needs it.
8753         * config.guess, config.sub: Remove these files, for similar reasons.
8754
8755 2000-05-03  Paul Eggert  <eggert@twinsun.com>
8756
8757         * m4/largefile.m4 (AC_SYS_LARGEFILE): Define _XOPEN_SOURCE to be
8758         500, instead of _GNU_SOURCE to be 1, to work around glibc 2.1.3
8759         bug.  This avoids a clash when files like regex.c that define
8760         _GNU_SOURCE.
8761
8762 2000-05-02  Paul Eggert  <eggert@twinsun.com>
8763
8764         * m4/largefile.m4 (AC_SYS_LARGEFILE):
8765         Define _GNU_SOURCE if this is needed to make
8766         ftello visible (e.g. glibc 2.1.3).  Use compile-time test, rather than
8767         inspecting host and OS, to decide whether to define _LARGEFILE_SOURCE.
8768
8769         * lib/quotearg.c (mbrtowc, mbstat_t):
8770         Add definitions if !HAVE_MBSTATE_T_OBJECT.
8771         (<wctype.h>): Include if HAVE_WCTYPE_H.
8772         (iswprint): Define to 1 if we lack it
8773
8774 2000-04-18  Paul Eggert  <eggert@twinsun.com>
8775
8776         * m4/mbstate_t.m4: New file.
8777
8778 2000-04-17  Bruno Haible  <haible@clisp.cons.org>
8779
8780         * tests/ignfail.sh: Test for uid 0 along with user "root".
8781
8782 2000-04-05  Paul Eggert  <eggert@twinsun.com>
8783
8784         * m4/largefile.m4 (AC_SYS_LARGEFILE_FLAGS):
8785         Don't use -n32 on IRIX if the installer said
8786         otherwise.
8787
8788 2000-02-28  Paul Eggert  <eggert@twinsun.com>
8789
8790         * lib/quotearg.c (ALERT_CHAR): New macro.
8791         (quotearg_buffer_restyled): Use it.
8792
8793 2000-02-23  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
8794
8795         * src/list.c (tartime): Fix off-by-one error when copying year if
8796         OLD_CTIME.
8797
8798 2000-02-18  Paul Eggert  <eggert@twinsun.com>
8799
8800         * lib/getdate.y: Handle two-digit years with leading zeros correctly.
8801         (textint): New typedef.
8802         (parser_control): Changed from struct parser_control to typedef
8803         (for consistency).  Member year changed from int to textint.  All
8804         uses changed.
8805         (YYSTYPE): Removed; replaced by %union with int and textint
8806         members.
8807         (tID): Removed; not used.
8808         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE,
8809         tMERIDIAN, tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER,
8810         tUNUMBER, tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
8811         (tSNUMBER, tUNUMBER): Now of type <textintval>.
8812         (date, number, to_year): Use width of number in digits, not its
8813         value, to determine whether it's a 2-digit year, or a 2-digit
8814         time.
8815         (yylex): Store number of digits of numeric tokens.  Return '?' for
8816         unknown identifiers, rather than (unused) tID.
8817
8818 2000-01-16  Paul Eggert  <eggert@twinsun.com>
8819
8820         * lib/quotearg.c (quotearg_buffer_restyled):
8821         Do not quote alert, backslash, formfeed,
8822         and vertical tab unnecessarily in shell quoting style.
8823
8824 2000-01-15  Paul Eggert  <eggert@twinsun.com>
8825
8826         * m4/c-bs-a.m4:
8827         Change quoting to be compatible with future autoconf versions.
8828
8829 2000-01-11  Paul Eggert  <eggert@twinsun.com>
8830
8831         * lib/exclude.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Remove unused macros.
8832
8833 2000-01-07  Paul Eggert  <eggert@twinsun.com>
8834
8835         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.17.
8836
8837         Fix bug with fnmatch.h dependency, as follows:
8838         * src/Makefile.am (OMIT_DEPENDENCIES): New macro.
8839         * lib/Makefile.am (OMIT_DEPENDENCIES): New macro.
8840
8841         * src/common.h (apply_nonancestor_delayed_set_stat):
8842         Renamed from apply_delayed_set_stat.
8843         (apply_delayed_set_stat, decode_mode, chmod_error_details,
8844         chown_error_details, close_warn, closedir_warn, mkdir_error,
8845         read_error_details, read_fatal_details, read_warn_details,
8846         seek_error_details, seek_warn_details, utime_error,
8847         write_error_details, write_fatal_details): New decls.
8848
8849         Make diagnostic messages more regular.
8850         * src/create.c (dump_file): Quote file names with colons if possible.
8851         * src/compare.c (diff_archive): Likewise.
8852         * src/extract.c (repair_delayed_set_stat, extract_archive): Likewise.
8853         * src/incremen.c (get_directory_contents, gnu_restore): Likewise.
8854         * src/mangle.c (extract_mangle): Likewise.
8855         * src/misc.c (call_arg_error, call_arg_fatal, call_arg_warn):
8856         Likewise.
8857         * src/buffer.c (archive_write_error, flush_archive, close_archive,
8858         new_volume, xclose):
8859         Use error message functions to report errors consistently.
8860         * src/compare.c (diff_sparse_files, diff_archive): Likewise.
8861         * src/create.c (finish_sparse_file, dump_file): Likewise.
8862         * src/extract.c (set_mode, set_stat, extract_sparse_file,
8863         extract_archive): Likewise.
8864         * src/list.c (list_archive): Likewise.
8865         * src/update.c (append_file): Likewise.
8866         * src/compare.c (diff_init, diff_sparse_files):
8867         Use xalloc_die to report memory exhaustion.
8868         * src/incremen.c (gnu_restore): Likewise.
8869         * src/list.c (read_header): Likewise.
8870         * src/mangle.c (extract_mangle): Likewise.
8871         * src/misc.c (maybe_backup_file): Likewise.
8872         * src/tar.c (decode_options): Likewise.
8873         * src/compare.c (read_and_process, fill_in_sparse_array,
8874         diff_sparse_files):
8875         Use consistent terminology for unexpected-EOF message.
8876         * src/extract.c (extract_sparse_file, extract_archive): Likewise.
8877         * src/list.c (list_archive, read_header, skip_file,
8878         skip_extended_headers): Likewise.
8879         * src/buffer.c (archive_write_error): Add noreturn attribute to decl.
8880         (xdup2): Regularize messages with rest of tar.
8881
8882         * src/buffer.c (flush_read): Don't read past EOF.
8883
8884         * src/extract.c (extr_init):
8885         If we run out of memory, invoke apply_delayed_set_stat.
8886         (prepare_to_extract): Don't complain if we can't remove ".".
8887         (apply_delayed_set_stat): New function.
8888         (apply_nonancestor_delayed_set_stat):
8889         Renamed from apply_delayed_set_stat.  All uses changed.
8890         Don't remove head if it doesn't apply.
8891
8892         * src/create.c (find_new_file_size):
8893         Return size instead of storing through pointer.
8894         All callers changed.
8895         (deal_with_sparse): Don't keep reading after read errors.
8896         (finish_sparse_file): Just abort if there is an internal error.
8897         (dump_file): Fix typo: stat_warn and stat_error were interchanged.
8898         Don't restore access times on directories during incremental dumps
8899         until after dealing with the directory.
8900         If ignoring failed reads, count closedir, read, and unknown
8901         file errors as warnings, not errors.
8902         Fix buffer overrun problem when dumping sparse files.
8903
8904         * src/list.c (read_and):
8905         Invoke apply_nonancestor_delayed_set_stat on file names
8906         after handling them.
8907         (decode_mode): Remove; moved to misc.c.
8908
8909         * src/misc.c (safer_rmdir): New function.
8910         (remove_any_file): Use it to avoid problems with rmdir(".").
8911         (maybe_backup_file): Regularize diagnostics.
8912         (undo_backup_file): Likewise.
8913         (decode_mode): Moved here from list.c.
8914         (chmod_error_details, chown_error_details, close_fatal,
8915         close_warn, closedir_warn, mkdir_error, read_error_details,
8916         read_warn_details, read_fatal_details, seek_error_details,
8917         seek_warn_details, utime_error, write_error_details,
8918         write_fatal_details): New functions.
8919
8920         * src/delete.c (save_record): Remove static variable (now local).
8921         (move_archive): Don't position before start of archive.
8922         (write_record): Abort if count is zero at inopportune time.
8923         Plug memory leak.
8924
8925         * src/tar.c (decode_options): --delete and -f - are now
8926         incompatible, since we didn't have time to fix their bugs.
8927
8928         * tests/Makefile.am (TESTS): Remove delete02.sh.
8929         * tests/ignfail.sh: Adjust to new quoting scheme again.
8930
8931 2000-01-06  Paul Eggert  <eggert@twinsun.com>
8932
8933         * lib/getdate.y: Sync tm_diff with the GNU C Library.
8934         (TM_YEAR_BASE): Renamed from TM_YEAR_ORIGIN.  All uses changed.
8935         (tm_diff): Renamed from difftm.  All uses changed.
8936         Replace body with that taken from GNU C Library 2.1.3pre1.
8937         (get_date): Prefer tm_gmtoff to tm_diff if available.
8938
8939 1999-12-29  "Melissa O'Neill"  <oneill@cs.sfu.ca>
8940
8941         * tests/incremen.sh: Invoke stat on newly created file so that its
8942         ctime is updated on Nextstep.
8943
8944 1999-12-21  Machael Stone  <mstone@cs.loyola.edu>
8945
8946         * lib/getdate.y (get_date):
8947         Fix typo when checking for time_t overflow in time zone calculations.
8948
8949 1999-12-13  Paul Eggert  <eggert@twinsun.com>
8950
8951         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.16.
8952
8953         * README-alpha: New file.
8954         * README: New sections for gzip and bzip2, Solaris.
8955         Remove mention of BACKLOG.
8956
8957         * configure.in (AC_C_BACKSLASH_A): Add.
8958         (AC_CHECK_HEADERS): Add wchar.h.
8959         (AC_CHECK_FUNCS): Add mbrtowc.
8960         (AC_FUNC_CLOSEDIR_VOID): Add.
8961
8962         * tests/Makefile.am (TESTS): Add delete02.sh.
8963         (POSTPONED_TESTS): Remove.
8964         (EXTRA_DIST): Remove $(POSTPONED_TESTS).
8965
8966         * tests/preset.in:
8967         Set LC_ALL rather than LANGUAGE, LANG, and LC_MESSAGES.
8968
8969         * tests/ignfail.sh (err): Adjust to new quoting scheme.
8970
8971         * tests/delete02.sh: Fix typo: need to list archive2, not archive.
8972
8973         * tests/extrac03.sh: Use -P option, so that .. doesn't get diagnosed.
8974
8975         * src/tar.c ("quotearg.h"): New include.
8976         (usage): Now has __attribute__ ((noreturn)).
8977         (confirm): Report errno if we can't open tty.
8978         (confirm, decode_options):
8979         Quote arbitrary strings in diagnostics.
8980         (OVERWRITE_OPTION): New constant.
8981         (long_options, usage, decode_options): New --overwrite option.
8982         (decode_options): --keep-old-files, --overwrite, and --unlink-first
8983         are now mutually exclusive.
8984         Don't assume that gettext preserves errno.
8985         (main): Set default quoting style to escape_quoting_style.
8986
8987         * src/update.c (<quotearg.h>): New include.
8988         (append_file):
8989         Don't assume that gettext preserves errno.
8990         Quote arbitrary strings in diagnostics.
8991         Check for close error.
8992
8993         * src/names.c (<quotearg.h>): New include.
8994         (name_init, name_next, name_close, names_notfound,
8995         collect_and_sort_names): Don't assume that gettext preserves
8996         errno.  Quote arbitrary strings in diagnostics.
8997         (excluded_name): Fix typo that caused empty patterns to be
8998         mishandled.
8999
9000         * src/misc.c (<quotearg.h>): New include.
9001         (quote_copy_string): Quote only newline and backslash; the output is no
9002         longer meant for humans, and is locale-independent.
9003         (contains_dot_dot): New function.
9004         (remove_any_file): Don't use lstat; just rmdir the file and then use
9005         unlink if the rmdir fails because the file isn't a directory.
9006         Check for readdir and closedir errors.
9007         (maybe_backup_file): Report "stat" for stat errors.
9008         (maybe_backup_file, chdir_do):
9009         Quote arbitrary strings in diagnostics.
9010         (maybe_backup_file, undo_last_backup):
9011         Don't assume that gettext preserves errno.
9012         (call_arg_error, call_arg_fatal, call_arg_warn,
9013         chdir_fatal, close_error, closedir_error, exec_fatal, mkfifo_error,
9014         mknod_error, open_error, open_fatal, open_warn, opendir_error,
9015         opendir_warn, read_error, read_fatal, readdir_error, readdir_warn,
9016         readlink_error, readlink_warn, seek_error, seek_warn, stat_error,
9017         stat_warn, truncate_error, truncate_warn, unlink_error, waitpid_error,
9018         write_error, write_fatal, xfork, xpipe, quote_n, quote): New functions.
9019
9020         * src/system.h (__attribute__): New macro.
9021         (O_NDELAY, O_NONBLOCK, O_APPEND): Remove.
9022         (S_ISDOOR): New macro.
9023         (closedir): New macro, if CLOSEDIR_VOID.
9024
9025         * src/rmt.c, src/rtapelib.c (decode_oflag):
9026         O_APPEND might not be defined.
9027
9028         * src/list.c: (read_and, list_archive):
9029         Quote arbitrary strings in diagnostics.
9030         (from_header): Use locale_quoting_style to quote diagnostics.
9031         (print_header, print_for_mkdir): Quote with quotearg, not quote_copy_string.
9032
9033         * src/rmt.h (REM_BIAS): Increase from 128 to (1 << 30).
9034
9035         * src/Makefile.am: Use ## for copyright comments.
9036
9037         * src/extract.c (<quotearg.h>): New include.
9038         (enum permstatus): New enum.
9039         (struct delayed_set_stat): file_name is now at end of buffer, to avoid
9040         two mallocs.  New members file_name_len, invert_permissions, permstatus.
9041         (extr_init): Remove hack that silently adjusted newdir_umask.
9042         (set_mode, set_stat): New args invert_permissions, permstatus, typeflag.
9043         Use these args to decide whether and how to set modes.
9044         (set_mode, set_stat, prepare_to_extract, extract_sparse_file, extract_archive):
9045         Don't assume that gettext preserves errno.
9046         (set_stat): Remove arg symlink_flag; subsumed by typeflag.
9047         (delay_set_stat, repair_delayed_set_stat): New functions.
9048         (make_directories): Avoid mkdir where last part of path is "..".
9049         Create a struct delayed_set_stat for each directory made.
9050         (prepare_to_extract): Renamed from unlink_destination, and
9051         return 0 immediately if to_stdout_option; all callers changed.
9052         (maybe_recoverable): New parameter interdir_made.
9053         Add support for --overwrite.
9054         (extract_sparse_file, extract_archive):
9055         Quote arbitrary strings in diagnostics.
9056         (extract_archive): By default, warn about ".." in member names, and skip them.
9057         Don't open files with O_NONBLOCK or O_APPEND.
9058         Open with O_TRUNC only if --overwrite; otherwise, use O_EXCL to avoid
9059         overwriting them.  Pass only rwxrwxrwx permissions to `open' and `mkdir',
9060         minus the current umask.  Keep track of intermediate directories made,
9061         to avoid looping when making x/../x when x doesn't exist; the
9062         earlier code solved this in a different way that didn't fit well
9063         into the new scheme.  Don't extract permissions onto existing
9064         directories unless --overwrite is given.  Do not add -wx------
9065         permissions to new directories permanently; just do it temporarily.
9066         Remove no-longer-needed hack with MSDOS and directory time stamps.
9067         (apply_delayed_set_stat): New argument specifies which directories to
9068         fix statuses of.  Do not wait until the end of extraction to fix
9069         statuses; instead, fix a directory's status once we exit that directory.
9070         This requires less memory and does the right thing in some cases
9071         where the old method didn't.
9072         (fatal_exit): New function.
9073
9074         * src/incremen.c (<quotearg.h>): New include.
9075         (get_directory_contents, gnu_restore):
9076         Check for readdir and closedir errors.
9077         (get_directory_contents, read_directory_file, gnu_restore):
9078         Quote arbitrary strings in diagnostics.
9079         (get_directory_contents, read_directory_file, write_directory_file):
9080         Don't assume that gettext preserves errno.
9081
9082         * src/create.c (<quotearg.h>): New include.
9083         (start_header): Use `member names' to refer to archive member names, not
9084         `archive names'.  Warn about `..' in member names.
9085         (finish_sparse_file, dump_file):
9086         Quote arbitrary strings in diagnostics.
9087         (finish_sparse_file, dump_file):
9088         Don't assume that gettext preserves errno.
9089         (dump_file): Don't use `access' to determine whether a directory is readable;
9090         this isn't reliable if tar is setuid.  Use `opendir' instead.
9091         Check for readdir and closedir failures.
9092         Don't dump sockets as if they were fifos; just warn and skip.
9093
9094         * src/delete.c (move_archive):
9095         Don't report fatal error merely because sizes don't fit
9096         into struct mtop values; fall back on lseek instead.
9097         Say `Cannot' uniformly, instead of `Could not' sometimes and `Cannot' others.
9098         Say `reposition' instead of `re-position'.
9099         (delete_archive_members):
9100         Set archive to STDOUT_FILENO before outputting trailing buffer.
9101
9102         * src/compare.c (<quotearg.h>): New include.
9103         (diff_init): Use `Cannot' uniformly, instead of `Could not' sometimes
9104         and `Cannot' others.
9105         (report_difference, diff_archive):
9106         Quote arbitrary strings in diagnostics.
9107         (process_rawdata, diff_sparse_files, get_stat_data, diff_archive, seek_warn):
9108         Don't assume that gettext preserves errno.
9109         (diff_archive): Don't open regular files with O_NONBLOCK.
9110         Preserve access times of files if --atime.
9111
9112         * src/common.h (FATAL_ERROR): Use new fatal_exit function to exit.
9113         (FATAL_ERROR, USAGE): Don't return 0.
9114         (enum old files): New enum.
9115         (old_files_option): New variable, replacing keep_old_files_option and
9116         unlink_first_option.
9117         (apply_delayed_set_stat): Now takes char const * param.
9118         (fatal_exit, contains_dot_dot, chdir_fatal, close_error,
9119         closedir_error, exec_fatal, mkfifo_error, mknod_error, open_error,
9120         open_fatal, open_warn, opendir_error, opendir_warn, read_error,
9121         read_fatal, readdir_error, readdir_warn, readlink_error,
9122         readlink_warn, seek_error, seek_warn, stat_error, stat_warn,
9123         truncate_error, truncate_warn, unlink_error, waitpid_error,
9124         write_error, write_fatal, xfork, xpipe, quote, quote_n): New decls.
9125
9126         * src/buffer.c:
9127         (xclose, xdup2, child_open_for_compress, child_open_for_uncompress,
9128         archive_write_error, archive_read_error, flush_archive, close_archive,
9129         init_volume_number, new_volume):
9130         Don't assume that gettext preserves errno.
9131
9132         (xdup2): Don't report errno if dup returns an unexpected nonnegative value.
9133         (open_archive): Reject multivolume verify attempts a bit earlier.
9134         Rename local variable `access', in case it's defined by system header.
9135
9136         (open_archive, backspace_output): Use `Cannot' uniformly, instead of
9137         `Could not' sometimes and `Cannot' others.
9138
9139         (open_archive, flush_read, flush_archive, close_archive, new_volume):
9140         Quote arbitrary strings in diagnostics.
9141
9142         (read_error): Set archive to STDOUT_FILENO temporarily when writing
9143         archive buffer.
9144
9145         (init_volume_number): Check for input and output errors in volno_file.
9146
9147         (new_volume): Use new fatal_exit function to exit, and new xfork
9148         function to fork.
9149
9150         * m4/Makefile.am (EXTRA_DIST): Add c-bs-a.m4.
9151
9152         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/c-bs-a.m4.
9153
9154         * doc/tar.texi: Add --overwrite.
9155         --absolute-names rejects ".." in names.
9156
9157         * lib/quotearg.c: Add support for multibyte characters.
9158         (ISGRAPH): Remove.
9159         (ISPRINT): New macro.
9160         (<wchar.h>): Include if HAVE_MBRTOWC && HAVE_WCHAR_H.
9161         (isprint, mbrtowc, mbsinit, mbstate_t): New macros,
9162         defined if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
9163         (quotearg_buffer_restyled): New function, with most of the old
9164         quotearg_buffer's contents.
9165         Major rewrite to support multibyte characters.
9166         (quotearg_buffer): Now just calls quotearg_buffer_restyled.
9167
9168         * m4/c-bs-a.m4: New file.
9169
9170         * lib/Makefile.am: Use ## for copyright notice.
9171
9172         * scripts/Makefile.am: Use ## on copyright notice.
9173
9174         * doc/Makefile.am:
9175         ($(srcdir)/tar.info, tar.dvi): We now use texinfo 4.0.
9176
9177 1999-12-05  Paul Eggert  <eggert@twinsun.com>
9178
9179         * doc/ChangeLog, lib/ChangeLog, scripts/ChangeLog,
9180         src/ChangeLog, tests/ChangeLog: Remove these files.
9181         * ChangeLog.1: New file, incorporating the above files, plus old
9182         ChangeLog entries.
9183         * Makefile.am (EXTRA_DIST): Add ChangeLog.1.
9184
9185 1999-12-05  Dale Worley  <worley@ariadne.com>
9186
9187         * src/compare.c (<utime.h>, struct utimbuf): Add.
9188         (diff_archive): Restore access times if --atime.
9189         * doc/tar.texi: Explain that --atime also preserves modification time.
9190
9191 1999-12-04  Gerhard Poul  <gpoul@gnu.org>
9192
9193         * ABOUT-NLS: Update to latest version from ftp.gnu.org.
9194         * BACKLOG, TODO: Remove.
9195         * Makefile.am (all-local, BABYL, dist-zoo, id, ID): Remove.
9196         * README: Bring up to date.
9197
9198 1999-12-03  Paul Eggert  <eggert@twinsun.com>
9199
9200         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.15.
9201
9202         * src/compare.c (diff_archive):
9203         Do not set errno to EPIPE; we no longer use perror.
9204
9205         * src/create.c (dump_file):
9206         If a parent directory said that a file should be there but it is
9207         absent, diagnose it as being removed in the meantime.
9208         Do not pass meaningless errno to ERROR when reporting that the
9209         file changed as we read it.
9210         Report that a file changed if its ctime changes; this is more
9211         sensitive than mtime+size, and more accurate.
9212
9213         * src/incremen.c (enum children): New type.
9214         (struct directory): Change old char allnew member to new enum children
9215         children member.
9216         All uses changed.
9217         (get_directory_contents): When doing an incremental dump that does
9218         not cross filesystem boundaries, dump the mount points, even though
9219         they are in a different filesystem.  This is for convenience when
9220         restoring, and for consistency with non-incremental dumps.
9221         This requires a 3-way flag for keeping track of which children we want,
9222         so we use enum children rather than boolean.
9223
9224         * src/open3.c (modes): Remove.
9225         (open3): Remove unportable assumptions about flag encodings.
9226         Use `stat' instead of `access' for testing file existence,
9227         to avoid problems with setuid programs.
9228
9229         * src/names.c (name_next): If file names are given both in the
9230         command line (e.g. via -C) and in a file (via -T), do not
9231         ignore the command-line names.
9232
9233         * m4/uintmax_t.m4: Backport to autoconf 2.13.
9234
9235         * doc/tar.texi: Clarify getdate authorship.
9236
9237 1999-11-23  Paul Eggert  <eggert@twinsun.com>
9238
9239         * lib/Makefile.am (DISTCLEANFILES): New macro.
9240
9241         * configure.in (tar_fnmatch_hin):
9242         Remove; it runs afoul of a bug in autoconf 2.13.
9243         Instead, always link fnmatch.h to some file, even if it's a throwaway.
9244
9245 1999-11-19  Paul Eggert  <eggert@twinsun.com>
9246
9247         * m4/largefile.m4: Update serial.
9248
9249 1999-11-18  Paul Eggert  <eggert@twinsun.com>
9250
9251         * m4/largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Work around a bug in
9252         the QNX shell, which doesn't propagate exit status of failed
9253         commands inside shell assignments.
9254
9255 1999-11-07  Paul Eggert  <eggert@twinsun.com>
9256
9257         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.14.
9258
9259         * configure.in (AC_PREREQ): Bump to 2.13.
9260         (ALL_LINGUAS): Add pt_BR, ja.
9261         (AC_FUNC_FNMATCH): Remove lib/funmatch.h before invoking, not after.
9262         (tar_cv_path_RSH): Prefer a non-symlink rsh to a symlink one,
9263         for AIX crossbuilds.
9264
9265         * doc/tar.texi: New node create options for --ignore-failed-read.
9266         Remove unused version control symbols.
9267         Modernize texinfo usage.
9268
9269         * src/tar.c (usage): Add examples.
9270
9271         * m4/fnmatch.m4 (AC_FUNC_FNMATCH):
9272         Include fnmatch.h when testing fnmatch.
9273
9274         * src/common.h (collect_and_sort_names): New decl.
9275
9276         * src/list.c (from_header):
9277         Handle 32-bit two's complement negative time stamps
9278         even if the leading octal digit is 2 or 3.
9279
9280         * src/extract.c (set_stat): Remove duplicate code.
9281
9282         * src/create.c (to_chars): Remove trailing newline from warning.
9283         (dump_file): Ignore doors.
9284         (finish_header): Report block numbers with origin 0, not origin 1.
9285
9286         * src/rmt.c: Include getopt.h.
9287         (long_opts): New constant.
9288         (usage): New function.
9289         (main): Implement --help and --version.
9290         Output usage message if arguments are bad.
9291
9292 1999-10-10  Paul Eggert  <eggert@twinsun.com>
9293
9294         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.13.
9295
9296         * README: Remove --with-dmalloc.
9297         Add --disable-largefile.
9298         Remove old NeXT dirent problems, or AIX valloc problems.
9299         Remove old union wait advice, and old %lld advice.
9300         Remove advice about FreeBSD 2.1.7, ISC 4.1mu, Ultrix `make'.
9301
9302         * doc/tar.texi: Clarify documentation for portable file names.
9303
9304         * configure.in (AM_WITH_DMALLOC): Remove.
9305         (ALL_LINGUAS): Add ja.
9306
9307         * src/tar.c (decode_options):
9308         Invalid dates are now treated as (time_t) -1.
9309         Redo version message to conform to GNU standards.
9310
9311         * src/create.c (dump_file):
9312         Fix typo: last two args to dump_file were interchanged.
9313         * src/update.c (update_archive): Likewise.
9314
9315         * src/common.h (tartime): New decl.
9316
9317         * src/list.c (tartime): Now extern.
9318         (read_and): Invalid headers cause errors, not warnings.
9319
9320 1999-10-03  Paul Eggert  <eggert@twinsun.com>
9321
9322         * lib/getdate.y (__attribute__):
9323         Don't use if GCC claims to be before 2.8; this is
9324         needed for OPENStep 4.2 cc.  Also, don't use if strict ANSI.
9325
9326 1999-09-25  Paul Eggert  <eggert@twinsun.com>
9327
9328         * lib/fnmatch.c, lib/fnmatch.hin: Merge changes from latest glibc.
9329         * lib/getopt.c, lib/getopt.h, lib/getopt1.c: Likewise.
9330
9331         * tests/incremen.sh: Add yet another sleep.
9332
9333 1999-09-24  Paul Eggert  <eggert@twinsun.com>
9334
9335         * NEWS: A read error now causes a nonzero exit status.
9336
9337         * src/create.c (to_chars): Fix base-256 output.
9338
9339         * src/buffer.c (write_error):
9340         Read error is an error, not just a warning.
9341
9342 1999-09-24  Paul Eggert  <eggert@twinsun.com>
9343
9344         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.12.
9345
9346         * src/tar.c (<time.h>): Include.
9347         (time): Declare if not defined.
9348         (confirm): Don't read past EOF.
9349         (long_options, usage): Add --no-same-owner, --no-same-permissions.
9350         (main): Use clock_gettime if available.
9351
9352         * tests/Makefile.am (TESTS): Add incremen.sh
9353         (INCLUDES): Add -I../lib, for fnmatch.h.
9354
9355         * src/update.c (update_archive):
9356         Remove call to name_expand; had no effect.
9357         Use chdir_do to change into directory.
9358         Use deref_stat instead of stat.
9359         Use add_avoided_name to mark names to be avoided; the old method of
9360         setting a bit with the name caused all descendants of that name to
9361         be avoided, in some circumstances.
9362
9363         * tests/incremen.sh: Remove unnecessary sleeps.
9364
9365         * src/names.c (name_next): Go back to using plain chdir.
9366         (name_gather): Use chdir_arg to keep track of arguments to chdir.
9367         (addname): Likewise.
9368         (name_match): Use chdir_do to act on chdir args.
9369         (merge_sort): Moved here from incremen.c.
9370         (compare_names, add_hierarchy_to_namelist, collect_and_sort_names):
9371         Likewise.
9372         (name_expand): Remove.
9373         (name_from_list): Skip fake names.
9374         Use chdir_do to act on chdir args.
9375         (struct avoided_name): New struct.
9376         (avoided_names): New var.
9377         (add_avoided_name, is_avoided_name): New functions.
9378
9379         * src/system.h (stat, lstat): Define in terms of statx on
9380         STX_HIDDEN && !_LARGE_FILES /* AIX */ hosts.
9381         (UCHAR_MAX): New macro.
9382         (TYPE_MAXIMUM): Cast to arg type, for types narrow than int.
9383
9384         * m4/largefile.m4: Work around GCC 2.95.1 bug with HP-UX 10.20.
9385
9386         * src/incremen.c (<time.h>): Remove include; no longer used.
9387         (time): Remove decl.
9388         (time_now): Remove.
9389         (get_directory_contents): Use deref_stat.
9390         Consider a subdirectory to be all new only if
9391         listed_incremental_option or if it its timestamp is newer than the
9392         cutoff.
9393         (add_hierarchy_to_namelist, merge_sort): Move to names.c.
9394         (read_directory_file): Now extern.  Do not set time_now.
9395         (write_directory_file): Renamed from write_dir_file.
9396         Use start_time instead of time_now.
9397         (compare_names, collect_and_sort_names): Move to names.c.
9398
9399         * src/mangle.c (<time.h>): Remove; not used.
9400         (time): Do not declare.
9401
9402         * src/misc.c (chdir_from_initial_wd): Remove.
9403         (deref_stat): New function.
9404         (struct wd): New struct.
9405         (wd, wds, wd_alloc): New variables.
9406         (chdir_arg, chdir_do): New function.
9407
9408         * src/compare.c (get_stat_data): Use deref_stat.
9409
9410         * src/common.h (name_expand): Remove.
9411
9412         * src/list.c (time): Declare if not defined.
9413         (base_64_digits): Moved here from create.c.
9414         (base64_map): Use UCHAR_MAX for size, not less-clear (unsigned char)
9415         -1.
9416         (read_and): Don't get time from header unless we need it now;
9417         as getting time can cause duplicate diagnostics if bogus.
9418         Remove "Hmm, " from diagnostic.
9419         Use "Skipping to next header" uniformly.
9420         (from_header): Renamed from from_chars.  All uses changed.
9421         Allow different forms for unportable 2's complement numbers.
9422         Don't check for extended forms when parsing checksums.
9423         Parse base-256 output.
9424         (gid_from_header): Renamed from gid_from_chars.  All uses changed.
9425         (major_from_header): Renamed from major_from_chars.  All uses changed.
9426         (minor_from_header): Renamed from minor_from_chars.  All uses changed.
9427         (mode_from_header): Renamed from mode_from_chars.  All uses changed.
9428         (off_from_header): Renamed from off_from_chars.  All uses changed.
9429         (size_from_header): Renamed from size_from_chars.  All uses changed.
9430         (time_from_header): Renamed from time_from_chars.  All uses changed.
9431         Warn about future timestamps.
9432         (uid_from_header): Renamed from uid_from_chars.  All uses changed.
9433         (uintmax_from_header): Renamed from uintmax_from_chars.
9434         All uses changed.
9435         (tartime): New function, incorporating isotime.
9436         (isotime): Delete.
9437         (print_header): Use tartime.
9438
9439         * src/create.c (to_chars): Fix typo in decl.
9440         Don't assign through char const *.
9441         Rename name_expand back to collect_and_sort_names.
9442
9443         * src/extract.c (<time.h>): No need to include.
9444         (time): No need to declare.
9445         (now): Remove variable.
9446         (extr_init): Don't initialize `now'.
9447         Increment same_permissions_option and same_owner_option if we_are_root
9448         is nonzero; this supports the new --no-same-owner option.
9449         (set_stat): Use start_time instead of `now'.
9450
9451         * src/create.c (struct link): Remove unused linkcount member.
9452         (base_64_digits): Move to list.c.
9453         (base_8_digits): Remove.
9454         (to_octal): New function, with some of old contents of to_base.
9455         (to_base): Remove.
9456         (to_base256): New function.
9457         (to_chars): Use base 256, not base 64, for huge values.
9458         (mode_to_chars): Don't use two's complement in GNU format or POSIX
9459         format.
9460         (dump_file): Interchange last two arguments. If TOP_LEVEL is negative,
9461         it means we have an incremental dump where we don't know whether this
9462         is a top-level call.
9463         Use deref_stat instead of statx / stat / lstat.
9464         Cast result of alloca.
9465         Check for dates if 0 < top_level, not if listed_incremental_option.
9466         Move multiple-link check after directory check.
9467         Do not dump avoided names.
9468         Dump hard links to symbolic names as links, not as separate
9469         symbolic links.
9470         start_header cannot return a null pointer, so don't test for it.
9471         Likewise for find_next_block.
9472
9473         * src/buffer.c, src/common.h (<human.h>): Include.
9474         (read_error): Read error is an error, not just a warning.
9475         (print_total_written): Also print human-readable byte count, and
9476         bytes/s.
9477         (open_archive, flush_write): Use start_time, not current time.
9478         (flush_read): Report about garbage bytes ignored at end of archive,
9479         but act on non-garbage bytes (instead of ignoring them).
9480         (new_volume): Use WARN for warnings.
9481
9482         * doc/Makefile.am:
9483         ($(srcdir)/tar.info): Add -I$(srcdir) so that subdir builds work.
9484
9485         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/fnmatch.m4.
9486
9487         * m4/Makefile.am (EXTRA_DIST): Add fnmatch.m4.
9488
9489         * lib/Makefile.am (noinst_HEADERS):
9490         Rename fnmatch.h to fnmatch.hin; add human.h.
9491         (libtar_a_SOURCES): Add human.c, xstrtoul.c.
9492         (INCLUDES): Remove -I.. -I$(srcdir) -- automake adds this for us.
9493
9494         * src/Makefile.am (rmt_LDADD, tar_LDADD): New macros.
9495
9496         * lib/fnmatch.c (strchrnul):
9497         Define to __strchrnul if _LIBC, to our own replacement otherwise.
9498         Do not define if !_LIBC and if it already exists.
9499         (internal_fnmatch): Use it.
9500
9501         * configure.in (tar_LDADD): New variable, used only when linking tar.
9502         (rmt_LDADD): Similarly, for rmt.
9503         (AC_FUNC_FNMATCH): Link fnnmatch.hin to fnmatch.h if we're using our
9504         fnmatch.c; otherwise, use the system fnmatch.h.
9505
9506         * doc/tar.texi: Add --no-same-owner, --no-same-permissions.
9507         Modernize sample backup script.
9508
9509         * THANKS: Martin Goik's email address has changed.
9510
9511         * m4/fnmatch.m4: New file.
9512
9513 1999-09-03  Paul Eggert  <eggert@twinsun.com>
9514
9515         * lib/lchown.h (ENOSYS): Don't use ENOMSG; it's not in NeXTStep3.3.
9516         Use EINVAL instead.
9517
9518 1999-08-29  Paul Eggert  <eggert@twinsun.com>
9519
9520         * lib/getdate.y (get_date):
9521         Rename outermost local `probe' to `quarter'.
9522         Rename latter local `tm' to probe_tm.
9523         From: Jim Meyering <meyering@ascend.com>
9524         Message-ID: <uryn1vafyyc.fsf@ixi.eng.ascend.com>
9525
9526 1999-08-28  Paul Eggert  <eggert@twinsun.com>
9527
9528         * lib/getdate.y (PC): New macro; use it when possible.
9529         (number): Handle `Nov 11 1996' example correctly.
9530         See Risks Digest 20.55 (1999-08-27)
9531         http://catless.ncl.ac.uk/Risks/20.55.html#subj18
9532
9533 1999-08-23  Paul Eggert  <eggert@twinsun.com>
9534
9535         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.11.
9536
9537         Remove minor cases of lint from many source files: this includes
9538         unnecessary casts, uses of NULL, etc.
9539
9540         * configure.in (AC_PROG_YACC): Remove.
9541         (YACC): Always use bison.
9542         (AC_STRUCT_TIMEZONE): Add.
9543         (AC_REPLACE_FUNCS): Add strcasecmp, strncasecmp.
9544
9545         * doc/tar.texi: --bzip2 is now -I.  Remove obsolete time zone info.
9546         Fix spelling.
9547
9548         * lib/Makefile.am (EXTRA_DIST): Add strcasecmp.c, strncasecmp.c.
9549         ($(srcdir)/getdate.c): Rename y.tab.c to getdate.c only if successful.
9550
9551         * lib/strcasecmp.c, lib/strncasecmp.c: New files.
9552
9553         * src/common.h (merge_sort): Remove decl; no longer exported.
9554
9555         * src/system.h (voidstar): Remove.
9556         (memcpy, memcmp): Cast args.
9557         ("xalloc.h"): Add include.
9558         (xmalloc, xrealloc): Remove decl.
9559
9560         * src/mangle.c (time): Do not declare if defined.
9561         (first_mangle, mangled_num): Remove.
9562
9563         * src/list.c (from_chars): Report out-of-range values more precisely.
9564         (off_from_chars): Do not allow negative offsets.
9565         (uid_from_chars): Allow negative uids.
9566
9567         * src/create.c (linklist): Now static.
9568         (to_chars): Fix wording of message to match from_chars.
9569
9570         * src/misc.c (merge_sort): Move to incremen.c.
9571         * src/incremen.c (merge_sort): Move here from misc.c; now static.
9572         It's too painful to make it both generic and portable.
9573         (read_directory_file): "timestamp" -> "time stamp" in messages.
9574
9575         * src/tar.c (long_options, usage, main): -y is now -I (for --bzip).
9576         (usage): Fix misspelling.
9577         (OPTION_STRING): -y is now -I.
9578         (decode_options): Use -1, not EOF, for getopt_long result.
9579         Fix typo when invoking xstrtoumax: look for LONGINT_OK, not LONG_MAX.
9580         Handle operands after any "--" argument.
9581         (main): Report any output errors.
9582
9583         * src/rmt.c (main): status is ssize_t, not long.
9584
9585         * src/names.c (name_gather): Handle trailing -C option correctly.
9586         (addname): use memcpy, not strncpy, to copy a string of known length.
9587         (name_match): Handle trailing -C option correctly.
9588         Propagate -C option to following files.
9589         (name_match, name_scan): Remove redundant matching code.
9590
9591         * src/buffer.c (open_archive): Use American spelling in diagnostic.
9592
9593         * lib/getdate.y: Major rewrite.  Add copyright notice.
9594         (<stdio.h>): Include only if testing.
9595         (ISUPPER): Remove.
9596         (ISLOWER): New macro.
9597         (<string.h>): Include if HAVE_STRING_H, not USG.
9598         (bcopy): Remove.
9599         (yymaxdepth, ..., yycheck): Don't bother to redefine, since we assume
9600         bison.
9601         (EPOCH_YEAR): Renamed from EPOCH.
9602         (table): Renamed from TABLE.
9603         (meridian): Now an anonymous enum.
9604         (struct parser_control): New type.
9605         (YYLEX_PARAM, YYPARSE_PARAM, YYSTYPE): New macros.
9606         (yyInput, ..., yyRelYear): Migrated into struct parser_control.
9607         (%pure_parser): Added, so that the parser is pure.
9608         (%union): Removed; the type is now just plain int.
9609         All %type directives removed.
9610         (tLOCAL_ZONE): New %token.
9611         (month_day_table): Renamed from MonthDayTable.
9612         (gmtime, localtime, mktime, time): Declare only if not defined.
9613         (meridian_table): New table.
9614         (dst_table): New table.
9615         (units_table): renamed from UnitsTable.
9616         (relative_time_table): Renamed from OtherTable.
9617         (time_zone_table): Renamed from TimezoneTable.  Modernized.
9618         (military_table): Renamed from MilitaryTable.
9619         (to_hour): Renamed from ToHour.
9620         (to_year): Renamed from ToYear.
9621         (lookup_zone): New function.
9622         (LookupWord): Renamed from lookup_word.  Use lookup_zone for time
9623         zones.
9624         (yylex): Now reentrant.  All callers changed.
9625         (get_date): Add support for local time zone abbreviations.
9626         Make it reentrant.
9627
9628 1999-08-20  Paul Eggert  <eggert@twinsun.com>
9629
9630         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.10.
9631
9632         * src/create.c (to_chars): Generate GNU base-64 representation
9633         if we are generating an old or new GNU format tar file for a
9634         number that can't be represented with the POSIX format.
9635
9636         * configure.in (AC_CHECK_FUNCS): Add fchdir.
9637         (AM_FUNC_GETLINE): Add.
9638         (LIBOBJS): Add getline.o to workaround comment.
9639         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/getline.m4.
9640         * m4/Makefile.am (EXTRA_DIST): Add getline.m4.
9641         * lib/Makefile.am (noinst_HEADERS): Add getline.h, save-cwd.h.
9642         (libtar_a_SOURCES): Add save-cwd.c, xgetcwd.c.
9643         * lib/getline.c, lib/getline.h, lib/save-cwd.c,
9644         lib/save-cwd.h, m4/getline.m4: New files.
9645
9646         * src/misc.c (<save-cwd.h>): Include.
9647         (chdir_from_initial_wd): New function.
9648
9649         * src/names.c (name_next): Use chdir_from_initial_wd, not chdir.
9650         (name_gather): Handle `-C x -C y' correctly.
9651         Do not rely on addname to handle -C.
9652         (addname): New CHANGE_DIR parameter.  All callers changed.
9653         Remove ugly calls to getcwd; no longer needed.
9654         (name_match, name_from_list): Use chdir_from_initial_wd, not chdir.
9655
9656         * src/incremen.c (listed_incremental_stream): New var.
9657         (read_directory_file): Remove arbitrary limits on file name length.
9658         Do not attempt to get the working directory; we can bypass this
9659         on fchdir hosts.  Open the listed_incremental_option file for both
9660         read and write instead of opening it twice.  Check for I/O errors
9661         when doing I/O to this file.  Check for invalid data in the file,
9662         and report line numbers of invalid data.
9663         (write_dir_file): Likewise.
9664         (collect_and_sort_names): Use chdir_from_initial_wd, not chdir.
9665         Do not invoke write_dir_file; that's our caller's responsibility.
9666
9667         * src/list.c (max): New macro.
9668         (isotime): Now takes time_t, not time_t *.  Report the decimal values
9669         of times that can't be broken down.
9670         (print_header): Don't assume that major and minor device numbers can
9671         fit into uintmax_t.
9672
9673         * src/common.h (struct name): change_dir is now char const *.
9674         (write_directory_file): Remove unused decl.
9675         (STRINGIFY_BIGINT): Assume b always points to UINTMAX_STRSIZE_BOUND
9676         chars; the old `sizeof (b)' broke when b was a pointer not an array.
9677         (chdir_from_initial_wd): New decl.
9678         (addname): New 2nd arg.
9679
9680         * THANKS: Torsten Lull -> Catrin Urbanneck
9681
9682 1999-08-18  Paul Eggert  <eggert@twinsun.com>
9683
9684         * configure.in (HAVE_GETHOSTENT, HAVE_SETSOCKOPT):
9685         Don't depend on ac_cv_func variables.
9686         From Albert Chin-A-Young <china@thewrittenword.com>.
9687
9688 1999-08-18  Paul Eggert  <eggert@twinsun.com>
9689
9690         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.9
9691
9692         * m4/signedchar.m4: New file.
9693         * configure.in (pe_AC_TYPE_SIGNED_CHAR): Add.
9694         * src/system.h (signed_char): New macro.
9695         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/signedchar.m4.
9696         * m4/Makefile.am (EXTRA_DIST): Add signedchar.m4.
9697
9698         * src/create.c (write_eot): Write at least two zero blocks.
9699
9700         * src/extract.c (extract_archive): Fix sparse array bug:
9701         we did not find end of array correctly.
9702
9703         * src/compare.c: (fill_in_sparse_array, diff_sparse_files):
9704         Don't assume find_next_block yields nonnull.
9705         * src/extract.c (extract_sparse_file, extract_archive): Likewise.
9706         * src/list.c (skip_extended_headers): Likewise.
9707
9708         * src/list.c (read_and, list_archive): Simplify code.
9709         (read_header): Fix computation of signed checksums on machines where
9710         char is unsigned.
9711         Do not consider a block to be zero unless all its bytes are zero,
9712         even the checksum bytes.  Do not attempt to parse the checksum of
9713         a zero block.  Fix memory leak with long names and links.
9714         (from_chars): Accommodate a buggy tar that outputs leading NUL
9715         if the previous field overflows.
9716
9717         * src/misc.c (quote_copy_string): Generate \177 for '\177', not
9718         \?, for portability to non-ASCII hosts.
9719
9720 1999-08-16  Paul Eggert  <eggert@twinsun.com>
9721
9722         * configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.8.
9723
9724         * src/extract.c (make_directories): Do not chown intermediate
9725         directories, even if we are root.
9726
9727         * src/list.c (read_header): Fix bugs when interpreting
9728         POSIX-compliant headers that do not contain null bytes in the
9729         header or link names.
9730
9731 1999-08-14  Paul Eggert  <eggert@twinsun.com>
9732
9733         * configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.7.
9734
9735         * configure.in (AC_CHECK_HEADERS): Remove sys/wait.h.
9736         (AC_HEADER_SYS_WAIT): Add.
9737         (AC_REPLACE_FUNCS): Add waitpid.
9738         (tar_cv_header_union_wait, HAVE_UNION_WAIT): Remove.
9739         * lib/waitpid.c: New file.
9740         * lib/Makefile.am (EXTRA_DIST): Add waitpid.c.
9741         * src/system.h (WCOREDUMP): Remove; no longer used.
9742         (WIFSTOPPED): Likewise.
9743         (WEXITSTATUS, WIFSIGNALED): Default to Solaris 7 versions.
9744         * src/buffer.c (child_open_for_compress): Undo previous change.
9745         (close_archive): Use waitpid, POSIX-style, instead of old BSD style.
9746         (new_volume): Likewise.
9747
9748         * src/buffer.c, src/extract.c, src/incremen.c (time):
9749         Don't declare if defined.
9750         * src/extract.c (extr_init): Remove unneeded cast around 0 arg to time.
9751         * src/incremen.c (read_directory_file):
9752         Invoke `time' the same way everyone else does.
9753         Check validity of --listed-incremental file contents a bit better.
9754         Do not worry about --after-date-option; tar.c now checks this.
9755         * src/list.c (isotime): Report ??? if localtime returns null.
9756         Don't assume years fit into four digits.
9757         Don't append trailing newline.
9758         (print_header): Report ??? if localtime returns null;
9759         Don't assume years fit into four digits.
9760
9761         * src/compare.c (diff_archive): Do not fall back on absolute name
9762         when --absolute-names is not specified.
9763
9764         * src/create.c (start_header):
9765         Include text of ignored filesystem prefix in warning.
9766         (create_archive): Check for excluded names when doing incremental
9767         pass through directory.
9768         (dump_file): Do not dump old files explicitly given on command line
9769         when using --listed-incremental.  Do not strip ./ prefix from names.
9770
9771         * src/tar.c: -g now implies after_date_option = 1.
9772         -g and -N are now incompatible options.
9773
9774         * doc/tar.texi: Explain --exclude better.  Don't strip leading `./'.
9775
9776 1999-08-11  Jeff Dairiki  <dairiki@dairiki.org>
9777
9778         * src/list.c (read_header): Don't parse OLDGNU_FORMAT
9779         incremental headers as POSIX prefixes.
9780
9781 1999-08-11  Paul Eggert  <eggert@twinsun.com>
9782
9783         * NEWS, configure.in: Version 1.13.6.
9784
9785         * configure.in (ALL_LINGUAS): Add pt_BR.
9786         * po/pt_BR.po: New file.
9787
9788         * doc/Makefile.am ($(srcdir)/tar.info, $(srcdir)/header.texi):
9789         Renamed from tar.info and header.texi; adjust actions so that
9790         they work in other directories.
9791
9792         * doc/tar.texi: Add -y and --bzip2.
9793         Patterns containing / now exclude only file names whose prefix match.
9794
9795         * lib/exclude.h (excluded_filename): New option parameter.
9796         (add_exclude_file): New ADD_FUNC parameter.
9797         (excluded_pathname): Remove decl.
9798         * lib/exclude.c (_GNU_SOURCE):
9799         Remove; no longer needed since we don't use FNM_ macros.
9800         (excluded_filename): Renamed from excluded_filename_opts.
9801         (excluded_filename, excluded_pathname): Remove.
9802         (add_exclude_file): New ADD_FUNC parameter.
9803
9804         * po/POTFILES.in: Add lib/quotearg.c.
9805
9806         * src/buffer.c (_GNU_SOURCE): Define.
9807         (<fnmatch.h>): Include unconditionally.
9808         (child_open_for_compress): Dup after closing, to avoid possible file
9809         descriptor exhaustion.
9810         (flush_write): Use FILESYSTEM_PREFIX_LEN instead of MSDOS ifdef.
9811         (flush_read): Likewise.
9812
9813         * src/common.h (LG_8, LG_64): New macros.
9814         (excluded_with_slash, excluded_without_slash): New vars.
9815         (excluded): Remove.
9816         (base_64_digits): New decl.
9817         (gid_to_chars, major_to_chars, minor_to_chars, mode_to_chars,
9818         off_to_chars, size_to_chars, time_to_chars, uid_to_chars,
9819         uintmax_to_chars,
9820         GID_TO_CHARS, MAJOR_TO_CHARS, MINOR_TO_CHARS, MODE_TO_CHARS,
9821         OFF_TO_CHARS, SIZE_TO_CHARS, TIME_TO_CHARS, UID_TO_CHARS,
9822         UINTMAX_TO_CHARS):
9823         Renamed from gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct,
9824         off_to_oct, size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct,
9825         GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT, MODE_TO_OCT, OFF_TO_OCT,
9826         SIZE_TO_OCT, TIME_TO_OCT, UID_TO_OCT, UINTMAX_TO_OCT,
9827         respectively.  All definitions and uses changed.
9828         (excluded_name): New decl.
9829
9830         * src/compare.c (diff_archive):
9831         Open files with O_NONBLOCK instead of O_NDELAY.
9832
9833         * src/create.c (base_64_digits): New constant.
9834         (base_8_digits): New macro.
9835         (MAX_VAL_WITH_DIGITS): New macro.
9836         (to_base): First half of old to_oct.  Support base 64 too.
9837         (to_chars): Other half of old to_oct, for 64-bit support.
9838         (GID_NOBODY, UID_NOBODY): Don't define if the headers don't.
9839         (gid_substitute, uid_substitute): Look up names dynamically if
9840         GID_NOBODY and UID_NOBODY aren't defined; use -2 if all else fails.
9841         (mode_to_chars): Renamed from mode_to_oct.
9842         Support negative values in all the _to_chars functions.
9843         (start_header): Use FILESYSTEM_PREFIX_LEN instead of MSDOS ifdef.
9844         Abort if archive format is DEFAULT_FORMAT when it shouldn't be.
9845         (dump_file): Inspect entire pathname, not just new file name
9846         component, when deciding whether to exclude it.
9847
9848         * src/extract.c (extract_archive):
9849         Open files with O_NONBLOCK instead of O_NDELAY.
9850
9851         * src/incremen.c (get_directory_contents):
9852         Inspect entire pathname, not just new file name
9853         component, when deciding whether to exclude it.
9854
9855         * src/list.c (<fnmatch.h>): Do not include.
9856         (from_chars): Renamed from from_oct.  New parameter specifying
9857         the negative of the minimum allowed value.  Support negative
9858         and base-64 values.
9859         (base64_map): New var.
9860         (base64_init): New function.
9861         (print_header): Output numeric uids and gids if numeric_owner_option.
9862
9863         * src/misc.c (quote_copy_string): Use LG_8 instead of constants.
9864
9865         * src/names.c (_GNU_SOURCE): Define.
9866         (<fnmatch.h>): Include unconditionally.
9867         (excluded_name): New function, taking over duties of excluded_pathname.
9868         All uses changed.
9869
9870         * src/rmt.c (decode_oflag): New function.
9871         (main): Use it to support symbolic open flags.
9872
9873         * src/rtapelib.c (encode_oflag): New function.
9874         (rmt_open__): Do not allow newlines in the path.
9875         Propagate errno correctly.
9876         Decode symbolic open flags, if present.
9877
9878         * src/system.h (FILESYSTEM_PREFIX_LEN, ISSLASH, O_ACCMODE, O_NONBLOCK):
9879         New macros.
9880
9881         * src/tar.c: (long_options, usage, OPTION_STRING, decode_options):
9882         New -y or --bzip2 option.
9883         (add_filtered_exclude): New function.
9884         (decode_options): Put excluded patterns with / into
9885         excluded_with_slash, and without / into excluded_without_slash.
9886         Compare newer_mtime_option to its new initial value
9887         TYPE_MINIMUM (time_t) when deciding whether more than one
9888         threshold date was specified.
9889
9890 1999-07-20  Paul Eggert  <eggert@twinsun.com>
9891
9892         * NEWS, configure.in: Version 1.13.5.
9893
9894         * src/common.h (FATAL_ERROR): Invoke apply_delayed_set_stat
9895         before exiting.
9896         * src/buffer.c (new_volume): Likewise.
9897         * src/incremen.c (read_directory_file): Likewise.
9898         * src/tar.c (decode_options):
9899         ERROR ((TAREXIT_FAILURE, ... -> FATAL_ERROR ((0,
9900         for consistency.
9901
9902         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.4.
9903         * configure.in (AC_CHECK_FUNCS): Add lstat, readlink, symlink.
9904
9905         * src/system.h (lstat): Define only if !HAVE_LSTAT && !defined lstat.
9906         (S_ISMPB, S_ISMPC, S_ISNWK): Remove unused macros.
9907         (S_ISBLK, S_ISCHR, S_ISCTG, S_ISFIFO, S_ISLNK, S_ISSOCK):
9908         Define to 0 if the corresponding S_IF* macro is not defined.
9909         (mkfifo): Do not define if already defined, or if S_IFIFO
9910         is not defined.
9911
9912         * src/compare.c (diff_archive): Use HAVE_READLINK, not
9913         S_ISLNK, to determine whether to invoke readlink.
9914         * src/create.c (dump_file): Likewise.
9915
9916         * src/extract.c (set_mode):
9917         Do not chmod unless we are root or the -p option was given;
9918         this matches historical practice.
9919         (unlink_destination): New function, which checks for unlink failures.
9920         (maybe_recoverable): Stay quiet if -U.
9921         (extract_archive): Use O_EXCL if unlink_first_option.
9922         Report unlink failures.
9923         Use HAVE_SYMLINK, not S_ISLNK, to determine whether symlink exists.
9924         Use HAVE_MKFIFO || defined mkfifo, not S_ISFIFO, to determine whether
9925         mkfifo exists.
9926
9927         * src/incremen.c (get_directory_contents): Depend on
9928         S_ISHIDDEN, not AIX, to determine whether to invoke S_ISHIDDEN.
9929
9930         * src/list.c: Remove S_IS* ifdefs.
9931         * src/misc.c (maybe_backup_file): Likewise.
9932
9933         * src/misc.c (maybe_backup_file):
9934         "Virtual memory exhausted" -> "Memory exhausted",
9935         to conform to the other places this message is issued.
9936
9937         * src/mangle.c (extract_mangle):
9938         Replace #ifdef S_ISLNK with #ifdef HAVE_SYMLINK.
9939
9940         * src/rtapelib.c (rmt_open__):
9941         Remove typo that caused us to omit the first char
9942         of the basename.
9943
9944 1999-07-16  Paul Eggert  <eggert@twinsun.com>
9945
9946         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.13.3.
9947
9948         * doc/tar.texi: A path name is excluded if any of its file name
9949         components matches an excluded pattern, even if the path name was
9950         specified on the command line.
9951         * src/create.c (create_archive): Likewise.
9952         * src/list.c (read_and): Likewise.
9953         * src/update.c (update_archive): Likewise.
9954         * lib/exclude.h (excluded_pathname): New decl.
9955         * lib/exclude.c (_GNU_SOURCE): Define.
9956         (FILESYSTEM_PREFIX_LEN, ISSLASH): New macros.
9957         (excluded_filename_opts): New function.
9958         (excluded_pathname): New function.
9959
9960         * lib/Makefile.am (EXTRA_DIST):
9961         xstrtol.c moved here from libtar_a_SOURCES.
9962         (libtar_a_SOURCES): Move xstrtol.c to EXTRA_DIST.
9963         Remove xstrtoul.c; no longer needed.
9964         * lib/xstrtol.c: Remove.
9965
9966         * src/tar.c (decode_options):
9967         Set newer_time_option to TYPE_MINIMUM, so that
9968         negative timestamps are handled correctly.
9969         Replace invocations of xstrtol and xstrtoul with xstrtoumax, for
9970         uniformity (and so that we don't need to have the other fns).
9971         (main): Remove call to init_total_written; no longer needed.
9972
9973         * configure.in (AC_CHECK_SIZEOF): Remove no-longer-needed
9974         checks for unsigned long and long long.
9975         * src/arith.c: Remove.
9976         * src/Makefile.am (tar_SOURCES): Remove arith.c.
9977         * po/POTFILES.in: Remove src/arith.c.
9978         * src/arith.h: Use double, to simplify configuration gotchas.
9979         (tarlong): Now double.
9980         (TARLONG_FORMAT): New macro.
9981         (BITS_PER_BYTE, BITS_PER_TARLONG, SUPERDIGIT, BITS_PER_SUPERDIGIT,
9982         LONGS_PER_TARLONG, SIZEOF_TARLONG, struct tarlong,
9983         zerop_tarlong_helper, lessp_tarlong_helper, clear_tarlong_helper,
9984         add_to_tarlong_helper, mult_tarlong_helper, print_tarlong_helper,
9985         zerop_tarlong, lessp_tarlong, clear_tarlong, add_to_tarlong,
9986         mult_tarlong, print_tarlong): Remove.  All callers replaced with
9987         arithmetic ops.
9988
9989         * src/common.h (init_total_written): Remove decl.
9990
9991         * src/buffer.c (total_written):
9992         Remove; replaced with prev_written + bytes_written.
9993         (prev_written): New var.
9994         (init_total_written): Remove.
9995         (print_total_written): Use TARLONG_FORMAT instead of print_tarlong.
9996
9997         * m4/ulonglong.m4 (jm_AC_TYPE_UNSIGNED_LONG_LONG):
9998         Make sure that we can shift, multiply
9999         and divide unsigned long long values; Ultrix cc can't do it.
10000
10001         * lib/modechange.c (mode_compile): Use uintmax_t, not unsigned long.
10002         Check for any unknown bits, not just unknown bits left of the leftmost
10003         known bit.
10004
10005         * lib/quotearg.c (quotearg_buffer):
10006         Don't quote spaces if C quoting style.
10007         * src/list.c (from_oct):
10008         Use C quoting style for error; omit trailing NULs.
10009
10010 1999-07-14  Paul Eggert  <eggert@twinsun.com>
10011
10012         * configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.2.
10013
10014         * m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX): Check whether
10015         <inttypes.h> defines strtoumax as a macro (and not as a function).
10016         HP-UX 10.20 does this.
10017
10018         * src/tar.c (usage): tar-bugs@gnu.org -> bug-tar@gnu.org
10019         * PORTS, README, TODO, doc/tar.texi: Likewise.
10020
10021 1999-07-12  Paul Eggert  <eggert@twinsun.com>
10022
10023         * configure.in (AM_INIT_AUTOMAKE): Version 1.13.1.
10024         (LIBOBJS): Add mktime.o to automake 1.4 bug workaround.
10025
10026         * src/list.c (decode_header):
10027         Do not assume that S_IFBLK and S_IFCHR are defined.
10028
10029         * src/create.c (start_header): Do not assume S_IFMT is defined.
10030         (dump_file): Remove unnecessary check for screwy apollo lossage.
10031         Do not assume S_IFBLK and S_IFCHR are defined.
10032
10033         * src/extract.c (extract_archive):
10034         Test whether S_IFCHR and S_IFBLK are nonzero,
10035         not whether they are defined, for consistency with other tests.
10036
10037         * src/buffer.c (is_regular_file):
10038         Don't succeed on files that we can't access due to
10039         permissions problems.
10040         (open_archive): Fix wording on fatal error message.
10041         Don't bother to stat /dev/null if the archive is not a character
10042         special device.
10043
10044         * src/compare.c (process_rawdata, diff_sparse_files, diff_archive):
10045         Report an error, not a warning, for I/O errors.
10046         (process_rawdata, process_dumpdir, diff_sparse_files):
10047         Change ungrammatical "Data differs" to "Contents differ".
10048         (get_stat_data): Find hidden files on AIX.
10049         Accept file name as argument; all uses changed.
10050         (get_stat_data, diff_archive): Use system error message for
10051         nonexistent files rather than rolling our own.
10052         (diff_archive): Unknown file types are errors, not warnings.
10053         Normalize spelling of message to "File type differs".
10054         Use get_stat_data to get link status, for consistency.
10055         Do not inspect st_rdev for fifos.
10056         Do not assume st_mode values contain only file types and mode bits.
10057         Check for mode changes and device number changes separately.
10058
10059         * src/update.c (append_file):
10060         Open the file before statting it, to avoid a race.
10061         Complain about file shrinkage only when we reach EOF.
10062
10063 1999-07-08  Paul Eggert  <eggert@twinsun.com>
10064
10065         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13 released.
10066
10067         * configure.in (AC_EXEEXT): Add.
10068
10069         * lib/Makefile.am (noinst_HEADERS):
10070         Add basename.h, exclude.h.  Remove full-write.h.
10071         (libtar_a_SOURCES): Add exclude.c.
10072
10073         * lib/basename.h, lib/exclude.c, lib/exclude.h, lib/safe-read.h:
10074         New files.
10075         * lib/full-write.c: Include safe-read.h instead of full-write.h.
10076         * lib/safe-read.h (safe_read): New decl.
10077         * src/rmt.c: Include safe-read.h.
10078         * src/rtapelib.c: Include basename.h, save-read.h.
10079         (rmt_open__): Use base_name to compute base name.
10080
10081         * src/common.h:
10082         Include basename.h, exclude.h; don't include full-write.h.
10083         (exclude_option): Remove decl.
10084         (excluded): New decl.
10085         (add_exclude, add_exclude_file, check_exclude): Remove decls.
10086
10087         * src/list.c (read_and):
10088         Use excluded_filename instead of check_exclude.
10089         Check base name of incoming file name, not entire file name, when
10090         deciding whether to exclude it.
10091
10092         * src/create.c (finish_sparse_file):
10093         Use excluded_filename instead of check_exclude.
10094         Don't bother to stat excluded file names.
10095         * src/incremen.c (get_directory_contents): Likewise.
10096
10097         * src/names.c (exclude_pool, exclude_pool_size,
10098         allocated_exclude_pool_size, simple_exclude_array,
10099         simple_excludes, allocated_simple_excludes,
10100         pattern_exclude_array, pattern_excludes,
10101         allocated_pattern_excludes, add_exclude, add_exclude_file,
10102         check_exclude):
10103         Remove; now done in ../lib/exclude.c.
10104
10105         * src/tar.c (decode_options): Initialize `excluded'.
10106         Use new add_exclude_file and add_exclude functions.
10107
10108 1999-07-05  Paul Eggert  <eggert@twinsun.com>
10109
10110         * m4/gettext.m4: Use changequote rather than [[ ]].
10111
10112         * lib/safe-read.c: Renamed from lib/full-read.c.
10113         (safe_read): Renamed from full_read.  All uses changed.
10114         * lib/safe-read.h, lib/full-write.h: New files.
10115         * lib/Makefile.am (noinst_HEADERS): Add full-write.h, safe-read.h.
10116         (libtar_a_SOURCES): Rename full-read.c to safe-read.c.
10117         * lib/full-write.c: Include full-write.h.
10118         * src/common.h: Include full-write.h, safe-read.h.
10119         * src/system.h: (full_read, full_write): Remove decls.
10120
10121         * src/Makefile.am (datadir): New var; needed for Solaris gettext.
10122
10123         * src/system.h (bindtextdomain, textdomain): undef before
10124         defining, to avoid preprocessor warnings with --disable-nls
10125         on hosts whose locale.h includes libintl.h.
10126
10127         * lib/xstrtol.c (__strtol): Remove decl; it doesn't work if __strtol
10128         expands to a macro, which occurs in HP-UX 10.20 with strtoumax.
10129         (strtol, strtoul): New decls (for pre-ANSI hosts), to replace
10130         the above decl.
10131
10132 1999-07-02  Paul Eggert  <eggert@twinsun.com>
10133
10134         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/mktime.m4.
10135         * m4/mktime.m4: New file.
10136         * m4/Makefile.am.in, m4/README: Remove these files.
10137         * m4/Makefile.am (EXTRA_DIST): Add mktime.m4;
10138         remove README, Makefile.am.in.
10139         (Makefile.am): Remove rule; it didn't work in BSD/OS 4.0.
10140         * m4/jm-mktime.m4 (jm_FUNC_MKTIME): Invoke AC_FUNC_MKTIME,
10141         not AM_FUNC_MKTIME.
10142
10143         * src/tar.c: Include signal.h.
10144         (SIGCHLD): Define to SIGCLD if SIGCLD is defined but SIGCHLD is not.
10145         (main): Ensure SIGCHLD is not ignored.
10146
10147         (BACKUP_OPTION, DELETE_OPTION, EXCLUDE_OPTION, GROUP_OPTION,
10148         MODE_OPTION, NEWER_MTIME_OPTION, NO_RECURSE_OPTION, NULL_OPTION,
10149         OWNER_OPTION, POSIX_OPTION, PRESERVE_OPTION, RECORD_SIZE_OPTION,
10150         RSH_COMMAND_OPTION, SUFFIX_OPTION, USE_COMPRESS_PROGRAM_OPTION,
10151         VOLNO_FILE_OPTION, OBSOLETE_ABSOLUTE_NAMES,
10152         OBSOLETE_BLOCK_COMPRESS, OBSOLETE_BLOCKING_FACTOR,
10153         OBSOLETE_BLOCK_NUMBER, OBSOLETE_READ_FULL_RECORDS, OBSOLETE_TOUCH,
10154         OBSOLETE_VERSION_CONTROL): Make sure they can't be valid chars, so
10155         they don't overlap with char codes.  Use an enum instead of a lot
10156         of #defines.
10157
10158         * src/system.h (ISASCII): Remove.
10159         (CTYPE_DOMAIN, ISDIGIT, ISODIGIT, ISPRINT, ISSPACE, S_ISUID,
10160         S_ISGID, S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP,
10161         S_IROTH, S_IWOTH, S_IXOTH, MODE_WXUSR, MODE_R, MODE_RW,
10162         MODE_RWX, MODE_ALL, SEEK_SET, SEEK_CUR, SEEK_END, CHAR_MAX,
10163         LONG_MAX): New macros.
10164
10165         * src/incremen.c (ISDIGIT, ISSPACE): Remove; now in system.h.
10166         (read_directory_file): Cast ISSPACE arg to unsigned char.
10167         * src/misc.c (ISPRINT): Remove; now in system.h.
10168         (remove_any_file): Add brackets to pacify gcc -Wall.
10169         * src/list.c: Don't include <ctype.h>; system.h already does this.
10170         (ISODIGIT, ISSPACE): Remove; now in system.h.
10171         (decode_header): No need to AND mode with 07777; MODE_FROM_OCT
10172         does this now.
10173         (from_oct): Cast ISSPACE arg to unsigned char.
10174
10175         * src/create.c (mode_to_oct): Translate modes from internal to
10176         external form.
10177         * src/list.c (mode_from_oct): Translate modes from external to
10178         internal form.  Do not complain about unrecognized mode bits.
10179         * src/common.h (TSUID, TSGID, TSVTX, TUREAD, TUWRITE, TUEXEC,
10180         TGREAD, TGWRITE, TGEXEC, TOREAD, TOWRITE, TOEXEC): Remove undefs.
10181
10182         * src/extract.c: (extr_init, make_directories, extract_archive):
10183         Do not assume mode bits have traditional Unix values.
10184         * src/list.c (decode_mode): Likewise.
10185         * src/create.c (start_header, dump_file): Likewise.
10186         * src/buffer.c (child_open_for_compress,
10187         child_open_for_uncompress, open_archive, (close_archive): Likewise.
10188         * src/compare.c (diff_archive): Likewise.
10189
10190         * src/extract.c (set_mode): Use %04 not %0.4 format.
10191         (extract_sparse_file): Do not use data_block uninitialized.
10192         Check for lseek failures.
10193
10194         * src/rtapelib.c (rmt_lseek__):
10195         Convert lseek whence values to portable integers on the wire.
10196         * src/rmt.c (main): Likewise.  Check for whence values out of range.
10197
10198         * src/create.c (finish_sparse_file): Use lseek whence macros
10199         instead of integers.
10200         * src/buffer.c (backspace_output): Likewise.
10201         * src/compare.c (diff_archive, verify_volume): Likewise.
10202         * src/delete.c (move_archive): Likewise.
10203         * src/extract.c (extract_sparse_file): Likewise.
10204
10205         * src/create.c (dump_file): Do not invoke finish_sparse_file
10206         on a negative file descriptor.
10207
10208         * src/buffer.c: Add braces to pacify gcc -Wall.
10209
10210         * src/compare.c (diff_sparse_files): Report lseek errors.
10211
10212         * configure.in (ALL_LINGUAS): Add cs, es, ru.
10213
10214         * PORTS, TODO: gnu.ai.mit.edu -> gnu.org
10215
10216         * src/arith.c, src/buffer.c (new_volume): Don't put ^G in
10217         message to be internationalized; \a doesn't work with msgfmt.
10218
10219         * src/tar.c (long_options, main, usage, OPTION_STRING):
10220         Remove -E or --ending-file.
10221         * src/list.c (read_and): Likewise.
10222         * src/common.h (ending_file_option): Likewise.
10223         * src/buffer.c (close_archive): Likewise.
10224
10225         * tests/after: Don't run two commands together in a pipeline,
10226         as some old shells mishandle pipeline exit status.
10227
10228 1999-06-28  Paul Eggert  <eggert@twinsun.com>
10229
10230         * configure.in (AM_INIT_AUTOMAKE): version 1.12.64015.
10231         * NEWS: Describe changes since 1.12.
10232         * README: Update bug reporting address; move paxutils ref to NEWS.
10233
10234         Handle EINTR correctly.
10235         * lib/Makefile.am (libtar_a_SOURCES): Add full-read.c, full-write.c.
10236         * lib/full-read.c, lib/full-write.c: New files.
10237         * src/buffer.c (child_open_for_compress, child_open_for_uncompress):
10238         Prefer full_read to read and full_write to write.
10239         * src/compare.c (process_rawdata, diff_sparse_files): Likewise.
10240         * src/create.c (deal_with_sparse, finish_sparse_file, dump_file):
10241         Likewise.
10242         * src/extract.c (extract_sparse_file): Likewise.
10243         * src/rmt.c (get_string, main, report_error_message,
10244         report_numbered_error): Likewise.
10245         * src/rmt.h (rmtread, rmtwrite): Likewise.
10246         * src/rtapelib.c (do_command, get_status_string, rmt_read__,
10247         rmt_write__, rmt_ioctl__): Likewise.
10248         * src/update.c (append_file): Likewise.
10249         * src/system.h (full_read, full_write): New decls.
10250
10251         * po/POTFILES.in: Add lib/argmatch.c, lib/error.c lib/getopt.c,
10252         lib/xmalloc.c, src/arith.c, src/misc.c.
10253
10254         * src/system.h (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO):
10255         New macros.  All uses of STDIN and STDOUT changed.
10256         * src/rmt.c (prepare_record_buffer, main): Use STDIN_FILENO
10257         instead of 0 and STDOUT_FILENO instead of 1.
10258         * src/rtapelib.c (_rmt_rexec): Use STDIN_FILENO and STDOUT_FILENO
10259         instead of fileno (stdin) and fileno (stdout) or 0 and 1.
10260
10261         * src/rmt.c (private_strerror): Avoid const.  Translate results.
10262
10263         * tests/Makefile.am (TESTS): Remove incremen.sh; it doesn't work
10264         in the presence of NFS clock skew.
10265
10266 1999-06-25  Paul Eggert  <eggert@twinsun.com>
10267
10268         * configure.in (AM_INIT_AUTOMAKE): version 1.12.64014.
10269
10270         * src/buffer.c (write_archive_buffer): New function.
10271         (child_open_for_compress, flush_write, flush_read): Use it to write
10272         buffers.
10273         (open_archive): Report error if fstat of archive fails.
10274         Improve efficiency of check for /dev/null.
10275         Also, fix some corner cases with remote archives and /dev/null checking.
10276         (close_archive): Test for input fifo only if not remote.
10277         Truncate output archive only if it's not remote.
10278
10279         * src/misc.c (remove_any_file):
10280         Don't terminate if you see . or ..; just skip them.
10281
10282 1999-06-18  Paul Eggert  <eggert@twinsun.com>
10283
10284         * configure.in (AM_INIT_AUTOMAKE): version 1.12.64013.
10285
10286         Output sizes using a format that's more compatible with
10287         traditional tar (and with GNU Emacs).
10288         * src/common.h (GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT,
10289         MODE_TO_OCT, SIZE_TO_OCT, UID_TO_OCT, UINTMAX_TO_OCT):
10290         Don't subtract 1 from size.
10291         * src/create.c (to_oct): Prepend leading zeros, not spaces.
10292         Output a trailing NUL unless the value won't fit without it.
10293         (finish_header): No need to append NUL to chksum, now that
10294         to_oct is doing it.
10295
10296 1999-06-16  Paul Eggert  <eggert@twinsun.com>
10297
10298         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64012.
10299
10300         * src/Makefile.am (LDADD): Link libtar.a after @INTLLIBS@, since
10301         @INTLLIBS@ might invoke rpl_realloc.
10302
10303         * src/tar.c (backup_type): Remove decl; backupfile.h now has it.
10304         (intconv): Remove; use xstrto* fns instead.
10305         ("xstrtol.h"): Include.
10306         (check_decimal): Remove.
10307         (long_options, usage, OPTION_STRING, decode_options):
10308         Remove -y, --bzip2, --unbzip2.
10309         (decode_options): Use xget_version instead of get_version.
10310         Check for overflow with -b and -L and RECORD_SIZE_OPTION.
10311         Replace invocations of check_decimal  with xstrtoumax.
10312
10313         * tests/preset.in (echo_n, echo_c): Remove.
10314
10315         * tests/after: Don't rely on $echo_c and $echo_n.
10316
10317         * lib/addext.c, lib/dirname.c, lib/lchown.c, lib/lchown.h,
10318         lib/malloc.c, lib/mktime.c, lib/realloc.c, lib/strtol.c, lib/strtoul.c,
10319         lib/strtoull.c, lib/strtoumax.c, lib/utime.c, lib/xstrtol.c,
10320         lib/xstrtol.h, lib/xstrtoul.c, lib/xstrtoumax.c,
10321         m4/Makefile.am.in, m4/README, m4/ccstdc.m4, m4/d-ino.m4,
10322         m4/gettext.m4, m4/inttypes_h.m4, m4/isc-posix.m4,
10323         m4/jm-mktime.m4, m4/largefile.m4, m4/lcmessage.m4,
10324         m4/malloc.m4, m4/progtest.m4, m4/realloc.m4, m4/uintmax_t.m4,
10325         m4/ulonglong.m4, m4/utimbuf.m4, m4/utime.m4, m4/utimes.m4,
10326         m4/xstrtoumax.m4: New files.
10327
10328         * configure.in(fp_PROG_ECHO): Remove; no longer needed.
10329         (AC_SYS_LARGEFILE): Renamed from AC_LFS.
10330         (jm_AC_HEADER_INTTYPES_H): Replaces inline code.
10331         (jm_STRUCT_DIRENT_D_INO, jm_AC_TYPE_UINTMAX_T, jm_AC_PREREQ_XSTRTOUMAX): Add.
10332         (AC_CHECK_FUNCS): Remove lchown.
10333         (AC_REPLACE_FUNCS): Remove basename, dirname.
10334         Add lchown, strtol, strtoul.
10335         (jm_FUNC_MKTIME): Add.
10336         (LIBOBJS): Replace .o with $U.o, so that the .o files in LIBOBJS
10337         are also built via the ANSI2KNR-filtering rules.
10338         Use a no-op line to work around bug in automake 1.4 with malloc and
10339         realloc.
10340         (AC_OUTPUT): Add m4/Makefile.
10341
10342         * lib/Makefile.am (EXTRA_DIST):
10343         Add lchown.c, malloc.c, mktime.c, realloc.c,
10344         strtol.c, strtoul.c, strtoull.c, strtoumax.c, utime.c.
10345         (noinst_HEADERS): Add lchown.h, modechange.h, xstrtol.h.
10346         (libtar_a_SOURCES): Add addext.c, basename.c, xstrtol.c,
10347         xstrtoul.c, xstrtoumax.c.  Remove getversion.c.
10348         ($(srcdir)/getdate.c:): Remove `expect conflicts' line.
10349
10350         * src/system.h (uintmax_t): Don't declare; configure now does this.
10351
10352         * src/common.h (backup_type): New decl.
10353         * src/common.h, src/misc.c, src/tar.c:
10354         Move include of backupfile.h to common.h.
10355
10356         * src/misc.c (maybe_backup_file):
10357         Pass backup_type to find_backup_file_name.
10358
10359         * src/list.c (print_header): Change sizes of uform and gform from 11 to
10360         UINTMAX_STRSIZE_BOUND.
10361
10362         * doc/tar.texi: Remove --bzip2.
10363         Fix @xref typos reported by latest makeinfo.
10364
10365         * Makefile.am (ACLOCAL_AMFLAGS): New macro.
10366         (SUBDIRS): Add m4.
10367         (M4DIR, ACINCLUDE_INPUTS): New macros.
10368         ($(srcdir)/acinclude.m4): New rule.
10369
10370         * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT,
10371         HAVE_INTTYPES_H, HAVE_LC_MESSAGES, HAVE_STPCPY): Remve #undefs;
10372         now generated automatically by autoconf.
10373
10374 1999-05-15  Paul Eggert  <eggert@twinsun.com>
10375
10376         * doc/tar.texi: Remove -y.
10377
10378 1999-04-09  Paul Eggert  <eggert@twinsun.com>
10379
10380         * src/system.h (INT_STRLEN_BOUND): Fix off-by-factor-of-10 typo
10381         (we were allocating too much storage).
10382         (uintmax_t): Don't declare; configure now does this.
10383
10384         * ABOUT-NLS: Update to gettext 0.10.35 edition.
10385
10386 1999-03-22  Paul Eggert  <eggert@twinsun.com>
10387
10388         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64010
10389
10390         * acinclude.m4 (AC_LFS_FLAGS):
10391         Don't use -mabi=n32 with GCC on IRIX 6.2; it's the default.
10392         (AC_LFS): -n32, -o32, and -n64 are CPPFLAGS, not CFLAGS.
10393         (jm_FUNC_MALLOC, jm_FUNC_REALLOC): New macros.
10394
10395         * configure.in (jm_FUNC_MALLOC, jm_FUNC_REALLOC):
10396         New macros; needed for latest GNU xmalloc.c.
10397
10398         * Makefile.am (noinst_HEADERS): Add quotearg.h, xalloc.h.
10399         (libtar_a_SOURCES): Add quotearg.c.
10400         * list.c: Include <quotearg.h>.
10401         (from_oct): Add forward decl.
10402         (read_header): Return HEADER_FAILURE if we can't parse the checksum.
10403         (from_oct): Report an error only if TYPE is nonzero.
10404         Quote any funny characters in bad header.
10405
10406 1999-03-20  Paul Eggert  <eggert@twinsun.com>
10407
10408         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64009
10409
10410         * acinclude.m4 (AC_LFS_FLAGS): Add support for IRIX 6.2 and later.
10411         (AC_LFS_SPACE_APPEND): Assume $2 is quoted properly; all callers
10412         changed.
10413         (AC_LFS): Simplify AIX revision number test.
10414
10415 1999-03-17  Paul Eggert  <eggert@twinsun.com>
10416
10417         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64008
10418
10419         * configure.in (AC_VALIDATE_CACHED_SYSTEM_TUPLE):
10420         Remove; it doesn't work that well
10421         with AC_CANONICAL_HOST.
10422         (fp_WITH_INCLUDED_MALLOC): Remove; we'll just use the system malloc.
10423
10424         * Makefile.am (EXTRA_DIST): Remove AC-PATCHES, AM-PATCHES, BI-PATCHES.
10425
10426         * Makefile.am (EXTRA_DIST): Remove gmalloc.c.
10427
10428         * acinclude.m4 (fp_WITH_INCLUDED_MALLOC): Remove.
10429
10430         * tar.texi: Fix bug-report addr.
10431
10432         * README: Remove --with-included-malloc.
10433         Upgrade version numbers of build software.
10434
10435 1999-03-07  Paul Eggert  <eggert@twinsun.com>
10436
10437         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64007.
10438
10439         * acinclude.m4 (AM_WITH_NLS): Port to Solaris 2.5.1,
10440         where bindtextdomain and gettext require -lintl.
10441         (AC_LFS_FLAGS): Simplify so that it only gets the flags;
10442         `no' means it failed.
10443         (AC_LFS_SPACE_APPEND, AC_LFS_MACRO_VALUE): New macros.
10444         (AC_LFS): Use them.  Set _FILE_OFFSET_BITS, _LARGEFILE_SOURCE, and
10445         _LARGE_FILES from LFS_CFLAGS, so that in the normal case we don't need
10446         to add anything to the command line (it's all in config.h).
10447         Put any extra -D and -I options into CPPFLAGS, the rest into CFLAGS.
10448
10449 1999-03-01  Paul Eggert  <eggert@twinsun.com>
10450
10451         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64006.
10452
10453         * acinclude.m4 (AC_LFS_FLAGS): Port to AIX 4.2.
10454
10455         * src/list.c: (gid_from_oct, major_from_oct, minor_from_oct,
10456         mode_from_oct, off_from_oct, size_from_oct, time_from_oct,
10457         uid_from_oct, uintmax_from_oct): Use TYPE_MAXIMUM instead of macros
10458         like OFF_MAX, which are not reliable
10459         (e.g. OFF_MAX in AIX 4.2 is incorrect).
10460         * src/system.h (GID_MAX, MAJOR_MAX, MINOR_MAX, MODE_MAX, OFF_MAX,
10461         SIZE_MAX, TIME_MAX,UID_MAX, UINTMAX_MAX):  Remove; no longer used.
10462
10463         * src/incremen.c (get_directory_contents):
10464         Don't use statx if _LARGE_FILES; it doesn't work under AIX 4.2.
10465         Have statx depend on STX_HIDDEN, not AIX.
10466
10467         * src/create.c (to_oct):
10468         New parameter substitute, giving a substitute value to use
10469         when the original value is out of range.  Do not append a space to the
10470         output; modern tars don't.  When a value is out of range, specify the
10471         maximum value, not the number of bits.
10472         (GID_NOBODY, UID_NOBODY): New macros.
10473         (gid_to_oct, uid_to_oct): Use them as substitutes.
10474         (finish_header): Do not assume that UINTMAX_TO_OCT appends a space.
10475         (dump_file): Check whether the file changed as we read it.
10476
10477         * src/rmt.c (main): Remove suspicious AIX/386 code.
10478
10479 1999-02-19  Paul Eggert  <eggert@twinsun.com>
10480
10481         * intl/localealias.c (read_alias_file): Don't assume that memcpy
10482         returns a type compatible with char *; it doesn't on SunOS
10483         4.1.4 with Sun cc, since <string.h> doesn't declare memcpy.
10484
10485         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64005.
10486
10487         * src/tar.c (long_options, usage): Prefer --unbzip2 to --bunzip2.
10488         * doc/tar.texi: Add --bzip2, --unbzip2 options.
10489
10490         * configure.in (AC_CANONICAL_HOST, AC_VALIDATE_CACHED_SYSTEM_TUPLE):
10491         Add.
10492         (AC_LINK_FILES): Omit; AM_GNU_GETTEXT now does this.
10493         (AC_OUTPUT): Omit munging of po/Makefile; AM_GNU_GETTEXT now does this.
10494         * acinclude.m4 (AM_WITH_NLS):
10495         Update to latest gettext version (serial 5).
10496         (AC_LFS_FLAGS): New macro
10497         (AC_LFS): Use it.  Append to CFLAGS, LDFLAGS, LDLIBS instead of
10498         working only with unset variables.  Append to CFLAGS, not CPPFLAGS.
10499         Work properly in cross-compilation scenario, by checking for getconf
10500         with AC_CHECK_TOOL and by ditching uname in favor of
10501         AC_CANONICAL_HOST and $host_os.  Add --disable-lfs option.
10502
10503         * lib/getdate.y: Update to fileutils 4.0 getdate.y, with one patch:
10504         replace FORCE_ALLOCA_H with HAVE_ALLOCA_H.
10505         * lib/Makefile.am (AUTOMAKE_OPTIONS): Append ../src/ansi2knr,
10506         since getdate.y now uses ANSI code.
10507
10508         * config.guess, config.sub: New files; taken from automake 1.4.
10509
10510         * intl/Makefile.in, intl/VERSION, intl/bindtextdom.c,
10511         intl/cat-compat.c, intl/dcgettext.c, intl/dgettext.c,
10512         intl/explodename.c, intl/finddomain.c, intl/gettext.c,
10513         intl/gettext.h, intl/gettextP.h, intl/hash-string.h,
10514         intl/l10nflist.c, intl/libgettext.h, intl/loadinfo.h,
10515         intl/loadmsgcat.c, intl/localealias.c, intl/textdomain.c:
10516         Update to GNU gettext 0.10.35, with patches as per GCC snapshot 990109.
10517
10518 1999-02-01  Paul Eggert  <eggert@twinsun.com>
10519
10520         * src/tar.c: Update copyright.
10521
10522         * NEWS: 1.12.64004
10523
10524 1999-02-01  Paul Eggert  <eggert@twinsun.com>
10525
10526         * NEWS, configure.in: Version 1.12.64004
10527
10528         * configure.in (AC_LFS): Use this macro, instead of open-coding it.
10529
10530         * acinclude.m4 (AC_LFS, AM_PROG_CC_STDC): New macros.
10531
10532         * src/extract.c (extract_archive): Fix bug when extracting sparse
10533         files: they were trashing the tar file header.
10534
10535         * src/tar.c: (long_options, usage, OPTION_STRING, decode_options):
10536         Add -y or --bzip2 or --bunzip2 option.
10537
10538 1999-01-30  Paul Eggert  <eggert@twinsun.com>
10539
10540         * src/names.c (cached_no_such_uname, cached_no_such_gname,
10541         cached_no_such_uid, cached_no_such_gid): New vars.
10542         (uid_to_uname, gid_to_gname, uname_to_uid, gname_to_gid):
10543         Cache failures, too.
10544
10545         * src/tar.c (decode_options):
10546         Don't pass names longer than UNAME_FIELD_SIZE to
10547         uname_to_uid, as it messes up the cache.  Similarly for gname_to_uid.
10548
10549 1999-01-27  Paul Eggert  <eggert@twinsun.com>
10550
10551         * NEWS, configure.in: Version 1.12.64003
10552
10553         * src/buffer.c (backspace_output, close_archive):  Cast
10554         rmtlseek position arg to off_t, for benefit of K&R compilers
10555         with long long.
10556         * src/compare.c (verify_volume): Likewise.
10557
10558         * NEWS, configure.in: Version 1.12.64002
10559
10560         * src/create.c (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct,
10561         off_to_oct, size_to_oct, time_to_oct, uid_to_oct):
10562         Cast arg to uintmax_t for benefit of pre-ANSI compilers with long long.
10563         * src/list.c: (gid_from_oct, major_from_oct, minor_from_oct,
10564         mode_from_oct, off_from_oct, size_from_oct, time_from_oct,
10565         uid_from_oct): Likewise.
10566
10567 1999-01-25  Paul Eggert  <eggert@twinsun.com>
10568
10569         * incremen.sh: Fix timing bug in regression test.
10570
10571 1999-01-22  Paul Eggert  <eggert@twinsun.com>
10572
10573         * NEWS, configure.in: Update version
10574
10575         * Makefile.am (localedir): Change to $(datadir)/locale.
10576         (DEFS): New macro, defining LOCALEDIR.
10577         (tar.o, tar._o, rmt.o, rmt._o): Remove.
10578         (INCLUDES): Add -I..
10579
10580         * Makefile.am (localedir): Change to $(datadir)/locale.
10581
10582 1999-01-21  Paul Eggert  <eggert@twinsun.com>
10583
10584         * NEWS, README, configure.in: Unofficial version 1.12.64001.
10585
10586         * tests/Makefile.am (localedir): Change to $(datadir)/locale.
10587         * src/Makefile.am (localedir): Likewise.
10588         (DEFS): New macro, defining LOCALEDIR.
10589         (tar.o, tar._o, rmt.o, rmt._o): Remove.
10590         (INCLUDES): Add `-I..'.
10591
10592         * tests/incremen.sh: Fix timing bug.
10593
10594 1999-01-20  Paul Eggert  <eggert@twinsun.com>
10595
10596         * NEWS, README, configure.in: Unofficial version 1.12.64000.
10597         `lfs.7' changed to `64000' in version number
10598         to conform to gnits standards.
10599
10600         * COPYING, INSTALL, doc/texinfo.tex, install-sh, missing,
10601         mkinstalldirs, ansi2knr.c: Update to latest public versions.
10602
10603         Rebuild with automake 1.4 and autoconf 2.13, to work around some
10604         porting problems.
10605
10606 1998-12-07  Paul Eggert  <eggert@twinsun.com>
10607
10608         * NEWS, README, configure.in: Unofficial version 1.12.lfs.6.
10609
10610         * src/list.c (read_header):
10611         Accept file names as specified by POSIX.1-1996 section 10.1.1.
10612
10613 1998-11-30  Paul Eggert  <eggert@twinsun.com>
10614
10615         * configure.in: Quote the output of uname.
10616
10617         * src/extract.c (set_stat): chmod after chown even when not root;
10618         if we are using --same-owner this is needed e.g. on Solaris 2.5.1.
10619
10620 1998-11-15  Paul Eggert  <eggert@twinsun.com>
10621
10622         * NEWS, README, configure.in: Unofficial version 1.12.lfs.5.
10623
10624         * configure.in (ac_test_CPPFLAGS, ac_test_LDFLAGS, ac_test_LIBS,
10625         ac_getconfs, ac_result): Special case for HP-UX 10.20 or later.
10626
10627 1998-10-28  Paul Eggert  <eggert@twinsun.com>
10628
10629         * NEWS, README, configure.in: Unofficial version 1.12.lfs.4.
10630
10631         * src/system.h (voidstar): Use void * if __STDC__ is defined,
10632         not merely nonzero.
10633
10634         * src/rtapelib.c: Don't use rexec code unless compiled with WITH_REXEC.
10635         On many installations, rexec is disabled.
10636
10637 1998-08-07  Paul Eggert  <eggert@twinsun.com>
10638
10639         * NEWS, README, configure.in: Unofficial version 1.12.lfs.3.
10640
10641         * src/names.c (uid_to_uname, gid_to_gname): Don't used cached name
10642         for nameless users and groups.
10643
10644 1998-02-17  Paul Eggert  <eggert@twinsun.com>
10645
10646         * NEWS, README, configure.in: Unofficial version 1.12.lfs.2.
10647         * NEWS, README: Add explanation of why this isn't an official version.
10648
10649 1998-02-02  Paul Eggert  <eggert@twinsun.com>
10650
10651         * NEWS, README, configure.in: Unofficial version 1.12.lfs.1.
10652         This is an unofficial version.
10653
10654 1997-12-17  Paul Eggert  <eggert@twinsun.com>
10655
10656         * src/incremen.c (ST_DEV_MSB): New macro.
10657         (NFS_FILE_STAT): Use most significant bit of st_dev,
10658         even if it's unsigned.
10659
10660 1997-12-08  Paul Eggert  <eggert@twinsun.com>
10661
10662         * src/system.h (ST_NBLOCKS): Fix typo in definition.
10663
10664 1997-11-19  Paul Eggert  <eggert@twinsun.com>
10665
10666         * configure.in (HAVE_INTTYPES_H):
10667         Don't ignore cache variable if it's already set.
10668
10669 1997-11-10  Paul Eggert  <eggert@twinsun.com>
10670
10671         * src/rmt.c (main): Don't assume mt_count is of type daddr_t.
10672         * src/delete.c (records_read): Now off_t.
10673         (move_archive): Don't assume mt_count is of type daddr_t.
10674
10675 1997-10-30  Paul Eggert  <eggert@twinsun.com>
10676
10677         * configure.in (CPPFLAGS, LDFLAGS, LIBS):
10678         Set to appropriate values if large file support
10679         needs explicit enabling.
10680         (HAVE_INTTYPES_H, HAVE_ST_FSTYPE_STRING, daddr_t, major_t, minor_t,
10681         ssize_t):
10682         New macros to configure.
10683         (AC_TYPE_MODE_T, AC_TYPE_PID_T, AC_TYPE_OFF_T): Add.
10684
10685         * acconfig.h (daddr_t, HAVE_INTTYPES_H, HAVE_ST_FSTYPE_STRING,
10686         major_t, minor_t, ssize_t): New macros.
10687
10688         * src/arith.h (TARLONG_FORMAT):
10689         Fix typo: %uld -> %lu.  Use unsigned when long long
10690         (%lld -> %llu).
10691         (add_to_tarlong_helper, mult_tarlong_helper): 2nd arg is now unsigned long.
10692         (add_to_tarlong, mult_tarlong): Cast 2nd arg to unsigned long.
10693
10694         * src/arith.c (add_to_tarlong_helper, mult_tarlong_helper):
10695         2nd arg is now unsigned long.
10696
10697         * src/rmt.c (allocated_size): Now size_t, and now initialized to 0.
10698         (prepare_record_buffer): Arg is now size_t.
10699         Remove now-useless casts.
10700
10701         (main): Use `long' for status, so that it can store ssize_t.
10702         Use daddr_t, mode_t, size_t, off_t when appropriate.
10703         Convert daddr_t and off_t values ourselves, since they might be longer
10704         than long.  Convert other types using `long' primitives.
10705         When processing MTIOCTOP, do not try to pass resulting
10706         count back, since it won't work (it could be too large) and it's
10707         not expected anyway.
10708
10709         * src/update.c:
10710         (append_file) Use off_t, size_t, ssize_t when appropriate.  Remove
10711         now-useless casts.  Use unsigned long to print *_t types, except use
10712         STRINGIFY_BIGINT for off_t.
10713         (update_archive): Cast -1 to dev_t when necessary.
10714
10715         * src/tar.c (check_decimal):
10716         Now returns 1 if successful, 0 otherwise, and returns
10717         uintmax_t value into new arg.  Check for arithmetic overflow.
10718         (decode_options): Avoid overflow if record_size fits in size_t but not int.
10719         Check for overflow on user or group ids.
10720
10721         * src/compare.c (diff_init, process_rawdata, read_and_process,
10722         diff_sparse_files, diff_archive):
10723         Use off_t, pid_t, size_t, ssize_t when appropriate.
10724         Remove now-useless casts.  Use unsigned long to print *_t types,
10725         except use STRINGIFY_BIGINT for off_t.
10726
10727         (process_noop, process_rawdata, process_dumpdir, read_and_process):
10728         Size arg is now size_t.
10729
10730         (diff_sparse_files): Arg is now off_t.  Check for size_t overflow
10731         when allocating buffer.
10732
10733         * src/rtapelib.c:
10734         (do_command, rmt_open__, rmt_read__, rmt_lseek__, rmt_ioctl__):
10735         Use pid_t, size_t, ssize_t when appropriate.  Remove now-useless casts.
10736         Use unsigned long to print *_t types, except use STRINGIFY_BIGINT for
10737         off_t.
10738
10739         (get_status_string, get_status_off): New function.
10740         (get_status): Now returns long, so that it can store ssize_t.
10741         Invoke get_status_string to do the real work.
10742         (rmt_read__, rmt_write__): Now returns ssize_t. Size arg is now size_t.
10743         (rmt_lseek__): Now returns off_t, using new get_status_off function.
10744         (rmt_ioctl__): Convert mt_count by hand,
10745         since it might be longer than long.
10746
10747         * src/mangle.c (extract_mangle):
10748         Check for overflow when converting off_t to size_t.
10749         Use off_t, size_t when appropriate.  Remove now-useless casts.
10750
10751         * src/system.h (mode_t): Remove; now done by autoconf.
10752         (ST_NBLOCKS): Do not overflow if st_size is near maximum.
10753         Return number of ST_NBLOCKSIZE-byte blocks,
10754         not number of 512-byte blocks;
10755         this also helps to avoid overflow.
10756         (st_blocks): Declare if needed.
10757         (ST_NBLOCKSIZE): New macro.
10758         (<limits.h>, <inttypes.h>): Include if available.
10759         (CHAR_BIT): New macro.
10760         (uintmax_t): New typedef.
10761         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_STRLEN_BOUND,
10762         UINTMAX_STRSIZE_BOUND, GID_MAX, MAJOR_MAX, MINOR_MAX, MODE_MAX,
10763         OFF_MAX, SIZE_MAX, TIME_MAX, UID_MAX, UINTMAX_MAX): New macros.
10764
10765         * src/names.c (name_init):
10766         Fix typo in error message: FILE* was passed, but char*
10767         was wanted.
10768
10769         (read_name_from_file, name_gather, addname, name_match, name_scan,
10770         add_exclude): Use size_t when appropriate.  Remove now-useless casts.
10771
10772         (exclude_pool_size, allocated_exclude_pool_size): Now size_t.
10773
10774         * src/extract.c (newdir_umask, current_umask): Now mode_t.
10775         (extract_sparse_file): Args now use off_t.
10776
10777         (set_mode, set_stat, make_directories, extract_sparse_file,
10778         extract_archive): Use off_t, size_t, ssize_t when appropriate.  Remove
10779         now-useless casts.  Use unsigned long to print *_t types, except use
10780         STRINGIFY_BIGINT for off_t.
10781
10782         * src/misc.c (quote_copy_string):
10783         Use size_t when appropriate.  Remove now-useless casts.
10784
10785         * src/list.c (read_and, list_archive, read_header, decode_mode,
10786         print_header, print_for_mkdir):
10787         Use mode_t, off_t, size_t when appropriate.  Remove
10788         now-useless casts.  Use unsigned long to print *_t types, except use
10789         STRINGIFY_BIGINT for off_t.
10790
10791         (read_header): Check for overflow when converting header size.
10792
10793         (from_oct): Now static.  Now returns uintmax_t.  `where' arg is now
10794         const char *.  Size arg is now size_t.  Now takes new type and maxval
10795         args.  Compute result using uintmax_t, not long.  Report error if
10796         field does not contain octal number in range.
10797         (gid_from_oct, major_from_oct, minor_from_oct, mode_from_oct,
10798         off_from_oct, size_from_oct, time_from_oct, uid_from_oct,
10799         uintmax_from_oct): New functions.
10800
10801         (stringify_uintmax_t_backwards): New function.
10802
10803         (decode_mode, print_for_mkdir): Mode arg is now mode_t.
10804         (skip_file): Offset arg is now off_t.
10805
10806         * src/buffer.c (record_start_block, save_totsize, save_sizeleft,
10807         real_s_totsize, real_s_sizeleft, current_block_ordinal):
10808         Now off_t.
10809         (write_error): Arg is now ssize_t.
10810         (child_pid): Now pid_t.
10811         (available_space_after): Now size_t.
10812
10813         (child_open_for_compress, child_open_for_uncompress, flush_write,
10814         open_archive, flush_write, write_error, flush_read, close_archive):
10815         Use pid_t, ssize_t, size_t when appropriate.  Remove now-useless
10816         casts.  Use unsigned long to print *_t types, except use
10817         STRINGIFY_BIGINT for off_t.
10818
10819         * src/delete.c (records_read): Now daddr_t.
10820         (move_archive): Arg is now daddr_t.  Check for overflow when
10821         computing offset.
10822         (move_archive, delete_archive_members): Use daddr_t, off_t when
10823         appropriate.  Remove now-useless casts.
10824
10825         * src/rmt.h (rmt_read__, rmt_write__): Now returns ssize_t.
10826         (rmt_lseek): Now returns off_t.
10827
10828         * src/create.c (to_oct):
10829         Now static.  Value arg is now uintmax_t.  Accept new args
10830         giving name of type of octal field, for error messages.  Report an
10831         error if the value is too large to fit in the field.
10832         (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct, off_to_oct,
10833         size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct): New functions.
10834
10835         (write_eot, write_long, finish_header, deal_with_sparse,
10836         finish_sparse_file, dump_file): Use dev_t, off_t, ssize_t, size_t when
10837         appropriate.  Remove now-useless casts.  Use unsigned long to print
10838         *_t types, except use STRINGIFY_BIGINT for off_t.
10839
10840         (find_new_file_size): 1st arg is now off_t*.
10841         (finish_sparse_file): Args now use off_t, not long.
10842         Check for lseek error.
10843         (create_archive, dump_file): Cast -1 to dev_t when necessary.
10844         (dump_file): Device arg is now dev_t.
10845         Avoid overflow when testing whether file has holes
10846         by using the new ST_NBLOCKSIZE macro.
10847
10848         * src/incremen.c (struct accumulator, add_to_accumulator,
10849         get_directory_contents, add_hierarchy_to_namelist, gnu_restore):
10850         Use size_t for sizes.
10851         (struct directory, get_directory_contents, add_hierarchy_to_namelist):
10852         Use dev_t, ino_t for devices and inodes.
10853         (gnu_restore): Use off_t for file offsets.
10854         (struct directory): Use char for flags.  Add new flag `nfs'.
10855         (nfs): New constant
10856         (NFS_FILE_STAT): New macro.
10857         (note_directory): Accept struct stat * instead of
10858         device and inode number.  All callers changed.
10859         (note_directory, get_directory_contents):
10860         Use NFS_FILE_STAT to determine whether directory is an NFS directory.
10861         (write_dir_file): Cast time_t to unsigned long before printing as %lu.
10862
10863         * src/common.h (record_size, struct name, struct sp_array,
10864         available_space_after):
10865         Use size_t for sizes.
10866         (save_sizeleft, save_totsize, current_block_ordinal, skip_file):
10867         Use off_t for file offsets.
10868         (struct name): dir_contents is now const char *, not char *.
10869         (dump_file, get_directory_contents): Use dev_t for devices.
10870         (to_oct): Remove decl.
10871         (GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT, MODE_TO_OCT, SIZE_TO_OCT,
10872         UID_TO_OCT, UINTMAX_TO_OCT, OFF_TO_OCT, TIME_TO_OCT, STRINGIFY_BIGINT,
10873         GID_FROM_OCT, MAJOR_FROM_OCT, MINOR_FROM_OCT, MODE_FROM_OCT,
10874         OFF_FROM_OCT, SIZE_FROM_OCT, TIME_FROM_OCT, UID_FROM_OCT,
10875         UINTMAX_FROM_OCT): New macros.
10876         (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct, off_to_oct,
10877         size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct,
10878         stringify_uintmax_t_backwards, gid_from_oct, major_from_oct,
10879         minor_from_oct, mode_from_oct, off_from_oct, size_from_oct,
10880         time_from_oct, uid_from_oct, uintmax_from_oct): New decls.
10881         (print_for_mkdir): 2nd arg is now mode_t.
10882
10883         -----
10884
10885         See ChangeLog.1 for earlier changes.
10886
10887         -----
10888
10889         Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007
10890         Free Software Foundation, Inc.
10891
10892         This file is part of GNU tar.
10893
10894         GNU tar is free software; you can redistribute it and/or modify
10895         it under the terms of the GNU General Public License as published by
10896         the Free Software Foundation; either version 3, or (at your option)
10897         any later version.
10898
10899         GNU tar is distributed in the hope that it will be useful,
10900         but WITHOUT ANY WARRANTY; without even the implied warranty of
10901         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10902         GNU General Public License for more details.
10903
10904         You should have received a copy of the GNU General Public License
10905         along with GNU tar; see the file COPYING.  If not, write to
10906         the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
10907         Boston, MA 02110-1301, USA.
10908 \f
10909 Local Variables:
10910 mode: change-log
10911 version-control: never
10912 buffer-read-only: t
10913 End: