]> git.cworth.org Git - tar/blob - ChangeLog
no point suggesting something that's required
[tar] / ChangeLog
1 2010-03-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2
3         Version 1.23
4         * configure.ac, NEWS: Update version number.
5
6         Doc changes.
7         * NEWS: Update.
8         * THANKS: Update.
9         * doc/snapshot.texi, doc/snapshot.texi,
10         doc/sparse.texi, doc/tar-snapshot-edit.texi,
11         doc/tar.texi: Spellchecked and proof-read. Thanks
12         to Denis Excoffier.
13         * gnulib.modules: Remove utime.
14
15 2010-03-08  Kamil Dudka  <kdudka@redhat.com>
16
17         Fix possible overflow in code_timespec (tiny change)
18         * src/misc.c (code_timespec): ignore invalid values of ns
19
20 2010-03-08  Sergey Poznyakoff  <gray@gnu.org.ua>
21
22         Minor fix in the testsuite.
23         * tests/extrac05.at: Skip test if creating
24         sparse file fails.
25
26         Fix eventual memory override and fd exhaustion in create.c
27         Both bugs reported by Kamil Dudka.
28
29         * src/create.c (check_exclusion_tags): Do not keep
30         pointer to a location within tagname: it may change
31         after xrealloc. Use byte offset instead.
32         (dump_file0): Close fd before returning without
33         dumping the directory.
34
35 2010-03-02  Sergey Poznyakoff  <gray@gnu.org.ua>
36
37         Minor change.
38         * doc/tar.texi: Improve some wording.
39
40 2010-03-02  Antonio Diaz Diaz  <ant_diaz@teleline.es>
41
42         Add Lzip support
43         * configure.ac: Add TAR_COMPR_PROGRAM(lzip)
44         * doc/tar.texi: Reflect lzip support.
45         * src/buffer.c (compress_type) <ct_lzip>: New constant.
46         (magic): Add magic for lzip.
47         * src/suffix.c (compression_suffixes): Add lz.
48         * src/tar.c: New option --lzip.
49
50 2010-03-02  Sergey Poznyakoff  <gray@gnu.org.ua>
51
52         Minor fix.
53         * tests/exclude05.at: Rewrite awk invocation to avoid
54         overflowing awk's file table on Solaris.
55
56 2010-03-02  Eric Blake  <ebb9@byu.net>
57
58         Fix large file support.
59         * scripts/xsparse.c (read_map): Use fseeko.
60         * src/incremen.c (write_directory_file): Likewise.
61
62 2010-03-02  Sergey Poznyakoff  <gray@gnu.org.ua>
63
64         Bugfix
65         * src/buffer.c (seek_archive): Rewrite size computation
66         to prevent it from reaching negative values. Based on
67         report by Denis Excoffier <Denis.Excoffier@free.fr>.
68
69 2010-02-25  Sergey Poznyakoff  <gray@gnu.org.ua>
70
71         Supply more information to the --to-command script.
72         * src/system.c (stat_to_env): Pass information about the current
73         volume in variables TAR_ARCHIVE, TAR_VOLUME, TAR_BLOCKING_FACTOR,
74         TAR_FORMAT.
75         * doc/tar.texi: Document new environment variables.
76         * NEWS: Likewise.
77         * configure.ac: Version number 1.22.91.
78
79 2010-02-17  Sergey Poznyakoff  <gray@gnu.org.ua>
80
81         Minor change.
82         * src/names.c (regex_usage_warning): Fix warning message.
83
84 2010-02-05  Sergey Poznyakoff  <gray@gnu.org.ua>
85
86         Update THANKS
87
88 2010-02-05  Ondřej Vašík  <ovasik@redhat.com>
89
90         Bugfix (tiny change)
91         * src/xheader.c (xheader_read): Remove unnecessary call
92         to xheader_init.
93
94 2010-01-26  Sergey Poznyakoff  <gray@gnu.org.ua>
95
96         Enable silent build mode.
97         * configure.ac: Require automake 1.11, autoconf 2.63. Enable
98         silent rules.
99         * NEWS: Update.
100         * lib/Makefile.am (rmt-command.h): Silent the rule.
101
102 2010-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
103
104         Read POSIX multivolume archives split at the header boundary.
105         * src/common.h (read_header_mode): New enum.
106         (read_header): Change type of the 3rd argument.
107         * src/list.c (read_header): Change type of the 3rd argument.
108         All callers updated.
109         * src/buffer.c (try_new_volume): Allow for volumes split at the
110         extended/ustar header boundary. This is against POSIX specs, but
111         we must be able to read such archives anyway.
112
113         * tests/multiv07.at: New test case.
114         * tests/Makefile.am: Add multiv07.at
115         * tests/testsuite.at: Likewise.
116
117         * src/compare.c: Update calls to read_header.
118         * src/delete.c: Likewise.
119         * src/update.c: Likewise.
120
121 2010-01-24  Sergey Poznyakoff  <gray@gnu.org.ua>
122
123         Minor change.
124         * NEWS: Update.
125         * doc/tar.texi: Update.
126         * src/create.c (finish_header): Minor change.
127
128 2010-01-24  Rob Vermaas  <rob.vermaas@gmail.com>
129
130         Bugfix (tiny change).
131         * src/tar.c (format_default_settings)[REMOTE_SHELL]: Fix
132         misplaced comma.
133
134 2010-01-24  Sergey Poznyakoff  <gray@gnu.org.ua>
135
136         Minor fix.
137         * src/incremen.c (read_incr_db_01)
138         (read_directory_file): Initialize bufsize to 0.
139         Suggested by noordsij@cs.helsinki.fi.
140
141         Improve handling of --test-label.
142         * src/list.c (print_volume_label): New function.
143         (print_header): Call print_volume_label.
144         (test_archive_label): New function.
145         * src/buffer.c (VOLUME_LABEL_APPEND): Remove.
146         (VOLUME_TEXT, VOLUME_TEXT_LEN): New macros
147         (drop_volume_label_suffix): New function.
148         (check_label_pattern): Use drop_volume_label_suffix.
149         * src/common.h (subcommand): New constant TEST_LABEL_SUBCOMMAND.
150         (test_label_option): Remove.
151         (drop_volume_label_suffix): New proto.
152         (test_archive_label): New proto.
153         * src/names.c (all_names_found): Remove test for
154         test_label_option.
155         * src/tar.c (subcommand_string): Handle TEST_LABEL_SUBCOMMAND.
156         (set_subcommand_option): Improve diagnostics.
157         (parse_opt): Set subcommand if --test-label is given.
158         (main): Handle TEST_LABEL_SUBCOMMAND.
159
160         Fix listing of volume labels (in particular in PAX archives).
161         * src/buffer.c (match_volume_label): Call set_volume_label.
162         (check_label_pattern): Get label string
163         as argument.
164         (match_volume_label): Handle volume labels stored in
165         global PAX headers.
166         * src/common.c (print_header,read_header): Change signature.
167         (read_header_primitive): Remove prototype.
168         * src/list.c (recent_global_header): New static.
169         (list_archive): Always print volume labels.
170         (read_header_primitive): Remove.
171         (read_header): Change the signature (all callers updated)
172         Save the recent global header.
173         (volume_label_printed): New static.
174         (simple_print_header): New function (ex-print_header).
175         (print_header): Change the signature (all callers updated).
176         For POSIX formats, print first volume header (if set).
177         * src/xheader.c (xheader_write_global): Write the data
178         accumulated in xhdr->stk even if keyword_global_override_list
179         is empty.
180         (xheader_read): On unexpected EOF, report error instead of
181         coredumping.
182         (XHDR_PROTECTED, XHDR_GLOBAL): New defines.
183         (struct xhdr_tab): Remove `protected' with `flags'. All uses
184         updated.
185         (decg): If XHDR_GLOBAL bit is set, call the keyword's decode
186         method instead of adding it to `kwl'.
187
188         * src/compare.c: Update calls to read_header.
189         * src/create.c: Likewise.
190         * src/delete.c: Likewise.
191         * src/update.c: Likewise.
192         * src/extract.c: Likewise.
193         (extract_volhdr): Do not print "Reading <label>" statement,
194         because
195         it is inconsistent: it is not printed if the volume begins with a
196         member continued from the previous volume.
197
198         * tests/label01.at: New testcase.
199         * tests/label02.at: New testcase.
200         * tests/Makefile.am, tests/testsuite.at: Add new testcases.
201
202 2010-01-22  Sergey Poznyakoff  <gray@gnu.org.ua>
203
204         Fix prefix length calculation in ustar mode.
205         * src/create.c (split_long_name): Fix prefix length
206         calculation.
207         (write_ustar_long_name): Improve ustar mode compatibility
208         with the Sun version.
209
210 2009-10-14  Sergey Poznyakoff  <gray@gnu.org.ua>
211
212         Rewrite update algorithm.
213         * src/common.h (namebuf_t): New typedef.
214         (namebuf_create, namebuf_free)
215         (namebuf_name): New prototypes.
216         (remname): New prototype.
217         * src/misc.c (struct namebuf): New structure.
218         (namebuf_create, namebuf_free)
219         (namebuf_name): New functions.
220         * src/create.c (dup_dir0): Remove is_avoided_name
221         checks. This is taken care of in update_archive.
222         * src/incremen.c (scan_directory): Use namebuf
223         to produce full file names.
224         * src/names.c (nametail): Remove extra level of
225         indirection. All uses updated.
226         (avoided_name_table, add_avoided_name)
227         (is_avoided_name): Remove.
228         * src/update.c (update_archive): Change algorithm.
229         Instead of adding unmodified files to the avoided_name
230         table, create namelist so that it contains only
231         modified files.
232
233         * tests/Makefile.am: Add update01.at, update02.at
234         * tests/testsuite.at: Likewise.
235         * tests/update.at (AT_KEYWORDS): Add update00.
236
237         Minor changes.
238         * src/tar.c (main): Ignore SIGPIPE.
239         * src/system.c (sys_child_open_for_compress)
240         (sys_child_open_for_uncompress): Reset SIGPIPE
241         in child to default.
242         * tests/remfiles01.at: Avoid race conditions.
243         * tests/remfiles02.at: Likewise.
244
245         Bugfix.
246         * src/buffer.c (_open_archive): Call guess_seekable_archive
247         only if the call to open_compressed_archive succeeded.
248
249 2009-10-10  Sergey Poznyakoff  <gray@gnu.org.ua>
250
251         Improve previous changes.
252         * acinclude.m4: Fix typos.
253         * gnulib.modules: Add xvasprintf.
254         * src/common.h: Include xvasprintf.h.
255         * src/tar.c (options): Remove docstrings for --gzip, --bzip2,
256         --compress, --lzop, --lzma and --xz.
257         (tar_help_filter): Generate these using actual values of
258         *_PROGRAM constants.
259         (format_default_settings): Use xasprintf.
260         (parse_opt): Use *_PROGRAM defines instead of hardcoded
261         program names.
262
263         Allow installers to specify alternative program names for
264         compression programs.
265         This adds --with-gzip, --with-bzip2 etc. switches to the
266         configure, so that
267         one can do, e.g. ./configure --with-bzip2=lbzip2 and have
268         lbzip2 executed
269         whenever user calls `tar --bzip2'.
270
271         * acinclude.m4: New file.
272         * configure.ac: Add TAR_COMPR_PROGRAM invocations for
273         the supported compressors.
274         * src/buffer.c (magic): Use *_COMPRESSOR defines instead
275         of hardcoded program names.
276         * src/suffix.c (compression_suffixes): Likewise.
277
278 2009-10-09  Sergey Poznyakoff  <gray@gnu.org.ua>
279
280         Minor fix.
281         * src/buffer.c (magic): Fix `xz' entry: add the name of the
282         program.
283         * src/suffix.c (compression_suffixes, nsuffixes): Mark as static.
284
285 2009-10-07  Sergey Poznyakoff  <gray@gnu.org.ua>
286
287         Provide a way to explicitly set mtime for extended header
288         ustar blocks.
289         * src/tar.c (struct textual_date): ts is a copy of the structure,
290         not a pointer to it. Date is a copy as well, hence the `const' is
291         taken away.
292         (get_date_or_file): Return 0/1 depending on success/failure.
293         Copy timestamp to the `ts' member. Store a copy of the string
294         in `date'.
295         (report_textual_dates): Report only if verbose_option is set,
296         but always free the list.
297         (expand_pax_option): New function.
298         (parse_opt): Preprocess the argument to xheader_set_option with
299         expand_pax_option.
300         (decode_options): Call report_textual_dates unconditionally.
301         * src/xheader.c (exthdr_mtime_option, exthdr_mtime)
302         (globexthdr_mtime_option, globexthdr_mtime): New statics.
303         (xheader_set_keyword_equal): handle exthdr.mtime and
304         globexthdr.mtime.
305         (xheader_write): Override `t' argument if a corresponding
306         exthdr.mtime or globexthdr.mtime option is set.
307         * NEWS: Update
308         * doc/tar.texi: Document the changes.
309
310         Use file's mtime as mtime for its extended header.
311         This makes two pax archives binary equivalent if they
312         have the same contents and care is taken to make extended
313         headers otherwise reproducible, e.g. by using:
314
315           --pax-option=exthdr.name=%d/PaxHeaders/%f,atime:=0
316
317         Proposed by Michael D. Adams <mdmkolbe@gmail.com>.
318
319         * src/common.h (start_private_header): Take time_t as 3rd param.
320         (xheader_write): Likewise.
321         * src/create.c (start_private_header): Take time_t as 3rd param.
322         All callers updated.
323         (write_extended): Use file's mtime as mtime for its extended
324         header,
325         Use current time stamp as mtime for global headers.
326         (xheader_write): Take time_t as 3rd param.
327
328         Fix bugs in handling the --remove-files option.
329         Make sure the files are deleted only if they were succesfully
330         stored
331         to the archive.
332
333         * src/exit.c: New file.
334         * src/unlink.c: New file.
335         * src/Makefile.am (tar_SOURCES): Add exit.c and unlink.c.
336         * src/common.h: Include progname.h
337         (program_name): Remove global.
338         (records_written): New extern.
339         (queue_deferred_unlink, finish_deferred_unlinks): New prototypes.
340         (fatal_exit_hook): New extern.
341         * src/create.c (create_archive): Call finish_deferred_unlinks.
342         (dump_hard_link, dump_file0): Don't actually unlink the file,
343         queue it to deferred_unlinks instead.
344         * src/delete.c (records_written): Remove extern: declared in
345         common.h.
346         * src/extract.c (extract_archive): Set fatal_exit_hook.
347         (fatal_exit, xalloc_die): Move to exit.c
348         * src/system.c (sys_wait_for_child): Exit immediately
349         if the child dies or exits with a non-zero status.
350         (sys_child_open_for_compress)
351         (sys_child_open_for_uncompress): Use set_program_name,
352         instead of setting program_name directly.
353         * src/tar.c (main): Use set_program_name,
354         instead of setting program_name directly.
355
356         * tests/Makefile.am (TESTSUITE_AT): Add remfiles01.at
357         and remfiles02.at.
358         * tests/testsuite.at: Likewise.
359         * tests/gzip.at: Reflect the above changes.
360
361 2009-10-04  Sergey Poznyakoff  <gray@gnu.org.ua>
362
363         Fix bug in OLDGNU format creation.
364         See tests/append02.at for a detailed description
365
366         * src/common.h (MODE_FROM_HEADER): Take additional argument.
367         (mode_from_header): Likewise.
368         * src/create.c (mode_to_chars): Store all mode bits if
369         using OLDGNU_FORMAT. This reverses f4e4adea80a.
370         * src/list.c (decode_header): Use header mode field
371         to discern between GNU and OLDGNU formats.
372         (mode_from_header): Store unrecognized mode bits (from 10th up)
373         in the location pointed to by the third parameter.
374         * tests/append02.at: Update documentation and references.
375
376 2009-09-16  Sergey Poznyakoff  <gray@gnu.org.ua>
377
378         Restore extra help output.
379         * src/tar.c (tar_list_quoting_styles): Change first argument to
380         struct obstack.
381         (format_default_settings): New function.
382         (show_default_settings)
383         (show_default_settings_fs): Removed.
384         (tar_help): Removed.
385         (tar_help_filter): New function.
386         (argp): Set help_filter.
387         (parse_opt): Fix error message.
388
389 2009-09-08  Sergey Poznyakoff  <gray@gnu.org.ua>
390
391         Improve command line option handling.
392         * gnulib.modules: Add argp-version-etc and progname,
393         use getopt-gnu instead of getopt.
394         * src/tar.c (HANG_OPTION, USAGE_OPTION)
395         (VERSION_OPTION): Remove.
396         (options): Remove corresponding options. Let argp
397         handle them.
398         (parse_opt): Likewise.
399         (_argp_hang): Removed.
400         (tar_authors): New variable.
401         (decode_options): Call argp_version_setup.
402         Do not use ARGP_NO_HELP flag in the call to argp_parse.
403
404         Avoid overwriting exit_status with a value indicating less
405         important condition.
406         * src/tar.c (set_exit_status): New function.
407         * src/common.h (set_exit_status): New prototype.
408         * src/compare.c: Use set_exit_status instead of
409         exit_status assignments.
410         * src/create.c: Likewise.
411         * src/misc.c: Likewise.
412
413         * src/system.c (wait_for_grandchild): Use auto variable
414         instead of the global exit_status.
415         * src/incremen.c (scan_directory): Use file_removed_diag
416         instead of stat_diag.
417
418         Automatic detection of seekable archives.
419         * src/buffer.c (guess_seekable_archive): New function.
420         (_open_archive): Call guess_seekable_archive for archives
421         open for reading.
422         (new_volume): Likewise.
423         * src/common.h (seek_option): New global.
424         * src/tar.c (options): New option --no-seek.
425         (parse_opt): --seek and --no-seek set seek_option,
426         not seekable_archive.
427         (decode_options): Initialize seek_option to -1.
428
429         * NEWS: Update.
430         * doc/tar.texi: Update.
431
432 2009-08-27  Sergey Poznyakoff  <gray@gnu.org.ua>
433
434         Fix testcases.
435         * tests/extrac08.at: Ensure a predictable umask value.
436         * tests/xform-h.at (xform): do not depend on file name
437         ordering.
438
439 2009-08-13  Sergey Poznyakoff  <gray@gnu.org.ua>
440
441         Fix interaction between --listed-incremental and -C
442         * src/incremen.c (read_directory_file): Execute eventual -C dir
443         after opening the snapshot file.
444         (collect_and_sort_names): Remove call to chdir_do
445         * tests/incr05.at, tests/incr06.at: Use relative file names for
446         snapshot files.
447
448 2009-08-12  Sergey Poznyakoff  <gray@gnu.org.ua>
449
450         Update for new exclude module from gnulib. Add testcases by
451         Phil Proudman.
452         * src/names.c (is_pattern): Remove.
453         (regex_usage_warning): Use fnmatch_pattern_has_wildcards
454         instead of
455         is_pattern.
456         * src/tar.c: New option --exclude-backups.
457         (vcs_file_table, backup_file_table): New globals.
458         (add_exclude_array): New function.
459         * tests/exclude01.at, tests/exclude02.at,
460         tests/exclude03.at, tests/exclude04.at,
461         tests/exclude05.at: New testcases. Supplied by Phil Proudman.
462         * tests/Makefile.am (TESTSUITE_AT): Add new tests.
463         * tests/testsuite.at: Add new tests.
464         * THANKS: Update.
465
466 2009-08-10  Sergey Poznyakoff  <gray@gnu.org.ua>
467
468         Remove src/version.c (reappeared after migration to Git)
469
470 2009-08-09  Sergey Poznyakoff  <gray@gnu.org.ua>
471
472         Minor fixes.
473         * src/misc.c (file_removed_diag): Set exit code to
474         TAREXIT_DIFFERS.
475
476 2009-08-08  Sergey Poznyakoff  <gray@gnu.org.ua>
477
478         Minor fixes
479
480         Fix handling of files removed during incremental dumps.
481         Changes to src/create.c and src/incremen.c are partially
482         based on patch from Alexander Peslyak <solar at openwall.com>.
483
484         The new testcases require paxutils commit f653a2b or later.
485
486         * src/common.h (struct name): New member `cmdline'.
487         (dump_file): Change type of the 2nd argument to bool.
488         (file_removed_diag, dir_removed_diag): New prototypes.
489         (addname): New argument `cmdline'.
490         (name_from_list): Change return value.
491         * src/create.c (dump_dir0, dump_dir): top_level is bool.
492         (create_archive): Update calls to name_from_list.
493         Take advantage of the name->cmdline to set top_level argument
494         during incremental backups.
495         (dump_file0): top_level is bool.
496         Do not bail out if a no-top-level file disappears during
497         incremental
498         backup, use file_removed_diag instead.
499         (dump_filed): top_level is bool.
500         * src/incremen.c (update_parent_directory): Silently ignore
501         ENOENT.  It should have already been reported elsewhere.
502         (scan_directory): Use dir_removed_diag to report missing
503         directories.
504         * src/misc.c (file_removed_diag, dir_removed_diag): New functions.
505         * src/names.c (name_gather): Set ->cmdname.
506         (addname): Likewise. All uses updated.
507         (name_from_list): Return struct name const *. All uses updated.
508
509         * tests/filerem01.at: New testcase.
510         * tests/filerem02.at: New testcase.
511         * tests/Makefile.am, tests/testsuite.at: Add filerem01.at,
512         filerem02.at
513         * tests/grow.at, test/truncate.at: Use new syntax for genfile
514         --run.
515
516         * NEWS: Update.
517         * doc/tar.texi: Minor fix.
518
519         Optimize searches for directory structures by keeping a pointer
520         to struct directory in struct name.
521         * src/common.h (struct name): New member `directory' replaces
522         dir_contents. Rearrange members.
523         (rebase_directory): Change signature.
524         (scan_directory): Change signature.
525         (name_fill_directory)
526         (directory_contents, safe_directory_contents): New prototypes.
527         (append_incremental_renames): Change signature.
528         (replace_prefix): New proto.
529         * src/compare.c (diff_dumpdir): Use directory_contents +
530         scan_directory.
531         * src/create.c
532         * src/incremen.c (replace_prefix): Move to misc.c
533         (rebase_directory): Rewrite.
534         (scan_directory): Return pointer to struct directory.
535         (directory_contents, safe_directory_contents): New functions.
536         (get_directory_contents): Remove.
537         (name_fill_directory): New function.
538         (append_incremental_renames): Rewrite. This also fixes a memory
539         leak.
540         * src/names.c (name_gather, addname): Reflect changes in struct
541         name.
542         (add_hierarchy_to_namelist): Rewrite using name_fill_directory and
543         directory_contents.
544         (rebase_child_list): Update call to rebase_directory.
545         (collect_and_sort_names): Optimize
546
547         * src/misc.c (replace_prefix): New function.
548         * src/names.c (add_hierarchy_to_namelist): Use new
549         get_directory_contents.
550
551         * tests/incr05.at: New test case.
552         * tests/incr06.at: New test case.
553         * tests/Makefile.am, test/testsuite.at: Add incr05.at and
554         incr06.at.
555
556         * doc/Makefile.am (check-options): Improve rule.
557         * doc/tar.texi, NEWS: Update.
558
559 2009-08-07  Sergey Poznyakoff  <gray@gnu.org.ua>
560
561         Minor fixes.
562         * src/common.h (rebase_directory): New prototype.
563         * src/incremen.c (rebase_directory): Use replace_prefix.
564         * src/names.c (collect_and_sort_names): Abort if
565         hash_insert fails.
566
567         Improve listed incremental dumps.
568         The modified algorithm tries to avoid dumping the same
569         directory twice and ensures the order of the directories
570         in the resulting archive is the same, whatever their order
571         on the command line.  It also fixes the operation of
572         --listed-incremental -C.
573
574         * gnulib.modules: Add canonicalize
575         * src/common.h (incremental_level): New global.
576         (check_exclusion_tags): first argument is const.
577         (get_directory_contents): Add third argument.
578         (zap_slashes, normalize_filename): New prototypes.
579         (chdir_count): New prototype.
580         (WARN_VERBOSE_WARNINGS): New define.
581         (WARN_ALL): Exclude WARN_VERBOSE_WARNINGS.
582         * src/compare.c (diff_dumpdir): Update the call to
583         get_directory_contents.
584         * src/create.c (check_exclusion_tags): First argument is const.
585         Use ISSLASH and DIRECTORY_SEPARATOR instead of referring to '/'.
586
587         * src/incremen.c (struct directory): New member `caname'.
588         (hash_directory_name): Rename to
589         hash_directory_canonical_name. Operate
590         on the canonical name.
591         (compare_directory_names): Rename to
592         compare_directory_canonical_names.
593         Operate on the canonical name.
594         (make_directory): Take two arguments.
595         (free_directory): Free caname.
596         (attach_directory): Create caname.
597         (find_directory): Use caname for lookups.
598         (PD_VERBOSE): Remove.
599         (PD_FORCE_INIT): New define.
600         (procdir): First argument is const.
601         Reinitialize directory if PD_FORCE_INIT bit is set.
602         Do not use PD_VERBOSE or verbose_option for issuing warnings.
603         Rely on WARNOPT instead.
604         Always set *entry.
605         (scan_directory): Take three arguments. The third one is a boolean
606         which is true if the directory is explicitly mentioned on
607         the command
608         line.
609         (get_directory_contents): Remove.  Use scan_directory instead.
610         All callers updated.
611         (read_directory_file): Truncate the file if --level=0 is given.
612         * src/misc.c: Include canonicalize.h
613         (zap_slashes, normalize_filename): New functions.
614         (chdir_count): New function.
615         * src/names.c (add_hierarchy_to_namelist): Take three arguments,
616         as
617         get_directory_contents and scan_directory.
618         (collect_and_sort_names): Allow at most one -C, before file name
619         arguments.
620         Read directory file after eventual changing to another directory.
621         Avoid adding the same directory under different pathnames to
622         the list.
623         * src/tar.c: New option --level.
624
625         * tests/incr03.at, tests/incr04.at, tests/listed01.at,
626         tests/listed02.at, tests/rename01.at, tests/rename02.at,
627         tests/rename03.at: Update for new tar behavior.
628         * tests/multiv01.at: Do not use --listed-incremental.
629
630 2009-08-05  Sergey Poznyakoff  <gray@gnu.org.ua>
631
632         Forgotten to push src/warning.c
633
634         Implement the --warning option.
635         * src/warning.c: New file.
636         * src/Makefile.am: Add warning.c
637         * src/common.h: Provide definitions for warning classes.
638         (warning_option): New global.
639         (WARNOPT): New define.
640         (set_warning_option): New prototype.
641         * src/tar.c: New option `--warning'.
642         * src/compare.c: When applicable WARNOPT instead of WARN.
643         * src/create.c: Likewise.
644         * src/extract.c: Likewise.
645         * src/incremen.c: Likewise.
646         * src/list.c: Likewise.
647
648         * NEWS, doc/tar.texi: Update.
649
650 2009-08-05  Carl Worth  <cworth@cworth.org>
651
652         Fix descriptions of some options (tiny change)
653
654 2009-08-05  Sergey Poznyakoff  <gray@gnu.org.ua>
655
656         Fix backup handling and restoring file modes of existing
657         directories
658         * NEWS, THANKS: Update
659         * src/extract.c (extract_dir): reset status to 0 if the
660         directory already exists.
661         * src/misc.c (maybe_backup_file): Assign before_backup_name
662         and clear after_backup_name before checking if we really need
663         to backup the file.
664         * tests/backup01.at: New testcase.
665         * tests/extrac08.at: New testcase.
666         * tests/Makefile.am, tests/testsuite.at: Add extrac08.at and
667         backup01.at
668
669 2009-07-30  Sergey Poznyakoff  <gray@gnu.org.ua>
670
671         Fix hard links recognition with -c --remove-files
672         * src/create.c (dump_hard_link): Always look up in the link table
673         if remove_files_option is set. Patch suggested by Theodore Ts'o
674         <tytso@mit.edu>.
675         (check_links): Remove extra newline from the warning message.
676         * tests/link02.at, tests/link03.at: New testcases.
677         * tests/Makefile.am (TESTSUITE_AT): Add link02.at and link03.at
678         * tests/testsuite.at: Include link02.at and link03.at
679
680         Fix handling of hard link targets by -c --transform
681         * src/create.c (file_count_links): Transform link target
682         before the look up.
683         * tests/xform-h.at: New test case.
684         * tests/Makefile.am (TESTSUITE_AT): Add xform-h.at.
685         * tests/testsuite.at: Add xform-h.at
686
687 2009-06-23  Sergey Poznyakoff  <gray@gnu.org.ua>
688
689         Minor fix.
690         * src/extract.c (file_newer_p): Do not report error on ENOENT
691
692 2009-06-19  Sergey Poznyakoff  <gray@gnu.org.ua>
693
694         Remove rebox.el (reappeared after migration to Git)
695
696 2009-06-18  Sergey Poznyakoff  <gray@gnu.org.ua>
697
698         Remove files that were removed in CVS, but reappeared after
699         migration to Git
700
701 2009-06-18  David Bartley  <dtbartle@csclub.uwaterloo.ca>
702
703         Fix Solaris bug where chmod fails if we don't have
704         PRIV_SYS_LINKDIR
705         * gnulib.modules: Add priv-set.
706         * src/extract.c (set_mode, extract_archive): Restore
707         PRIV_SYS_LINKDIR on chmod failure.
708         * src/tar.c (main): Drop PRIV_SYS_LINKDIR on startup.
709
710 2009-06-18  Sergey Poznyakoff  <gray@gnu.org.ua>
711
712         Ensure default behavior for SIGPIPE
713         * src/tar.c (main): Install default handler for SIGPIPE.
714         Proposed by Bastian Blank.
715
716 2009-06-18  Eric Blake  <ebb9@byu.net>
717
718         Follow autoconf recommendation for TESTSUITEFLAGS.
719         * tests/Makefile.am (check-local, installcheck-local): Honor
720         TESTSUITEFLAGS.
721
722 2009-06-18  Sergey Poznyakoff  <gray@gnu.org.ua>
723
724         Fix handling of sub-subprocess returns.
725         * src/system.c (wait_for_grandchild): New function.
726         (sys_child_open_for_compress)
727         (sys_child_open_for_uncompress): Use wait_for_grandchild
728         to manage grandchild return.
729
730 2009-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
731
732         Report record size only if the archive refers to a device.
733         * Makefile.am (INCLUDES): Add ../lib, for rmt-command.h
734         * src/buffer.c (short_read): Report the actual record size
735         only if the archive descriptor refers to a device.
736         * tests/pipe.at, tests/shortrec.at,
737         tests/sparsemvp.at: Reflect the above change.
738         * NEWS, configure.ac: Version 1.22.90
739
740 2009-05-14  Sergey Poznyakoff  <gray@gnu.org.ua>
741
742         Do not issue errors on existing files when given the -k option
743         * Makefile.am (dist-hook): Fix rule.
744         * src/extract.c (maybe_recoverable): Return three-state value.
745         (extract_dir): Skip extraction if maybe_recoverable indicates so.
746         (extract_file): Likewise.
747
748 2009-05-12  Eric Blake  <ebb9@byu.net>
749
750         Avoid undefined behavior
751         * src/xheader.c (xheader_set_keyword_equal): Pass correct type to
752         ctype macros.
753         * src/transform.c (run_case_conv): Likewise.
754
755 2009-05-12  Sergey Poznyakoff  <gray@gnu.org.ua>
756
757         Remove src/Makefile.in
758
759 2009-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>
760
761         Bugfixes.
762         * bootstrap (symlink_to_dir): Fix symlink calculation.
763         * doc/tar.texi: Minor fixes by Victor Villa and Stepan Kasal.
764
765 2009-03-07  Sergey Poznyakoff  <gray@gnu.org.ua>
766
767         Remove Makefile.in
768
769         Migrate to Git
770
771 2009-03-05  Sergey Poznyakoff  <gray@gnu.org.ua>
772
773         * src/incremen.c: --no-recursive works with --incremental.
774
775 2009-03-04  Sergey Poznyakoff  <gray@gnu.org.ua>
776
777         Add xz support.
778         
779         * src/buffer.c, src/suffix.c: Add support for xz compression.
780         * src/tar.c: New option --xz, for compression/decompression using xz.
781         Re-assign -J as a short equivalent of --xz.
782
783 2009-01-19  Sergey Poznyakoff  <gray@gnu.org.ua>
784
785         * doc/tar.texi: Fix typo.
786
787 2008-12-29  Sergey Poznyakoff  <gray@gnu.org.ua>
788
789         * bootstrap.conf: Include size_max.
790         * gnulib.modules: Remove memset, rmdir. Replace strdup with
791         strdup-posix. Patch by Eric Blake.
792         * src/tar.c: Implement -I as a shorthand for --use-compress-program.
793         * doc/tar.texi: Document -I.
794         * tests/pipe.at, tests/shortrec.at: Account for eventual 'Record
795         size' output.
796         * tests/testsuite.at (AT_TAR_CHECK_HOOK): New define
797         (AT_TAR_WITH_HOOK, TAR_IGNREC_HOOK): New macros.
798
799 2008-11-30  Sergey Poznyakoff  <gray@gnu.org.ua>
800
801         * src/xheader.c: Remove duplicate inclusion of fnmatch.h. Reported
802         by Jim Meyering.
803
804 2008-11-25  Sergey Poznyakoff  <gray@gnu.org.ua>
805
806         Do not try to drain the input pipe before closing the
807         archive. 
808         
809         * src/buffer.c (close_archive): Remove call to
810         sys_drain_input_pipe. Pass hit_eof as the second
811         argument to sys_wait_for_child.
812         * src/common.h (sys_drain_input_pipe): Remove
813         (sys_wait_for_child): Declare second argument.
814         * src/system.c (sys_drain_input_pipe): Remove.
815         (sys_wait_for_child): Take two arguments. The second one helps to
816         decide whether to tolerate child termination on SIGPIPE.
817
818 2008-11-03  Sergey Poznyakoff  <gray@gnu.org.ua>
819
820         * src/buffer.c (_write_volume_label): Fix typo, which prevented
821         `-V label -M' from working.
822
823 2008-10-30  Sergey Poznyakoff  <gray@gnu.org.ua>
824
825         * NEWS, configure.ac: Version 1.20.91
826         * doc/tar.texi: Document transformation scope flags.
827         * src/common.h (transform_symlinks_option): Remove in favor of
828         transformation scope flags.
829         (XFORM_REGFILE, XFORM_LINK, XFORM_SYMLINK, XFORM_ALL): New macros.
830         (transform_name, transform_member_name, transform_name_fp): Take
831         an additional argument, specifying scope flags.
832         * src/create.c: Reflect changes to transform_name.
833         * src/extract.c (extract_link, extract_symlink): Remove calls to
834         transform_member_name. It is done in read_header.
835         * src/list.c (decode_xform): Reflect change in data type of 2nd
836         argument. 
837         (transform_member_name): 2nd arg is int.
838         (decode_header): Transform file name and link target names.
839         * src/tar.c: Remove --transform-symlinks.
840         * src/transform.c (struct transform): New member `flags'.
841         (transform_flags): New variable.
842         (parse_transform_expr): Parse transformation scope flags. Allow to
843         set global flags using `flags=' syntax.
844         (_transform_name_to_obstack, transform_name_fp)
845         (transform_name): Take an additional argument, specifying scope
846         flags. 
847
848 2008-10-19  Sergey Poznyakoff  <gray@gnu.org.ua>
849
850         * THANKS: Add Ed Leaver.
851         * src/buffer.c (short_read): Remove !read_full_records condition,
852         which was always false on a first record and thus disabled record
853         size autodetection.  Thanks Ed Leaver for the patch.
854         (_gnu_flush_read): Handle blocking_factor == 1.
855         * tests/sparsemv.at: Reflect changes to buffer.c.
856         * tests/sparsemvp.at: Likewise.
857         * tests/volsize.at: Likewise.
858         * NEWS: Update.
859         
860 2008-10-16  Sergey Poznyakoff  <gray@gnu.org.ua>
861
862         * src/common.h (transform_symlinks_option): New global.
863         * src/create.c (dump_file0): Transform symlink targets only if
864         explicitly required.  Thanks Cyril Strejc for reporting the
865         problem.
866         * src/tar.c (parse_opt): New options --transform-symlinks and
867         --no-transform-symlinks. New alias --xform to the --transform
868         option.
869         * doc/tar.texi: Document --transform-symlinks
870         * NEWS: Update.
871         * THANKS: Update.
872         
873         * src/names.c (name_gather): Use xzalloc.
874         * src/buffer.c (short_read): Move record size detection before
875         the loop.
876         
877 2008-10-07  Sergey Poznyakoff  <gray@gnu.org.ua>
878
879         * src/tar.c (options): Add --lzop option.
880
881 2008-10-05  Xavier Hienne <xavier.hienne@free.fr> (tiny change)
882
883         * src/checkpoint.c (checkpoint_compile_action): Add missing
884         `else'. 
885
886 2008-09-24  Sergey Poznyakoff  <gray@gnu.org.ua>
887
888         * NEWS: Update.
889         * doc/tar.texi: Update.
890         * src/tar.c: New option --no-null.
891
892 2008-09-23  Sergey Poznyakoff  <gray@gnu.org.ua>
893
894         * src/common.h (filename_terminator): Remove global.
895         * src/tar.c (filename_terminator): New static.
896         * src/names.c (name_next_elt): Do not depend on
897         filename_terminator, this was a leftover from 1.13.
898
899 2008-09-18  Sergey Poznyakoff  <gray@gnu.org.ua>
900
901         * doc/tar.texi: Remove incorrect example.
902
903 2008-09-07  Sergey Poznyakoff  <gray@gnu.org.ua>
904
905         * src/incremen.c (dumpdir_create0): Eliminate gcc warning.
906         (attach_directory): Bugfix - add missing return statement.
907         * THANKS: Add Enric Hernandez
908
909 2008-07-31  Sergey Poznyakoff  <gray@gnu.org.ua>
910
911         * src/incremen.c (struct directory): New member `next'.  Change
912         type of `name'.
913         (dirhead, dirtail): New statics.
914         (make_directory): Reflect changes to struct directory.
915         (free_directory, attach_directory): New functions.
916         (dirlist_replace_prefix): New function.
917         (note_directory): Use attach_directory, instead of make_directory,
918         (find_directory, find_directory_meta): Use free_directory.
919         (procdir): Replace directory prefixes in directory list to avoid
920         marking subdirectories as renamed after renaming their parent
921         directory.
922         (append_incremental_renames): Iterate over directory list, not
923         hash table, to preserve logical ordering of renames.
924         * tests/rename04.at, tests/rename05.at: New test cases.
925         * tests/Makefile.am, tests/testsuite.at: Add rename04.at and
926         rename05.at.
927         * tests/atlocal.in (decho): New function.
928         * tests/multiv06.at: Use decho instead of echo2.
929         * tests/incremental.at: Raise wait interval to 2 seconds.
930         
931 2008-07-24  Sergey Poznyakoff  <gray@gnu.org.ua>
932
933         * src/tar.c (decode_options): Do not allow volume length less
934         than record size.
935         * src/buffer.c (_gnu_flush_write): Compensate for the effect
936         of eventual flush_archive occurring in the middle of buffer
937         move.
938         Increment records_written only if _flush_write was able to write
939         something.
940         * tests/multiv06.at: New testcase.
941         * tests/Makefile.am, test/testsuite.at: Add tests/multiv06.at
942
943 2008-06-26  Sergey Poznyakoff  <gray@gnu.org.ua>
944
945         * configure.ac, NEWS: Version 1.20.90
946         * doc/tar.texi: Document -J, --no-auto-compress, etc.
947         * src/buffer.c (ct_tar): New constant.
948         (magic): Add lzop support.  Proposed by Kevin Day
949         <thekevinday@gmail.com>.
950         (check_compressed_archive): Do not use autodetect if the
951         compression program was specified explicitly.
952         Fall back to analyzing archive name, if the autodetection fails.
953         * src/suffix.c: Add .lzo
954         * src/tar.c: New options --lzop and --no-auto-compress.
955         New short option -J (alias for --lzma).
956
957         * src/buffer.c (try_new_volume): Print more information with error
958         diagnostics.
959         (_gnu_flush_write): Improve error checking.  Adjust
960         real_s_sizeleft before calling new_volume to avoid creating
961         malformed multivolume headers.
962         * tests/delete05.at, tests/gzip.at, tests/ignfail.at,
963         tests/longv7.at, tests/lustar01.at, tests/lustar02.at,
964         tests/shortfile.at: Update to match new diagnostic wording
965         (see 2008-05-06).
966         
967         * NEWS: Update.
968
969 2008-06-14  Sergey Poznyakoff  <gray@gnu.org.ua>
970
971         * doc/tar.texi (exclude): Document support for new VCS.
972         * THANKS: Update.
973         * NEWS: Update. 
974         * tests/multiv05.at: Fix typos.
975         * tests/volsize.at: Remove a TZ dependency.
976         
977 2008-06-14  Dan Drake <dan@dandrake.org> (tiny change)
978
979         * src/tar.c (exclude_vcs_files): Support for Bazaar, Mercurial and
980         Darcs. 
981
982 2008-05-06  Sergey Poznyakoff  <gray@gnu.org.ua>
983
984         * src/tar.c (main): Reword the "delayed error" message. New
985         wording proposed by Karl Berry.
986
987 2008-02-20  Sergey Poznyakoff  <gray@gnu.org.ua>
988
989         * configure.ac: Raise version number to 1.20
990         * src/compare.c (diff_dumpdir): const.
991         * src/common.h (dumpdir_t,dumpdir_iter_t): New data types.
992         (dumpdir_create0,dumpdir_create,dumpdir_free,dumpdir_locate)
993         (dumpdir_first,dumpdir_next): New functions.
994         * src/incremen.c (dumpdir_create0,dumpdir_create,dumpdir_free)
995         (dumpdir_first,dumpdir_next): New functions.
996         (dumpdir_locate): Rewrite using binary search.
997         (struct directory): Change members char *contents, *icontents to
998         struct dumpdir *dump, *idump. All references updated.
999         (note_directory): Last arg is const.
1000         * src/names.c (add_hierarchy_to_namelist): buffer is const.
1001         * tests/incr03.at, tests/incr04.at, tests/rename02.at,
1002         tests/rename03.at: Insert calls to sleep between creation of files
1003         and adding them to the archive.
1004         
1005 2008-03-31  Sergey Poznyakoff  <gray@gnu.org.ua>
1006
1007         * src/create.c (dump_file0): Count links only for actually dumped
1008         files. 
1009
1010 2008-03-27  Sergey Poznyakoff  <gray@gnu.org.ua>
1011
1012         * NEWS: Document --no-check-device and --check-device.
1013         * doc/rendition.texi: Change the way FIXME-*refs are handled in
1014         !PROOF. 
1015         * doc/intern.texi, doc/tar.texi: Update.
1016         * doc/untabify.el: New file.
1017         * doc/Makefile.am (EXTRA_DIST): Add untabify.el
1018         (untabify, final, check-format, check-refs, check-fixmes)
1019         (check-unrevised, all-check-docs, check-docs): New rules.
1020         
1021         * src/common.h (check_device_option): New global.
1022         * src/incremen.c (procdir): Use boolean and instead of bitwise
1023         one. Patch by Jean-Louis Martineau.
1024         Compare device numbers only if check_device_option is set.
1025         * src/tar.c: New command line options --no-check-device and
1026         --check-device. Proposed by Jean-Louis Martineau.
1027         (parse_opt): Hanlde new options.
1028         (decode_options): Initialize check_device_option to true.
1029         
1030         * THANKS: Update
1031
1032 2008-03-06  Sergey Poznyakoff  <gray@gnu.org.ua>
1033
1034         * bootstrap: Use rsync to get translations.
1035         * doc/tar.texi: Minor change.
1036         * lib/.cvsignore: Update
1037         * po/.cvsignore: Update
1038         * src/system.c: Remove include setenv.h.
1039         * tests/atlocal.in (STAR_DATA_URL): Update.
1040         * tests/star/README: Update URL. 
1041
1042 2008-02-09  Sergey Poznyakoff  <gray@gnu.org.ua>
1043
1044         * doc/tar.texi: Fix a typo. Reported by Denis Excoffier.
1045
1046 2008-02-08  Sergey Poznyakoff  <gray@gnu.org.ua>
1047
1048         * NEWS: Update.
1049         * configure.ac: Version 1.19.90
1050         * po/POTFILES.in: Add missing files.
1051         * src/compare.c (verify_volume): Honor --ignore-zeros.
1052         Proposed by Jan-Benedict Glaw.
1053         * tests/shortfile.at (AT_KEYWORDS): Add shortfile0.
1054
1055 2008-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1056
1057         * NEWS: Update.
1058         * src/create.c (dump_file0): Apply transform_name to symlink
1059         targets.
1060
1061 2008-02-04  Sergey Poznyakoff  <gray@gnu.org.ua>
1062
1063         * src/transform.c: Support multiple --transform options. Support
1064         semicolon-separated lists of replace expressions.
1065         * NEWS, tar.texi: Document changes to the --transform option.
1066
1067 2008-01-30  Paul Eggert  <eggert@cs.ucla.edu>
1068
1069         * doc/tar.texi: Update Back-Cover text to reflect new GNU wording.
1070
1071 2007-12-17  Paul Eggert  <eggert@cs.ucla.edu>
1072
1073         Exit with nonzero status if a close fails on an archive.
1074         Problem (and initial trivial fix)
1075         * src/buffer.c (close_archive, new_volume): close_error, not
1076         close_warn. 
1077
1078 2007-12-05  Sergey Poznyakoff  <gray@gnu.org.ua>
1079
1080         * src/buffer.c (check_compressed_archive): Do not bail out if the
1081         file is too short, set boolean flag, passed as an argument
1082         instead.  This fixes a bug introduced on 2007-08-24. See also
1083         tests/shortupd.at.
1084
1085         * tests/Makefile.am, tests/testsuite.at: Add shortupd.at.
1086         * tests/shortupd.at: New test.
1087
1088 2007-11-12  Jim Meyering  <meyering@redhat.com>
1089
1090         Don't read from name[-1].
1091         * src/incremen.c (make_directory): Handle namelen == 0, since
1092         find_directory_meta calls make_directory ("").
1093
1094 2007-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1095
1096         * bootstrap (checkout): Use URL of the gnulib CVS mirror.
1097         * gnulib.modules: Add fseeko and snprintf.
1098
1099 2007-10-31  Sergey Poznyakoff  <gray@gnu.org.ua>
1100
1101         * src/checkpoint.c: New actions: bell and ttyout
1102         * src/system.c (sys_exec_info_script)
1103         (sys_exec_checkpoint_script): pass the current blocking factor in
1104         TAR_BLOCKING_FACTOR environment variable.
1105         * doc/tar.texi: Update
1106         * NEWS: Update
1107
1108 2007-10-30  Sergey Poznyakoff  <gray@gnu.org.ua>
1109
1110         * doc/Makefile.am: Use texi2html and the CVS version of gendocs.sh
1111         to create HTML versions of the manual.
1112         * doc/gendocs_template: Likewise.
1113         * doc/tar.texi: Document --hard-dereference and
1114         --checkpoint-action options. Improve documentation of
1115         --check-links.
1116
1117 2007-10-29  Sergey Poznyakoff  <gray@gnu.org.ua>
1118
1119         * NEWS: Update
1120         * configure.ac: Version 1.19.1
1121         * po/POTFILES.in: Add src/checkpoint.c
1122         * src/Makefile.am (tar_SOURCES): add checkpoint.c
1123         * src/checkpoint.c: New file - checkpoint handling.
1124         * src/buffer.c (checkpoint, do_checkpoint): Remove.
1125         (_flush_write, simple_flush_read, _gnu_flush_read): Use
1126         checkpoint_run.
1127         * src/common.h (enum checkpoint_style): Remove.
1128         (checkpoint_style): Remove.
1129         (DEFAULT_CHECKPOINT): New define.
1130         (hard_dereference_option): New variable.
1131         (sys_exec_checkpoint_script): New declaration.
1132         * src/create.c (file_count_links): do nothing if
1133         hard_dereference_option is set.
1134         * src/system.c (sys_exec_checkpoint_script): New function.
1135         (sys_exec_info_script): Restore SIGPIPE handler.
1136         * src/tar.c: (parse_opt): New options --hard-dereference,
1137         --checkpoint-action.
1138         (decode_options): Call checkpoint_finish_compile.
1139
1140         * src/system.c (sys_exec_info_script): Initialize buf. Problem
1141         reported by Bengt-Arne Fjellner.
1142
1143 2007-10-18  Jim Meyering  <jim@meyering.net>
1144
1145         Avoid compiler warnings.
1146         * src/list.c (read_header_primitive): Define two locals, to
1147         avoid incorrect "may be used uninitialized" warnings.
1148         * src/incremen.c (procdir): Remove decl of unused local, "len".
1149
1150 2007-10-18  Sergey Poznyakoff  <gray@gnu.org.ua>
1151
1152         * doc/tar.texi (gzip): Remove compression patent
1153         warning. According to Brett Smith, the patent is
1154         expired.
1155
1156 2007-10-17  Sergey Poznyakoff  <gray@gnu.org.ua>
1157
1158         * src/suffix.c: New file. Compress format detection by archive
1159         suffix (when creating). Suggested by Jean-Pierre Demailly.
1160         * src/Makefile.am: Add suffix.c
1161         * src/buffer.c (magic): Add an entry for new lzma format. Proposed
1162         by Lasse Collin.
1163         * src/common.h (set_comression_program_by_suffix): New prototype.
1164         * src/tar.c: New options --auto-compress (-a) and --lzma
1165         * THANKS: Add Lasse Collin and Jean-Pierre Demailly.
1166         * NEWS: Update
1167         * doc/tar.texi: Update
1168
1169 2007-10-12  Paul Eggert  <eggert@cs.ucla.edu>
1170
1171         * src/utf8.c (string_ascii_p): Recode to avoid bogus GCC 4.2.1
1172         warning about "comparison is always true due to limited range of
1173         data type" when char is unsigned.
1174
1175 2007-10-11  Paul Eggert  <eggert@cs.ucla.edu>
1176
1177         Adjust to recent gnulib changes.
1178         * configure.ac: Dont' check for strerror, since gnulib now does this.
1179         * .cvsignore: Add m4, tar-[0-9]*.
1180         * lib/.cvsignore: Adjust to various gnulib file name changes.
1181         Add .deps, rmt-command.h.
1182
1183 2007-10-10  Sergey Poznyakoff  <gray@gnu.org.ua>
1184
1185         * configure.ac, NEWS: Raise version number to 1.19
1186         * tests/star/README: Update
1187
1188 2007-10-05  Sergey Poznyakoff  <gray@gnu.org.ua>
1189
1190         * src/create.c (dump_regular_file): Fix file padding in case of
1191         truncation to zero size.
1192         * NEWS: Update
1193
1194 2007-10-04  Sergey Poznyakoff  <gray@gnu.org.ua>
1195
1196         * tests/T-null.at: Use AT_DATA for sample output.
1197
1198 2007-10-03  Sergey Poznyakoff  <gray@gnu.org.ua>
1199
1200         * src/incremen.c (try_purge_directory): Ensure that arguments to T
1201         and R are safe.
1202
1203 2007-09-29  Sergey Poznyakoff  <gray@gnu.org.ua>
1204
1205         * src/incremen.c (obstack_code_rename): Apply safer_name_suffix to
1206         name arguments before storing them in T and R records. Reported by
1207         Nicholas Cole.
1208
1209 2007-09-27  Sergey Poznyakoff  <gray@gnu.org.ua>
1210
1211         * configure.ac: Raise version number to 1.18.90
1212         * NEWS: Likewise
1213
1214         * doc/snapshot.texi: Document version 2.
1215         * doc/dumpdir.texi: Update.
1216
1217         Implement --exclude-tag* and --exclude-cache* options for listed
1218         incremental archives.
1219         New option --exclude-vcs to exclude VCS-specific files and
1220         directories.
1221
1222         * NEWS: Update
1223         * doc/tar.texi: Document --exclude-vcs option
1224         * src/common.h (exclusion_tag_warning, check_exclusion_tags): New
1225         prototypes.
1226         * src/create.c (exclusion_tag_warning, check_exclusion_tags):
1227         Remove static qualifier.
1228         (check_exclusion_tags): account for dirname without terminating
1229         slash.
1230         (dump_dir0): exclusion_tag_all is handled elsewhere.
1231         * src/incremen.c (struct directory): New member tagfile
1232         (make_directory): Initialize tagfile to NULL
1233         (procdir): New argument: entry
1234         Hanlde exclusion tags.
1235         (makedumpdir): Take into account directory->tagfile.
1236         (scan_directory): Hanlde exclusion tags.
1237         * src/tar.c: New option --exclude-vcs
1238         (exclude_vcs_files): New function
1239
1240 2007-09-14  Paul Eggert  <eggert@cs.ucla.edu>
1241
1242         * AUTHORS: Remove unnecessary information.  Just list the
1243         principal authors.
1244         * THANKS: Remove info duplicated from AUTHORS.
1245
1246 2007-08-25  Jim Meyering  <jim@meyering.net>
1247
1248         Don't include <getline.h>.  No longer needed.
1249         * src/incremen.c: Don't include <getline.h>.  No longer needed.
1250         * src/buffer.c: Likewise.
1251         * src/system.c: Likewise.
1252         * src/tar.c: Likewise.
1253
1254         Avoid shadowing and unused-variable warnings.
1255         * src/create.c (check_exclusion_tags): Remove declaration of unused
1256         local, "ret".
1257         * src/compare.c (diff_dumpdir): Rename stat->stat_data to avoid
1258         shadowing the syscall.
1259         * src/buffer.c (do_checkpoint): Don't shadow the write syscall.
1260         (try_new_volume): Avoid shadowing "access".
1261         * src/tar.c (decode_options): Rename index->idx to avoid shadowing.
1262         (find_argp_option): Rename option->o to avoid shadowing.
1263         * src/incremen.c (scan_directory): Rename local, dir_name->dir,
1264         to avoid shadowing the function.
1265         (get_directory_contents): Likewise.
1266         * src/system.c (global_pid): Rename from "pid", to avoid being
1267         shadowed by locals.
1268         * src/extract.c (apply_nonancestor_delayed_set_stat):
1269         Rename st->sb to avoid shadowing another local.
1270
1271 2007-08-24  Sergey Poznyakoff  <gray@gnu.org.ua>
1272
1273         * configure.ac, NEWS: Raise version number to 1.18.1
1274
1275         * src/buffer.c (check_compressed_archive): Detect files smaller
1276         than 512 bytes.
1277         * tests/shortfile.at: New test case for the above change.
1278         * tests/testsuite.at, tests/Makefile.am: Add shortfile.at
1279
1280 2007-08-19  Sergey Poznyakoff  <gray@gnu.org.ua>
1281
1282         * bootstrap: Gnulib initialization destroyed paxutils m4 files.
1283         Initialize paxutils structure after that of gnulib.
1284
1285 2007-08-12  Sergey Poznyakoff  <gray@gnu.org.ua>
1286
1287         * src/names.c (contains_dot_dot): Fix double-dot recognition in
1288         case of duplicate /. Patch by Dmitry V. Levin.
1289
1290         * bootstrap (symlink_to_gnulib): Make sure the target directory
1291         exists and create it if it does not.
1292
1293         * doc/tar.texi: Fix a typo.
1294
1295 2007-06-28  Sergey Poznyakoff  <gray@gnu.org.ua>
1296
1297         * bootstrap: Update for the change of the TP URL
1298
1299 2007-06-27  Sergey Poznyakoff  <gray@gnu.org.ua>
1300
1301         Relicense under GPLv3
1302
1303 2007-06-21  Sergey Poznyakoff  <gray@gnu.org.ua>
1304
1305         * tests/testsuite.at (AT_TAR_MKHIER): Skip test if genfile is
1306         unable to create the file
1307         * tests/lustar01.at: Likewise
1308
1309 2007-06-21  Eric Blake  <ebb9@byu.net>
1310
1311         Resolve testsuite failures 40-42 on cygwin.
1312         * tests/testsuite.at (AT_TAR_MKHIER): Skip tests when long
1313         file names cannot be created.
1314
1315 2007-06-16  Sergey Poznyakoff  <gray@gnu.org.ua>
1316
1317         * doc/Makefile.am (tar_TEXINFOS): Add tar-snapshot-edit.texi
1318         * doc/tar-snapshot-edit.texi: New file
1319         * doc/tar.texi (Fixing Snapshot Files): New appendix
1320
1321         * scripts/tar-snapshot-edit: New file
1322         * tests/extrac07.at: Add back write permissions on dir
1323
1324 2007-06-09  Sergey Poznyakoff  <gray@gnu.org.ua>
1325
1326         * tests/exclude.at: Sort the output.
1327
1328 2007-06-08  Sergey Poznyakoff  <gray@gnu.org.ua>
1329
1330         * configure.ac, NEWS: Raise version number to 1.17
1331
1332         * doc/tar.texi, doc/intern.texi: Replace: s/filename/file name/;
1333         s/(ASCII|ID|BSD)/@acronym{&}/;s/"[^"]+"/``&''/
1334         Use `path' only when it refers to search paths, use
1335         `file name' otherwise.
1336         Fix various errors (based on patch by Benno Schulenberg)
1337
1338         * doc/tar.texi (Operation Summary): Restore alphabetical order of
1339         the options.
1340
1341 2007-06-02  Sergey Poznyakoff  <gray@gnu.org.ua>
1342
1343         Fix bug, introduced on 2007-03-30.
1344
1345         * src/common.h (xform_type): New data type
1346         (transform_member_name): Last argument is of xform_type type
1347         All callers updated
1348
1349         * src/extract.c: Update calls to transform_member_name
1350         * src/list.c (decode_xform): Exempt symbolic links from component
1351         stripping and name suffix normalization.
1352
1353         * tests/extrac07.at: Update
1354
1355 2007-05-30  Sergey Poznyakoff  <gray@gnu.org.ua>
1356
1357         * src/xheader.c (decx): Unknown pax keywords produce a warning,
1358         not error.
1359
1360 2007-05-29  Paul Eggert  <eggert@cs.ucla.edu>
1361
1362         * src/misc.c (set_file_atime): Use gl_futimens, not futimens,
1363         due to gnulib change.
1364
1365 2007-05-19  Sergey Poznyakoff  <gray@gnu.org.ua>
1366
1367         * src/common.h (buffer_write_global_xheader): New function
1368         (struct xheader): Move definition to tar.h
1369         (extended_header): Remove global
1370         (xheader_init): New function
1371         (xheader_decode_global,xheader_store,xheader_read)
1372         (xheader_write_global,xheader_write,xheader_string_begin)
1373         (xheader_string_add,xheader_string_end): Take xhdr as first
1374         argument.
1375         * src/tar.h (struct xheader): New definition
1376         (struct tar_stat_info): New member xhdr (extended header).
1377
1378         * src/xheader.c (xheader_init): New function
1379         (xheader_decode_global,xheader_store,xheader_read)
1380         (xheader_write_global,xheader_write,xheader_string_begin)
1381         (xheader_string_add,xheader_string_end): Take xhdr as first
1382         argument.
1383
1384         * src/buffer.c (buffer_write_global_xheader): New function
1385         Update to use new xheader calls.
1386
1387         * src/compare.c, src/create.c, src/delete.c, src/list.c,
1388         src/sparse.c, src/tar.c, src/update.c: Global extended_header
1389         removed, use new xheader calls instead.
1390
1391         * tests/T-null.at: Minor fix
1392         * tests/atlocal.in (tarball_prereq): Discard eventual md5sum
1393         output.
1394
1395 2007-05-18  Sergey Poznyakoff  <gray@gnu.org.ua>
1396
1397         * src/create.c (dump_file0): Original ctime cannot be used as a
1398         directory change indicator if --remove-files is given.
1399
1400 2007-04-12  Paul Eggert  <eggert@cs.ucla.edu>
1401
1402         Adjust to latest Gnulib.
1403         * lib/.cvsignore: Add dirfd.c, dirfd.h, float+.h, mbscasecmp.c,
1404         stdio.h, stdio_.h, stdlib.h, stdlib_.h, time.h, time_.h, unistd.h.
1405         Remove exit.h, getcwd.h, mempcpy.h, memrchr.h, mkdtemp.h, stpcpy.h,
1406         strcase.h, strchrnul.h, strdup.h, strndup.h, strnlen.h, time_r.h,
1407         vsnprintf.h.
1408         * m4/.cvsignore: Remove localedir.h.  Sort.
1409
1410 2007-04-03  Paul Eggert  <eggert@cs.ucla.edu>
1411
1412         * src/common.h (closeopen): Remove decl.
1413         * src/misc.c: Don't include <sys/time.h>, <sys/resource.h>; no longer
1414         needed.
1415         (get_max_open_files, closeopen): Remove.  All callers removed.
1416         (chdir_dir): Use a different technique, which doesn't rely on closing
1417         all open files.
1418         * src/tar.c (main): Don't call closeopen.
1419
1420 2007-04-04  Sergey Poznyakoff  <gray@gnu.org.ua>
1421
1422         * NEWS: Update
1423         * doc/tar.texi: Update
1424         * src/system.c (sys_exec_info_script): Store the
1425         inter-communication fd in the environment variable TAR_FD
1426
1427 2007-04-03  Sergey Poznyakoff  <gray@gnu.org.ua>
1428
1429         * src/tar.c (main): Move closeopen after decode_options to
1430         allow shell process substitution to work.
1431         * tests/extrac07.at: Expect a warning on stderr.
1432
1433 2007-03-30  Sergey Poznyakoff  <gray@gnu.org.ua>
1434
1435         * src/common.h (transform_name_fp): Change signature
1436         (transform_member_name): New function
1437         * src/extract.c (extract_link, extract_symlink): Use
1438         transform_member_name instead of safer_name_suffix so that
1439         --transform and --strip-components affect links as well.
1440         * src/list.c (transform_member_name): New function
1441         (decode_header): Use transform_member_name
1442         * src/names.c (all_names_found): Remove check for matching_flags.
1443         * NEWS: Update
1444
1445         * TODO: Update
1446         * bootstrap (slurp): Remove any occurrences of $bt from the
1447         generated gnulib.mk
1448         * src/incremen.c: Do not include mkdtemp.h
1449
1450 2007-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1451
1452         Adjust to recent gnulib changes.
1453         * lib/.cvsignore: Add fchownat.c, rmt-command.h, strerror.c, string.h,
1454         string_.h, sys, sys_time_.h, unistd_.h, wchar_.h, wctype_.h.
1455         Remove localedir.h, size_max.h, xsize.h.
1456         * src/xheader.c: Don't include stpcpy.h; no longer needed, now that
1457         gnulib string.h defines stpcpy on all platforms.
1458
1459 2007-01-23  Sergey Poznyakoff  <gray@gnu.org.ua>
1460
1461         * doc/tar.texi: Document --exclude-caches* and --exclude-tag*
1462         options.
1463         * src/common.h (exclude_caches_option): Remove
1464         (enum exclusion_tag_type): New data type
1465         (add_exclude_tag): Rename to add_exclusion_tag
1466         (cachedir_file_p): New prototype
1467         * src/create.c (struct exclude_tag): rename to exclusion_tag
1468         (check_exclusion_tags): New function
1469         (cachedir_file_p): New function (from check_cache_directory)
1470         (dump_dir0,dump_file0): Use check_exclusion_tags
1471         * src/tar.c: New options --exclude-caches-all,
1472         --exclude-caches-under, --exclude-tag-all, --exclude-tag-under
1473         * tests/exclude.at: New file
1474         * tests/Makefile.am (TESTSUITE_AT): Add exclude.at
1475         * tests/testsuite.at: Add exclude.at
1476
1477 2007-01-19  Sergey Poznyakoff  <gray@gnu.org.ua>
1478
1479         * gnulib.modules: Require strerror
1480         * doc/gendocs_template: Fix typos
1481         * scripts/xsparse.c (expand_sparse): use ftruncate to handle the
1482         trailing hole
1483         * src/sparse.c (sparse_skip_file,pax_dump_header_1)
1484         (pax_decode_header): Keep track of the number of bytes
1485         written.
1486         * configure.ac: Version 1.16.2
1487         * NEWS: Update
1488
1489 2007-01-04  Sergey Poznyakoff  <gray@gnu.org.ua>
1490
1491         * src/compare.c (diff_dumpdir): Compare directory contents using
1492         dumpdir_cmp.  Do not free dumpdir_buffer, it will leave the
1493         incremental directory table in the inconsistent state and trigger
1494         full dump.
1495         (read_and_process): Process dumpdirs no matter what the archive
1496         format.
1497         * src/incremen.c (list_dumpdir): Minor fixes.
1498
1499         * src/compare.c (read_and_process): Fix type of "size"
1500
1501 2006-12-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1502
1503         * tests/T-null.at: Skip the test if genfile is not able to create
1504         the filename with an embedded newline.
1505
1506 2006-12-12  Paul Eggert  <eggert@cs.ucla.edu>
1507
1508         Port to Forte Developer 7 C 5.4 and C99.
1509         * src/common.h (add_exclude_tag): Add decl; C99 requires this
1510         and Forte warns about it.
1511         * src/incremen.c: Include <mkdtemp.h> for mkdtemp prototype,
1512         for same reason.
1513         * src/misc.c (get_max_open_files): Rewrite to avoid code that
1514         Forte C complains about as being unreachable.
1515         * src/xheader.c (mtime_code): Rewrite to avoid Forte error
1516         reported by Trond Hasle Amundsen.
1517
1518         * src/incremen.c (compare_dirnames): Rewrite to avoid casts.
1519         * src/utf8.c (string_ascii_p): Likewise.
1520         * src/xheader.c (mtime_coder, volume_size_coder, volume_offset_coder):
1521         Likewise.
1522
1523 2006-12-08  Sergey Poznyakoff  <gray@gnu.org.ua>
1524
1525         * bootstrap: Add paxutils files to dot_ignore.
1526
1527         * configure.ac: Raise version number to 1.16.1
1528         * bootstrap (slurp): Create .(cvs|git)ignore if not present
1529         * po/.cvsignore, m4/.cvsignore: Remove automatically generated
1530         files.
1531
1532 2006-12-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1533
1534         * NEWS: Update
1535         * Makefile.am (distclean-local): Fixed
1536         * doc/tar.texi: Update documentation of --exclude-tag
1537         * src/create.c (dump_dir0): Move checks for exclude tags to
1538         dump_file0.
1539         (dump_dir): Move calls to ensure_slash to dump_file0
1540         * src/extract.c (extract_file): Call skip_member if open fails.
1541         Patch proposed by Jan-Benedict Glaw <jbglaw@lug-owl.de>
1542         * tests/truncate.at: Use genfile instead of dd, because on some
1543         systems /dev/zero is not available.
1544
1545 2006-12-04  Paul Eggert  <eggert@cs.ucla.edu>
1546
1547         * NEWS: Fix some race conditions with tar -x --same-owner.
1548         * src/extract.c (ARCHIVED_PERMSTATS): Add a comment saying that
1549         S_IRWXG | S_IRWXO might be masked out.
1550         (set_mode): Set the mode if some bits were masked out originally.
1551         (set_stat): Don't chmod before chown, as that might temporarily
1552         grant permissions that we don't want to grant.  The chmod was
1553         there only to work around broken hosts, so add a comment advising
1554         users not to use those broken hosts instead.
1555         (repair_delayed_set_stat, extract_dir):
1556         Remember to mask out current umask before inverting permissions.
1557         (extract_dir): If the owner might change, or if the mode has
1558         special bits, create the directory 700 at first, but restore it later.
1559         (open_output_file): New arg mode; all uses changed.
1560         (extract_file, extract_node, extract_fifo): If the owner might
1561         change, omit group and other bits at first, but restore them after
1562         changing the owner.
1563
1564 2006-12-04  Jim Meyering  <jim@meyering.net>
1565
1566         * doc/tar.texi (Long Options): Remove doubled word.
1567
1568 2006-11-30  Sergey Poznyakoff  <gray@gnu.org.ua>
1569
1570         * src/xheader.c (xheader_read): Remove unused variable
1571
1572         * po/POTFILES.in: Remove src/mangle.c
1573
1574         * bootstrap: Implement --update-po and .bootstrap
1575
1576         * src/create.c (dump_dir0): Implement --exclude-tag option
1577         * src/tar.c: Likewise
1578         * doc/tar.texi (exclude): Document --exclude-tag
1579
1580 2006-11-29  Paul Eggert  <eggert@cs.ucla.edu>
1581
1582         * NEWS: Remove support for mangled names.
1583         * doc/tar.texi (verbose tutorial): Likewise.
1584         * src/Makefile.am (tar_SOURCES): Remove mangle.c.
1585         * src/common.h (extract_mangle): Remove decl.
1586         * src/extract.c (extract_mangle_wrapper): Remove.
1587         (prepare_to_extract): Remove support for mangled names.
1588         * src/list.c (read_and, print_header): Likewise.
1589         * src/mangle.c: Remove.
1590         * src/tar.h (GNUTYPE_NAMES): Remove.
1591
1592         Port to latest gnulib.  There were a lot of changes, so the
1593         simplest way to get this up and running was to switch to coreutils
1594         bootstrap procedure.  I noticed one feature missing after this
1595         merge: the ability to update a single .po file.  I can add that
1596         later if need be.
1597         * README-cvs, bootstrap.conf: New files.
1598         * lib/.cvsignore: Remove Makefile.am, printf-parse.c, vasnprintf.c.
1599         Add fstatat.c, gnulib.mk, openat-proc.c, same-inode.h, stat_.h,
1600         tempname.c, tempname.h, uinttostr.c.
1601         * lib/printf-parse.c, lib/vasnprintf.c: New files, from coreutils,
1602         to override gnulib, so that we don't need xsize.h.
1603         * bootstrap: Replace with coreutils bootstrap, except add support
1604         for paxutils.
1605         * configure.ac (gl_USE_SYSTEM_EXTENSIONS): Remove, as gl_EARLY now
1606         does this.
1607         (gl_EARLY, gl_INIT): Add.
1608         (tar_GNULIB): Remove.
1609         * gnulib.modules: Add configmake.
1610         * lib/Makefile.tmpl: Remove, replacing with....
1611         * lib/Makefile.am: New file.
1612         * src/Makefile.am (tar.o): Remove dependency: Automake does this
1613         for us.
1614         * src/tar.c: Include <configmake.h> and <rmt-command.h>, not
1615         <localedir.h>.
1616
1617 2006-11-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1618
1619         * src/xheader.c (mtime_coder): Treat non-null data as a pointer to
1620         struct timespec, overriding st->mtime
1621         * src/create.c (start_header): Pass mtime as a call-specific data
1622         to xheader_store.
1623
1624         * tests/truncate.at: Do not use 'k' modifier in dd options.
1625         * tests/append02.at: Do not depend on command timing.
1626
1627 2006-11-01  Sergey Poznyakoff  <gray@gnu.org.ua>
1628
1629         * src/tar.c (enum read_file_list_state.file_list_skip): New value
1630         (read_name_from_file): Skip zero-length entries
1631
1632         * tests/T-empty.at: New test case
1633         * tests/T-null.at: New test case
1634         * tests/extrac07.at: New test case
1635         * tests/Makefile.am: Add new test cases.
1636         * tests/testsuite.at: Add new test cases.
1637         * tests/extrac02.at: Add more keywords
1638         * tests/extrac04.at: Likewise
1639         * tests/extrac06.at: Likewise
1640         * tests/shortrec.at: Do not assume tar's default archive is stdout
1641
1642 2006-10-31  Sergey Poznyakoff  <gray@gnu.org.ua>
1643
1644         * src/extract.c, src/xheader.c: Call last_component instead of
1645         base_name. The latter returns a malloced string since 2006-03-11.
1646
1647 2006-10-21  Sergey Poznyakoff  <gray@gnu.org.ua>
1648
1649         * NEWS, configure.ac: Version 1.16
1650         * Makefile.am (distclean-local): New rule
1651
1652 2006-10-17  Sergey Poznyakoff  <gray@gnu.org.ua>
1653
1654         * src/tar.c: Fix help output formatting.  Thanks Benno
1655         Schulenberg.
1656
1657 2006-10-16  Sergey Poznyakoff  <gray@gnu.org.ua>
1658
1659         * Makefile.am (dist-hook): Create a cpio archive.
1660         * NEWS: Update
1661
1662 2006-10-14  Sergey Poznyakoff  <gray@gnu.org.ua>
1663
1664         * doc/tar.texi (Synopsis): Document tar exit codes.
1665         * src/create.c (dump_regular_file,dump_file0): Set exit_status to
1666         TAREXIT_DIFFERS if the file being dumped was truncated or
1667         otherwise changed.
1668         * src/tar.c: Do not attempt to close stderr after call to
1669         close_stdout.
1670         * tests/grow.at: New test case
1671         * tests/Makefile.am: New test grow.at
1672         * tests/testsuite.at: Likewise
1673         * tests/truncate.at (AT_KEYWORDS): Keyword `filechange'
1674         Test tar exit status.
1675
1676         * src/buffer.c (_open_archive): Make sure stdlis is set to stderr
1677         when we are writing archive to stdout (unless --index-file is
1678         used). Bug introduced on 2006-07-06.
1679         * tests/Makefile.am: New test verbose.at
1680         * tests/testsuite.at: Likewise
1681         * tests/indexfile.at (AT_KEYWORDS): Add stdout keyword
1682         * tests/verbose.at: New test case
1683
1684 2006-10-02  Sergey Poznyakoff  <gray@gnu.org.ua>
1685
1686         * THANKS: Add Joerg Weilbier
1687         * src/buffer.c (new_volume): Initialize current_block
1688         * src/xheader.c (xheader_string_end): Fix diagnostic message.
1689         * tests/multiv05.at: New testcase.
1690         * tests/Makefile.am, tests/testsuite.at: Add multiv05.at
1691
1692 2006-09-27  Sergey Poznyakoff  <gray@gnu.org.ua>
1693
1694         * bootstrap: Use ${package} instead of hardcoding package name
1695         * doc/tar.texi: Minor fix
1696         * src/tar.c (doc0, doc1, initialize_argp_doc): Removed.  Rely on
1697         the new argp method instead.
1698
1699 2006-09-12  Sergey Poznyakoff  <gray@gnu.org.ua>
1700
1701         * README: Fix a typo
1702
1703 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
1704
1705         Adjust to latest gnulib.
1706         * lib/.cvsignore: Add at-func.c, configmake.h, fchmodat.c,
1707         fcntl.h, fcntl_.h, inttypes_.h, lstat.c, lstat.h.
1708         * tests/testsuite.at (AT_TAR_MKHIER): Use install-sh -d
1709         rather than the no-longer-included mkinstalldirs.
1710
1711 2006-09-08  Sergey Poznyakoff  <gray@gnu.org.ua>
1712
1713         * src/incremen.c (try_purge_directory): Initialize struct st.  Fix
1714         condition for selecting candidates for removal.
1715         * README-alpha: List texinfo among build prerequisites for the CVS
1716         version.
1717
1718         * bootstrap (intl_files_to_remove): Do not remove m4/inttypes-h.m4
1719         and m4/inttypes-pri.m4
1720
1721 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
1722
1723         * bootstrap: Set XGETTEXT_OPTIONS to flag our printf-format functions,
1724         so that translators are warned about strings that are formats but
1725         don't look like formats.  This might help prevent core dumps.
1726         * configure.ac (AM_GNU_GETTEXT): Upgrade to need-formatstring-macros.
1727         Suggested by Eric Blake to avoid problems like
1728         <http://lists.gnu.org/archive/html/bug-coreutils/2006-07/msg00087.html>.
1729         (AM_GNU_GETTEXT_VERSION): Upgrade from 0.12.1 to 0.15.  The gettext
1730         manual says we should use the version number normally expected of
1731         maintainers, neither more nor less.
1732
1733         * bootstrap (get_translations):
1734         Don't exclude ky.po; it is working again.
1735
1736 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
1737
1738         * bootstrap (get_translations):
1739         Don't exclude ja.po; it is working again.
1740         Don't remove all old .po files if we're merely updating one.
1741         * po/.cvsignore: Add Makevars.
1742
1743 2006-08-07  Paul Eggert  <eggert@cs.ucla.edu>
1744
1745         * src/tar.c: Work around limitation imposed by gettext 0.15
1746         by concatenating strings with "\v" after translation.
1747         (doc): Remove, splitting into:
1748         (doc0, doc1): New constants.
1749         (argp): Don't use doc; just initialize to NULL.
1750         (initialize_argp_doc): New function.
1751         (decode_options): Use it.
1752
1753         * bootstrap: Redo po file retrieval to match Bison's method,
1754         since the translation project changed its index format.
1755         Don't use --assume-autoconf; it's now replaced
1756         by looking in configure.ac.
1757         (m4/codeset.m4, m4/intdiv.m4, m4/inttypes-pri.m4, m4/isc-posix.m4):
1758         (m4/lcmessage.m4, m4/onceonly_2_57.m4, m4/gettext.m4, m4/glibc21.m4):
1759         (m4/inttypes_h.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4):
1760         (m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4):
1761         Don't rename to ..._gl.m4, as this is no longer needed.
1762         (m4/geteext.m4): Patch to remove the need for intl/*.
1763         Use autopoint manually, then remove the intl files,
1764         then undo changes to gnulib files that autoreconf made,
1765         and then run aclocal/autoconf/autoheader/automake.
1766         This makes our bootstrap procedure closer to Bison's.
1767         (po/Makevars): Generate automatically.
1768         * configure.ac (AC_PREREQ): Update from 2.59 to 2.60.
1769         (gl_AC_TYPE_INTMAX_T, jm_AC_TYPE_UINTMAX_T): Remove.
1770         * gnulib.modules: Add inttypes, stdint.
1771         * lib/.cvsignore: Add close-stream.c, close-stream.h,
1772         stdint.h, stdint_.h.
1773         * po/Makefile: Remove; now automatically generated.
1774
1775         * src/incremen.c (read_incr_db_01): Check input strings more
1776         carefully.  Do not pass arbitrary char values to isspace, as
1777         this has undefined behavior.  Likewise for assigning arbitrary
1778         uintmax_t values to other types.
1779         (read_negative_num, read_unsigned_num, read_timespec):
1780         New functions, to check input values a bit more carefuly.
1781         (read_num): Use read_unsigned_num.  New arg MAX_VAL;
1782         all callers changed.
1783         (read_incr_db_2): Use these new functions.
1784         Use a consistent diagnostic for unexpected EOF.
1785         (read_directory_file): Do not assign arbitrary uintmax_t value
1786         to int.
1787         (read_timespec, write_directory_file_entry, write_directory_file):
1788         Handle negative time_t values correctly.  We don't bother to do
1789         this with pre-2 formats, since presumably the time stamps were
1790         output incorrectly.
1791
1792         * src/tar.c (doc): Don't use \v in an argument to gettext;
1793         gettext 0.15 rejects this.
1794
1795 2006-07-24  Sergey Poznyakoff  <gray@gnu.org.ua>
1796
1797         * src/tar.c (decode_options): Do not require -L with -M -Hpax.
1798         It could be needed in future, but currently it is not.
1799         * src/create.c (to_chars_subst): Update comment regarding OLDGNU
1800         vs. GNU format differences.
1801         (mode_to_chars): Treat OLDGNU_FORMAT same as GNU_FORMAT. Fixes bug
1802         reported by TAMUKI Shoichi <tamuki@linet.gr.jp>, which caused
1803         equivalent `tar cf ...' and `tar rf ...' commands to produce
1804         different archives.
1805
1806         * tests/append02.at: New test case
1807         * tests/Makefile.am, tests/testsuite.at: Add append02.at
1808
1809 2006-07-20  Paul Eggert  <eggert@cs.ucla.edu>
1810
1811         * bootstrap: Adjust to today's change to gnulib-tool by invoking
1812         it with --assume-autoconf='latest-stable'.
1813
1814 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
1815
1816         Adjust to recent gnulib changes.
1817         * lib/.cvsignore: Remove atexit.c, exit.c, getndelim2.c, getndelim2.h,
1818         pathmax.h, paxconvert.c, paxerror.h, xstrdup.c.
1819         Add inttypes.h, mktime.c, wcwidth.h, xstrndup.c, xstrndup.h.
1820         * src/create.c (start_header): Adjust to API change to mode_adjust.
1821
1822 2006-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
1823
1824         * THANKS: Add Ralf Wildenhues
1825         * NEWS: Update
1826
1827 2006-07-09  Ralf Wildenhues   <Ralf.Wildenhues@gmx.de>
1828
1829         * doc/dumpdir.texi, doc/snapshot.texi, doc/sparse.texi,
1830         doc/tar.texi: Fix some typos.
1831
1832 2006-07-06  Sergey Poznyakoff  <gray@gnu.org.ua>
1833
1834         tar --index-file=FILE --file=- sent the archive to FILE, and
1835         the listing to stderr. Bug reported by Marcin Gryszkalis
1836         <mg@fork.pl>
1837
1838         * src/buffer.c (_open_archive): Remove stdlis initialization
1839         * src/tar.c (decode_options): Initialize stdlis
1840         * tests/indexfile.at: New test case
1841         * tests/testsuite.at: Include indexfile.at
1842         * tests/Makefile.am (TESTSUITE_AT): Add indexfile.at
1843
1844 2006-07-05  Sergey Poznyakoff  <gray@gnu.org.ua>
1845
1846         * doc/Makefile.am (manual): Fix TEXINPUTS
1847         * doc/rendition.texi (FIXME): Do not use deprecated @quote-args.
1848         Do not use @allow-recursion. In its current form the macro is not
1849         recursive.
1850
1851 2006-07-03  Sergey Poznyakoff  <gray@gnu.org.ua>
1852
1853         * bootstrap (update_po): Fix single translation update
1854
1855 2006-07-03  Sergey Poznyakoff  <gray@gnu.org.ua>
1856
1857         * configure.ac (AC_CHECK_FUNCS): Check for getdtablesize
1858         * src/common.h (closeopen): New function
1859         * src/misc.c (chdir_arg): Use x2nrealloc to reallocate wd.
1860         (get_max_open_files,closeopen): New functions
1861         (chdir_do): Do not use save_cwd if it was already used more than
1862         max_open_files-4 times to avoid running off the file
1863         descriptors.
1864         * src/tar.c (main): Call closeopen
1865         * doc/tar.texi: Update --directory description
1866         * NEWS: Update
1867
1868 2006-06-26  Sergey Poznyakoff  <gray@gnu.org.ua>
1869
1870         * doc/tar.texi: Update. Add cross-references.
1871         * doc/sparse.texi: Add cross-references.
1872
1873 2006-06-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1874
1875         * scripts/xsparse.c: A sample utility to expand sparse files
1876         extracted by third-party tars. It is not meant to be installed nor
1877         to be included in the distribution. It is here, so that it can be
1878         obtained either from CVS or from the tar web site.
1879         * doc/Makefile.am (tar_TEXINFOS): Sorted
1880         * doc/tar.texi (Other Tars): New node describing how to extract
1881         GNU-specific member formats using third-party tars.
1882         * src/common.h (sparse_file_p): Remove
1883         * src/sparse.c: Likewise
1884         * src/create.c: Use ST_IS_SPARSE instead of sparse_file_p (update
1885         paxutils first)
1886         * src/tar.c: --sparse-version turns on --sparse
1887
1888 2006-06-24  Sergey Poznyakoff  <gray@gnu.org.ua>
1889
1890         * src/buffer.c (print_total_stats): Add default case.
1891         * src/common.h (name_init): New prototype.
1892         (xheader_string_end): Return bool.
1893         * src/extract.c (extract_volhdr): Add missing return
1894         * src/incremen.c: Remove not used variables
1895         * src/sparse.c (pax_dump_header_0): Return false if
1896         xheader_string_end fails (for 0.1 formats).
1897         (pax_dump_header): Return meaningful value
1898         * src/transform.c (segm_count): Change type to size_t
1899         * src/xheader.c (xhdr_tab.decoder): pass keyword as a second
1900         argument. All callers changed.
1901         (decode_record): Check for numeric overflow
1902         (xheader_string_end): Return boolean value. Check for possible
1903         numeric overflow
1904
1905 2006-06-23  Sergey Poznyakoff  <gray@gnu.org.ua>
1906
1907         * doc/sparse.texi: New file
1908         * doc/Makefile.am (tar_TEXINFOS): Add sparse.texi
1909         * doc/intern.texi (Sparse Formats): New node
1910         * doc/tar.texi: Update master menu
1911
1912         * src/common.h (tar_sparse_major,tar_sparse_minor): New globals.
1913         * src/sparse.c: Implement sparse format versioning. Implement new
1914         version (1.0) of PAX sparse format.
1915         (pax_sparse_member_p): Fix condition
1916         (pax_dump_header): A dispatcher function
1917         (pax_dump_header_0,pax_dump_header_1): New functions.
1918         (pax_optab): Update
1919         (oldgnu_dump_header): Minor fix: make sure
1920         sparse_header.isextended is set before calling
1921         set_next_block_after
1922         * src/tar.c: New option --sparse-version
1923         * src/tar.h (struct tar_stat_info.sparse_major,sparse_minor): New
1924         members.
1925         * src/xheader.c: Implement new keywords: GNU.sparse.name,
1926         GNU.sparse.major, GNU.sparse.minor, GNU.sparse.realsize
1927
1928         * tests/spmpv00.at, tests/spmvp01.at, tests/spmvp10.at: New
1929         testcases.
1930
1931         * tests/Makefile.am: Add spmvp00.at, spmpv01.at, spmpv10.at
1932         * tests/shortrec.at: Explicitely give `-f -' to the tar invocation
1933         * tests/sparsemvp.at: Rewritten as an include file.
1934         (TAR_MVP_TEST): New macro
1935         * tests/testsuite.at: Include sparsemvp.at, spmvp00.at,
1936         spmvp01.at, spmvp10.at
1937
1938 2006-06-21  Sergey Poznyakoff  <gray@gnu.org.ua>
1939
1940         * doc/tar.texi (Overriding File Metadata): New node
1941         Document --mtime option.
1942         * src/common.h (set_mtime_option,mtime_option): New globals
1943         * src/create.c (start_header): Override mtime if requested
1944         * src/tar.c: Implement new option, --mtime, allowing to set
1945         modification times for all archive members during creation.
1946         (struct tar_args): textual_date_option replaced with a linked list
1947         textual_date. All references updated.
1948         (get_date_or_file,report_textual_dates): New functions.
1949         * configure.ac: Raise version number to 1.15.92
1950         * NEWS: Update
1951
1952 2006-06-20  Sergey Poznyakoff  <gray@gnu.org.ua>
1953
1954         * src/common.h (struct name.explicit): Remove
1955         Use variable names in all declarations
1956         (name_scan): Remove second argument
1957         * src/delete.c: Remove second argument from calls to name_scan
1958         * src/update.c: Likewise
1959         * src/incremen.c (procdir): Use is_individual_file to check for
1960         files explicitely specified in the command line. Fixes bug
1961         reported by Dat Head on 19 Jun 2006 (descending into mountpoints
1962         with --one-file-system in use)
1963         * src/misc.c (maybe_backup_file): Second argument is bool
1964         * src/names.c (name_next_elt): Call register_individual_file
1965         (namelist_match): Remove third argument
1966         (name_match): Change return type to bool
1967         (name_scan): Remove second argument
1968         * src/sparse.c (pax_dump_header): Store original sparse file name
1969         in GNU.sparse.name variable. The name field in the ustar header
1970         now contains generated name (%d/GNUSparseFile.%p/%f), so that
1971         non-pax-aware tars won't extract the file under the original
1972         filename.
1973         * src/xheader.c (GNU.sparse.name): New variable for storing sparse
1974         file name.
1975
1976 2006-06-13  Sergey Poznyakoff  <gray@gnu.org.ua>
1977
1978         * doc/Makefile.am (check-options): Expand macros before grepping
1979         in $(info_TEXINFOS)
1980         * doc/rendition.texi (FIXME) [!PROOF_FOOTNOTED]: Enclose in a
1981         cartouche
1982         * doc/tar.texi: Define op as codeindex. Use special macros to
1983         populate it
1984         Consequently prefer @dfn{long options} over @dfn{mnemonic
1985         options}.
1986         Document --unquote, --no-unquote
1987         (Short Option Summary): Build a table of cross-references to the
1988         corresponding long options.
1989         (Using Multiple Tapes,Multi-Volume Archives): Rewritten
1990
1991         * doc/value.texi (xopindex,opsummary): New macros
1992
1993         * doc/Makefile.am (check-options): New goal
1994         * doc/tar.texi: Update
1995         * src/tar.c: Implement --overwrite-dir option (long ago
1996         documented).
1997
1998 2006-06-12  Sergey Poznyakoff  <gray@gnu.org.ua>
1999
2000         * doc/tar.texi: Document better the --totals option
2001         * NEWS: Update
2002         * src/buffer.c (total_blocks_deleted): New variable
2003         (set_start_time): Set volume_start_time and last_stat_time as well
2004         (set_volume_start_time): New function
2005         (compute_duration): Do not call set_start_time, update
2006         last_stat_time instead. Use it in calculation instead of
2007         start_time, which is now set only once, upon startup.
2008         (print_total_written): Removed.
2009         (print_total_stats): New function for printing byte/speed statistics.
2010         (_open_archive): Detect attempts to update compressed archives.
2011         (_gnu_flush_write): Always update prev_written.
2012         (open_archive): Call set_volume_start_time.
2013         * src/common.h (volume_start_time,last_stat_time): New globals
2014         (print_total_written): Replaced with:
2015         (print_total_stats): New function
2016         * src/delete.c (records_skipped): Remove static qualifier, the
2017         variable is used by print_total_stats in buffer.c
2018         * src/extract.c (check_time): Use volume_start_time when checking
2019         for timestamp plausability.
2020         * src/tar.c: (options, parse_opt): Allow for optional argument to
2021         the --totals option, which specifies a signal upon delivery of which
2022         the statistics must be output.
2023         (main): Call print_total_stats if total_option is set.
2024
2025 2006-06-11  Sergey Poznyakoff  <gray@gnu.org.ua>
2026
2027         * src/xheader.c (xheader_set_single_keyword): Fix typo.
2028         (decode_time): Avoid using gotos.
2029
2030         * doc/mastermenu.el: New file
2031         * doc/Makefile.am (master-menu): New goal
2032         * doc/tar.texi: Update master menu
2033
2034 2006-06-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2035
2036         * doc/tar.texi: Remove leftover include
2037
2038 2006-06-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2039
2040         * doc/Makefile.am (tar_TEXINFOS): Add intern.texi
2041         (EXTRA_DIST): Remove convtexi.pl, add texify.sed
2042         * doc/intern.texi: New file
2043         * doc/convtexi.pl: Remove
2044         * doc/texify.sed: Auxiliary script to convert ../src/tar.h to
2045         header.texi
2046         * doc/rendition.texi: Fix typo
2047         * doc/tar.texi: Update
2048         * src/tar.h: Fix indentation, introduce end-of-format marker for
2049         texify.sed
2050
2051         * THANKS: Add Jason Armistead
2052         * doc/tar.texi: Update
2053         * NEWS: Update
2054         * src/buffer.c: Implement more flexible checkpoint style
2055         * src/common.h (checkpoint_option): Change type to unsigned
2056         (checkpoint_style): New variable.
2057         * src/tar.c: --checkpoint takes an optional argument specifying
2058         number of records between two successive checkpoints (proposed
2059         by Jason Armistead on 2004-06-22).  Optional dot starting the
2060         argument means "print dots instead of textual checkpoints".
2061         (tar_help): New function
2062         * src/transform.c: Minor fixes.
2063
2064 2006-06-08  Sergey Poznyakoff  <gray@gnu.org.ua>
2065
2066         * gnulib.modules: Add mkdtemp
2067         * doc/dumpdir.texi: New file
2068         * doc/Makefile.am (tar_TEXINFOS): Add dumpdir.texi
2069         * doc/tar.texi: Document dumpdir format
2070         * src/incremen.c (dumpdir_locate,obstack_code_rename):
2071         (purge_directory): Re-implement renaming. Introduce
2072         'X' control code.
2073         (make_tmp_dir_name): Remove
2074
2075         * src/transform.c (set_transform_expr,_transform_name_to_obstack):
2076         Implement NUMBER flag.
2077         (add_char_segment): Fix length assignement
2078
2079         * doc/tar.texi: Update
2080
2081 2006-06-07  Sergey Poznyakoff  <gray@gnu.org.ua>
2082
2083         * src/transform.c (transform_name_fp): Run fun even if
2084         _transform_name_to_obstack returns false.
2085         (_transform_name_to_obstack,set_transform_expr): Implement GNU
2086         extension case conversion operations.
2087
2088         * doc/tar.texi (transform): Document the option.
2089
2090 2006-06-02  Sergey Poznyakoff  <gray@gnu.org.ua>
2091
2092         * NEWS: Update
2093         * src/common.h (set_transform_expr): New function
2094         * tests/Makefile.am: Add incr04.at
2095         * tests/testsuite.at: Likewise
2096         * tests/incr04.at: New test case
2097         * tests/long01.at: Fix typo in the comment
2098         * tests/multiv04.at: Use genfile --files-from
2099
2100         (Above changes need new genfile.c from paxutils)
2101
2102         * TODO: Update
2103         * NEWS: Update
2104         * doc/tar.texi: Update
2105         * src/transform.c: New file
2106         * src/Makefile.am (tar_SOURCES): New module transform.c
2107         * src/common.h (transform_name, transform_name_fp): New functions
2108         (show_stored_names_option): Renamed to
2109         show_transformed_names_option. All uses changed
2110         * src/create.c (dump_file0): Transform file name
2111         * src/extract.c (extract_archive): safer_name_suffix and
2112         stripped_prefix_len are now called by decode_header
2113         * src/list.c (print_header): Update displayable name selection.
2114         * src/tar.c: New option --transform
2115         New option --show-transformed-names generalizes
2116         --show-stored-names. The latter is retained as an alias.
2117
2118 2006-05-31  Sergey Poznyakoff  <gray@gnu.org.ua>
2119
2120         * src/incremen.c (make_directory): Fix initialization of struct
2121         directory.
2122
2123 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
2124
2125         * doc/tar.texi: Document use of globbing patterns.
2126         * src/tar.c (parse_opt): Add comment before --preserve case.
2127
2128 2006-05-24  Sergey Poznyakoff  <gray@gnu.org.ua>
2129
2130         * NEWS: Update
2131         * doc/tar.texi: Update
2132         * configure.ac (AM_INIT_AUTOMAKE): Use tar-ustar option. Raise
2133         version requirement to 1.9
2134         * src/common.h (struct name): Refactured
2135         (warn_regex_usage): New variable.
2136         (dump_file): First argument is const char*.
2137         (name_init,name_add): Removed
2138         (name_add_name,name_add_dir): New functions
2139         (name_next): Return const char*.
2140         * src/create.c: (dump_file,dump_file0): First argument is const
2141         char*. All callers updated.
2142         * src/names.c: Rewritten handling of member names in the command
2143         line. Tar no longer attempts to guess globbing patterns, instead
2144         it relies on --wildcard option.
2145         (init_names): Removed.
2146         (struct name_elt): New structure.
2147         (name_array): Change type to struct name_elt. All references updated
2148         (name_add_name,name_add_dir): New functions
2149         (name_next_elt): New function
2150         (name_next): Rewritten using name_next_elt.
2151         (namelist_match): Rewritten pattern matching using
2152         exclude_fnmatch.
2153         (names_notfound): Warn if globbing patterns were used without
2154         --wildcards option
2155         * src/tar.c (options): Move globbing-related options into a
2156         separate group. Set -l as an alias to --check-links, as required
2157         by UNIX98
2158         (struct tar_args): New fields
2159         wildcards,matching_flags,include_anchored
2160         (MAKE_EXCL_OPTIONS,MAKE_INCL_OPTIONS): New macros
2161         (parse_opt): Use x2nrealloc to grow archive_name_array.
2162         Use MAKE_EXCL_OPTIONS,MAKE_INCL_OPTIONS to create appropriate
2163         fnmatch options, and name_add_name,name_add_dir to handle member
2164         name and -C arguments.
2165         (decode_options): Likewise
2166         (main): Remove call to init_names.
2167
2168         * tests/append.at, tests/append01.at, tests/extrac01.at,
2169         tests/options.at, tests/options02.at, tests/same-order01.at,
2170         tests/same-order02.at: Make AT_SETUP more readable.
2171
2172 2006-05-23  Sergey Poznyakoff  <gray@gnu.org.ua>
2173
2174         * src/buffer.c (change_tape_menu): Fix typo (uninitialized
2175         variable) introduced yesterday.
2176
2177 2006-05-22  Sergey Poznyakoff  <gray@gnu.org.ua>
2178
2179         * doc/tar.texi: Use @var{file_name} instead of @var{file name}
2180         * src/buffer.c (change_tape_menu): Break the loop after obtaining
2181         new archive name. Check for empty input line.
2182
2183 2006-05-15  Sergey Poznyakoff  <gray@gnu.org.ua>
2184
2185         * tests/atlocal.in (XFAILFILE): New variable
2186         * tests/version.at: Create $XFAILFILE on failure
2187         * tests/testsuite.at (AT_TAR_CHECK): Declare expected failure if
2188         $XFAILFILE exists.
2189
2190 2006-05-13  Sergey Poznyakoff  <gray@gnu.org.ua>
2191
2192         * THANKS: Update
2193         * src/buffer.c (read_header0): Use read_header_primitive to avoid
2194         clubbering current_tar_info. All callers updated.
2195         * src/common.h (read_header_primitive): New function
2196         * src/extract.c (extract_volhdr): New function
2197         (prepare_to_extract): Use extract_volhdr as extractor for volume
2198         names.
2199         * src/list.c (read_header_primitive): New function
2200         (read_header): Front end for read_header_primitive
2201         * tests/chtype.at: New file
2202         * tests/volsize.at: New file
2203         * tests/Makefile.am (TESTSUITE_AT): Add chtype.at, volsize.at
2204         (check-full): New target.
2205         * tests/atlocal.in (TEST_DATA_URL,STAR_DATA_URL)
2206         (STAR_TESTSCRIPTS): Provide default values.
2207         (tarball_prereq): New function
2208         * tests/testsuite.at (AT_TARBALL_PREREQ): New defun
2209         (AT_STAR_PREREQ): Rewrite using tarball_prereq
2210         Include chtype.at and volsize.at
2211         * tests/volume.at: Add keywords.
2212
2213         * tests/star/gtarfail.at, tests/star/gtarfail2.at,
2214         tests/star/multi-fail.at, tests/star/pax-big-10g.at,
2215         tests/star/ustar-big-2g.at, tests/star/ustar-big-8g.at
2216         (AT_STAR_PREREQ): Provide md5 sum.
2217
2218         * lib/.cvsignore: Update
2219
2220 2006-05-08  Sergey Poznyakoff  <gray@gnu.org.ua>
2221
2222         * tests/testsuite.at (AT_SORT_PREREQ, AT_UNPRIVILEGED_PREREQ): New
2223         defines
2224
2225         * tests/extrac04.at, tests/incr03.at, tests/listed02.at,
2226         tests/pipe.at, tests/rename01.at, tests/rename02.at,
2227         tests/rename03.at, tests/same-order01.at: Call
2228         AT_SORT_PREREQ. Remove fd 2 redirection after calls to sort
2229         * ignfail.at: Call AT_UNPRIVILEGED_PREREQ
2230
2231 2006-05-08  Sergey Poznyakoff  <gray@gnu.org.ua>
2232
2233         Listed incremental backups: keep more information about
2234         directories. Handle renamed directories more effectively
2235         (initial implementation, more updates to follow).
2236         Source tree before this point is tagged
2237         alpha_1_15_90_incremental_1.
2238
2239         * NEWS: Update
2240         * configure.ac: Raise version number to 1.15.91
2241         * src/common.h (rename_directory,append_incremental_renames): New
2242         functions.
2243         * src/extract.c (rename_directory): New function
2244         * src/incremen.c (struct directory.contents, flags): New members
2245         (nfs,found,new): Remove. Replaced by appropriate bitmask values in
2246         `flags' field. All uses updated.
2247         (directory_meta_table): New table.
2248         (hash_directory): Rename to hash_directory_name
2249         (compare_directories): Rename to compare_directory_names
2250         (hash_directory_meta,compare_directory_meta,find_directory_meta):
2251         New functions
2252         (compare_dirents): Removed
2253         (note_directory): Get 7th argument: directory contents.
2254         All callers updated
2255         (dumpdir_locate,makedumpdir): New functions
2256         (scan_directory): Rewritten. Use makedumpdir to create a sorted
2257         dumpdir array. This makes the obstack argument unnecessary. Besides,
2258         ALL_CHILDREN flag is set only for new directories.
2259         (procdir): Change return type to struct directory. Return
2260         immediately if the directory was already initialized. Discover
2261         directory renames using directory_meta_table.
2262         (append_incremental_renames): New function.
2263         (read_directory_file, write_directory_file): Use new snapshot file
2264         format.
2265         * src/names.c (collect_and_sort_names): Update dir_contents of the
2266         first non-fake name entry when in listed incremental mode.
2267
2268         * tests/incr03.at: New testcase
2269         * tests/rename01.at: New testcase
2270         * tests/rename02.at: New testcase
2271         * tests/rename03.at: New testcase
2272         * tests/Makefile.am: Add
2273         incr03.at,rename01.at,rename02.at,rename03.at
2274         * tests/testsuite.at: Likewise.
2275         * tests/listed02.at: Update for the new behavior
2276         * tests/multiv04.at (AT_KEYWORDS): Add missing incremental kw.
2277
2278 2006-05-02  Sergey Poznyakoff  <gray@gnu.org.ua>
2279
2280         * src/buffer.c (try_new_volume): Attempt to continue if the name
2281         is apparently truncated in a GNU format volume.
2282
2283         * tests/comprec.at, tests/delete01.at, tests/delete02.at,
2284         tests/delete04.at, tests/delete05.at, tests/extrac05.at,
2285         tests/listed01.at, tests/multiv01.at, tests/multiv02.at,
2286         tests/pipe.at, tests/same-order01.at, tests/same-order02.at,
2287         tests/sparse01.at, tests/sparse03.at: Always use genfile --file,
2288         this enables extra error checking.
2289
2290         * tests/multiv03.at: Attempt to extract a member with truncated
2291         file name from the archive.
2292
2293         * src/buffer.c (_open_archive): Remove unnecessary argument to
2294         check_compressed_archive.
2295
2296 2006-04-25  Sergey Poznyakoff  <gray@gnu.org.ua>
2297
2298         * tests/sparse01.at, tests/sparse02.at, tests/sparse03.at,
2299         tests/sparsemv.at, tests/sparsemvp.at: Skip the test if the file
2300         system does not support sparse files.
2301         * doc/tar.texi (@copying): Remove the reference to not existing
2302         invariant section.
2303
2304 2006-04-11  Sergey Poznyakoff  <gray@gnu.org.ua>
2305
2306         * src/extract.c (extract_dir): Fix toggling existing directory
2307         permissions (Debian bug #361077). Use parts of patch provided by
2308         Ian Jackson <iwj@ubuntu.com>.
2309         * src/compare.c: Minor changes
2310         * src/incremen.c (directory.new): New member
2311         (note_directory,find_directory: Use make_directory to create
2312         struct directory entries
2313         (procdir): Avoid duplicating  directories in the incremental
2314         backup map.
2315         * tests/Makefile.am (TESTSUITE_AT): Add extrac06.at
2316         * tests/testsuite.at: Include extrac06.at
2317
2318 2006-03-18  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de> (trivial change)
2319
2320         * tests/atlocal.in (PATH): Add build-aux from the source tree,
2321         not the build tree.
2322
2323 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
2324
2325         * THANKS: Add Benno Schulenberg
2326
2327 2006-03-13  Jim Meyering <jim@meyering.net>
2328
2329         * tests/listed02.at:  Sort the two lines of stderr from the
2330         first `tar -v --listed-incremental'.  They would come out
2331         reversed and provoke a test failure on a tmpfs
2332         file system.
2333
2334 2006-03-13  Benno Schulenberg <benno@nietvergeten.nl>
2335
2336         * doc/tar.texi: Minor fixes.
2337         * src/tar.c (options): Consistently begin help messages with a
2338         lowercase letter.
2339
2340 2006-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>
2341
2342         * tests/Makefile.am (AM_CPPFLAGS): Define LOCALEDIR
2343
2344 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
2345
2346         * src/buffer.c (record_buffer_aligned): New var.
2347         (init_buffer): Use it to ensure that the buffer is aligned.
2348         This doesn't result in any measurable performance improvement
2349         on my host (Debian GNU/Linux 3.1 stable, with default block size),
2350         but I assume it does help on some hosts.
2351
2352         * lib/.cvsignore: Sort.
2353
2354 2006-03-04  Sergey Poznyakoff  <gray@gnu.org.ua>
2355
2356         * tests/shortrec.at: Use -f - to read from stdin.
2357
2358 2006-02-21  Sergey Poznyakoff  <gray@gnu.org.ua>
2359
2360         * doc/tar.texi: Fix typo: --to-command instead of --to-program
2361
2362 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
2363
2364         * tests/multiv04.at (split directory members in a MV archive):
2365         Don't use %X in an awk printf format; this doesn't work with
2366         Solaris 10 /usr/bin/awk.  Use %x instead.
2367
2368 2006-02-20  Sergey Poznyakoff  <gray@gnu.org.ua>
2369
2370         * src/create.c (split_long_name): Fix maximum length estimation.
2371         Patch by Jim Lowe.
2372         * tests/Makefile.am (lustar01.at,lustar02.at,lustar03.at): New
2373         tests.
2374         * tests/atlocal.in: Add build-aux to the PATH
2375         * tests/long01.at: Remove mkhier, use AT_TAR_MKHIER instead
2376         * tests/longv7.at: Reword test title
2377         * tests/lustar01.at: New test
2378         * tests/lustar02.at: New test
2379         * tests/lustar03.at: New test
2380         * tests/testsuite.at (AT_TAR_MKHIER): New macro
2381         (lustar01.at,lustar02.at,lustar03.at): New tests.
2382
2383 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
2384
2385         * bootstrap: Don't claim lib/Makefile.am is generated automatically
2386         from itself.
2387
2388         Avoid installation glitches on Solaris 8 with Sun C 5.4.
2389         * lib/.cvsignore: Add system-ioctl.h.
2390         * lib/Makefile.tmpl (noinst_HEADERS): Add system-ioctl.h.
2391         * src/buffer.c: Include system-ioctl.h.
2392         * src/compare.c: Likewise.
2393         * src/delete.c: Likewise.
2394         * src/system.c: Include <getline.h>, <setenv.h>.
2395         * src/tar.c: Include <getline.h>.
2396
2397 2006-02-19  Sergey Poznyakoff  <gray@gnu.org.ua>
2398
2399         * src/buffer.c (add_chunk_header): Free st.orig_file_name after
2400         calling finish_header().
2401         (new_volume): Prompt the user for archive name if unable to open
2402         next archive.
2403
2404         * src/create.c (dump_file0): Restore file_count_links,
2405         accidentally removed on 2005-11-29.
2406         * configure.ac: Raise version number to 1.15.90
2407         * NEWS: Likewise.
2408
2409 2006-02-08  Sergey Poznyakoff  <gray@gnu.org.ua>
2410
2411         * src/tar.c (tar_set_quoting_style): Provide second argument to
2412         the format spec: program_invocation_short_name. Reported by Jim
2413         Meyering.
2414
2415 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
2416
2417         * gnulib.modules: Add closeout, exitfial.
2418         * lib/.cvsignore: Add __fpending.c, __fpending.h, closeout.c,
2419         closeout.h.
2420         * src/buffer.c: Incluse closeout.h.
2421         (_open_archive): Use freopen rather than fopen, so
2422         that stdlis is always either stdout or stderr.  Use
2423         close_stdout_set_file_name to report its name.
2424         * src/tar.c: Include closeout.h and exitfail.h.
2425         (parse_opt, usage): Call close_stdout as appropriate, to check for
2426         write errors.
2427         (decode_options): Exit with status TAREXIT_FAILURE, not 1.
2428         (main): Set exit_failure, to exit with proper status on memory
2429         allocation failure and the like.
2430         Use close_stdout rather than rolling our own test.
2431
2432         * NEWS: --version now outputs copyright etc., to conform to the
2433         GNU coding standards.  Remove --license.
2434         * gnulib.modules: Add version-etc-fsf.
2435         * doc/tar.texi: Document the change.
2436         * lib/.cvsignore: Add version-etc-fsf.c, version-etc.c, version-etc.h.
2437         * scripts/Makefile.am (SED_CMD): Update PAKCAGE_NAME, not PACKAGE.
2438         * scripts/backup.in: Remove --license.  Change --version to conform
2439         to GCS.
2440         * scripts/restore.in: Likewise.
2441         * scripts/backup.sh.in (license): Output briefer license in the
2442         style of coreutils, for consistency with other changes.
2443         * src/tar.c: Include <version-etc.h>.
2444         (LICENSE_OPTION): Remove.
2445         (options): Remove --license.
2446         (license): Remove.
2447         (parse_opt): Use version_etc instead of rolling it ourselves.
2448         Remove --license.
2449         * tests/version.at (tar --version): Check only the first line of
2450         output.
2451
2452         * ChangeLog, NEWS, src/common.h, src/extract.c, src/incremen.c:
2453         * src/list.c, src/names.c, src/tar.h, src/xheader.c:
2454         Update copyright year to 2006.
2455
2456 2006-02-07  Jim Meyering  <jim@meyering.net>
2457
2458         * src/xheader.c (sparse_map_decoder): Fix misleading diagnostic.
2459
2460 2006-01-31  Sergey Poznyakoff  <gray@gnu.org.ua>
2461
2462         * src/common.h (get_gnu_dumpdir): Remove prototype
2463         (is_dumpdir): New function
2464         * src/extract.c (prepare_to_extract): Use is_dumpdir member to
2465         check for dumpdirs.
2466         * src/incremen.c (get_gnu_dumpdir): Static
2467         (is_dumpdir): New function
2468         (purge_directory): Use is_dumpdir
2469         * src/list.c (list_archive): Use is_dumpdir
2470         Do not wrap skip_member in mv_begin/mv_end, the function itself
2471         takes care of it.
2472         (decode_header): Set stat_info->is_dumpdir
2473         (skip_member): Do nothing if skipped is true
2474         * src/tar.h (struct tar_stat_info): New members is_dumpdir and skipped.
2475
2476 2006-01-22  Sergey Poznyakoff  <gray@gnu.org.ua>
2477
2478         * src/tar.c (decode_options): Refuse using --delete with
2479         compression options.
2480
2481 2006-01-18  Sergey Poznyakoff  <gray@gnu.org.ua>
2482
2483         * NEWS: Updated.
2484         * configure.ac (DEFAULT_QUOTING_STYLE): New configuration variable
2485         * doc/tar.texi: Initial documentation for --quoting-style,
2486         --quote-chars and --no-quote-chars option.
2487         * src/tar.c: Implement new options --quoting-style, --quote-chars
2488         and --no-quote-chars.
2489
2490 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
2491
2492         * bootstrap: Default to pserver, and switch to cvs.sv.gnu.org,
2493         to accommodate recent changes to the GNU CVS server.
2494         * lib/.cvsignore: Add argp-pin.c, mkdirat.c, openat-priv.h.
2495
2496 2005-12-14  Sergey Poznyakoff  <gray@gnu.org.ua>
2497
2498         * src/names.c (name_scan): Take an additional argument requesting
2499         exact matching.
2500         * src/common.h (name_scan): Change prototype.
2501         * src/delete.c, src/incremen.c, src/update.c: Update invocations
2502         of name_scan.
2503
2504 2005-12-13  Sergey Poznyakoff  <gray@gnu.org.ua>
2505
2506         * src/common.h (struct name): New member `explicit'. Remove unused
2507         member `isdir'.
2508         * src/incremen.c (procdir): If name_scan() returns something,
2509         check if it was explicitely given in the command line
2510         * src/names.c (addname,add_hierarchy_to_namelist): Initialize
2511         explicit member appropriately.
2512
2513         * src/incremen.c (procdir): If --one-file-system is given and a
2514         directory is found to be on another device, *and* this directory
2515         is explicitely given in the command line, then do not omit it.
2516
2517 2005-12-11  Sergey Poznyakoff  <gray@gnu.org.ua>
2518
2519         * NEWS: Update
2520         * doc/tar.texi: Document --delay-directory-restore option.
2521         (Configuring Help Summary): Document usage of ARGP_HELP_FMT
2522         variable to customize help output.
2523         * src/common.h (delay_directory_restore_option): New global.
2524         * src/extract.c (directories_first): Replaced by
2525         delay_directory_restore_option. All uses changed.
2526         * src/tar.c (options,parse_opt): New options
2527         --delay-directory-restore and --no-delay-directory-restore
2528
2529 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2530
2531         * src/buffer.c (open_archive): Add default case to shut up gcc.
2532         * src/common.h (set_file_atime): Add prototype.
2533         * src/create.c (to_chars_subst): Remove unused variable
2534         Make sure useful result code is returned.
2535         * src/incremen.c (read_directory_file): Fix format string
2536         Thanks Eric Blake for reporting.
2537
2538 2005-12-08  Sergey Poznyakoff  <gray@gnu.org.ua>
2539
2540         * doc/tar.texi (Current status): Renamed to 'Changes' and moved to
2541         appendices.
2542         (Large or Negative Values): Rewritten
2543         * src/common.h (gid_to_chars, major_to_chars, minor_to_chars)
2544         (mode_to_chars, off_to_chars, size_to_chars, time_to_chars)
2545         (uid_to_chars, uintmax_to_chars): Return bool
2546         * src/create.c (gid_to_chars, major_to_chars, minor_to_chars)
2547         (mode_to_chars, off_to_chars, size_to_chars, time_to_chars)
2548         (uid_to_chars, uintmax_to_chars): Return bool
2549         (to_chars): Return bool
2550         (start_header): Check return values of convertion routines. Fail
2551         if unable to store data in the header.
2552
2553 2005-12-07  Sergey Poznyakoff  <gray@gnu.org.ua>
2554
2555         * doc/tar.texi: Following the discussion with Karl Berry,
2556         discontinue using @value{} substitutions for Texinfo commands.
2557         Properly index all long options. Print a
2558         separate long option index.
2559         * doc/value.texi: Remove @set's
2560
2561         * doc/tar.texi: Update --info-script documentation
2562         Resolve some more FIXMEs.
2563         * scripts/dump-remind.in: Use TAR_VOLUME instead of reading volno
2564         file.
2565         * src/buffer.c (new_volume): Update invocation
2566         (change_tape_menu): New function. Disable '!' command if given
2567         --restrict option.
2568         * src/common.h (sys_exec_info_script): Update declaration
2569         (restrict_option): New global
2570         * src/system.c (sys_exec_info_script): The script can supply new
2571         archive name to use by writing it to file descriptor 3.
2572         * src/tar.c (options): Add --restrict option. Use macros for
2573         option grouping.
2574         (license): Print full list of copyright years
2575         * NEWS: Update
2576
2577 2005-12-06  Eric Blake  <ebb9@byu.net> (trivial changes)
2578
2579         * configure.ac (DENSITY_LETTER): Fix m4 overquoting.
2580         * .cvsignore: Ignore .bootstrap.
2581
2582 2005-12-06  Sergey Poznyakoff  <gray@gnu.org.ua>
2583
2584         * doc/tar.texi: Document --to-command and --info-script
2585         options. Add missing xrefs.
2586         * src/buffer.c (new_volume): Use sys_exec_info_script() instead of
2587         system().
2588         * src/common.h (archive_format_string,subcommand_string)
2589         (sys_exec_info_script): New prototypes.
2590         * src/system.c (sys_exec_info_script): New function.
2591         * src/tar.c (archive_format_string): Remove static qualifier.
2592         (subcommand_string): New function.
2593
2594 2005-12-01  Sergey Poznyakoff  <gray@gnu.org.ua>
2595
2596         * src/extract.c: Fix restoring of directory timestamps from
2597         incremental archives.
2598         (directories_first): New variable.
2599         (prepare_to_extract): Set directories_first
2600         (extract_archive): Call apply_nonancestor_delayed_set_stat() only
2601         if not extracting from an incremental archive
2602         (extract_dir): Obtain root_device here, to make sure it works
2603         correctly with -C.
2604
2605         * src/incremen.c (purge_directory): Skip the member and return if
2606         the archive is not in incremental format.
2607         * tests/incr02.at: New testcase
2608         * tests/Makefile.am: Add incr02.at
2609         * tests/testsuite.at: Likewise
2610
2611         * THANKS: Add Guerkan Karaman.
2612         * NEWS: Update
2613
2614 2005-11-30  Paul Eggert  <eggert@cs.ucla.edu>
2615
2616         * doc/tar.texi (Option Summary): Rewrite the
2617         --atime-preserve=system description in response to Ian Turner's
2618         proposed patch.
2619
2620 2005-11-30  Ian Turner  <ian@zmanda.com>
2621
2622         * doc/tar.texi (Extracting Specific Files): Remove obsolescent
2623         FIXME.
2624
2625 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
2626
2627         * NEWS: New option --atime-preserve=system, which uses O_NOATIME.
2628         * THANKS: Add Ian Turner.
2629
2630         * configure.ac: Prefer AC_CHECK_HEADERS_ONCE to AC_CHECK_HEADERS.
2631         Check for stropts.h and sys/filio.h too, for _FIOSATIME.
2632         * doc/tar.texi: Change "modification time" to "data modification
2633         time", "change time" to "status change time", and "filesystem" to
2634         "file system", so that we use terminology consistent with POSIX.
2635         Use American spacing rather than French for sentence ends.
2636         "non-dependable" -> "undependable".
2637         (Option Summary, Attributes): Explain better the pitfalls of the
2638         --atime-preserve option, and suggest read-only mounts,loopback
2639         mounts, and noatime mounts for older systems.
2640         * doc/value.texi (op-atime-preserve-system): Renamed from
2641         op-atime-preserver-system to fix a misspelling.
2642         * src/common.h (enum atime_preserve): Use lower case for enum values.
2643         * src/compare.c: Don't include utimens.h; no longer needed.
2644         (diff_file): Use set_file_atime rather than utimens; avoid closing
2645         diff_handle until after this, so that we can set the file time stamp
2646         via the file descriptor rather than via its name.
2647         * src/create.c: Don't include utimens.h; no longer needed.
2648         (dump_regular_finish): Remove.  All callers now do its work inline.
2649         (dump_dir): New arg FD.  All callers changed.
2650         Use fdsavedir rather than savedir.
2651         (unknown_file_error): Arg is a const pointer now.
2652         (dump_file0): 2nd arg is a const pointer now.
2653         Treat directories more like files, with respect to --atime-preserve.
2654         For example, also warn if a directory changes while we are dumping it.
2655         Prefer file descriptors to file names when retrieving/setting file
2656         attributes; this saves path-resolution time and allows us to avoid
2657         changing mtime/ctime on Solaris when restoring atime as root.
2658         Use O_DIRECTORY when opening directories, to avoid some race conditions.
2659         Do not reset atime if mtime has changed.  Report an error if
2660         we cannot reset atime.
2661
2662         * lib/.cvsignore: Add malloc.h, regcomp.c, regex.c, regex.h,
2663         regex_internal.c, regex_internal.h, regexc.c; used by rpmatch.
2664
2665 2005-11-29  Ian Turner  <ian@zmanda.com>
2666
2667         First cut at adding support for --atime-preserve=system.
2668         * doc/tar.texi (Option Summary): First cut at documenting it.
2669         All other uses of --atime-preserve changed to --atime-preserve=replace.
2670         * doc/value.texi (op-atime-preserve-replace, op-atime-preserver-system):
2671         New.
2672         (op-atime-preserve): Mention METHOD.
2673         * src/common.h (atime_preserve): New enum.
2674         (atime_preserve_option): Now of the enum type rather than bool.
2675         All uses changed.
2676         * src/compare.c (diff_file): Read with O_NOATIME if asked for.
2677         * src/create.c (dump_file0): Read regular and CTG files with O_NOATIME
2678         if asked for.
2679         * src/tar.c (usage): Mention new usage.
2680         (parse_opt): Parse new usage.
2681
2682 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
2683
2684         * THANKS: Convert back to UTF-8, sort (using LC_ALL=C on Debian
2685         stable), and consistently use tabs rather than spaces.
2686
2687 2005-11-27  Sergey Poznyakoff  <gray@gnu.org.ua>
2688
2689         * src/xheader.c: Remove parts of code prematurely introduced
2690         yesterday. Thanks Eric Blake.
2691
2692 2005-11-26  Sergey Poznyakoff  <gray@gnu.org.ua>
2693
2694         * src/xheader.c (xheader_format_name): Fix memory leak.
2695
2696 2005-11-11  Sergey Poznyakoff  <gray@gnu.org.ua>
2697
2698         * gnulib.modules: Add rpmatch
2699         * lib/stdopen.h, lib/stdopen.c: New file. Imported from coreutils.
2700         * lib/Makefile.tmpl: Add stdopen.h, stdopen.c
2701         * po/POTFILES.in: Add rpmatch.c
2702         * src/tar.c (confirm): Rewritten using rpmatch.
2703         (decode_options): Minor optimizations
2704         (main): Call stdopen() to ensure the first three descriptors are
2705         open.
2706
2707         * tests/multiv01.at, tests/multiv02.at, tests/multiv03.at,
2708         tests/multiv04.at, tests/sparsemv.at, tests/sparsemvp.at,
2709         tests/star/multi-fail.at: Close stdin so that if something fails
2710         causing tar to ask for the next volume, it won't hang the
2711         testsuite.
2712
2713         * src/buffer.c (flush_write,flush_read): Change data type.
2714         (flush_archive): Compute actual buffer fill level before calling
2715         low level function.
2716         (close_archive): Call flush_archive again if the first call
2717         resulted in partially filled buffer.
2718         (try_new_volume): Rewritten handling of initial headers.
2719         (add_chunk_header): New function. Write an additional header
2720         before the continuation chunk. The purpose of the header is to
2721         allow third-party tars to extract the member.
2722         (simple_flush_write): Take an argument.
2723         (_gnu_flush_write): Correctly handle partially filled buffers.
2724         * src/common.h (flush_read,flush_write): Functions, again.
2725         (write_extended): Changed declaration
2726         (xheader_format_name): New declaration
2727         * src/create.c (write_extended): Change type and meaning of
2728         the first argument. All callers updated
2729         * src/xheader.c (xheader_format_name): Remove static
2730         qualifier. Change last argument.
2731         Correct buffer size calculation (allocated too much space).
2732         (xheader_write): Increase global_header_count here ...
2733         (xheader_write_global): ... instead of here
2734
2735         * tests/testsuite.at (AT_TAR_CHECK): Define TEST_TAR_FORMAT
2736         * tests/multiv01.at: Update
2737         * tests/multiv02.at: Update
2738         * tests/multiv03.at: Update
2739         * tests/sparsemvp.at: Update
2740         * tests/star/multi-fail.at: Update
2741
2742         * scripts/tarcat: Handle archives in pax format. Improve handling
2743         of traditional archives.
2744         * doc/tar.texi (Tarcat): New node
2745
2746 2005-11-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2747
2748         Fix splitting of sparse files between the volumes.
2749
2750         * src/buffer.c (try_new_volume): Bugfix. Always check
2751         continued_file_name. If it is absent, the volume is out
2752         of sync.
2753         (add_multi_volume_header): Create GNU.volume.filename keyword in
2754         the extended header.
2755         * src/sparse.c (sparse_dump_region): Call mv_size_left.
2756         (sparse_dump_file): Enclose the loop in mv_begin/mv_end.
2757         * src/system.c: Do not pad compressed output if it goes to
2758         stdout.
2759         * src/xheader.c (xhdr_tab): New keyword GNU.volume.filename.
2760
2761         * tests/sparsemv.at: New testcase
2762         * tests/sparsemvp.at: New testcase
2763         * tests/Makefile.am: Add sparsemv.at and sparsemvp.at.
2764         * tests/testsuite.at: Likewise.
2765
2766 2005-11-09  Sergey Poznyakoff  <gray@gnu.org.ua>
2767
2768         * src/buffer.c: Rewritten in a more modular fashion to provide
2769         GNU extensions (multi-volume archives and archive labels) in
2770         pax format.
2771         NOTICE, that some of the aspects (e.g. splitting the archive
2772         on the extended header boundary) are still not solved, others
2773         (splitting a sparse file between the volume) require additional
2774         testing. Wait for the next commit.
2775
2776         (volume_label,continued_file_name,continued_file_size)
2777         (continued_file_offset): New globals.
2778         (save_name,save_totsize,save_sizeleft): Make static
2779         (mv_begin,mv_end,mv_total_size,mv_size_left): New functions
2780         (open_archive,flush_write,flush_read): Rewritten
2781
2782         * src/common.h (save_name,save_sizeleft,save_totsize): Remove
2783         globals.
2784         (volume_label,continued_file_name,continued_file_size): New
2785         variables.
2786         (flush_read,flush_write): Pointers to functions
2787         (mv_begin,mv_end,mv_total_size,mv_size_left): New functions
2788         (write_extended): New function.
2789
2790         * src/compare.c, src/create.c, src/extract.c, src/incremen.c,
2791         src/list.c: Use mv_.* functions uniformly instead of fiddling
2792         with the global variables.
2793         * src/sparse.c: Use mv_.* functions where necessary.
2794         * src/tar.c (decode_options): Allow to use --multi-volume and
2795         --label with pax archives.
2796         * src/xheader.c (xhdr_tab): Support for new GNU keywords.
2797
2798         * tests/delete01.at, tests/delete02.at, tests/delete03.at,
2799         tests/delete04.at, tests/delete05.at, tests/extrac01.at,
2800         tests/extrac02.at, tests/extrac03.at, tests/extrac04.at,
2801         tests/extrac05.at, tests/incr01.at, tests/incremental.at,
2802         tests/listed01.at, tests/listed02.at, tests/long01.at,
2803         tests/longv7.at, tests/multiv01.at, tests/multiv02.at,
2804         tests/multiv03.at, tests/multiv04.at, tests/options.at,
2805         tests/options02.at, tests/same-order01.at, tests/same-order02.at,
2806         tests/sparse01.at, tests/sparse02.at, tests/sparse03.at,
2807         tests/star/multi-fail.at (AT_KEYWORDS): Improve to allow execution
2808         of related tests in groups.
2809
2810         * doc/tar.texi: Update
2811
2812 2005-11-07  Paul Eggert  <eggert@cs.ucla.edu>
2813
2814         * src/xheader.c (struct xhdr_tab.coder): Last arg is void const *,
2815         not void *, to avoid create.c warning from GCC "passing argument 3
2816         of 'xheader_store' discards qualifiers from pointer target type".
2817         (dummy_coder, atime_coder, gid_coder, gname_coder, linkpath_coder):
2818         (ctime_coder, mtime_coder, path_coder, size_coder, uid_coder):
2819         (uname_coder, sparse_size_coder, sparse_numblocks_coder):
2820         (sparse_offset_coder, sparse_numbytes_coder, dumpdir_coder):
2821         (xheader_store): Likewise.
2822         * src/common.h (xheader_store): Likewise.
2823
2824 2005-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>
2825        and  Paul Eggert  <eggert@cs.ucla.edu>
2826
2827         * src/tar.c (NS_PRECISION_FORMAT_MASK): New macro.
2828         (tar_timespec_cmp): New function. Wrapper over
2829         timespec_cmp using the timespec precision provided by the
2830         current archive format.
2831         * src/common.h (tar_timespec_cmp): New declaration.
2832         * src/compare.c (diff_file): Use tar_timespec_cmp.
2833         * src/extract.c (file_newer_p): Likewise.
2834         * src/update.c (update_archive): Likewise.
2835         * tests/truncate.at: Reverted changes
2836         * tests/update.at: Reverted changes
2837
2838 2005-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>
2839
2840         Support for incremental formats in pax archives.
2841         Fixed POSIX compatibility of `sparse' extended header keywords.
2842
2843         * src/common.h (dumpdir_size,get_gnu_dumpdir)
2844         (xheader_string_begin,xheader_string_add)
2845         (xheader_string_end): New functions.
2846         * src/create.c (dump_dir0): Handle incremental backups in pax
2847         archives.
2848         * src/incremen.c (dumpdir_size, get_gnu_dumpdir): New functions.
2849         (purge_directory): Use stat_info.dumpdir instead of getting its
2850         value explicitely.
2851         * src/list.c (list_archive): Handle incremental backups in pax
2852         format.
2853         (decode_header): Initialize stat_info.dumpdir
2854         * src/sparse.c (sparse_diff_file): Bugfix: set seekable.
2855         (pax_dump_header): Store sparse map in GNU.sparse.map. If this
2856         variable has been explicitely deleted, use GNU.sparse.offset/
2857         GNU.sparse.numbytes variables.
2858         * src/tar.c (decode_options): Incremental options are allowed with
2859         --format=pax
2860         (tar_stat_destroy): Free dumpdir
2861         * src/tar.h (struct tar_stat_info.dumpdir): New member.
2862         * src/xheader.c (xheader_keyword_deleted_p): Remove static
2863         qualifier.
2864         (struct xhdr_tab.decoder): Change prototype. POSIX allows string
2865         values to contain embedded nulls, so take an extra argument
2866         specifying the length of the string.
2867         (decx,decg,dummy_decoder,atime_decoder,gid_decoder)
2868         (gname_decoder,linkpath_decoder,ctime_decoder,mtime_decoder)
2869         (path_decoder,size_decoder,uid_decoder,uname_decoder)
2870         (sparse_size_decoder,sparse_numblocks_decoder)
2871         (sparse_offset_decoder,sparse_numbytes_decoder): Likewise.
2872         (decode_record): Pass value length to the handler
2873         (run_override_list): Pass value length to the decoder
2874         (xheader_print_n): New function
2875         (xheader_print): Rewritten using xheader_print_n
2876         (xheader_finish): Do not rely om strlen to compute the length of
2877         the collected string: it can contain embedded nulls
2878         (xheader_string_begin,xheader_string_add,xheader_string_end): New
2879         functions.
2880         (sparse_map_decoder,dumpdir_coder,dumpdir_decoder): New
2881         functions. Handle GNU.sparse.map and GNU.dumpdir variables.
2882         (xhdr_tab): Add new variables.
2883
2884         * tests/incr01.at: Test gnu, oldgnu, and posix formats
2885         * tests/incremental.at: Likewise
2886
2887 2005-11-06  Paul Eggert  <eggert@cs.ucla.edu>
2888
2889         * NEWS: Minor language and white space fixes.
2890
2891         * tests/truncate.at: Create files whose time stamps must fall on
2892         1-second boundaries.  This prevents tests from failing on hosts
2893         like Solaris 8 that have nanosecond-resolution file time stamps.
2894         * tests/update.at: Likewise.
2895
2896         * src/xheader.c (strtoimax, strtoumax): Remove decls; now done
2897         in system.h.
2898
2899 2005-11-06  Sergey Poznyakoff  <gray@gnu.org.ua>
2900
2901         * doc/tar.texi: Properly document incremental dumps
2902         * doc/value.texi: Likewise.
2903         * doc/snapshot.texi: Likewise.
2904
2905 2005-11-05  Sergey Poznyakoff  <gray@gnu.org.ua>
2906
2907         Improve listed incremental format:
2908
2909         * src/common.h (update_parent_directory): New prototype.
2910         * src/create.c (dump_file): Call update_parent_directory.
2911         * src/incremen.c (struct directory.mtime): New member.
2912         (note_directory): Take additional arguments. All callers updated.
2913         (scan_directory): Updated to use more metadata. In particular,
2914         this allows to correctly detect renamed files.
2915         (read_directory_file,write_directory_file)
2916         (write_directory_file_entry): Support new directory file format.
2917         * tests/listed01.at: Sleep 1 sec before creating second file.
2918         * tests/listed02.at: Never skip the test. It should work on any
2919         filesystem.
2920
2921         * doc/snapshot.texi: New file
2922         * doc/tar.texi: Update.
2923         * doc/Makefile.am: Update.
2924
2925 2005-11-04  Paul Eggert  <eggert@cs.ucla.edu>
2926
2927         * src/extract.c (set_stat): Rewrite to avoid bug in Forte
2928         Developer 7 C 5.4 Patch 111708-09 (2004-02-19).
2929
2930 2005-11-04  Sergey Poznyakoff  <gray@gnu.org.ua>
2931
2932         * bootstrap: Fix quoting in help output.
2933         (update_po): Use backward-compatible wget option --cache instead
2934         of deprecated -C to accomodate for wget 1.10.
2935         Changes proposed by Eric Blake
2936         * THANKS: Add Eric Blake
2937
2938 2005-11-02  Paul Eggert  <eggert@cs.ucla.edu>
2939
2940         * doc/tar.texi: Consistently put two spaces after sentences,
2941         and put commas after "i.e." and "e.g.".  This is the usual GNU
2942         style in manuals.
2943
2944         * lib/.cvsignore: Add creat-safer.c, fcntl--.h, fcntl-safer.h,
2945         open-safer.c, openat-die.c, verify.h, to accommodate recent gnulib
2946         changes.
2947
2948 2005-10-27  Sergey Poznyakoff  <gray@gnu.org.ua>
2949
2950         * src/compare.c (diff_dumpdir): Pass a valid device number to
2951         get_directory_contents.
2952
2953         * THANKS: Add John Thomas McDole
2954
2955         * bootstrap: If file `.bootstrap' exists in the cwd and is
2956         readable, prepend its contents to the command line
2957
2958 2005-10-21  Sergey Poznyakoff  <gray@gnu.org.ua>
2959
2960         * tests/link01.at: Skip test if ln fails (suppose the OS does
2961         not support hard links).
2962
2963 2005-10-04  Sergey Poznyakoff  <gray@gnu.org.ua>
2964
2965         * src/tar.c (decode_options): Report error if -A or -r is used
2966         together with compression option.
2967
2968 2005-09-29  Sergey Poznyakoff  <gray@gnu.org.ua>
2969
2970         * doc/tar.texi: Use @option and @kbd consistently.
2971         Document new options.
2972
2973 2005-09-28  Sergey Poznyakoff  <gray@gnu.org.ua>
2974
2975         * NEWS: Updated
2976         * src/common.h (show_stored_names_option): New variable
2977         * src/list.c (print_header): If show_stored_names_option is given,
2978         list member names as stored in the archive. Patch proposed by Erik
2979         Cumps <erik.cumps@icos.be>
2980         * src/tar.c: Implement --show-stored-names option
2981
2982         * src/common.h (test_label_option): New variable;
2983         * src/list.c (print_header): Special handling if test_label_option
2984         is set.
2985         * src/names.c (all_names_found): If test_label_option is set
2986         return true.
2987         * src/tar.c: New option --test-label tests the archive volume
2988         label. The option proposed by Wouter Verhelst <wouter@nixsys.be>
2989
2990 2005-09-21  Paul Eggert  <eggert@cs.ucla.edu>
2991
2992         * tests/Makefile.am (clean-local): Don't attempt to run
2993         $(TESTSUITE) if it doesn't exist.  Problem reported by
2994         Eric Blake.
2995
2996 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2997
2998         Don't filter time stamps through the resolution supported
2999         by struct stat; keep them to full nanosecond resolution.
3000         This affects behavior only on older hosts or file systems
3001         that have lower-resolution time stamps.
3002         * src/common.h (OLDER_STAT_TIME): Parenthesize arg.
3003         (OLDER_TAR_STAT_TIME): New macro.
3004         (code_timespec): New function.
3005         (BILLION, LOG10_BILLION, TIMESPEC_STRSIZE_BOUND): New constants.
3006         * src/compare.c (diff_file): Use full time stamp resolution.
3007         * src/create.c (start_header, dump_file0): Likewise.
3008         (start_header, dump_file0): Adjust to new structure layout.
3009         (dump_regular_finish): Simplify by using timespec_cmp.
3010         * src/extract.c (struct delayed_set_stat): Don't store stat info
3011         that we don't need, to save space.  All uses changed.
3012         (struct delayed_set_stat, struct delayed_link, file_newer_p):
3013         (create_placeholder_file, extract_link, apply_delayed_links):
3014         Use full time stamp resolution.
3015         (check_time): Use code_timespec rather than rolling our own code.
3016         (set_stat, delay_set_stat): Arg now points to tar_stat_info to
3017         avoid losing time information.  All callers changed.
3018         * src/list.c (read_and, decode_header, print_heaeder):
3019         Use full time stamp resolution.
3020         * src/misc.c (code_timespec): New function.
3021         * src/tar.h (struct tar_stat_info): Record atime, mtime, ctime
3022         separately, for benefit of hosts with lower resolution.
3023         * src/update.c (update_archive): Use full time stamp resolution.
3024         * src/xheader.c (code_time): Use new code_timespec function
3025         to simplify code.
3026         (atime_coder, atime_decoder, ctime_coder, ctime_decoder):
3027         (mtime_coder, mtime_decoder): Use full time stamp resolution.
3028
3029         Report time stamps to full resolution in environment.
3030         Report memory allocation failures rather than ignoring them.
3031         * src/system.c (time_to_env): New function.
3032         (oct_to_env, str_to_env, chr_to_env): Report memory allocation failures.
3033         (stat_to_env): Report full resolution in time stamps.
3034
3035 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
3036
3037         Merge changes from gnulib for file system sub-second time stamps.
3038         * configure.ac: Remove checks for struct stat.st_spare1, struct
3039         stat.st_atim.tv_nsec, struct stat.st_atimespec.tv_nsec, struct
3040         stat.st_atimensec, as gnulib now does this for us.
3041         Similarly for LIB_CLOCK_GETTIME.
3042         * gnulib.modules: Add stat-time.
3043         * lib/.cvsignore: Add stat-time.h.
3044         * src/common.h: Include stat-time.h.
3045         (timespec_lt): Remove.  All callers changed to use timespec_cmp.
3046         (get_stat_atime, get_stat_ctime, get_stat_mtime):
3047         (set_stat_atime, set_stat_ctime, set_stat_mtime):
3048         Remove; now defined by stat-time.h.
3049
3050 2005-09-14  Sergey Poznyakoff  <gray@gnu.org.ua>
3051
3052         * src/incremen.c (list_dumpdir): New function. Used to dump
3053         contents of GNUTYPE_DUMPDIR blocks.
3054         * src/common.h (list_dumpdir): Likewise.
3055         * src/list.c (list_archive): Use list_dumpdir() to display
3056         GNUTYPE_DUMPDIR blocks. Do that only if two or more -v options are
3057         given.
3058
3059 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
3060
3061         * lib/.cvsignore: Adjust to current gnulib and modules used.
3062         Add getdelim.c, getdelim.h, mbchar.c, mbchar.h, mbuiter.h, memchr.c,
3063         pipe-safer.c, size_max.h, strdup.c, strdup.h, strnlen.h, strnlen1.c,
3064         strnlen1.h, unistd--.h.
3065         Remove getndelim2.c, getndelim2.h, pathmax.h, sysexits.h, xstrdup.c.
3066
3067         Treat fishy-looking hard links like fishy-looking symlinks.
3068         * src/extract.c (struct delayed_set_stat): Rename after_symlinks
3069         member to after_links.  All uses changed.
3070         (struct delayed_link): Renamed from struct delayed_symlink.
3071         All uses changed.  New member is_symlink.
3072         (delayed_link_head): Renamed from delayed_symlink_head.  All uses
3073         changed.
3074         (create_placeholder_file): New function, taken from extract_symlink.
3075         (extract_link): Create placeholders for fishy-looking hard links.
3076         (extract_symlink): Move code into create_placeholder_file.
3077         (apply_delayed_links): Renamed from apply_delayed_symlinks.
3078         All uses changed.  Create both hard links and symlinks.
3079
3080 2005-09-03  Paul Eggert  <eggert@cs.ucla.edu>
3081
3082         * README-alpha: Modernize description of software required for
3083         developers.
3084
3085 2005-09-03  Sergey Poznyakoff  <gray@gnu.org.ua>
3086
3087         * gnulib.modules: Add strdup
3088         * src/incremen.c (purge_directory): Do not dereference symbolic
3089         links. Bug reported by Ralph Corderoy <ralph@inputplus.co.uk> and
3090         David Brown <davidb@davidb.org>
3091         * tests/incr01.at: New test.
3092         * tests/Makefile.am: Add incr01.at
3093         * tests/testsuite.at: Likewise
3094         * THANKS: Updated
3095
3096 2005-08-17  Sergey Poznyakoff  <gray@gnu.org.ua>
3097
3098         * src/incremen.c (read_directory_file): Use strtoumax to read
3099         snapshot file contents.
3100         (write_directory_file_entry): Use umaxtostr().
3101
3102 2005-07-31  Sergey Poznyakoff  <gray@gnu.org.ua>
3103
3104         * src/create.c (file_dumpable_p,dump_file0): Fix handling of
3105         sparse files to /dev/null with --totals option.
3106         * tests/update.at: Remove dependency on file order.
3107
3108 2005-07-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3109
3110         * doc/tar.texi: Fix typo.
3111
3112 2005-07-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3113
3114         * tests/pipe.at: Pipe the output from `tar xfv' through sort.
3115
3116 2005-06-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3117
3118         * src/sparse.c (tar_sparse_init): Fill structure with zeros. Call
3119         sparse_select_optab(). All callers updated.
3120         (sparse_member_p, sparse_fixup_header): Use tar_sparse_init().
3121
3122 2005-06-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3123
3124         * src/sparse.c (pax_sparse_member_p): Checking member size
3125         vs. file size is not reliable enough. Use sparse_map_avail.
3126
3127         * tests/star/gtarfail.at: Adapt to the new output format
3128         * tests/star/gtarfail2.at: Likewise
3129         * tests/star/multi-fail.at: Likewise
3130         * tests/star/pax-big-10g.at: Likewise
3131         * tests/star/ustar-big-2g.at: Likewise
3132         * tests/star/ustar-big-8g.at: Likewise
3133
3134         * tests/sparse03.at: New test.
3135         * tests/Makefile.am: Add sparse03.at
3136         * tests/testsuite.at: Likewise
3137
3138         * src/xheader.c (size_decoder): Do not set archive_file_size.
3139
3140         Fix bugs introduced yesterday:
3141
3142         * src/sparse.c (tar_sparse_init):  Initialize
3143         dimped_size to 0.
3144         (sparse_scan_file): Initialize archive_file_size to 0. The
3145         variable keeps size of the file *as stored in the archive*, not
3146         the size reported by stat.
3147
3148 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
3149
3150         A sweep of the sparse code prompted by a bug report by Jim Meyering.
3151         * src/sparse.c: Include <inttostr.h>.
3152         (struct tar_sparse_file): offset and dumped_size are off_t, not
3153         size_t.  optab is now const *.
3154         (dump_zeros): Return bool success flag, not off_t.
3155         All callers changed.
3156         Use a constant-zero buffer rather than clearing a buffer each time.
3157         Don't mess up if write fails.
3158         (dump_zeros, check_sparse_region):
3159         Don't assume off_t is no wider than size_t.
3160         (tar_sparse_init): Don't bother clearing a field that is already clear.
3161         (zero_block_p): First arg is const *, not *.
3162         (clear_block, SPARSES_INIT_COUNT): Remove.
3163         (sparse_add_map): First arg is now struct start_stat_info *, not
3164         struct tar_sparse_file *.  All callers changed.
3165         Use x2nrealloc to check for size_t overflow.
3166         (parse_scan_file): Cache commonly-used parts of file.
3167         Use an auto buffer, not a static one.
3168         Don't bother clearing the buffer; not needed.
3169         Don't bother clearing items that are already clear.
3170         (oldgnu_optab, star_optab, pax_optab): Now const.
3171         (sparse_dump_region): Don't bother clearing the buffer before
3172         reading into it; just clear the parts that aren't read into.
3173         (sparse_dump_file): Clear the whole local variable 'file'.
3174         (diff_buffer): Remove; now a local var.
3175         (check_sparse_region): Don't bother clearing buffer before
3176         reading into it.  Don't assume off_t is promoted to long.
3177         (oldgnu_get_sparse_info, star_get_sparse_info):
3178         Use an auto status, not static.
3179         * src/tar.h (struct tar_stat_info): had_trailing_slash is
3180         now bool, not int.
3181         * src/xheader.c (sparse_offset_coder, sparse_numbytes_coder):
3182         Rewrite to avoid cast.
3183         (sparse_offset_decoder, sparse_numbytes_decoder):
3184         Diagnose excess entries rather than crashing.
3185
3186 2005-06-22  Jim Meyering  <jim@meyering.net>
3187
3188         * src/common.h (timespec_lt): Add a return type: bool.
3189
3190 2005-06-21  Paul Eggert  <eggert@cs.ucla.edu>
3191
3192         Further improvements inspired by Jim Meyering's fixes.
3193
3194         * NEWS: Better support for full-resolution time stamps.
3195         The -v option now prints time stamps only to 1-minute resolution.
3196         * gnulib.modules: Add utimens.
3197         * lib/.cvsignore: Add imaxtostr.c, inttostr.c, inttostr.h,
3198         offtostr.c, umaxtostr.c, utimens.c, utimens.h.  Remove paxconvert.c.
3199         * lib/Makefile.tmpl (libtar_a_SOURCES): Remove paxconvert.c.
3200         * lib/paxconvert.c: Remove; superseded by umaxtostr.c.
3201         * po/POTFILES.in: Remove lib/paxconvert.c.  Add lib/xalloc-die.c,
3202         lib/obstack.c.
3203         * src/buffer.c (set_start_time, compute_duration, start_time):
3204         Use gettime rather than rolling our own code.
3205         * src/common.h (OLDGNU_NAME_FIELD_SIZE, MAXOCTAL11, MAXOCTAL7): Remove.
3206         (newer_ctime_option): Remove.
3207         (timespec_lt): New function.
3208         (OLDER_STAT_TIME): Use it.
3209         (string_to_chars): First arg is char const *, not char *.
3210         (tartime): Time arg is now struct timespec.  New bool arg.
3211         All callers changed.
3212         (code_ns_fraction): New decl.
3213         (sys_stat_nanoseconds): Remove decl.
3214         (get_stat_atime, get_stat_ctime, get_stat_mtime): New functions.
3215         (set_stat_atime, set_stat_ctime, set_stat_mtime): New functions.
3216         * src/compare.c: Include utimens.h rather than rolling our own.
3217         (diff_dir, diff_file, diff_link, diff_symlink, diff_special):
3218         Prototype.
3219         (diff_dumpdir, diff_multivol): Prototype.
3220         (diff_file): Support higher-resolution time stamps.
3221         * src/create.c: Include utimens.h rather than rolling our own.
3222         (MAX_OCTAL_VAL): New macro.
3223         (tar_copy_str, string_to_chars): Don't bother to zero-fill;
3224         the destination is already zeroed.
3225         (string_to_chars): First arg is char const *.
3226         (start_private_header): Use MINOR_TO_CHARS, not MAJOR_TO_CHARS,
3227         for minor device number.
3228         (write_header_name, dump_hard_link, dump_file0):
3229         Simplify test for old GNU format.
3230         (start_header): Put in placeholders for uid, etc., even when
3231         using extended headers, for benefit of older "tar" implementations.
3232         Don't assume uintmax_t is wider than 32 bits.
3233         Output extended header for mtime if needed.
3234         (dump_regular_finish, dump_file0):
3235         Support extended time stamp resolution.
3236         * src/extract.c: Include utimens.h rather than rolling our own.
3237         (check_time): Support extended time stamp resolution.
3238         * src/list.c: Include <inttostr.h>.
3239         (tartime): Use umaxtostr rather than stringify_uintmax_t_backwards.
3240         * src/xheader.c: Include <inttostr.h>.
3241         Do not include <xstrtol.h>.
3242         (strtoimax) [!HAVE_DECL_STRTOIMAX && !defined strtoimax]: New decl.
3243         (strtoumax) [!HAVE_DECL_STRTOUMAX && !defined strtoumax]: New decl.
3244         (BILLION, LOG10_BILLION): New constants.
3245         (to_decimal): Remove; superseded by inttostr.  All callers changed
3246         to use umaxtostr.
3247         (xheader_format_name): Don't assume pids and uintmax_t values
3248         fit in 63 bytes (!) when printed.
3249         (decode_record): Don't bother to check for ERANGE; an out of range
3250         value must be treater than len_max anyway.
3251         If the length is out of range, output it in the diagnostic.
3252         (format_uintmax): Remove; all callers changed to use umaxtostr.
3253         (xheader_print): Don't assume sizes can be printed in 99 bytes (!).
3254         (out_of_range_header): New function.
3255         (decode_time): Use it.
3256         (code_time): Accept struct timespec, not time_t and unsigned long.
3257         All callers changed.  Size sbuf properly, and remove unnecessary check.
3258         Don't assume time stamps can fit in 199 bytes.
3259         Handle negative time stamps.  Handle fractional time stamps
3260         more consistently.  Don't output unnecessary trailing zeros.
3261         (decode_time): Yield struct timespec, not time_t and unsigned long.
3262         All callers changed.
3263         Handle negative time stamps.  Truncate towards minus infinity
3264         consistently.  Improve overflow checks, and output a better
3265         diagnostic on overflow.
3266         (code_num): Don't assume uintmax_t can be printed in 99 bytes (!).
3267         (decode_num): New function, for better diagnostics.
3268         (atime_coder, atime_decoder, gid_decoder, ctime_coder):
3269         (ctime_decoder, mtime_coder, mtime_decoder, size_decoder):
3270         (uid_decoder, sparse_size_decoder, sparse_numblocks_decoder):
3271         (sparse_offset_decoder, sparse_numbytes_decoder):
3272         Use decode_num, etc., instead of xstrtoumax, etc.
3273
3274 2005-06-21  Jim Meyering  <jim@meyering.net>
3275
3276         Carefully crafted invalid headers can cause buffer overrun.
3277         Invalid header fields go undiagnosed.
3278         Some valid time strings are ignored.
3279
3280         * src/xheader.c (sparse_numblocks_decoder): Remove unchecked use
3281         of `calloc'.  Use xcalloc instead.
3282         (decode_time, gid_decoder, size_decoder, uid_decoder):
3283         (sparse_size_decoder, sparse_offset_decoder, sparse_numblocks_decoder):
3284         Ensure that the result of calling xstrtoumax is no larger than
3285         the maximum value for the target type.  Upon any failure, exit with
3286         a diagnostic.
3287         (sparse_numblocks_decoder): Avoid buffer overrun/heap corruption:
3288         use x2nrealloc, rather than `n *= 2' and xrealloc(p, n,....
3289         (decode_time): Rewrite to accept time strings like
3290         1119018481.000000000.  Before, such strings were always ignored.
3291
3292 2005-06-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3293
3294         * src/create.c (dump_file0): Check for is_avoided_name()
3295         first. Fixes bug reported by Martin Lohmeier
3296         <martin@mein-horde.de>
3297         * tests/update.at: New file
3298         * tests/Makefile.am (TESTSUITE_AT): Add update.at
3299         * tests/testsuite.at: Likewise
3300
3301 2005-06-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3302
3303         * configure.ac (AC_STRUCT_ST_BLKSIZE)
3304         (AC_STRUCT_ST_BLOCKS): Removed. Handled by system.m4.
3305
3306 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
3307
3308         * src/names.c (excluded_name): excluded_filename ->
3309         excluded_file_name, because the name was changed in gnulib.
3310
3311 2005-05-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3312
3313         * src/tar.c (read_name_from_file,update_argv): Automatically
3314         detect nul-terminated list files.
3315         * NEWS: Updated
3316
3317 2005-05-27  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3318
3319         * scripts/backup.sh.in: Bugfixes.
3320
3321 2005-05-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3322
3323         * scripts/backup.in: Minor fixes
3324         * scripts/backup.sh.in (mt_begin,mt_rewind)
3325         (mt_offline,mt_status): Use $MT to invoke mt
3326         (init_common): Set --rsh-command option for mt if TAPE_FILE is a
3327         remote archive.
3328         * doc/tar.texi: Document new backup scripts behavior
3329
3330 2005-05-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3331
3332         * lib/.cvsignore: Updated
3333         * lib/Makefile.tmpl: Add new paxutils files
3334         * po/POTFILES.in: Likewise
3335         * src/buffer.c: Update invocations of safer_name_suffix()
3336         * src/create.c: Likewise
3337         * src/extract.c: Likewise
3338         * src/xheader.c: Likewise
3339         * src/common.h: Include paxlib.h instead of paxerror.h
3340         (safer_name_suffix,removed_prefixes_p): Removed. The functions are
3341         imported from paxutils
3342         * src/names.c (hash_string_hasher,hash_string_compare)
3343         (hash_string_insert,hash_string_lookup,removed_prefixes_p)
3344         (safer_name_suffix): Moved to paxutils
3345
3346 2005-05-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3347
3348         * bootstrap (copy_files): Accept optional third argument: a prefix
3349         to be appended to destination file names.
3350         Import paxutils/paxlib files.
3351         * configure.ac: Remove checking for LIB_SETSOCKOPT, it is handled
3352         by paxutils.
3353         * lib/Makefile.tmpl (libtar_a_SOURCES): Add paxerror.c paxexit.c
3354         paxconvert.c
3355         * po/POTFILES.in: Likewise.
3356         * src/common.h: Remove defines and declarations imported from
3357         paxutils
3358         * src/misc.c: Likewise
3359         * src/list.c (stringify_uintmax_t_backwards): Moved to paxutils
3360
3361 2005-05-17  Paul Eggert  <eggert@cs.ucla.edu>
3362
3363         * src/misc.c (remove_any_file): Fix typo in previous change.
3364
3365 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
3366
3367         Port to Solaris 10's treatment of unlinking directories.
3368         * gnulib-modules: Add unlinkdir.
3369         * lib/.cvsignore: Add unlinkdir.h, unlinkdir.c.
3370         * src/common.h (we_are_root): Remove extern decl; it's now static.
3371         * src/extract.c (we_are_root): Now static.
3372         * src/misc.c: Include <unlinkdir.h>.
3373         (remove_any_file): Use cannot_unlink_dir () rather than we_are_root.
3374
3375         * ChangeLog, ChangeLog.1, Makefile.am, NEWS, PORTS, README,
3376         README-alpha, TODO, bootstrap, configure.ac, doc/Makefile.am,
3377         doc/convtexi.pl, doc/fdl.texi, doc/gendocs_template,
3378         lib/Makefile.tmpl, lib/prepargs.c, lib/waitpid.c, po/POTFILES.in,
3379         scripts/Makefile.am, scripts/backup-specs, scripts/backup.in,
3380         scripts/backup.sh.in, scripts/restore.in, src/Makefile.am,
3381         src/arith.h, src/buffer.c, src/common.h, src/compare.c,
3382         src/create.c, src/delete.c, src/extract.c, src/incremen.c,
3383         src/list.c, src/mangle.c, src/misc.c, src/names.c, src/sparse.c,
3384         src/system.c, src/tar.c, src/tar.h, src/update.c, src/utf8.c,
3385         src/xheader.c, tests/Makefile.am, tests/append.at,
3386         tests/append01.at, tests/comprec.at, tests/delete01.at,
3387         tests/delete02.at, tests/delete03.at, tests/delete04.at,
3388         tests/delete05.at, tests/extrac01.at, tests/extrac02.at,
3389         tests/extrac03.at, tests/extrac04.at, tests/extrac05.at,
3390         tests/gzip.at, tests/ignfail.at, tests/incremental.at,
3391         tests/link01.at, tests/listed01.at, tests/listed02.at,
3392         tests/long01.at, tests/longv7.at, tests/multiv01.at,
3393         tests/multiv02.at, tests/multiv03.at, tests/multiv04.at,
3394         tests/old.at, tests/options.at, tests/options02.at, tests/pipe.at,
3395         tests/recurse.at, tests/same-order01.at, tests/same-order02.at,
3396         tests/shortrec.at, tests/sparse01.at, tests/sparse02.at,
3397         tests/testsuite.at, tests/truncate.at, tests/version.at,
3398         tests/volume.at, tests/star/gtarfail.at, tests/star/gtarfail2.at,
3399         tests/star/multi-fail.at, tests/star/pax-big-10g.at,
3400         tests/star/quicktest.sh, tests/star/ustar-big-2g.at,
3401         tests/star/ustar-big-8g.at:
3402         Update FSF postal mail address.
3403
3404 2005-05-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3405
3406         * NEWS: Updated
3407         * THANKS: Updated
3408         * bootstrap: Install files from paxutils/doc
3409         * doc/Makefile.am (tar_TEXINFOS): Add genfile.texi
3410         * doc/tar.texi (Genfile): New appendix
3411         * src/compare.c (diff_file): diff_handle was not initialized
3412         * src/create.c (dump_regular_file): Correctly pad archive members
3413         that shrunk during archiving. Repored by Frank Heckenbach.
3414         * src/extract.c (file_newer_p): Return false if file does not
3415         exist
3416         (prepare_to_extract): Correct warning wording.
3417         * tests/truncate.at: New test case
3418         * tests/Makefile.am: Add truncate.at
3419         * tests/testsuite.at: Likewise.
3420
3421         * doc/.cvsignore: Updated
3422         * lib/.cvsignore: Updated
3423         * tests/.cvsignore: Updated
3424
3425 2005-05-02  Paul Eggert  <eggert@cs.ucla.edu>
3426
3427         * tests/multivol04.at: Tell awk to read from /dev/null.
3428
3429         Adjust to recent gnulib changes.
3430         * lib/.cvsignore: Add dup-safer.c, fd-safer.c, unistd-safer.h.
3431         * src/common.h (initial_umask): New var.
3432         * src/create.c (start_ueader): Use it, and adjust to new modechange
3433         API.
3434         (hash_link): unsigned -> size_t parameters and result.
3435         * src/incremen.c (hash_directory): Likewise.
3436         * src/names.c (hash_string_hasher): Likewise.
3437         * src/tar.c (parse_opt): Set it, and adjust to new modechange API.
3438
3439 2005-04-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3440
3441         * tests/Makefile.am: Add shortrec.at.
3442
3443 2005-04-18  Paul Eggert  <eggert@cs.ucla.edu>
3444
3445         * src/buffer.c (reading_from_pipe): Remove.  All uses removed.
3446         (short_read): Don't warn about short reads; they're normal.
3447         * tests/shortrec.at: New file.
3448         * tests/testsuite.at: Include it.
3449
3450         * bootstrap (gnulib_modules): Don't create a file modlist.tmp, as
3451         it is sometimes left behind as a garbage file (maybe due to the
3452         multiple traps?).
3453
3454 2005-04-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3455
3456         * src/list.c: Handle Solaris 'X' type flag
3457         * src/tar.h (SOLARIS_XHDTYPE): New define
3458
3459 2005-04-06  Sergey Poznyakoff  <gray@mirddin.farlep.net>
3460
3461         * src/tar.c: Minor fixes to text messages. Proposed by Benno
3462         Schulenberg.
3463         * src/extract.c: Likewise
3464         (extract_file): Assign orig_file_name
3465         to save_name uniformly over the program. This fixes matching
3466         directory names at the start of an archive volume.
3467         * src/buffer.c (flush_write): Warn when the name of the archive
3468         straddling volume boundary is longer than 100 characters. Earlier
3469         behavior was to issue a fatal error.
3470         (struct zip_magic): Reverted part of changes from 2005-04-04.
3471         They make the maintenance too costly. Removing `unsigned'
3472         qualifier from `magic' member should be enough.
3473         * src/compare.c (diff_init): Read directory file if in listed
3474         incremental. This prevents spurious 'Contents differ' diagnostics.
3475         (diff_archive): Minor fixes to text messages
3476         (diff_file,diff_dumpdir,diff_multivol): Assign orig_file_name
3477         to save_name uniformly over the program. This fixes matching
3478         directory names at the start of an archive volume.
3479         * src/create.c: Assign orig_file_name
3480         to save_name uniformly over the program. This fixes matching
3481         directory names at the start of an archive volume.
3482         * src/list.c: Likewise
3483
3484         * tests/multiv03.at: Modified to match the new behavior
3485         * tests/multiv04.at: New file. Test splittind directory members between
3486         the archive volumes.
3487         * tests/Makefile.am: Add multiv04.at
3488         * tests/testsuite.at: Likewise.
3489
3490 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
3491
3492         * configure.ac (AC_CONFIG_AUX_DIR): Rename from config to build-aux,
3493         for reasons discussed in the thread beginning at
3494         <http://lists.gnu.org/archive/html/bug-gnulib/2005-03/msg00119.html>.
3495         * .cvsignore: Remove config; add build-aux.
3496
3497         * src/buffer.c (struct zip_magic): Use char arrays, not pointers.
3498         The unsigned char * pointer ran afoul of pedantic C compilers, and
3499         we didn't need pointers anyway.  Put the size field before the
3500         data to avoid unnecessary padding.  All uses changed.
3501         (magic) Make it const, since it doesn't change.  All uses changed.
3502
3503 2005-04-02  Paul Eggert  <eggert@cs.ucla.edu>
3504
3505         * src/xheader.c (decode_record): Don't dump core when given
3506         a corrupted extended header.  Problem reported by Jim Meyering.
3507         Also, check for other ways that the header might be invalid,
3508         e.g., missing newline at end.  Do not allow keys with nulls.
3509         Allow blanks before and after length, as POSIX requires.
3510         Do not allow leading "-" in length.  Check for length overflow.
3511         (xheader_decode, xheader_decode_global): Let decode_record
3512         check for exhaustion of record.
3513         (xheader_read): Null-terminate the extended record;
3514         decode_record relies on this.
3515
3516 2005-03-21  Paul Eggert  <eggert@cs.ucla.edu>
3517
3518         * bootstrap (TP_URL): Change from
3519         <http://www2.iro.umontreal.ca/~gnutra/po/maint/tar/> to
3520         <http://www.iro.umontreal.ca/translation/maint/tar/> to avoid
3521         some redirection glitches.
3522         Use "trap - 0" rather than "trap 0" to fix a POSIX-conformance bug.
3523         * doc/.cvsignore: Change "tar.info" to "tar.info*".  Sort.
3524         * lib/.cvsignore: Add intprops.h (new gnulib file).
3525
3526 2005-03-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3527
3528         * src/list.c (print_header): Print UID/GID in case of
3529         empty user/group name. This could occur when dumping
3530         files belonging to non-existing users and when listing
3531         broken archives.
3532         Reported by Igor Lautar.
3533
3534         * src/create.c: Correctly parse empty uname/gname
3535         * src/sparse.c (sparse_scan_file): Bugfix. offset had
3536         incorrect type.
3537
3538         * scripts/backup.in: Use `head -n 1'. Provide missing
3539         argument to ${MT_STATUS}. Proposed by Jan Merka.
3540         * scripts/backup.sh.in: Likewise. Fixed typo in
3541         MT_OFFLINE assignment.
3542         * scripts/restore.in (restore_fs): Use root_fs
3543
3544 2005-02-15  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3545
3546         * src/create.c: Replace strdup with xstrdup
3547         * src/names.c: Likewise
3548         * src/tar.c: Likewise
3549
3550         * tests/append01.at: Added reference to bug-tar archive
3551         * tests/listed02.at: Use -print with find.
3552
3553 2005-02-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3554
3555         * THANKS: Added Tim Adye. Fixed UTF.
3556         * src/list.c (read_header): Removed assignment to
3557         oldgnu_header.isextended. It was breaking append mode.
3558
3559         * tests/append01.at: New test.
3560         * tests/Makefile.am: Added append01.at
3561         * tests/testsuite.at: Likewise
3562
3563 2005-02-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3564
3565         * gnulib.modules: New file. List of required gnulib
3566         modules.
3567         * bootstrap: Merge list of required modules from
3568         paxutils with that from tar proper.
3569         * src/tar.c: Various fixes in help and diagnostic messages.
3570
3571 2005-02-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3572
3573         * src/common.h (EXTRACT_OVER_PIPE): New macro
3574         * src/compare.c: Code clean up.
3575         * src/extract.c (extract_archive): Do not check for
3576         EXTRACT_OVER_PIPE, decode_options() does this.
3577         * src/misc.c (exec_error,fork_error,dup2_error)
3578         (pipe_error): Removed unneeded functions.
3579         * src/system.c (sys_exec_command): Use xclose, xpipe,
3580         xfork, xdup2 and exec_fatal.
3581         * src/tar.c (options): Improved sorting. Document --backup=off.
3582         (decode_options): Clear backup_option if necessary.
3583
3584 2005-02-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3585
3586         Initial implementation of --to-command option proposed
3587         by Hansjoerg Lipp.
3588
3589         * bootstrap: Get setenv module from gnulib
3590         * src/buffer.c: Do not use 8-bit chars in comments
3591         * src/common.h (to_command_option)
3592         (ignore_command_error_option): New globals
3593         (sys_exec_command,sys_wait_command): New commands
3594         * src/extract.c (extract_file): Handle to_command_option
3595         Fix error recovery: decrease `size' by `written', not
3596         by `count', otherwise tar misses the next header
3597         Do not diagnose write error if to_command_option
3598         is set, since the command may have exited prematurely.
3599         It would be better to check for sigpipe, though.
3600         (prepare_to_extract): Handle to_command_option
3601         * src/misc.c (exec_error, fork_error, dup_error)
3602         (pipe_error): New functions
3603         * src/system.c (sys_exec_command)
3604         (sys_wait_command): New functions
3605         * src/tar.c: Handle new options --to-command,
3606         --ignore-command-error
3607         * THANKS: Added Hansjoerg Lipp
3608
3609 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
3610
3611         * src/list.c (from_header): New arg OCTAL_ONLY, normally false.
3612         All uses changed.  Fix typo that sometimes suppressed all "Archive
3613         contains obsolescent base-64 headers" warnings, not just the first
3614         one.
3615         (tar_checksum): Accept only octal checksums, since they aren't
3616         supposed to overflow into weird formats.
3617
3618         Adjust to gnulib changes.
3619         * lib/.cvsignore: Add chdir-long.c, chdir-long.h, memrchr.c,
3620         memrchr.h, openat.c, openat.h.  Remove pathmax.h (added by
3621         mistake, perhaps?), sysexit.h (my typo), xstrdup.c (gnulib removed
3622         this file).  Sort entries.
3623
3624 2005-02-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3625
3626         * src/extract.c: Further rewrite.
3627         * src/buffer.c: Removed unused variables.
3628         * src/list.c: Likewise
3629         * src/tar.c (update_argv): Changed type to void
3630
3631         * src/common.h (OLDGNU_NAME_FIELD_SIZE): New constant
3632         * src/create.c (start_private_header,write_header_name)
3633         (dump_hard_link): Restore compatibility with 1.13.25
3634         * src/extract.c (extract_archive): Rewritten
3635         * src/list.c: Add translators' comments
3636         * src/tar.c (options) Minor spelling fix
3637         * tests/star/quicktest.sh: Determine path to the tar executable.
3638
3639 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3640
3641         * po/POTFILES.in: Added tests/genfile.c
3642         * src/buffer.c (short_read): Use ngettext()
3643         (new_volume): use quote().
3644         * src/create.c: Use quote()
3645         * src/extract.c: Likewise
3646         * src/xheader.c: Likewise
3647         * src/misc.c: Add comments to translators
3648
3649         * tests/same-order01.at: sort ls output
3650         * tests/sparse01.at (RE_CHECK): Added missing space
3651
3652         * tests/sparse02.at: Test extracting sparse files over a pipe.
3653         * tests/Makefile.am: Added sparse02.at
3654         * tests/testsuite.at: Likewise
3655         * tests/listed02.at: Skip the test on filesystems that do not
3656         update ctime of a file when renaming it. To be reverted when
3657         the new incremental mode is ready.
3658         * tests/sparse01.at: Extract and compare sparse file
3659
3660 2005-02-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3661
3662         * src/sparse.c: Extract sparse files even if the output
3663         fd is not seekable.
3664
3665 2005-02-01  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3666
3667         * bootstrap: Add a comment to lib/Makefile.am saying that this
3668         is an autogenerated file.
3669         Exit with code 1 if any of autotools fails.
3670         * lib/Makefile.tmpl: Insert Emacs magic to the first line.
3671         * tests/Makefile.am: Add append.at
3672
3673         * m4/.cvsignore: Ignore all *.m4 files
3674
3675 2005-01-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3676
3677         Rewritten handling of -T (--files-from) option. Now it
3678         inserts the file names immediately into argv array which allows
3679         for:
3680         1) any valid tar options (including another -T) to be used in the file
3681         2) any number of -T options to be given in command line
3682
3683         * configure.ac: Raised version number to 1.15.2
3684         * src/common.h: Include obstack.h
3685         (files_from_option): Removed
3686         (unquote_option): New variable
3687         (stat_fatal): New function
3688         (name_close): Removed function.
3689         * src/incremen.c: Remove inclusion of obstack.h
3690         * src/xheader.c: Likewise.
3691         * src/misc.c (stat_fatal): New function
3692         * src/names.c (name_file): Removed variable.
3693         (read_name_from_file): Removed function. All callers changed.
3694         (name_close): Removed function. All callers changed.
3695         * src/tar.c: New options --unquote (--no-unquote) and
3696         --add-file
3697         (add_file_id,read_name_from_file,update_argv): New functions
3698         (parse_opt): Rewritten handling of -T option. Handle hidden
3699         --HANG option for debugging purposes.
3700         (decode_options): Init unquote_option to true. Init argv_stk.
3701         Remove unneeded references to files_from_option
3702
3703         * doc/tar.texi: Document new options.
3704         Moved rendition macros and option value definitions into
3705         separate files
3706         * doc/rendition.texi: New file
3707         * doc/value.texi: New file
3708         * doc/Makefile.am: Updated
3709
3710 2005-01-13  Paul Eggert  <eggert@cs.ucla.edu>
3711
3712         * tests/testsuite.at (RE_CHECK): Use "join - file", not
3713         "join file -", to work around a bug in Solaris 8 join.
3714         Problem reported by Tomohiro Suzuki.
3715
3716 2005-01-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3717
3718         * src/list.c (read_header): Fixed calculation of the
3719         size for GNU long name/link. Tar was reading one block
3720         more if name_size was divisible by 512. Thanks Josef
3721         Bauer.
3722         * tests/long01.at: New file. Test listing of GNU long names
3723         divisible by 512.
3724         * tests/pipe.at: Sort tar output.
3725         * tests/Makefile.am: Added long01.at
3726         * tests/testsuite.at: Likewise.
3727         * THANKS: Added Josef Bauer
3728         * lib/.cvsignore: Updated
3729         * m4/.cvsignore: Updated
3730         * NEWS: Updated
3731
3732 2005-01-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3733
3734         * directory: Updated for 1.15.1
3735         * doc/Makefile.am: Use gendocs.sh to generate web documentation
3736         * doc/gendocs_template: Template file for gendocs.sh
3737         * doc/tar.texi: Updated docs for --[no-]same-permissions
3738         * src/tar.c: Reworded docstrings for --[no-]same-permissions
3739
3740 2005-01-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3741
3742         * bootstrap: Create m4/paxutils.m4
3743         * configure.ac: Call tar_PAXUTILS
3744         * tests/options02.at: Test that tar correctly handles non-option
3745         arguments interspersed with options.
3746         * tests/Makefile.am: Add options02.at
3747         * tests/testsuite.at: Likewise
3748         * tests/listed02.at: Do not create useless directory
3749
3750 2005-01-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3751
3752         * src/tar.c (parse_opt): Bugfix: Use ARGP_KEY_ARG. Thanks
3753         Mike Frysinger <vapier@gentoo.org> for reporting.
3754
3755 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
3756
3757         * lib/Makefile.tmpl (localedir.h): Omit needless quotes and a
3758         needless sed command.  Problem reported by Paul Jarc.
3759
3760 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
3761
3762         Accommodate latest gnulib.
3763         * doc/.cvsignore: Add getdate.texi.
3764         * bootstrap: Do not treat alloca-opt specially; this is no
3765         longer needed (and breaks builds) with latest gnulib.
3766
3767 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3768
3769         * src/tar.c (main): Reverted recent changes (#ifdef).
3770
3771 2004-12-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3772
3773         * configure.ac: Raise version number to 1.15.1
3774         Check for locale.h
3775         * NEWS: Entry for 1.15.1
3776         * src/buffer.c: Bugfix. Changes introduced 2004-11-26
3777         broke extraction from stdin.
3778         * src/list.c (from_header, tar_checksum): Changed declaration.
3779         All callers updated.
3780         * src/common.h: Likewise
3781         * src/tar.c (main): Protect invocation of setlocale by
3782         ifdef.
3783
3784         * tests/comprec.at: New test
3785         * tests/pipe.at: New test
3786         * tests/Makefile.am (comprec.at,pipe.at): New tests
3787         * tests/testsuite.at: Likewise
3788         * tests/gzip.at: Use AT_GZIP_PREREQ
3789         * tests/star/pax-big-10g.at: Likewise
3790         * tests/star/ustar-big-2g.at: Likewise
3791         * tests/star/ustar-big-8g.at: Likewise
3792
3793         * tests/extrac04.at: Discard stderr from sort, on some
3794         systems it spits out lots of irrelevant info.
3795         * tests/listed02.at: Likewise
3796
3797         * doc/index.html.in: Rewritten in xhtml to follow recent
3798         GNU site standards.
3799         * THANKS: Updated
3800
3801 2004-12-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3802
3803         Released version 1.15. Sources up to this point are
3804         tagged release_1_15.
3805
3806         * configure.ac: Raised version number to 1.15
3807         * NEWS: Likewise
3808         * directory: Updated
3809         * bootstrap (update_po): Give -r to wget. Always remove index.html
3810         Ignore alloca-opt module (it duplicates alloca)
3811
3812         * tests/Makefile.am: Distribute star/quicktest.sh
3813         * tests/star/README: Document quicktest.sh
3814         * tests/star/qucktest.sh: Removed.
3815         * tests/star/quicktest.sh: New file.
3816
3817 2004-12-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3818
3819         * NEWS: Updated
3820         * doc/tar.texi: Document auto-detection of compressed archive
3821         formats.
3822         * src/tar.c (decode_options): Ignore --seek if used with --delete.
3823         Delete.c is based on the assumption that the archive is being
3824         actually read, not lseeked.
3825
3826         * tests/delete05.at: New file
3827         * tests/extrac02.at: Fixed typo in AT_SETUP
3828         * tests/Makefile.am: Added delete05.at
3829         * tests/testsuite.at: Likewise.
3830
3831 2004-12-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3832
3833         * src/delete.c (delete_archive_members): Bugfix: when
3834         attempting to delete an nonexistent member, the last
3835         blocking_factor blocks were zeroed.
3836
3837 2004-12-14  Paul Eggert  <eggert@cs.ucla.edu>
3838
3839         * TODO: Mention sub-second resolution, lutimes, lchmod.
3840
3841 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
3842
3843         Adjust to recent gnulib changes.
3844         * doc/getdate.texi: Remove, since bootstrap gets it from gnulib now.
3845         * .cvsignore: Add rmt, rmt/*, rmt/*/*.
3846         * lib/.cvsignore: Add allocsa.c, allocsa.h, allocsa.valgrind,
3847         charset.alias, config.charset, getcwd.c, getcwd.h, localcharset.c,
3848         localcharset.h, ref-add.sed, ref-add.sin, ref-del.sed,
3849         ref-del.sin, setenv.c, setenv.h, unsetenv.c.  Remove pathmax.h,
3850         xstrdup.c.
3851         * m4/.cvsignore: Add allocsa.m4, eealloc.m4, getcwd-path-max.m4,
3852         localcharset.m4, realloc.m4, setenv.m4.  Remove malloc.m4,
3853         pathmax.m4, realloc.m4.
3854
3855 2004-11-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3856
3857         * configure.ac: Raised version number to 1.14.91
3858         * scripts/tarcat: New file
3859         * scripts/Makefile.am: Added tarcat
3860         * src/buffer.c (hit_eof): Changed type to boolean
3861         (read_full_records,reading_from_pipe): New variables
3862         (check_compressed_archive,open_compressed_archive): New functions
3863         (open_archive): Autodetect compressed archives and act accordingly.
3864         Set reading_from_pipe. This fixes controversial set of changes
3865         introduced 2004-05-11,2004-03-22.
3866         * src/list.c (tar_checksum): New function
3867         (read_header): Use tar_checksum().
3868         * src/common.h (tar_checksum): New function
3869
3870         * tests/star/README: Updated
3871         * NEWS: Updated
3872         * PORTS: Updated
3873
3874 2004-11-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3875
3876         * src/tar.c (decode_options): Fixed -o semantics. Thanks
3877         Jean Delvare <khali@linux-fr.org>
3878
3879 2004-10-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3880
3881         * bootstrap: Add localcharset
3882         * lib/Makefile.tmpl: Initialize SUFFIXES and CLEANFILES since the
3883         makefile snippet from localcharset uses '+=' on them.
3884         * src/Makefile.am (LDADD): Add LIBICONV
3885         * src/list.c (decode_header): Set uname/gname to NULL if their
3886         header counterparts are empty
3887         * src/tar.c (options): Use OPTION_NO_TRANS
3888         * src/utf8.c: Use locale_charset() from gnulib
3889
3890         * tests/star/README: Updated
3891
3892         * NEWS: Updated
3893         * TODO: Minor fix
3894
3895 2004-10-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3896
3897         * THANKS: Added Bryan Ford
3898         * doc/Makefile.am (.text): Fixed rule
3899         * po/POTFILES.in: Added argp-help.c
3900
3901 2004-10-04  Bryan Ford  <baford@mit.edu>
3902
3903         * src/tar.c: New option --exclude-caches, to exclude
3904         cache directories automatically on archive creation.
3905         Cache directories are directories containing a
3906         standardized tag file, as specified at:
3907                 http://www.brynosaurus.com/cachedir/spec.html
3908         * src/common.h: New variable exclude_caches_option.
3909         * src/create.c: New function check_cache_directory(),
3910         called from dump_dir0() if exclude_caches_option is set,
3911         to check for a cache directory tag and exclude the directory
3912         if such a tag is found.
3913         * doc/tar.texi: Updated accordingly.
3914
3915 2004-09-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3916
3917         * doc/tar.texi: Minor fix
3918         * src/tar.c (options): Minor fix
3919
3920 2004-09-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3921
3922         * TODO: Updated
3923         * lib/Makefile.tmpl: Added 'rtapelib.o: localedir.h' dependency
3924         * src/common.h: Comment WANT_DIRECTORY_REMOVE_OPTION.
3925         * src/extract.c: Normalized use of remove_any_file().
3926         * src/misc.c: Likewise.
3927         * src/tar.c (parse_opt): Emit warning if -l option is used.
3928         (show_default_settings): REMOTE_SHELL may be undefined
3929
3930 2004-09-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3931
3932         Test suite rewritten in autotest.
3933
3934         * configure.ac: Updated for autotest
3935         * src/tar.c (argp_program_version): Modified.
3936         * tests/Makefile.am: Rewritten for autotest.
3937
3938         * tests/.cvsignore: Updated
3939         * tests/append.at: New file
3940         * tests/atlocal.in: New file
3941         * tests/delete01.at: New file
3942         * tests/delete02.at: New file
3943         * tests/delete03.at: New file
3944         * tests/delete04.at: New file
3945         * tests/extrac01.at: New file
3946         * tests/extrac02.at: New file
3947         * tests/extrac03.at: New file
3948         * tests/extrac04.at: New file
3949         * tests/extrac05.at: New file
3950         * tests/gzip.at: New file
3951         * tests/ignfail.at: New file
3952         * tests/incremental.at: New file
3953         * tests/link01.at: New file
3954         * tests/listed01.at: New file
3955         * tests/listed02.at: New file
3956         * tests/longv7.at: New file
3957         * tests/multiv01.at: New file
3958         * tests/multiv02.at: New file
3959         * tests/multiv03.at: New file
3960         * tests/old.at: New file
3961         * tests/options.at: New file
3962         * tests/recurse.at: New file
3963         * tests/same-order01.at: New file
3964         * tests/same-order02.at: New file
3965         * tests/sparse01.at: New file
3966         * tests/testsuite.at: New file
3967         * tests/version.at: New file
3968         * tests/volume.at: New file
3969         * tests/star/gtarfail.at: New file
3970         * tests/star/gtarfail2.at: New file
3971         * tests/star/multi-fail.at: New file
3972         * tests/star/pax-big-10g.at: New file
3973         * tests/star/ustar-big-2g.at: New file
3974         * tests/star/ustar-big-8g.at: New file
3975
3976         * tests/preset.in: Removed
3977         * tests/before: Removed
3978         * tests/after: Removed
3979         * tests/version.sh: Removed.
3980         * tests/append.sh: Removed.
3981         * tests/delete01.sh: Removed.
3982         * tests/delete02.sh: Removed.
3983         * tests/delete03.sh: Removed.
3984         * tests/delete04.sh: Removed.
3985         * tests/extrac01.sh: Removed.
3986         * tests/extrac02.sh: Removed.
3987         * tests/extrac03.sh: Removed.
3988         * tests/extrac04.sh: Removed.
3989         * tests/extrac05.sh: Removed.
3990         * tests/gzip.sh: Removed.
3991         * tests/incremen.sh: Removed.
3992         * tests/ignfail.sh: Removed.
3993         * tests/link01.sh: Removed.
3994         * tests/listed01.sh: Removed.
3995         * tests/listed02.sh: Removed.
3996         * tests/longv7.sh: Removed.
3997         * tests/multiv01.sh: Removed.
3998         * tests/multiv02.sh: Removed.
3999         * tests/multiv03.sh: Removed.
4000         * tests/old.sh: Removed.
4001         * tests/options.sh: Removed.
4002         * tests/same-order01.sh: Removed.
4003         * tests/same-order02.sh: Removed.
4004         * tests/volume.sh: Removed.
4005         * tests/recurse.sh: Removed.
4006         * tests/sparse01.sh: Removed.
4007         * tests/star/gtarfail.sh: Removed.
4008         * tests/star/gtarfail2.sh: Removed.
4009         * tests/star/multi-fail.sh: Removed.
4010         * tests/star/ustar-big-2g.sh: Removed.
4011         * tests/star/ustar-big-8g.sh: Removed.
4012         * tests/star/pax-big-10g.sh: Removed.
4013
4014 2004-09-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4015
4016         * bootstrap: Install genfile.c from paxutils
4017         * tests/genfile.c: Removed. Integrated into
4018         paxutils.
4019         * tests/mksparse.c: Removed. Integrated into
4020         (paxutils) genfile.c
4021         * tests/Makefile.am: Removed mksparse
4022         * tests/sparse01.sh: Use genfile instead of mksparse
4023
4024 2004-09-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4025
4026         Started merging with cpio into paxutils. Sources before
4027         this point are tagged alpha-1_14_90
4028
4029         * Makefile.am: Updated for use with paxutils
4030         * README-alpha: Likewise
4031         * bootstrap: Likewise
4032         * configure.ac: Likewise
4033         * lib/Makefile.tmpl: Likewise
4034         * po/POTFILES.in: Likewise
4035         * src/Makefile.am: Likewise
4036         * src/buffer.c: Likewise
4037         * src/common.h: Likewise
4038         * src/compare.c: Likewise
4039         * src/create.c: Likewise
4040         * src/delete.c: Likewise
4041         * src/extract.c: Likewise
4042         * src/incremen.c: Likewise
4043         * src/list.c: Likewise
4044         * src/mangle.c: Likewise
4045         * src/misc.c: Likewise
4046         * src/names.c: Likewise
4047         * src/sparse.c: Likewise
4048         * src/system.c: Likewise
4049         * src/tar.c: Likewise
4050         * src/update.c: Likewise
4051         * src/utf8.c: Likewise
4052         * src/xheader.c: Likewise
4053
4054         * src/system.h: Removed
4055         * src/rmt.c: Removed
4056         * src/rmt.h: Removed
4057         * src/rtapelib.c: Removed
4058
4059 2004-09-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4060
4061         * tests/listed02.sh: Do not depend on any particular ordering
4062         of output.
4063
4064 2004-09-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4065
4066         * doc/tar.texi: Document the use of -C option in
4067         file lists. Document --seek option.
4068         * configure.ac: New option --with-rmt. New configuration variable
4069         DEFAULT_RMT_DIR. Removed DEFAULT_RMT_COMMAND.
4070         * src/Makefile.am: Install rmt into rmtdir
4071         * src/tar.c (usage): Minor fix.
4072         * NEWS: Updated.
4073         * README: Updated.
4074
4075 2004-09-01  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4076
4077         * configure.ac: Raised version number to 1.14.90
4078         * src/common.h (is_individual_file): New prototype
4079         * src/create.c (dump_file0): Fix bug introduced
4080         2004-02-21.
4081         * src/names.c (register_individual_file)
4082         (is_individual_file): New functions.
4083         * tests/listed01.sh: Use genfile instead of dd.
4084         * tests/listed02.sh: New file.
4085         * tests/Makefile.am: Added listed02.sh
4086
4087         * NEWS: Updated
4088
4089 2004-08-31  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4090
4091         * src/sparse.c (sparse_add_map): Fixed improper initializations
4092         of sparse_map_size. We assume that whatever number it contains
4093         describes adequately the current size of sparse_map. The only
4094         number we need to reset is sparse_map_avail.
4095         * src/compare.c (verify_volume): Call set_next_block_after
4096         if read_header returns HEADER_FAILURE
4097         Destroy and reinitialize content of current_stat_info and
4098         extended_header after each iteration (bug reported by
4099         John L. Males <jlmales@yahoo.com>).
4100         Issue a warning if the created archive contains some members
4101         whose file names were stripped off their leading prefixes.
4102         This is a temporary fix of the issue reported by Bdale Garbee
4103         <bdale@gag.com> (Refs: Debian bug 230064, Message-Id
4104         <87n07kyzhi.fsf@rover.gag.com>, Sun, 15 Feb 2004 11:22:17 -0700)
4105
4106         * src/names.c (removed_prefixes_p): New function.
4107
4108         * src/buffer.c: When computing write rate do not take
4109         into account the time needed to verify the archive(s).
4110         The bug reported by John L. Males <jlmales@yahoo.com>
4111         (set_start_time,compute_duration): New functions.
4112         (print_total_written): Use the result of compute_duration().
4113         (close_archive): Call compute_duration.
4114         * src/common.h (set_start_time, removed_prefixes_p): New prototypes.
4115         * src/list.c (decode_header): Fixed initialization
4116         of stat_info->is_sparse
4117         * src/tar.c (main): Call set_start_time().
4118
4119         * src/misc.c (unquote_string): Unquote '\a' and '\v'.
4120         Reported by Helmut Waitzmann <helmut.waitzmann@web.de>.
4121
4122         * NEWS: Updated
4123         * THANKS: Updated
4124
4125 2004-08-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4126
4127         * src/tar.c: Fix copy-n-paste errors in the license
4128
4129 2004-08-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4130
4131         * scripts/backup.in: Renamed LIBPATH to LIBDIR.
4132         Use ROOT_FS with -C option. Do not send mail
4133         if ADMINISTRATOR is set to NONE.
4134         * scripts/backup.sh.in (test_root): Append / to
4135         ROOT_FS if it does not already end in it.
4136         * scripts/restore.in: Renamed LIBPATH to LIBDIR.
4137         New option -a (--all). Do not start restore unless
4138         -a or patterns are given.
4139         (restore_fs,restore_files): Fixed use of --listed option.
4140         * doc/tar.texi: Updated
4141         * NEWS: Updated
4142
4143 2004-08-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4144
4145         * src/tar.c (find_argp_option): Fixed typo
4146
4147 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
4148
4149         Merge argp, getopt, xalloc changes from gnulib.
4150         * bootstrap (gnulib_modules): Add xalloc-die.
4151         Remove code to test for patches; we don't have patches now.
4152         Set LC_ALL=C so that file names sort consistently.
4153         Prefer the gnulib copies of gettext.m4, glibc21.m4,
4154         lib-ld.m4, lib-prefix.m4, po.m4 too.
4155
4156         * patches/getopt.diff: Remove; gnulib now works unpatched.
4157         * configure.ac (_getopt_long_only_r): Remove check.
4158         gl_ARGP now does this for us.
4159         * lib/.cvsignore: Add fnmatch.h, getopt_.h, sysexit.h,
4160         xalloc-die.c.
4161         * src/extract.c: Adjust to changes to gnulib xalloc module.
4162         (extr_init): Remove assignment to xalloc_fail_func; no longer needed.
4163         (xalloc_die): New function.
4164
4165 2004-08-10  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4166
4167         * NEWS: Updated
4168
4169         * src/buffer.c (flush_write): Limit filenames
4170         of the members that straddle multivolume archive
4171         boundary to 100 characters.
4172         (flush_read): Use strncmp when comparing multivolume member
4173         names.
4174         * tests/multiv03.sh: New file
4175         * tests/Makefile.am: Added multiv03.sh
4176
4177 2004-08-09  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4178
4179         * src/list.c (read_and): Call decode_header before
4180         calling skip_member()
4181         (skip_member): Use is_sparse field to determine if the
4182         member is a sparse file.
4183
4184         * tests/Makefile.am: Added extrac05.sh
4185         * tests/extrac05.sh: New file
4186         * tests/append.sh: Rearranged leading comments. Added explicit
4187         references to report messages wherever available.
4188         * tests/delete01.sh: Likewise
4189         * tests/delete02.sh: Likewise
4190         * tests/delete03.sh: Likewise
4191         * tests/delete04.sh: Likewise
4192         * tests/extrac01.sh: Likewise
4193         * tests/extrac02.sh: Likewise
4194         * tests/extrac03.sh: Likewise
4195         * tests/extrac04.sh: Likewise
4196         * tests/gzip.sh: Likewise
4197         * tests/ignfail.sh: Likewise
4198         * tests/incremen.sh: Likewise
4199         * tests/link01.sh: Likewise
4200         * tests/listed01.sh: Likewise
4201         * tests/longv7.sh: Likewise
4202         * tests/multiv01.sh: Likewise
4203         * tests/multiv02.sh: Likewise
4204         * tests/old.sh: Likewise
4205         * tests/options.sh: Likewise
4206         * tests/recurse.sh: Likewise
4207         * tests/same-order01.sh: Likewise
4208         * tests/same-order02.sh: Likewise
4209         * tests/sparse01.sh: Likewise
4210         * tests/version.sh: Likewise
4211         * tests/volume.sh: Likewise
4212
4213 2004-08-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4214
4215         * bootstrap: Extended --update-po option to take an
4216         optional argument specifying the po file to update.
4217         * src/create.c: Improved compatibility with 1.13.25
4218         * tests/link01.sh: New file.
4219         * tests/Makefile.am: Added link01.sh
4220
4221 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
4222
4223         Merge from gnulib.
4224
4225         * patches/argp.diff: Remove; no longer needed.
4226
4227         * lib/.cvsignore: Add stat-macros.h.
4228         Remove addext.c, malloc.c, realloc.c.
4229
4230         * src/extract.c: Include <getcwd.h>.
4231         (extract_archive): Rewrite with new macro IS_ABSOLUTE_FILE_NAME.
4232         * src/extract.c (make_directories):
4233         FILESYSTEM_PREFIX_LEN -> FILE_SYSTEM_PREFIX_LEN.
4234         * src/misc.c (must_be_dot_or_slash): Likewise.
4235         * src/names.c (excluded_name, safer_name_suffix, stripped_prefix_len):
4236         Likewise.
4237         * src/tar.c (parse_opt): Likewise.
4238         * src/incremen.c (purge_directory): Fix format buffer typos in warning
4239         strings.
4240         * src/tar.c (options): Add missing initializers to pacify gcc.
4241         (decode_options): Remove unused var.
4242
4243 2004-08-02  Paul Eggert  <eggert@cs.ucla.edu>
4244
4245         * bootstrap (gnulib_modules): Add getpagesize.
4246         * configure.ac (valloc): Remove check; valloc no longer used.
4247         * lib/.cvsignore: Add getpagesize.h.
4248         * m4/.cvsignore: Add getpagesize.m4.
4249         * src/buffer.c (record_buffer): New var.
4250         (open_archive): Don't use valloc; on older or buggy hosts, you can't
4251         free the result.  Use page_aligned_alloc instead.
4252         * src/compare.c (diff_init): Likewise.
4253         * src/buffer.c (open_archive): Record the pointer to be freed
4254         into record_buffer.
4255         (close_archive): Free record_buffer.
4256         * src/common.h (page_aligned_alloc): New decl.
4257         * src/misc.c (quote_n, quote): Remove these redundant functions.
4258         (ptr_align): New function, from coreutils/src/system.h.
4259         (page_aligned_alloc): New function.
4260         * src/system.h (valloc): Remove.
4261
4262 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
4263
4264         * src/extract.c (extract_archive): Do not report an error
4265         when hard-linking X to X when X exists.  Problem reported by
4266         Toby Peterson.
4267         * lib/.cvsignore: Add fchown-stub.c.
4268
4269 2004-06-29  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4270
4271         * NEWS: Updated
4272         * src/common.h (root_device): New global.
4273         (gnu_restore): Renamed to purge_directory().
4274         * src/extract.c (extr_init): Save the device number
4275         of the root device.
4276         (extract_archive): Renamed gnu_restore() to purge_directory().
4277         * src/incremen.c (gnu_restore): Renamed to purge_directory().
4278         Do not attempt to purge the directory if it is on a different
4279         device and one_file_system_option is set.
4280
4281 2004-06-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4282
4283         * doc/tar.texi: The actual default for exclude patterns
4284         is --no-anchored. Fixed.
4285         * src/tar.c (options): Likewise.
4286         Thanks "Felix Natter" <felix.natter@ldc.de> for noticing.
4287
4288 2004-06-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4289
4290         * doc/tar.texi: Fixed several inconsistencies.
4291         * src/tar.c: Fixed docstring for --checkpoint option.
4292
4293 2004-05-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4294
4295         * src/buffer.c (seek_archive): New function
4296         * src/common.h (seek_archive): New function
4297         (seekable_archive): New global.
4298         * src/list.c (skip_file): Use seek_archive() if
4299         possible.
4300         * src/tar.c (struct fmttab): Accept 'pax' as alias
4301         for 'posix'
4302         (options): New option -n (--seek).
4303         * src/update.c: Determine type of the archive before
4304         appending to it.
4305
4306         * TODO: Updated.
4307
4308 2004-05-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4309
4310         * bootstrap: New option --update-po
4311         * src/tar.c: New option -H (short alias to --format)
4312         * doc/tar.texi: Document -H option
4313         * src/names.c (safer_name_suffix): Fixed bug introduced
4314         2004-05-11.
4315
4316 2004-05-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4317
4318         * bootstrap: Apply patches from patch subdirectory
4319         * patches: New dir
4320         * patches/argp.diff: New file
4321         * patches/getopt.diff: New file
4322         * configure.ac: Check for _getopt_long_only_r and
4323         force using included version of getopt if the function
4324         is not available.
4325         * src/tar.c: Use argp for command line parsing.
4326         * src/system.h: Minor formatting fix
4327         * m4/.cvsignore: Updated
4328         * lib/.cvsignore: Updated
4329         * doc/tar.texi: Minor fix.
4330         * src/extract.c: Fix improper use of 'path' term
4331         * src/incremen.c: Likewise
4332         * src/list.c: Likewise
4333         * src/misc.c: Likewise
4334         * src/names.c: Likewise
4335         * src/rmt.h: Likewise
4336         * src/rtapelib.c: Likewise
4337         * src/update.c: Likewise
4338         * src/xheader.c: Likewise
4339         * tests/star/README: Minor fix
4340
4341 2004-05-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4342
4343         * configure.ac: Raised version number to 1.14.1
4344         * src/tar.c: Renamed --strip-path to --strip-components
4345         Changed improper use of _() to ngettext().
4346         * src/extract.c: Renamed strip_path_option to strip_components_option
4347         * src/common.h: Likewise.
4348         * NEWS: Updated.
4349         * doc/tar.texi: Updated
4350
4351 2004-05-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4352
4353         * src/system.c (sys_child_open_for_uncompress): Do not
4354         set read_full_records_option: the compressed archive is
4355         likely not to contain integer number of records. Should
4356         the user wish to use reblocking, he may always give tar
4357         -B option. This is a minor improvement over the change
4358         dated 2004-03-22.
4359         * src/buffer.c (open_archive): Removed assignment to
4360         read_full_records_option.
4361
4362         * src/names.c (safer_name_suffix): (safer_name_suffix): Use "%s"
4363         as the format argument, rather than a possibly-translated variable
4364         string. Patch provided by Jim Meyering  <jim@meyering.net>
4365         * src/tar.c (decode_options): Fixed typo in the comment.
4366         * tests/star/README: Minor correction
4367
4368 2004-05-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4369
4370         * directory: New file. GNU directory entry for tar.
4371         * doc/Makefile.am: Rewritten. Added rules for generating
4372         documentation for the project's website.
4373         * doc/.cvsignore: Updated
4374         * doc/index.html.in: New file.
4375
4376 2004-05-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4377
4378         * configure.ac: Raised version number to 1.14
4379         * NEWS: Updated.
4380         * tests/after: Added copyleft statement
4381         * tests/before: Added copyleft statement
4382         * tests/preset.in: Added copyleft statement
4383
4384         Tar 1.14 is released. Sources up to this point are tagged
4385         release_1_14
4386
4387 2004-05-10  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4388
4389         * configure.ac: Fixed prerequisite headers for sys/buf.h
4390         (needed on FreeBSD)
4391         * src/system.h: Likewise.
4392         * tests/after (compare): Fixed argument quoting under eval
4393         * tests/before: Quote TAR_ARCHIVE_FORMATS
4394
4395 2004-05-10  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4396
4397         * NEWS: Updated
4398         * README: Updated
4399         * PORTS: Updated
4400         * configure.ac: Call gl_AC_TYPE_INTMAX_T. Document
4401         DEFAULT_.* variables. Use DEFAULT_RMT_COMMAND to set
4402         the pathname of the rmt utility.
4403         New option --enable-backup-scripts.
4404         * doc/tar.texi: Updated
4405         * scripts/Makefile.am: Install the scripts only if requested
4406         by the configure.
4407         * scripts/backup.in: Fixed --version output.
4408         Fixed initialization of the listing files and printing
4409         the time of the last previous level dump.
4410         * scripts/restore.in: Fixed --version output.
4411         * src/Makefile.am (localedir.h rule): Generate correct
4412         DEFAULT_RMT_COMMAND variable.
4413         * src/common.h (rmt_command_option): New variable.
4414         * src/list.c (read_and): Print block number before
4415         issuing 'Skipping to next header' diagnostics, if
4416         requested by block_number_option.
4417         * src/rtapelib.c: Use rmt_command_option instead of
4418         hardcoded "/etc/rmt".
4419         * src/tar.c: New option --rmt-command.
4420         (decode_options): Handle --rmt-command. Initialize
4421         rmt_command_option to DEFAULT_RMT_COMMAND.
4422
4423 2004-05-09  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4424
4425         * doc/tar.texi: Further update.
4426
4427 2004-05-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4428
4429         * configure.ac: Minor fix
4430         * scripts/Makefile.am: Updated
4431         * scripts/backup-specs: Updated
4432         * scripts/backup.in: Minor fixes
4433         * scripts/backup.sh: Removed
4434         * scripts/backup.sh.in: New file. Source for backup.sh
4435         * scripts/restore.in: New file
4436         * scripts/.cvsignore: Updated
4437         * scripts/WARNING: Removed
4438         * doc/tar.texi: Updated
4439         * NEWS: Updated
4440
4441 2004-05-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4442
4443         * src/names.c (name_gather): Bugfix: Honor single -C with
4444         --same-order.
4445         * tests/same-order01.sh: New file
4446         * tests/same-order02.sh: New file
4447         * tests/Makefile.am: Updated
4448
4449         * tests/append.sh: Added copyleft header
4450         * tests/delete01.sh: Likewise
4451         * tests/delete02.sh: Likewise
4452         * tests/delete04.sh: Likewise
4453         * tests/extrac01.sh: Likewise
4454         * tests/extrac02.sh: Likewise
4455         * tests/extrac03.sh: Likewise
4456         * tests/extrac04.sh: Likewise
4457         * tests/gzip.sh: Likewise
4458         * tests/ignfail.sh: Likewise
4459         * tests/incremen.sh: Likewise
4460         * tests/multiv01.sh: Likewise
4461         * tests/old.sh: Likewise
4462         * tests/options.sh: Likewise
4463         * tests/recurse.sh: Likewise
4464         * tests/version.sh: Likewise
4465         * tests/volume.sh: Likewise
4466         * tests/star/gtarfail.sh: Likewise
4467         * tests/star/gtarfail2.sh: Likewise
4468         * tests/star/multi-fail.sh: Likewise
4469         * tests/star/pax-big-10g.sh: Likewise
4470         * tests/star/qucktest.sh: Likewise
4471         * tests/star/ustar-big-2g.sh: Likewise
4472         * tests/star/ustar-big-8g.sh: Likewise
4473
4474         * doc/.cvsignore: Updated
4475
4476 2004-05-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4477
4478         * configure.ac: Check whether date accepts +format argument
4479         (for backup scripts).
4480         * scripts/level-0: Removed
4481         * scripts/level-1: Removed
4482         * scripts/weekly.new: Removed
4483         * scripts/dump-remind: Removed
4484         * scripts/backup.in: New file
4485         * scripts/backup.sh: New file
4486         * scripts/dump-remind.in: New file
4487         * scripts/backup-specs: Updated
4488         * scripts/Makefile.am: Updated for new directory contents.
4489         * scripts/.cvsignore: Updated
4490
4491 2004-05-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4492
4493         * TODO: Updated
4494         * doc/tar.texi: Updated
4495         * src/tar.c: --utc implies -vv
4496
4497 2004-04-28  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4498
4499         * src/utf8.c: Make sure ICONV_CONST is defined. AM_ICONV
4500         does not define it if it fails to find iconv.h.
4501
4502 2004-04-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4503
4504         * bootstrap: Use gnulib-tool to generate lib/Makefile.am
4505         and parts of configure.ac
4506         * configure.ac: Invoke tar_GNULIB to configure gnulib stuff.
4507         * lib/Makefile.am: Removed
4508         * lib/Makefile.tmpl: New file.
4509         * lib/.cvsignore: Updated
4510         * m4/.cvsignore: Updated
4511         * src/xheader.c: Include stpcpy.h
4512
4513         * src/create.c: Produce an error, not warning, if the
4514         filename is too long.
4515         * tests/longv7.sh: Synchronized with the recent changes.
4516
4517 2004-04-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4518
4519         * configure.ac: Fixed test for iconv_t
4520         * src/rmt.h: Bugfix by Jürgen Weigert
4521         * THANKS: Add Jürgen Weigert
4522         * tests/star/README: Fixed typo
4523
4524 2004-04-04  Paul Eggert  <eggert@twinsun.com>
4525
4526         Merge getdate documentation changes from coreutils.
4527
4528         * doc/getdate.texi: Update from coreutils CVS.
4529         * doc/tar.texi: Fix getdate menu to match getdate.texi's.
4530
4531         Merge recent gnulib changes, and remove some lint.
4532
4533         Improve support for nanosecond-resolution time stamps.
4534         * bootstrap: Add gettime, timespec modules.
4535         * configure.ac (gl_GETTIME, gl_TIMESPEC): Add.
4536         * lib/.cvsignore (getopt_int.h, gettime.c, gettimeofday.c,
4537         timespec.h): Add.
4538         * lib/Makefile.am (libtar_a_SOURCES): Add gettime.c, timespec.h.
4539         * m4/.cvsignore: Add clock_time.m4, gettime.m4, gettimeofday.m4,
4540         st_mtim.m4, timespec.m4.  Remove malloc.m4, realloc.m4.
4541         * src/common.h (newer_mtime_option): Now a struct timespec, not
4542         time_t.  All uses changed.
4543         (NEWER_OPTION_INITIALIZED, OLDER_STAT_MTIME): New macros.
4544         * src/create.c (dump_file0): Use OLDER_STAT_TIME to compare times.
4545         * src/incremen.c (scan_path): Likewise.
4546         * src/list.c (read_and): Likewise.
4547         * src/list.c (read_and): Use NEWER_OPTION_INITIALIZED to decide
4548         whether newer_mtime_option is initialized.
4549         * src/tar.c (decode_options): Likewise.
4550         * src/tar.c (decode_options): Adjust to new signature for get_date.
4551
4552         * src/buffer.c (short_read, flush_read): Use size_t, not ssize_t, for
4553         result of safe_read, full_write, and similar functions.
4554         Detect safe_read error by comparing to SAFE_READ_ERROR;
4555         detect full_write error by comparing to 0.
4556         All uses changed.
4557         * src/common.h (write_error_details, sys_write_archive_buffer):
4558         Likewise.
4559         * src/misc.c (write_error_details): Likewise.
4560         * src/rmt.c (main): Likewise.
4561         * src/rmt.h (rmt_read__, rmt_write__): Likewise.
4562         * src/rtapelib.c (rmt_read__, rmt_write__, rmt_ioctl__): Likewise.
4563         * src/sparse.c (sparse_scan_file, sparse_dump_region,
4564         check_sparse_region, check_data_region): Likewise.
4565         * src/system.c (sys_write_archive_buffer, sys_drain_input_pipe,
4566         sys_child_open_for_compress, sys_child_open_for_uncompress): Likewise.
4567         * src/update.c (append_file): Likewise.
4568
4569         * src/buffer.c (clear_read_error_count): Use explicit (void)
4570         to indicate a function with no arguments.
4571         * src/create.c (check_links): Likewise.
4572         * src/system.c (sys_get_archive_stat, sys_save_archive_dev_ino,
4573         sys_detect_dev_null_output, sys_drain_input_pipe, sys_spawn_shell,
4574         sys_reset_uid_gid, sys_get_archive_stat, sys_save_archive_dev_ino,
4575         sys_detect_dev_null_output, sys_drain_input_pipe, sys_spawn_shell):
4576         Likewise.
4577         * src/utf8.c (get_input_charset): Likewise.
4578         * src/xheader.c (xheader_ghdr_name, xheader_write_global,
4579         xheader_decode_global, extended_header_init): Likewise.
4580         * tests/mksparse.c (usage): Likewise.
4581
4582         * src/buffer.c (new_volume): Rename local variables to avoid
4583         shadowing warnings.
4584         * src/common.h (file_dumpable_p, sys_stat_nanoseconds,
4585         sparse_file_p, sparse_member_p, sparse_fixup_header,
4586         sparse_dump_file, sparce_extract_file, sparse_skip_file,
4587         sparse_diff_file): Likewise.
4588         * src/compare.c (diff_archive): Likewise.
4589         * src/create.c (file_dumpable_p, dump_regular_file, dump_dir0,
4590         dump_dir, dump_hard_link, file_count_links, dump_file0, dump_file):
4591         Likewise.
4592         * src/extract.c (repair_delayed_set_stat): Likewise.
4593         * src/misc.c (maybe_backup_file, add_hierarchy_to_namelist):
4594         Likewise.
4595         * src/sparse.c (struct tar_sparse_optab, tar_sparse_dump_region,
4596         tar_sparse_extract_region, sparse_dump_region, sparse_extract_region,
4597         sparse_dump_file, sparse_file_p, sparse_member_p,
4598         sparse_fixup_header, sparse_extract_file, sparse_skip_file,
4599         check_data_region, sparse_diff_file): Likewise.
4600         * src/system.c (sys_stat_nanoseconds): Likewise.
4601         * src/xheader.c (xheader_format_name): Likewise.
4602
4603         * src/common.h (enum old_files): Remove comma before }; not portable.
4604
4605         * src/common.h (read_fatal_details): Add __attribute__ ((noreturn)).
4606         * src/rmt.c (usage): Likewise.
4607         * src/xheader.c (xheader_set_single_keyword): Likewise.
4608         * tests/genfile.c (usage): Likewise.
4609         * tests/mksparse.c (die, usage): Likewise.  Also add printf attribute
4610         to die.
4611
4612         * src/common.h (gname_to_gid, uname_to_uid): Add const to avoid
4613         some gcc warnings.
4614         * src/names.c (uname_to_uid, gname_to_gid): Likewise.
4615         * src/utf8.c (struct langtab.lang, struct langtab.terr, struct
4616         langtab.charset, charset_lookup): Likewise.
4617
4618         * src/common.h (name_init): Remove unused args.  All callers changed.
4619         * src/names.c (name_init): Likewise.
4620
4621         * src/common.h (usage, xheader_write, xheader_write_global,
4622         sys_reset_uid_gid): New decls.
4623
4624         * src/compare.c (report_difference, process_noop): Add
4625         __attribute__ ((unused)) for unused attributes.
4626         * src/sparse.c (oldgnu_sparse_member_p, star_sparse_member_p):
4627         Likewise.
4628         * src/xheader.c (dummy_coder, dummy_decoder, atime_coder,
4629         gid_coder, gname_coder, linkpath_coder, ctime_coder, mtime_coder,
4630         path_coder, size_coder, uid_coder, uname_coder,
4631         sparse_numblocks_coder): Likewise.
4632
4633         * src/create.c (dump_regular_finish, dump_dir0, dump_dir,
4634         dump_file0): Now static.
4635         * src/utf8.c (charset_lookup): Likewise.
4636         * src/xheader.c (xheader_protected_pattern_p,
4637         xheader_protected_keyword_p, xheader_set_single_keyword,
4638         xheader_keyword_deleted_p, xheader_keyword_override_p,
4639         xheader_list_append, xheader_list_destroy, xheader_set_keyword_equal):
4640         Likewise.
4641         * tests/genfile.c (usage): Likewise.
4642         * tests/mksparse.c (die, mkhole, mksparse, usage, xlat_suffix):
4643         Likewise.
4644
4645         * src/create.c (hash_link): Rewrite to avoid cast.
4646
4647         * src/extract.c (file_newer_p): Use parameter, not global var.
4648         * src/misc.c (write_error_details): Likewise.
4649
4650         * src/extract.c (prepare_to_extract): Remove directory arg; not
4651         used.  All callers changed.
4652
4653         * src/misc.c (close_fatal): Remove; not used.
4654         * src/system.c (sys_utimes): Likewise.
4655
4656         * src/rmt.c (get_string): Avoid buffer overrun (off by 1 error).
4657
4658         * src/rmt.c (main): Update copyright date to 2004.
4659         * src/tar.c (decode_options): Likewise.
4660
4661         * src/rtapelib.c (get_status_string): Don't lose errno when
4662         skipping the error messages.
4663         (get_status): Report an error if atol returns a negative number.
4664
4665         * src/utf8.c (struct langtab, langtab, charset_lookup,
4666         get_input_charset) [!defined HAVE_LIBCONV]: Omit unused
4667         definitions.
4668         (iconv_open, iconv, iconv_close) [!defined HAVE_LIBCONV]:
4669         Use macros, not definitions, to avoid type clashes with system
4670         headers.
4671         (charset_lookup): Local var is now auto, not static.
4672         (utf8_convert): Use ICONV_CONST instead of const, to avoid
4673         type clashes.
4674
4675         * src/utf8.c (langtab): Initialize all elements of struct, to
4676         avoid gcc warning.
4677         * src/xheader.c (xhdr_tab): Likewise.
4678
4679         * src/xheader.c: Include fnmatch.h, since we use fnmatch.
4680
4681         * tests/mksparse.c (mkhole): Fix typo: bool was assigned to off_t.
4682
4683 2004-04-04  Sergey Poznyakoff  <gray@Noldor.runasimi.org>
4684
4685         * NEWS: Updated
4686         * configure.ac: Raised version number to 1.13.94
4687         * src/system.h: Protect inclusion of <sys/time.h>
4688         by ifdef.
4689         Declare time() if HAVE_DECL_TIME is 0
4690         * tests/.cvsignore: Added mksparse
4691
4692         * tests/sparse01.sh: New file
4693         * tests/multiv02.sh: New file
4694         * tests/Makefile.am: Add sparse01.sh and multiv02.sh
4695         * tests/longv7.sh: Added missing call to 'after'
4696
4697         * src/common.h: Added missing prototypes
4698         * src/compare.c (diff_archive): Use is_sparse member
4699         instead of GNUTYPE_SPARSE.
4700         * src/create.c: Removed unused variables
4701         * src/extract.c (extract_archive): Use sparse_member_p instead
4702         of GNUTYPE_SPARSE.
4703         Removed unused variables
4704         * src/list.c (decode_header): Use sparse_fixup_header to correct
4705         the st_size value.
4706         (print_header): Do not rely on GNUTYPE_SPARSE type.
4707         Use st->stat.st_size to print real file size.
4708         (skip_member): Assign stat_info.file_name to save_name. This fixes
4709         bug reported by Mads Martin Joergensen <mmj@suse.de>
4710         Use sparse_skip_file() to skip sparse members.
4711         * src/rtapelib.c: include "common.h"
4712         * src/sparse.c (struct tar_sparse_optab.sparse_member_p)
4713         (struct tar_sparse_optab.fixup_header): New member
4714         (tar_sparse_member_p): New function.
4715         (tar_sparse_init): Return true if decode_header is not provided
4716         (tar_sparse_fixup_header)
4717         (sparse_member_p,sparse_fixup_header)
4718         (sparse_skip_file)
4719         (oldgnu_sparse_member_p,oldgnu_fixup_header,star_sparse_member_p)
4720         (star_fixup_header, pax_sparse_member_p): New function
4721         (pax_decode_header): Remove
4722         * src/system.h: Include <sys/time.h> and <utime.h> when available
4723         * src/tar.c (usage): Prototype moved to common.h
4724         * src/tar.h (struct tar_stat_info.is_sparse): New member
4725         * src/utf8.c (utf8_convert): Changed prototype
4726         (get_input_charset): Removed unused variable
4727         * src/xheader.c: include <fnmatch.h>
4728         (size_decoder): Assign to both st->archive_file_size and
4729         st->stat.st_size.
4730         (st->stat.st_size): Assign to st->stat.st_size
4731         (sparse_numbytes_decoder): Removed unused variable
4732         * src/.cvsignore: Added .gdbinit
4733         * THANKS: Added Mads Martin Joergensen
4734
4735 2004-03-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4736
4737         * src/create.c (write_long_name): Do not allow more than
4738         NAME_FIELD_SIZE-1 characters in a file name for V7 format
4739         archives.
4740         * tests/longv7.sh: New file.
4741         * tests/Makefile.am: Add longv7.sh
4742
4743 2004-03-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4744
4745         * src/buffer.c (open_archive): Clear read_full_records_option
4746         if reading from a pipe.
4747         (short_read): Display warning about the deduced record size
4748         if version > 1
4749         * tests/star/pax-big-10g.sh: Updated to match the above changes.
4750         * tests/star/ustar-big-2g.sh: Likewise.
4751         * tests/star/ustar-big-8g.sh: Likewise.
4752
4753         * configure.ac: Added gl_FUNC_STRTOULL
4754         * src/create.c (start_header): Check for GNU_FORMAT
4755         if incremental_option is set.
4756         * src/xheader.c (to_decimal): New function.
4757         (xheader_format_name): Use to_decimal() instead of snprintf.
4758         * tests/listed01.sh: Use genfile instead of dd
4759         * tests/multiv01.sh: Likewise.
4760
4761 2004-03-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4762
4763         * src/list.c (read_and): Stop processing the archive after
4764         encountering a single zero record. Many old archives contain
4765         arbitrary garbage after it.
4766         The warning is issued anyway.
4767
4768 2004-03-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4769
4770         * src/rtapelib.c (rmt_lseek__,rmt_ioctl__): Bugfix. The
4771         conversion buffer was not null terminated. Fix provided
4772         by Leland Lucius <llucius@tiny.net>
4773         * THANKS: Added Leland Lucius
4774         * src/utf8.c (utf8_convert): Indentation fix.
4775
4776 2004-02-29  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4777
4778         * src/buffer.c (flush_read): Bugfix: the
4779         condition at line 714 included
4780
4781               || (status > 0 && !read_full_records_option)
4782
4783         which is grossly wrong, since even if new_volume() below succeeds,
4784         the subsequent call to rmtread will overwrite the chunk of data
4785         already read in the buffer and thus spoil everything.
4786         * src/system.c (sys_child_open_for_uncompress): Minor stylistic
4787         fix.
4788         * tests/star/multi-fail.sh: New test.
4789         * tests/Makefile.am: Added multi-fail.sh
4790         * tests/star/README: Updated
4791
4792 2004-02-29  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4793
4794         * NEWS: Updated
4795         * configure.ac: Removed spurious AC_CHECK_LIB(iconv)
4796         * src/common.h (utc_option): new global
4797         (enum old_files.KEEP_NEWER_FILES): New element
4798         * src/extract.c: Handle --keep-newer-files option
4799         * src/list.c (tartime): Print UTC if --utc was given.
4800         * src/tar.c: New options: --utc and keep-newer-files
4801
4802         * tests/Makefile.am: Added new tests
4803         * tests/after: Rewritten
4804         * tests/before: Rewritten
4805         * tests/preset.in: Rewritten
4806         * tests/delete03.sh: Accommodate for the new testsuite logic
4807         * tests/gzip.sh: Likewise
4808         * tests/incremen.sh: Likewise
4809         * tests/listed01.sh: Likewise
4810         * tests/multiv01.sh: Likewise
4811         * tests/old.sh: Likewise
4812         * tests/options.sh: Likewise
4813         * tests/version.sh: Likewise
4814         * tests/volume.sh: Likewise
4815
4816         * tests/star: New directory
4817         * tests/star/README: New file
4818         * tests/star/gtarfail.sh: New file
4819         * tests/star/gtarfail2.sh: New file
4820         * tests/star/pax-big-10g.sh: New file
4821         * tests/star/qucktest.sh: New file
4822         * tests/star/ustar-big-2g.sh: New file
4823         * tests/star/ustar-big-8g.sh: New file
4824
4825 2004-02-26  Paul Eggert  <eggert@twinsun.com>
4826
4827         * doc/tar.texi (dircategory Individual utilities): Append period,
4828         as suggested by Karl Berry.
4829
4830 2004-02-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4831
4832         * src/list.c (decode_header): Call xheader_decode before
4833         the assignment to current_stat_info.archive_file_size.
4834
4835 2004-02-23  Paul Eggert  <eggert@twinsun.com>
4836
4837         * configure.ac: Invoke AM_ICONV, to define ICONV_CONST if needed.
4838
4839 2004-02-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4840
4841         1.13.93 released.
4842
4843         * NEWS: Updated
4844         * tests/before: Move testing of the prerequisite archive formats
4845         to the separate function 'prereq'. Do not expect any arguments
4846         * tests/delete03.sh: Use prereq() instead of passing arguments
4847         to 'before'.
4848         * tests/incremen.sh: Likewise.
4849         * tests/listed01.sh: Likewise.
4850         * tests/multiv01.sh: Likewise.
4851
4852 2004-02-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4853
4854         Added UTF-8 support. Finished global extended header
4855         support.
4856
4857         * NEWS: Minor fix
4858         * configure.ac: Detect libiconv
4859         * src/utf8.c: New file. Conversions to and from utf-8.
4860         * src/Makefile.am: Added utf8.c
4861         * src/create.c (write_header_name) In pax format, use
4862         "path" keyword if the file name is not ASCII
4863         (start_header): Likewise for uname and gname.
4864         * src/list.c: Decode encountered global headers.
4865         * src/xheader.c: Use keywords from the global
4866         headers.
4867         Correctly handle UTF-8 conversions.
4868         (xheader_list_destroy): New function.
4869         (xheader_set_single_keyword,xheader_set_keyword_equal): Added
4870         missing gettext markers
4871         (decode_record): Rewritten using caller-provided handler and
4872         data closure.
4873         * tests/listed01.sh: Give credit to Andreas Schuldei.
4874
4875 2004-02-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4876
4877         * src/create.c (dump_file0): The conditional at line
4878         1296 prevented incremental backups on individual files
4879         from working, as reported by Andreas Schuldei
4880         <andreas@schuldei.org>.
4881
4882         This is due to the condition
4883
4884           (0 < top_level || !incremental_option)
4885
4886         Removing it makes incremental backups work for individual
4887         files as well as for directories. On the other hand, it does
4888         not affect other functionality, as shown by the reasoning below:
4889
4890         To begin with, the two parts of this condition are mutually
4891         superfluous, because
4892
4893           1) when top_level < 0, incremental_option == 1
4894           so the condition yields false
4895           2) when top_level >= 0, incremental_option == 0
4896           so the condition yields true.
4897
4898         In other words, it is completely equivalent to
4899
4900               (!incremental_option)
4901
4902         Now, let's consider the effect of its removal. There are two cases:
4903
4904         1) when incremental_option==1
4905         This means incremental backup in progress. In this case dump_file
4906         is invoked only for directories or for files marked with 'Y' by
4907         get_directory_contents. The latter are those that did not meet the
4908         condition in incremen.c:242, which is exactly the same condition
4909         as this at create.c:1296. So, for these files the check
4910         (!incremental_option) is useless, since the rest of the
4911         conditional will yield false anyway. On the other hand, if
4912         dump_file is invoked on a directory, the conditional will yield
4913         false due to !S_ISDIR assertion, so these will be processed as usual.
4914
4915         Thus, for this case the extra condition (!incremental_option) is
4916         irrelevant, and its removal won't alter the behavior of tar,
4917         *except* that it will enable incremental backups on individual
4918         files, which is the wanted effect.
4919
4920         2) when incremental_option==0
4921         In this case the condition yields true and its removal does not
4922         affect the functionality.
4923
4924         * THANKS: Updated
4925         * configure.ac: Raised patchlevel to 93
4926         * src/incremen.c: Minor stylistic fixes.
4927         * tests/listed01.sh: New test. Check listed incremental
4928         backups on individual files.
4929         * tests/Makefile.am: Added listed01.sh
4930
4931 2004-02-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4932
4933         * src/common.h (simple_finish_header,start_private_header): New
4934         declarations
4935         (xheader_ghdr_name): Changed declaration
4936         * src/create.c (start_private_header): Removed static qualifier.
4937         (write_extended): Removed superfluous last argument. Use
4938         xheader_write()
4939         (simple_finish_header): New function.
4940         (finish_header): Use simple_finish_header() to break recursive
4941         dependency between this function and write_extended().
4942         * src/tar.c (assert_format): Do not bail out if several
4943         --format arguments are given. This is a common case when
4944         TAR_OPTIONS are used.
4945         (decode_options): New option --show-defaults displays the
4946         compiled-in defaults.
4947         Use POSIX format if no --format option was given and
4948         --pax-option was specified.
4949         Do not allow to use --pax-option unless the archive format is
4950         set to POSIX (or reading subcommand is requested).
4951
4952         * src/update.c (update_archive): Write global extended header if
4953         constructed.
4954         * src/xheader.c (xheader_format_name): Bugfix.
4955         (xheader_xhdr_name): Changed the default extended header name
4956         to '%d/PaxHeaders.%p/%f', as POSIX requires.
4957         (xheader_ghdr_name): Removed unused argument.
4958         (xheader_write,xheader_write_global): New function.
4959         (xheader_decode): Modified to honor overrides whatever
4960         the current archive format is.
4961
4962         * src/delete.c (delete_archive_members): Call xheader_decode
4963         unconditionally.
4964         * src/list.c (decode_header): Likewise.
4965         * src/incremen.c (sort_obstack): Fixed typo in the comment
4966
4967         * doc/tar.texi: Document new default for extended
4968         header names.
4969
4970         * tests/before: Accept an optional list of allowed archive
4971         formats. Exit with the status 77 if the current archive
4972         format does not match any of them.
4973         * tests/delete03.sh: Require gnu, oldgnu or posix format
4974         * tests/incremen.sh: Require gnu or oldgnu format
4975         * tests/multiv01.sh: Likewise
4976
4977 2004-02-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4978
4979         * doc/tar.texi (Option Summary): Documented --pax-option
4980         * src/tar.c: Likewise.
4981         * NEWS: Likewise.
4982         * src/create.c (to_chars): Added a comment.
4983         * src/tar.h: Comment to GNU_FORMAT
4984
4985 2004-02-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
4986
4987         * README: Updated
4988         * configure.ac: Added stpcpy
4989         * bootstrap: Likewise
4990         * lib/Makefile.am: Likewise
4991         * src/common.h (xheader_xhdr_name,xheader_ghdr_name): New
4992         functions
4993         * src/create.c (write_extended): Call xheader_xhdr_name
4994         instead of using hardcoded "././@PaxHeader" name.
4995         * src/tar.c: New option --pax-option (equivalent to -o option
4996         of pax).
4997         * src/xheader.c: Implement pax -o option. Fixed misleading
4998         heading comment (introduced 2003-09-02).
4999         * src/incremen.c: Minor fixes
5000         * m4/.cvsignore: Updated
5001
5002 2004-02-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5003
5004         * src/incremen.c: Removed accumulator stuff in favor of obstack.
5005         (get_directory_contents): Split into two functions
5006         * src/update.c: Minor changes
5007         * doc/tar.texi: Fixed typo
5008
5009 2004-02-15  Paul Eggert  <eggert@twinsun.com>
5010
5011         Fix Debian bug 230872, originally reported by Jeff King in
5012         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=230872>.
5013
5014         * doc/tar.texi (posix compliance): Remove.  The whole section
5015         was a misunderstanding of what POSIXLY_CORRECT is supposed to
5016         mean.  The GNU Coding Standards says that POSIXLY_CORRECT
5017         is for disabling extensions that are incompatible with POSIX:
5018         it is not for disabling compatible extensions.  All references
5019         to this section removed.
5020         (posix): This format is created only if the posix format is
5021         specified; it is no longer created if gnu format is specified
5022         and POSIXLY_CORRECT is set.
5023         * src/tar.c (decode_options): Ignore POSIXLY_CORRECT.
5024         POSIX does not specify the behavior of tar, so we should
5025         not worry about POSIXLY_CORRECT here.
5026
5027 2004-01-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5028
5029         * Makefile.am: Removed m4
5030         * configure.ac: Require automake-1.8/autoconf-2.59. Removed
5031         m4/Makefile.
5032         * README-alpha: Updated
5033         * bootstrap: Updated TP URL, improved help output. Default
5034         to :ext:anoncvs and set CVS_RSH, unless already set.
5035         * m4/Makefile.am: Removed
5036
5037 2004-01-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5038
5039         * bootstrap: Bugfix by Marco Gerards <metgerards@student.han.nl>:
5040         Use $option instead of $1 so all options will be parsed.
5041
5042 2004-01-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5043
5044         Started rewriting buffer.c ...
5045
5046         * bootstrap: New option --no-po
5047         * src/buffer.c (new_volume,check_label_pattern): Changed return type.
5048         (time_to_start_writing): Changed data type
5049         (file_to_switch_to): Removed. Variable never assigned to.
5050         (open_archive) Moved option compatibility checks to tar.c
5051         Other minor changes.
5052         * src/common.h (maybe_backup_file): Changed return type
5053         * src/misc.c: Likewise.
5054         * src/create.c: Updated invocations of safer_name_suffix
5055         * src/extract.c: Likewise
5056         * src/delete.c: Updated assignment to write_archive_to_stdout
5057         * src/tar.c (decode_options): More option compatibility checks
5058         (moved from buffer.c)
5059         * src/update.c (time_to_start_writing): Changed data type.
5060         * tests/recurse.sh: New test case.
5061         * tests/mksparse.c: New file.
5062         * tests/Makefile.am: Added recurse.sh and mksparse.c
5063
5064 2004-01-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5065
5066         * src/sparse.c (sparse_diff_file): Bugfix. Thanks
5067         Martin Simmons for the patch.
5068         * src/create.c (dump_dir0): Bugfix. Thanks Piotr Czerwinski
5069         <pius@pld-linux.org> for the patch.
5070
5071 2003-12-26  Paul Eggert  <eggert@twinsun.com>
5072
5073         Synchronize with Gettext 0.13.1, Automake 1.8, Autoconf 2.59,
5074         and translation website.
5075
5076         * bootstrap: Don't bother skipping codeset.m4, glibc21.m4,
5077         intdiv0.m4, inttypes_h.m4, inttypes.m4, inttypes-pri.m4,
5078         isc-posix.m4, and lcmessage.m4 from gnulib.  This list of files is
5079         a bit obsolete anyway, now that gettext 0.13.1 is out.  Also, the
5080         files are replaced by autoreconf.  Also, there seems to be a bug
5081         in gettext/autoconf/automake if we try to omit these files after
5082         autoreconf has replaced them, even though the gettext manual says
5083         they're optional.  So give up and just include them for now, even
5084         though they make 'configure' longer and slower.
5085
5086         Change translation URL from
5087         <http://www.iro.umontreal.ca/contrib/po/maint/tar/> to
5088         <http://www2.iro.umontreal.ca/~gnutra/po/maint/tar/> to
5089         accommodate translator website revamp.
5090
5091         Fail if autoreconf fails.
5092
5093         * m4/.cvsignore: Add intmax.m4, longdouble.m4, printf-posix.m4,
5094         signed.m4, size_max.m4, wchar_t.m4, wint_t.m4, xsize.m4, to
5095         ignore files now supplied by gettext 0.13.1.
5096
5097 2003-12-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5098
5099         Synchronized with the backup repository on Mirddin
5100
5101 2003-12-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5102
5103         * configure.ac: Check for varios members of struct stat
5104         that may represent file modification times with a subsecond
5105         precision.
5106         Check for utimes (for future use)
5107         * src/buffer.c (short_read): Issue a warning on short reads.
5108         * src/common.h (sys_stat_nanoseconds): New function
5109         * src/create.c (dump_file0): Use sys_stat_nanoseconds().
5110         * src/list.c (read_and): Treat only two successive zero
5111         filled blocks as an EOF indicator. Issue a warning if
5112         a single one is encountered.
5113         * src/system.c (sys_stat_nanoseconds): New function
5114         * src/tar.h (tar_stat_info.atime_nsec,mtime_nsec,ctime_nsec): New
5115         members.
5116         * src/xheader.c (code_time,decode_time): Support for subsecond
5117         precision.
5118         (atime_coder,atime_decoder,ctime_coder,ctime_decoder)
5119         (mtime_coder,mtime_decoder): Update invocations of code_time and
5120         decode_time.
5121         (gid_decoder,size_decoder,uid_decoder,sparse_size_decoder)
5122         (sparse_numblocks_decoder,sparse_offset_decoder)
5123         (sparse_numbytes_decoder): Updated
5124
5125 2003-12-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5126
5127         * src/names.c (safer_name_suffix): Reverted change made
5128         2003-11-14. Reason: Discussion with Paul Eggert and
5129         Jean-Louis Martineau. See also ChangeLog entry from
5130         1999-08-14.
5131         * tests/delete03.sh: Likewise.
5132         * tests/extrac04.sh: Likewise.
5133         * tests/multiv01.sh: Likewise.
5134
5135 2003-12-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5136
5137         * src/incremen.c (write_directory_file): Use sys_truncate
5138         * src/list.c (print_header): Use archive_file_size member
5139         when printing real file size.
5140         * src/sparse.c (sparse_scan_file): Correctly handle files with
5141         a hole at the end.
5142         (sparse_dump_region,sparse_extract_region): Allow for zero size
5143         trailing blocks
5144
5145 2003-12-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5146
5147         * configure.ac: Raised version number to 1.13.92
5148         * src/list.c (decode_header): Discern between pax and ustar
5149         formats
5150         Initialize current_stat_info.archive_file_size.
5151
5152         NOTE: Modifications from this date on are temporarily
5153         stored on local CVS on mirddin. This repository will
5154         be synchronized with Savannah as soon as the latter
5155         becomes operational again.
5156
5157 2003-12-01  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5158
5159         * TODO: Updated
5160         * src/sparse.c: Initial implementation of GNU/pax sparse
5161         file format.
5162         * src/common.h (xheader_store): Changed prototype.
5163         * src/create.c: Update calls to xheader_store
5164         * src/extract.c (extract_archive): Check reported size vs.
5165         archive file size to determine if we have to do with a
5166         sparse file.
5167         * src/tar.c (usage): Cleaned up the sample argument to --newer
5168         option.
5169         (decode_options): Allow --sparse for POSIX_FORMAT archives.
5170         * src/xheader.c (struct xhdr_tab.coder; all coder function): Added
5171         extra argument
5172         Implemented GNU.sparse.* keywords.
5173
5174 2003-11-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5175
5176         * configure.ac: Check for setlocale. Thanks Bruno Haible for
5177         reporting.
5178
5179 2003-11-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5180
5181         * src/create.c (write_gnu_long_link): Use oldgnu
5182         magic with @LongLink blocks.
5183
5184 2003-11-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5185
5186         * src/tar.h: Support for star sparse format.
5187         * src/sparse.c: Likewise.
5188
5189 2003-11-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5190
5191         * src/sparse.c (sparse_diff_file): New function
5192         * src/common.h (sys_compare_uid,sys_compare_gid): New functions
5193         (sys_compare_uid_gid): Removed.
5194         (sys_compare_links,report_difference): Changed prototype
5195         (sparse_diff_file): New function
5196         * src/system.c (sys_compare_uid,sys_compare_gid): New functions
5197         (sys_compare_uid_gid): Removed.
5198         (sys_compare_links): Changed declaration
5199         * src/compare.c (diff_archive): Use sparse_diff_file.
5200
5201 2003-11-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5202
5203         Rewritten sparse file handling.
5204
5205         * src/sparse.c: New file. Provides a universal framework
5206         for various methods for sparse files handling.
5207         * src/Makefile.am: Added sparse.c
5208         * src/common.h (struct sp_array,sparsearray,sp_array_size)
5209         (init_sparsearray,fill_in_sparse_array): Removed
5210         (enum dump_status): New data type
5211         (pad_archive,close_diag,open_diag,read_diag_details)
5212         (readlink_diag,savedir_diag,seek_diag_details,stat_diag): New
5213         functions.
5214         (sparse_file_p,sparse_dump_file,sparse_extract_file): New
5215         functions.
5216         (print_header): Changed prototype declaration.
5217         * src/tar.h (struct sp_array): Declaration from common.h
5218         (struct tar_stat_info): New members archive_file_size,
5219         sparse_map_avail,sparse_map.
5220         * src/create.c: Major rewrite.
5221         * src/extract.c: Use new sparse file interface.
5222         * src/compare.c (diff_sparse_files): Temporary placeholder.
5223
5224         * src/buffer.c: Minor changes
5225         * src/tar.c: Likewise.
5226         * src/list.c: Likewise.
5227         * src/misc.c (close_diag,open_diag,read_diag_details)
5228         (readlink_diag,savedir_diag,seek_diag_details,stat_diag): New
5229         diagnostics functions.
5230         * src/incremen.c: Use new diagnostics functions.
5231         * src/names.c: Likewise.
5232
5233 2003-11-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5234
5235         * configure.ac: Fixed check for setsockopt
5236
5237         * src/create.c: Do not zero-terminate name field if
5238         the name is exactly 100 characters long.
5239         (write_ustar_long_name): Fixed cheking for unsplittable
5240         names.
5241
5242 2003-11-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5243
5244         * src/create.c (start_header): Removed debugging hook
5245         (dump_file): Fixed handling of linkname field.
5246         * src/names.c (safer_name_suffix): If the input
5247         file name ends with a slash, output one should do so
5248         as well.
5249         * doc/tar.texi: Documented --format=ustar
5250
5251 2003-11-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5252
5253         * src/tar.h (archive_format): USTAR_FORMAT: New type.
5254         * src/create.c: Added POSIX.1-1988 support.
5255         * src/names.c (safer_name_suffix): Skip leading ./
5256         * src/tar.c: New option --format=ustar forces
5257         POSIX.1-1988 archive format.
5258         * tests/delete03.sh: Updated.
5259         * tests/extrac04.sh: Updated.
5260         * tests/multiv01.sh: Updated.
5261
5262 2003-11-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5263
5264         * src/list.c (read_and): Initialize current_stat_info
5265         and extended_header at the start of the loop.
5266         * src/names.c (all_names_found): Check if the argument
5267         contains valid filename. Fixes coredump on `not_a_tar_file'
5268         * src/xheader.c (atime_decoder,gid_decoder,ctime_decoder)
5269         (mtime_decoder,size_decoder,uid_decoder): Use xstrtoumax.
5270         Fixes `pax-big-10g' bug.
5271
5272 2003-11-12  Paul Eggert  <eggert@twinsun.com>
5273
5274         Fix some C compatibility bugs reported by Joerg Schilling.
5275
5276         * src/common.h (stripped_prefix_len): Fix misspelling
5277         "stripped_path_len" in declaration.
5278         * src/rmt.c (main): Use "return FOO;" rather than
5279         "exit (FOO);"; we no longer have to worry about
5280         pre-ANSI hosts that mishandled returned values from "main".
5281         * src/tar.c (main): Likewise.  This avoids warnings on some
5282         compilers.
5283         * src/system.c: Include signal.h, for 'kill'.
5284         * src/system.h (DEV_BSIZE): Remove.
5285         (DEFAULT_ST_BLKSIZE): New macro.
5286         (ST_BLKSIZE): Use it, instead of DEV_BSIZE.
5287         * src/tar.c (enum): Remove comma just before }.
5288
5289 2003-11-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5290
5291         * src/list.c (decode_header): Initialize st_atime and
5292         st_ctime.
5293
5294 2003-11-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5295
5296         * configure.ac (tar_save_LIBS): Bugfix. Thanks Adrian
5297         Bunk <bunk@fs.tum.de> for reporting.
5298         * doc/tar.texi: Fixed spelling. Thanks Martin Buchholz
5299         <martin@xemacs.org> for spotting.
5300
5301 2003-11-04  Paul Eggert  <eggert@twinsun.com>
5302
5303         * src/xheader.c (xhdr_tab): Make it extern, not static, as C89 and
5304         C99 require this.
5305
5306 2003-10-26  Paul Eggert  <eggert@twinsun.com>
5307
5308         * src/system.c (sys_spawn_shell): Cast trailing null to (char *).
5309         Bug reported by Christian Weisgerber.
5310
5311 2003-10-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5312
5313         * AUTHORS: Updated
5314         * NEWS: Updated
5315         * src/tar.c (decode_options): Removed superfluous archive format
5316         check
5317         * doc/tar.texi: Documented new features.
5318
5319 2003-10-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5320
5321         * NEWS: Updated
5322         * THANKS: Added Wojciech Polak
5323         * configure.ac: Added checks for missing functions. Raised
5324         version number to indicate alpha release.
5325         * lib/Makefile.am: Added missing headers
5326         * lib/waitpid.c: Added missing includes.
5327         * src/extract.c: Likewise.
5328         * src/names.c: Removed spurious includes.
5329         * src/xheader.c: Likewise.
5330         * src/system.h [MSDOS]: Fixed spelling of EACCES. Added
5331         macro overriding broken mkdir prototypes.
5332
5333 2003-10-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5334
5335         * configure.ac: Check for dev_t and ino_t.
5336         * m4/Makefile.am: Added missing files.
5337         * src/system.c: New file.
5338         * src/Makefile.am: Added system.c
5339         * src/common.h: Prototypes for functions from system.c
5340         * src/system.h (SET_BINARY_MODE, ERRNO_IS_EACCESS): New defines
5341         * src/buffer.c: Moved system dependencies to system.c
5342         * src/compare.c: Likewise.
5343         * src/create.c: Likewise.
5344         * src/delete.c: Likewise.
5345         * src/extract.c: Likewise.
5346         * src/rtapelib.c: Likewise.
5347
5348 2003-10-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5349
5350         Implemented --occurrence option.
5351
5352         * NEWS: Updated.
5353         * src/tar.c: New option --occurrence.
5354         * src/common.h (occurrence_option): New global
5355         (struct name): Changed `found' member to `uintmax_t
5356         found_count'.
5357         (names_done): Removed
5358         (all_names_found): Changed prototype.
5359         (ISFOUND,WASFOUND): New macros
5360         * src/delete.c (delete_archive_members): Honor --occurrence
5361         option.
5362         * src/list.c (read_and): Likewise.
5363         * src/names.c: Count number of occurrences of each name in the
5364         archive.
5365         (name_match): Honor --occurrence option.
5366         (names_done): Removed
5367         (all_names_found,names_notfound): Rewritten.
5368
5369 2003-10-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5370
5371         * src/tar.c: Removed extra precaution regarding
5372         subcommand_option == CAT_SUBCOMMAND
5373         * lib/Makefile.am: Updated
5374
5375 2003-10-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5376
5377         * src/common.h (names_done): New function.
5378         * src/names.c: Likewise.
5379         * src/list.c (read_and): Use all_names_found() as `while'
5380         condition.
5381         * src/tar.c: New option --first-copy
5382         * NEWS: Updated
5383
5384 2003-09-24  Paul Eggert  <eggert@twinsun.com>
5385
5386         * src/rmt.c (main): Don't translate Copyright string; international
5387         law says the word "Copyright" should be in English.
5388         * src/tar.c (decode_options): Likewise.
5389
5390 2003-09-22  Paul Eggert  <eggert@twinsun.com>
5391
5392         * doc/tar.texi (extracting untrusted archives): New section.
5393
5394         * src/common.h (stripped_path_len): Renamed from cut_path_elements.
5395         Return size_t, not pointer, so that we don't have to worry about
5396         violating the C standard by converting char const * to char *.
5397         All callers changed.
5398         * src/names.c (stripped_path_len): Likewise.  Strip file system
5399         prefix, too.  Count adjacent slashes as if they were one slash;
5400         that is the POSIX standard.
5401
5402 2003-09-17  Paul Eggert  <eggert@twinsun.com>
5403
5404         * README-alpha: Document maintainer tool assumptions a bit.  GNU
5405         'sed' is no longer required.  For GNU m4 1.4, suggest the patch in
5406         Debian bug 211447.  Fix minor misspellings/whitespace nits.
5407
5408         * configure.ac (AC_AIX, AC_MINIX): Remove; subsumed by
5409         gl_USE_SYSTEM_EXTENSIONS.
5410
5411         * lib/.cvsignore: Add exit.h, time_r.c, time_r.h.
5412         * m4/.cvsignore: Add restrict.m4, time_r.m4.
5413
5414 2003-09-17  Paul Eggert  <eggert@twinsun.com>
5415
5416         * bootstrap: Don't use "for option; do";
5417         Solaris 8 /bin/sh doesn't like that.
5418
5419 2003-09-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5420
5421         * README-alpha: Updated
5422         * bootstrap: Updated
5423
5424 2003-09-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5425
5426         * README-alpha: Updated
5427         * bootstrap: Updated
5428         * po/POTFILES.in: Added src/xheader.c
5429         * src/common.h (cut_path_elements): Added proto.
5430
5431 2003-09-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5432
5433         * src/buffer.c: Use ngettext where appropriate.
5434         * src/compare.c: Likewise.
5435         * src/create.c: Likewise.
5436         * src/misc.c: Likewise.
5437         * src/tar.c: Likewise.
5438         * src/update.c: Likewise.
5439
5440 2003-09-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5441
5442         * .cvsignore: Added *.shar.gz
5443         * NEWS: Updated
5444         * TODO: Updated
5445         * src/common.h (strip_path_elements): New variable.
5446         * src/extract.c (extract_archive): Implemented --strip-path
5447         * src/names.c (cut_path_elements): New function.
5448         * src/tar.c: New option --strip-path=NUM.
5449         (decode_options) Assign boolean values to bool variables.
5450
5451 2003-09-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5452
5453         * src/delete.c: Fixed deletion from the POSIX archives.
5454         * src/list.c (read_header): Minor change.
5455         * src/tar.c (main): Do not check for volume_label_option
5456         if subcommand_option is not CREATE_SUBCOMMAND.
5457         * src/xheader.c (xheader_decode): Store the header as
5458         well (for eventual delete).
5459
5460         * tests/incremen.sh: Explicitly request GNU format. This will
5461         disappear when GNU extended header keywords are working.
5462         * tests/multiv01.sh: Likewise
5463         * tests/volume.sh: Likewise
5464
5465 2003-09-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5466
5467         * src/create.c: Support for "linkpath" extended keyword.
5468         * src/xheader.c (decode_record): Reversed the return
5469         condition.
5470
5471 2003-09-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5472
5473         * configure.ac: Allow to redefine the default output format.
5474         * src/tar.c: Use DEFAULT_ARCHIVE_FORMAT macro
5475         (archive_format_string): New function.
5476         (usage): Updated help output.
5477         * README: Updated.
5478         * NEWS: Updated.
5479         * TODO: Updated.
5480
5481 2003-09-02  Paul Eggert  <eggert@twinsun.com>
5482
5483         * src/common.h (destroy_stat, xheader_decode, xheader_store,
5484         xheader_read, xheader_finish, xheader_destroy): Add decls;
5485         C99 requires this.
5486
5487         * src/create.c (write_extended): Remove unused local 'bufsize'.
5488
5489         * src/delete.c (delete_archive_members): Handle case of
5490         HEADER_SUCCESS_EXTENDED followed by HEADER_FAILURE.
5491         * src/list.c (read_and): Abort if HEADER_SUCCESS_EXTENDED
5492         occurs, as it's not possible.
5493         * src/update.c (update_archive): Likewise.
5494
5495         Use "const" when possible in new code.
5496         * src/tar.c (struct fmttab.name): Now char const *.  All uses changed.
5497         (fmttab): Now const.  All uses changed.
5498         * src/xheader.c (struct xhdr_tab.keyword): Now pointer to const.
5499         (struct xhdr_tab.coder, struct xhdr_tab.decoder, locate_handler,
5500         decode_record, xheader_store, xheader_print, code_string, code_time,
5501         code_num, dummy_coder, dummy_decoder, atime_coder, atime_decoder,
5502         gid_coder, gid_decoder, gname_coder, gname_decoder, linkpath_coder,
5503         linkpath_decoder, ctime_coder, ctime_decoder, mtime_coder,
5504         mtime_decoder, path_coder, path_decoder, size_coder, size_decoder,
5505         uid_coder, uid_decoder, uname_coder, uname_decoder):
5506         Use pointers to const when possible.
5507         (xhdr_tab): Now const.
5508
5509         * src/tar.c (fmttab): Avoid GCC warning by not eliding initializers.
5510         (set_archive_format): Report an error if no format name matches,
5511         instead of returning an undefined value.
5512
5513         * src/xheader.c (struct xhdr_tab.decoder, dummy_decoder,
5514         atime_decoder, gid_decoder, gname_decoder, linkpath_decoder,
5515         ctime_decoder, mtime_decoder, path_decoder, size_decoder,
5516         uid_decoder, uname_decoder): Remove unused keyword arg.
5517         All uses changed.
5518
5519         * src/tar.c (set_archive_format): Now static.
5520         * src/xheader.c (xhdr_tab, format_uintmax): Now static.
5521
5522         * src/xheader.c (dummy_coder, dummy_decoder, atime_coder,
5523         atime_decoder, gid_coder, gid_decoder, gname_coder, gname_decoder,
5524         linkpath_coder, linkpath_decoder, mtime_coder, mtime_decoder,
5525         ctime_coder, ctime_decoder, path_coder, path_decoder, size_coder,
5526         size_decoder, uid_coder, uid_decoder, uname_coder, uname_decoder):
5527         Remove forward decls; no longer needed.
5528         (xhdr_tab): Move to end, so that the forward decls aren't needed.
5529         Add a forward declaration.
5530
5531         Use 'bool' in new code, when appropriate.
5532         * src/xheader.c (decode_record): Return bool, not int.
5533         * src/common.h (read_header): Since it accepts bool, change
5534         all callers to use false and true rather than 0 and 1.
5535
5536         * src/xheader.c (decode_record): Fix misspelling in diagnostic
5537         "extended headed" -> "extended header".
5538
5539         GNU coding style fixes.
5540         * src/xheader.c (decode_record, xheader_decode):
5541         Do not use decls like "char *p, *q;".
5542
5543         Minor style fixes.
5544         (xheader_store): Avoid parentheses around object operand of sizeof.
5545
5546 2003-09-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5547
5548         * src/create.c (start_header): Store long file names
5549         in "path" keyword of an extended header if in POSIX
5550         mode.
5551         (finish_header): print header before calling write_extended().
5552         * src/list.c (list_archive): Always decode the header. This
5553         is necessary so the extended header is processed and the correct
5554         filename is printed no matter what the state of verbose_option.
5555         * src/xheader.c (xhdr_tab): Reserved GNU keywords (commented out
5556         for the time being).
5557
5558 2003-09-01  Paul Eggert  <eggert@twinsun.com>
5559
5560         Update from gnulib, and correct fnmatch to fnmatch-gnu.
5561         * bootstrap (gnulib_modules): Change fnmatch to fnmatch-gnu.
5562         Sort.
5563         * configure.ac (gl_USE_SYSTEM_EXTENSIONS): Use this instead
5564         of AC_GNU_SOURCE.
5565         * lib/.cvsignore: Add alloca.h, stdbool.h.  Sort.  Append newline.
5566         * lib/Makefile.am (lib_OBJECTS): New macro, for convenience when
5567         copying rules from gnulib module descriptions.
5568         (BUILT_SOURCES, EXTRA_DIST, all-local, alloca.h):
5569         Update from gnulib modules alloca, fnmatch, getline, stdbool.
5570         * m4/.cvsignore: Add utimes-null.m4.  Sort.
5571
5572 2003-09-01  Sergey Poznyakoff
5573
5574         Added initial support for creating POSIX headers.
5575
5576         * src/common.h (MAXOCTAL11,MAXOCTAL7): New defines
5577         (string_to_chars): New functions
5578         (struct xheader): Changed structure
5579         (gid_to_gname,gname_to_gid,uid_to_uname,uname_to_uid): Changed
5580         prototypes.
5581         * src/create.c (string_to_chars): New function.
5582         (write_extended): New function
5583         (start_header): Create extended POSIX headers if necessary.
5584         (finish_header): Likewise.
5585         * src/list.c (print_header): Take user/group from
5586         current_stat_info.
5587         * src/names.c (gid_to_gname,gname_to_gid)
5588         (uid_to_uname,uname_to_uid): Changed prototypes.
5589         * src/tar.c: New option --format.
5590         * src/tar.h (OLDGNU_COMPATIBILITY): Removed
5591         (struct extra_header): Removed unused structure.
5592         (union block.extra_header): Removed unused member.
5593         * src/xheader.c: Implemented coder functions.
5594         * bootstrap: Added obstack.
5595         * lib/.cvsignore: Likewise.
5596         * configure.ac: Added 'gl_OBSTACK'
5597         * m4/Makefile.am: Added new files.
5598         * m4/.cvsignore: Likewise.
5599         * TODO: Minor formatting change
5600
5601 2003-08-31  Sergey Poznyakoff
5602
5603         Added initial support for POSIX extended and STAR headers
5604         (only for listing/extracting).
5605
5606         * src/xheader.c: New file.
5607         * src/Makefile.am: Added xheader.c
5608         * src/tar.h (struct star_header): New datatype
5609         (XHDTYPE,XGLTYPE): New defines
5610         (enum archive_format:STAR_FORMAT): New member
5611         (struct tar_stat_info): New datatype.
5612         (union block.star_header): New member.
5613         * src/common.h (orig_file_name,current_file_name)
5614         (current_trailing_slash,current_link_name): Removed variables.
5615         (current_stat_info): New variable
5616         (current_stat): Removed
5617         (extended_header): New variable
5618         (decode_header): Changed prototype.
5619         * src/list.c (decode_header): Added initial support for POSIX extended
5620         and STAR headers.
5621         (skip_member): Check oldgnu_header only if current_format is set
5622         to OLDGNU_FORMAT.
5623         * src/buffer.c: Use current_stat_info
5624         * src/compare.c: Likewise.
5625         * src/create.c: Likewise.
5626         * src/delete.c: Likewise.
5627         * src/incremen.c: Likewise.
5628         * src/mangle.c: Likewise.
5629         * src/update.c: Likewise.
5630         * src/extract.c: Likewise.
5631         (make_directories): Improved check for the existence of the directory
5632         * src/tar.c (destroy_stat): New function.
5633
5634 2003-08-29  Paul Eggert  <eggert@twinsun.com>
5635
5636         * NEWS, bootstrap: Drop en_GB locale; it was more trouble than it
5637         was worth (e.g., different users in en_GB disagree about -ize
5638         versus -ise).
5639         * po/en_GB.po: Remove.
5640
5641 2003-07-28  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5642
5643         * TODO: Updated
5644         * NEWS: Updated
5645         * src/tar.c: Removed support for the obsolete command line
5646         options.
5647         * doc/tar.texi: Removed references to the obsolete command
5648         line options.
5649
5650 2003-07-27  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5651
5652         * TODO: Updated
5653         * NEWS: Updated
5654         * doc/tar.texi: Updated
5655         * src/common.h (check_links_option): New variable
5656         (orig_file_name): New variable
5657         (check_links): New proto.
5658         * src/create.c (struct link.nlink): New member
5659         (link_table): Static for the module.
5660         (dump_file): Update `link' member when adding new links
5661         to the link_table.
5662         (check_links): New function.
5663         * src/list.c (print_header): Use orig_file_name.
5664         * src/tar.c: New option --check-links. Changed semantics of
5665         -o to comply to UNIX98 when extracting and to its previous
5666         semantics otherwise.
5667         (main): Call check_links if --check-links. was given.
5668
5669 2003-07-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5670
5671         * src/list.c (print_header): Revised
5672         * NEWS: Started the entry for 1.13.26
5673         * doc/Makefile.am (tar.dvi): Fixed TEXINPUTS value.
5674
5675 2003-07-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
5676
5677         * .cvsignore: Added to the repository.
5678         * doc/.cvsignore: Likewise.
5679         * lib/.cvsignore: Likewise.
5680         * m4/.cvsignore: Likewise.
5681         * po/.cvsignore: Likewise.
5682         * scripts/.cvsignore: Likewise.
5683         * src/.cvsignore: Likewise.
5684         * tests/.cvsignore: Likewise.
5685
5686         * lib/Makefile.am: Added exitfail.[hc]
5687         * src/misc.c (chdir_do): Fixed call to restore_cwd
5688         * src/buffer.c (flush_read): Fixed behavior on short
5689         reads right after opening the new archive (multiv01.sh test).
5690         (new_volume): Special handling for "-".
5691         * src/list.c (print_header): Print trailing slash if
5692         current_trailing_slash was set (extrac03.sh,extrac04.sh tests).
5693         * tests/multiv01.sh: Minor changes.
5694         * m4/Makefile.am: Added missing files.
5695
5696 2003-07-05  Paul Eggert  <eggert@twinsun.com>
5697
5698         Finish the checkin begin yesterday.
5699
5700         * NEWS: Document the user-visible changes installed in the last
5701         two days.
5702
5703         * TODO: New file (actually, resurrected; but with new contents).
5704
5705         * src/list.c (read_and): Give full type for procedure arg.
5706         (read_header): Strip trailing slashes, setting current_trailing_slash.
5707         (tartime): Avoid int overflow when printing year (!).
5708         (print_header): New arg specifying block ordinal.  All uses changed.
5709         Print link as 'h' type.  Give labels for long links and names.
5710
5711         * src/misc.c (contains_dot_dot): Moved to names.c
5712         (must_be_dot_or_slash): New function.
5713         (safer_rmdir): Use it.
5714         (remove_any_file): Now takes enum as option, not boolean.
5715         Check for (Linux) EISDIR as well as (POSIX) EPERM when attempting
5716         to unlink a directory.
5717         (deref_stat): Accept bool, not int.
5718
5719         * src/names.c (namelist_match): Allow partial matches only if
5720         recursive.
5721         (hash_string_hasher): Renamed from hash_avoided_name.
5722         (hash_string_compare): Renamed from compare_avoided_anames.
5723         (hash_string_insert, hash_string_lookup): New functions.
5724         (add_avoided_name, is_avoided_name): Use them.
5725         (safer_name_suffix): New function.
5726         (contains_dot_dot): Moved here from misc.c.  Now returns bool, not int.
5727
5728         * src/rmt.c: Don't include print-copyr.h.
5729         (prepare_input_buffer): New arg FD.
5730         Do not read more than INT_MAX bytes at once,
5731         since it breaks on some brain damaged Tru64 hosts.
5732         Divide size by two
5733         when retrying instead of subtracting 1024; for speed.
5734         (main): Use gettext to translate (C), not print_copyright.
5735
5736         * src/system.h: Include <alloca.h> and <stdbool.h> unconditionally,
5737         now that gnulib handles this.
5738         Include <stddef.h> and <limits.h> unconditionally, now that we assume
5739         C89 or better.
5740         Assume that offsetof is defined in stddef.h.
5741         Do not include <sys/param.h>.
5742         (realloc, lseek): Do not declare.
5743         (HAVE_DECL_VALLOC): Renamed from HAVE_VALLOC.
5744         (CHAR_BIT, CHAR_MAX, UCHAR_MAX, LONG_MAX): Remove
5745         declarations, since we now assume C89 or better.
5746         (PARAMS): Remove, as we now assume C89.  All uses changed.
5747         (bindtextdomain, textdomain): Include <gettext.h> to define.
5748         Include <unlocked-io.h>.
5749         (valloc): Define if not defined, and if valloc is not declared.
5750         (xstrdup): Remove decl.
5751
5752         * src/tar.c: Do not include <print-copyr.h>.
5753         Include <getdate.h>.
5754         (get_date): Remove decl.
5755         (ATIME_PRESERVE_OPTION, CHECKPOINT_OPTION, FORCE_LOCAL_OPTION,
5756         IGNORE_FAILED_READ_OPTION, INDEX_FILE_OPTION, NO_OVERWRITE_DIR_OPTION,
5757         NUMERIC_OWNER_OPTION, RECURSIVE_UNLINK_OPTION, REMOVE_FILES_OPTION,
5758         SHOW_OMITTED_DIRS_OPTION, TOTALS_OPTION): New constants.
5759         (long_options, decode_options): Use them.
5760         (OVERWRITE_DIR_OPTION): Remove.
5761         (long_options): New options --index-file, --no-overwrite-dir.
5762         Remove --overwrite-dir option.
5763         (usage): Use PACKAGE_BUGREPORT.
5764         (decode_options): Terminate new argv properly.
5765         Use PACKAGE_NAME, PACKAGE_VERSION.
5766         If verbose, report how we grokked any textual date option.
5767         (main): Add support for index-file.
5768
5769         * tests/Makefile.am: Convert to UTF-8.
5770         (AUTOMAKE_OPTIONS): Remove.
5771         (TESTS): Add delete04.sh, multiv01.sh, options.sh.
5772         (INCLUDES): Remove ../intl.
5773         (LDADD): Don't link libtar.a twice.
5774
5775         * tests/genfile.c: Convert to UTF-8.
5776         Don't include <print-copyr.h>.
5777         (DEFAULT_PATTERN): Renamed from DEFAULT.
5778         (ZEROS_PATTERN): Renamed from ZEROS.
5779         (main): Use gettext to translate (C), not print_copyright.
5780
5781 2003-07-04  Paul Eggert  <eggert@twinsun.com>
5782
5783         Revamp to meet current standards of autoconf, automake,
5784         gettext, and gnulib, and incorporate new translations.
5785
5786         * config/config.guess, config/config.sub, config/depcomp,
5787         config/install-sh, config/mdate-sh, config/missing,
5788         config/mkinstalldirs, config/texinfo.texi:
5789         Moved here from parent directory, or from doc.
5790         * config.hin: Renamed from config.h.in.
5791         * config/config.rpath: New file.
5792
5793         * intl: Remove this subdirectory.
5794
5795         * lib/fnmatch_.h: Renamed from lib/fnmatch.hin.
5796
5797         * lib/getstr.c, lib/getstr.h, lib/msleep.c, lib/print-copyr.c,
5798         lib/print-copyr.h, lib/readutmp.c, lib/rename.c, lib/stpcpy.c,
5799         lib/strstr.c, lib/strtoimax.c, lib/strtoll.c, lib/strtoull.c,
5800         lib/strtoumax.c, lib/unicodeio.c, lib/unicodeio.h,
5801         lib/xstrtoimax.c, m4/c-bs-a.m4, m4/ccstdc.m4, m4/check-decl.m4,
5802         m4/decl.m4, m4/jm-mktime.m4, m4/prereq.m4, m4/xstrtoimax.m4,
5803         stamp-h.in: Remove.
5804
5805         * lib/alloca_.h, lib/fnmatch_loop.c, lib/gettext.h, lib/pathmax.h,
5806         lib/safe-write.c, lib/safe-write.h, lib/stdbool_.h, lib/strcase.h,
5807         lib/stripslash.c, lib/unlocked-io.h, lib/xgetcwd.h, m4/alloca.m4,
5808         m4/backupfile.m4, m4/bison.m4, m4/chown.m4, m4/dirname.m4,
5809         m4/dos.m4, m4/exclude.m4, m4/fileblocks.m4, m4/ftruncate.m4,
5810         m4/getdate.m4, m4/getopt.m4, m4/hash.m4, m4/human.m4,
5811         m4/intdiv0.m4, m4/intmax_t.m4, m4/inttypes-pri.m4,
5812         m4/inttypes_h.m4, m4/isc-posix.m4, m4/lchown.m4, m4/lib-ld.m4,
5813         m4/lib-link.m4, m4/lib-prefix.m4, m4/memset.m4, m4/mktime.m4,
5814         m4/modechange.m4, m4/nls.m4, m4/onceonly.m4, m4/pathmax.m4,
5815         m4/po.m4, m4/quote.m4, m4/quotearg.m4, m4/rmdir.m4,
5816         m4/safe-read.m4, m4/safe-write.m4, m4/save-cwd.m4, m4/savedir.m4,
5817         m4/ssize_t.m4, m4/stdbool.m4, m4/stdint_h.m4, m4/strcase.m4,
5818         m4/strtoimax.m4, m4/strtol.m4, m4/strtoll.m4, m4/strtoul.m4,
5819         m4/strtoull.m4, m4/strtoumax.m4, m4/tm_gmtoff.m4, m4/uintmax_t.m4,
5820         m4/unlocked-io.m4, m4/xalloc.m4, m4/xgetcwd.m4, m4/xstrtol.m4,
5821         po/LINGUAS, po/Makevars, po/Rules-quot, po/boldquot.sed,
5822         po/en@boldquot.header, po/en@quot.header, po/en_GB.po,
5823         po/insert-header.sin, po/remove-potcdate.sin, po/stamp-po: New files.
5824
5825         * ABOUT-NLS, INSTALL, lib/addext.c, lib/alloca.c, lib/argmatch.c,
5826         lib/argmatch.h, lib/backupfile.c, lib/backupfile.h, lib/dirname.c,
5827         lib/dirname.h, lib/error.c, lib/exclude.c, lib/exclude.h,
5828         lib/fnmatch.h, lib/full-write.c, lib/full-write.h, lib/getdate.h,
5829         lib/getdate.y, lib/getline.c, lib/getline.h, lib/getopt.c,
5830         lib/getopt.h, lib/getopt1.c, lib/hash.c, lib/hash.h, lib/human.c,
5831         lib/human.h, lib/lchown.c, lib/malloc.c, lib/mktime.c,
5832         lib/modechange.c, lib/modechange.h, lib/quote.c, lib/quote.h,
5833         lib/quotearg.c, lib/quotearg.h, lib/realloc.c, lib/safe-read.c,
5834         lib/safe-read.h, lib/save-cwd.c, lib/save-cwd.h, lib/savedir.c,
5835         lib/savedir.h, lib/strcasecmp.c, lib/utime.c, lib/xalloc.h,
5836         lib/xgetcwd.c, lib/xmalloc.c, lib/xstrdup.c, lib/xstrtol.c,
5837         lib/xstrtol.h, lib/xstrtoumax.c, m4/codeset.m4, m4/d-ino.m4,
5838         m4/error.m4, m4/fnmatch.m4, m4/getcwd.m4, m4/getline.m4, m4/gettext.m4,
5839         m4/glibc21.m4, m4/iconv.m4, m4/inttypes.m4, m4/lcmessage.m4,
5840         m4/longlong.m4, m4/malloc.m4, m4/mbrtowc.m4, m4/mbstate_t.m4,
5841         m4/progtest.m4, m4/realloc.m4, m4/strerror_r.m4, m4/ulonglong.m4,
5842         m4/utimbuf.m4, m4/utime.m4, m4/utimes.m4, m4/xstrtoumax.m4,
5843         po/Makefile.in.in:
5844         Upgrade to latest version from external source.  The file "bootstrap"
5845         now grabs these automatically, so we needn't keep track of them
5846         in this change long any longer.
5847
5848         * Makefile.am (AUTOMAKE_OPTIONS): Remove.  Now done by configure.ac.
5849         (SUBDIRS): Remove intl.
5850         * PORTS: Update for star, Macintosh.
5851         * README, README-alpha: Suggest Autoconf 2.57, Automake 1.7.5,
5852         Bison 1.875, gettext 0.12.1.
5853         * THANKS: Add Bernhard Rosenkraenzer, Solar Designer.
5854         * configure.ac (AC_INIT, AM_INIT_AUTOMAKE): Convert to modern form.
5855         (AC_CONFIG_AUX_DIR): New.
5856         (AC_CONFIG_HEADERS): Rename config.h.in to config.hin, to be more
5857         like coreutils.
5858         (AC_PREREQ): Bump from 2.52 to 2.57.
5859         (AC_GNU_SOURCE): New.
5860         (AC_PROG_GCC_TRADITIONAL, AM_C_PROTOTYPES, AC_C_CONST): Remove;
5861         we no longer support K&R C.
5862         (YACC): Remove.
5863         (AC_CHECK_HEADERS): Remove limits.h, poll.h, stdbool.h, stropts.h,
5864         sys/ioccom.h, sys/param.h, sys/time.h, sys/timeb.h, wchar.h, wctype.h.
5865         (AC_MBSTATE_T): Remove.
5866         (HAVE_UTIME_H, HAVE_DECL_FREE, HAVE_DECL_GETGRGID, HAVE_DECL_GETPWUID,
5867         HAVE_DECL_GETENV, HAVE_DECL_MALLOC, HAVE_DECL_STRTOUL,
5868         HAVE_DECL_STRTOULL, HAVE_MKNOD): Remove our special code.
5869         (AM_STDBOOL_H): Add.
5870         (AC_HEADER_TIME, AC_STRUCT_TIMEZONE,
5871         jm_CHECK_TYPE_STRUCT_DIRENT_D_INO): Remove.
5872         (AC_CHECK_TYPE): Remove ssize_t.
5873         (gt_TYPE_SSIZE_T): Add.
5874         (jm_AC_PREREQ_XSTRTOUMAX, jm_PREREQ_ADDEXT, jm_PREREQ_ERROR,
5875         jm_PREREQ_HUMAN, jm_PREREQ_QUOTEARG, jm_PREREQ_XGETCWD,
5876         AC_FUNC_ALLOCA, AC_FUNC_CLOSEDIR_VOID, AC_FUNC_STRERROR_R,
5877         AC_FUNC_FNMATCH, AC_FUNC_VPRINTF, AM_FUNC_GETLINE, jm_FUNC_MALLOC,
5878         jm_FUNC_MKTIME, jm_FUNC_REALLOC):
5879         Remove.  Switch to gnulib macros like gl_BACKUPFILE instead.
5880         (tar_LDADD): Rename to LIB_CLOCK_GETTIME.  All uses changed.
5881         (rmt_LDADD): Rename to LIB_SETSOCKOPT.  All uses changed.
5882         (AC_CHECK_FUNCS): Remove fchdir, ftime, getcwd, isascii, nap,
5883         napms, poll, select, strstr, usleep.
5884         (AC_REPLACE_FUNCS): Remove ftruncate, lchown, memset, rename,
5885         rmdir, strcasecmp, strncasecmp, strtol, strtoul.
5886         (AM_GNU_GETTEXT): Use external and need-ngettext options.
5887         (AM_GNU_GETTEXT_VERSION): New.
5888         (AC_OUTPUT): Remove intl/Makefile.
5889
5890         * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
5891         ($(srcdir)/tar.info, tar.dvi): Remove obsolete warnings.
5892         * doc/fdl.texi: Update to current GNU version.
5893         * doc/gettext.texi: Update to current coreutils version,
5894         plus a copyright notice.
5895         * doc/tar.texi: Switch to new method for doing copyright notices.
5896         Use @acronym instead of @sc where appropriate.
5897         Remove empty examples.  Give a few more examples.
5898
5899         * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
5900         (EXTRA_DIST, libtar_a_SOURCES): Switch to gnulib, so that they
5901         are built up in pieces with +=.
5902         (noinst_HEADERS, INCLUDES): Remove.
5903         (BUILT_SOURCES, MAINTAINERCLEANFILES, MOSTLYCLEANFILES): New.
5904         (libtar_a_LIBADD): Use $ rather than @.
5905         (all-local, alloca.h, fnmatch.h, stdbool.h): New rules, from gnulib.
5906
5907         * m4/Makefile.am (EXTRA_DIST): Add alloca.m4, backupfile.m4,
5908         bison.m4, chown.m4, dirname.m4, dos.m4, exclude.m4, fileblocks.m4,
5909         ftruncate.m4, getdate.m4, getopt.m4, hash.m4, human.m4,
5910         intdiv0.m4, intmax_t.m4, inttypes_h.m4, inttypes-pri.m4,
5911         isc-posix.m4, lcown.m4, lib-ld.m4, lib-link.m4, lib-prefix.m4,
5912         memset.m4, mktime.m4, modechange.m4, nls.m4, onceonly.m4,
5913         pathmax.m4, po.m4, quotearg.m4, quote.m4, rmdir.m4, safe-read.m4,
5914         safe-write.m4, save-cwd.m4, savedir.m4, ssize_t.m4, stdbool.m4,
5915         stdint_h.m4, strcase.m4, strtoimax.m4, strtoll.m4, strtol.m4,
5916         strtoull.m4, strtoul.m4, strtoumax.m4, tm_gmtoff.m4, uintmax_t.m4,
5917         unlocked-io.m4, xalloc.m4, xgetcwd.m4, xstrtol.m4.
5918         Remove c-bs-a.m4, ccstdc.m4, check-decl.m4, decl.m4, jm-mktime.m4,
5919         prereq.m4, xstrtoimax.m4.
5920
5921         * po/POTFILES.in: Remove tests/genfile.c; it doesn't need to
5922         be translated, since it's not a user-visible tool.
5923
5924         * scripts/Makefile.am (AUTOMAKE_OPTIONS): Remove.
5925
5926         * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
5927         (INCLUDES): Remove ../intl.  Put top-srcdir before ., for
5928         consistency with coreutils.
5929         (LDADD): Link LIBINTL after libtar.a, since
5930         it's now external and should stand by itself.
5931
5932         * src/buffer.c (print_total_written): Adjust to new human.h
5933         interface.
5934         (child_open_for_compress): Do not increase size to BLOCKSIZE.
5935         (open_archive): Open index file name.
5936         Strip trailing slahes from file names.
5937         (flush_write): Set size to 0 if not saving names.
5938         (flush_write, flush_read): Use safer_name_suffix rather than
5939         inline code.
5940
5941         * src/common.h: Include <quote.h>.
5942         (absolute_names_option, atime_preserve_option, backup_option,
5943         block_number_option, checkpoint_option, dereference_option,
5944         force_local_option, ignore_failed_read_option, ignore_zeros_option,
5945         incremental_option, interactive_option, multi_volume_option,
5946         numeric_owner_option, one_file_system_option, recursive_unlink_option,
5947         read_full_records_option, remove_files_option, same_order_option,
5948         show_omitted_dirs_option, sparse_option, starting_file_option,
5949         to_stdout_option, totals_option, touch_option, verify_option,
5950         dev_null_output, now_verifying, we_are_root): Now bool, not int.
5951         (current_trailing_slash, index_file_name, recent_long_name_blocks,
5952         recent_long_link_blocks): New vars.
5953         (NO_OVERWRITE_DIR_OLD_FILES): New constant.
5954         (OVERWRITE_OLD_DIRS): Remove.
5955         (enum remove_option): New enum.
5956         (remove_any_file): Use it as option arg, not int.
5957         (is_avoided_name, contains_dot_dot): Return bool, not int.
5958         (safer_name_suffix): New decl.
5959
5960         * src/compare.c (now_verifying): Now bool, not int.
5961         (fill_in_sparse_array): Move to extract.c.  Now returns bool;
5962         all callers changed to test for failure.
5963         (diff_sparse_files): Take size from current_stat, not from param.
5964         (diff_archive): Do not count trailing slashes in archives.
5965         (verify_volume): Test for header failure after loop, not before.
5966
5967         * src/create.c (relativize): Remove; replaced by safer_name_suffix.
5968         All callers changed.
5969         (start_header): Clear devmajor and devminor fields, too.
5970         (finish_header): New arg block_ordinal.
5971         (init_sparsearray): Now extern.  Set sp_array_size to
5972         SPARSES_IN_OLDGNU_HEADER if it is zero.
5973         (dump_file): Keep link table as a hash.
5974         Do not count "file changed as we read it" as a failure.
5975
5976         * src/delete.c (recent_long_name_blocks, recent_long_link_blocks):
5977         Move extern decl to common.h.
5978
5979         * src/extract.c (we_are_root): Now bool, not int.
5980         (check_time): Warn about implausibly old time stamps.
5981         (set_stat): Use utimbuf, not stat_info.
5982         (prepare_to_extract): New arg DIRECTORY.
5983         (fill_in_sparse_array): Moved here from compare.c.
5984         (extract_sparse_file): Now returns off_t, giving size left.
5985         Truncate file at end.
5986         (extract_archive): Use safer_name_suffix rather than rolling our own.
5987         Use fill_in_sparse_array rather than rolling our own.
5988         Strip trailing slashes more effectively.
5989         Check for unsafe names.
5990
5991         * src/incremen.c (struct directory): nfs and found are now of type
5992         bool, not int.
5993         (gnu_restore): Now takes directory name as argument, not offset
5994         of directory name in a global.  All uses changed.
5995         (CURRENT_FILE_NAME): Remove.
5996
5997         New tests.
5998         * tests/delete04.sh, tests/multiv01.sh, tests/options.sh: New
5999         files.
6000
6001 2002-09-30  Paul Eggert  <eggert@twinsun.com>
6002
6003         * src/rmt.c (prepare_input_buffer): Renamed form
6004         prepare_record_buffer.  All uses changed.  Do not assume that
6005         size_t is the same width as int.
6006
6007 2002-03-29  Paul Eggert  <eggert@twinsun.com>
6008
6009         * src/incremen.c (get_directory_contents):
6010         If ignore_failed_read_option, only warn about
6011         get_directory_contents failures.  Fix suggested by
6012         Mark Costlow.
6013
6014 2002-01-31  Mark W. Eichin  <eichin@thok.org>
6015
6016         * src/buffer.c (child_open_for_compress): Don't try to read
6017         past the end of the buffer.
6018
6019 2001-10-11  Jim Meyering  <meyering@lucent.com>
6020
6021         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
6022         and quote_n (1, ... to avoid clobbering a buffer.
6023
6024 2001-09-26  Paul Eggert  <eggert@twinsun.com>
6025
6026         * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 1.13.25.
6027
6028         * src/buffer.c (flush_read): Don't diagnose partial blocks before
6029         end of file; just ignore them silently.
6030
6031         * src/list.c (read_header): Don't keep around extended name
6032         and link info indefinitely; keep it only for the next file.
6033         This fixes a bug introduced in 1.13.24, and removes the need
6034         for some static variables.  Set recent_long_name and
6035         recent_long_link to zero if there were no long links; this
6036         avoids a violation of ANSI C rules for pointers in delete.c.
6037         * THANKS: Add Christian Laubscher.
6038
6039 2001-09-26  Jim Meyering  <meyering@lucent.com>
6040
6041         * doc/tar.texi (Remote Tape Server): is know -> is known
6042
6043 2001-09-25  Paul Eggert  <eggert@twinsun.com>
6044
6045         * lib/unicodeio.c (EILSEQ): Include <iconv.h> first, since
6046         <iconv.h> may define EILSEQ (e.g. libiconv).  Define a
6047         replacement EILSEQ to be ENOENT, not EINVAL, since callers may
6048         want to distinguish EINVAL and EILSEQ.
6049
6050 2001-09-24  Christophe Kalt  <Christophe.Kalt@kbcfp.com>
6051
6052         * src/extract.c (maybe_recoverable):
6053         Treat OVERWRITE_OLD_DIRS like DEFAULT_OLD_FILES.
6054
6055 2001-09-22  Paul Eggert  <eggert@twinsun.com>
6056
6057         * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 1.13.24.
6058
6059         * ABOUT-NLS, intl/*: Update to gettext-0.10.40, replacing LGPL
6060         with GPL.
6061
6062         * INSTALL, mkinstalldirs: Update to autoconf 2.52 version.
6063         * PORTS: Add copyright notice, 'star' reference.
6064         * README-alpha: Add copyright notice, autoconf 2.52 patch.
6065         * THANKS: Add Christophe Kalt.
6066         * config.sub: Upgrade to 2001-09-14 version.
6067
6068         * configure.ac (ALL_LINGUAS): Add ko.
6069         * po/ko.po: Resurrected file.
6070
6071         * doc/convtexi.pl: Add coding advice for Emacs.
6072
6073         * doc/getdate.texi: Add copyright notice.
6074
6075         * doc/mdate-sh: Upgrade to automake 1.5 version.
6076
6077         * doc/tar.texi (extracting files): Mention --to-stdout.
6078         (Option Summary, Dealing with Old Files): New option --overwrite-dir.
6079         (Overwrite Old Files): Likewise.
6080
6081         * lib/Makefile.am (noinst_HEADERS):
6082         Remove copysym.h.  Add print-copyr.h, unicodeio.h.
6083         (libtar_a_SOURCES): Remove copysym.c, Add print-copyr.c, unicodeio.c.
6084
6085         * lib/copysym.c, lib/copysym.h: Remove.
6086         * lib/print-copyr.c, lib/print-copyr.h, lib/unicodeio.c,
6087         lib/unicodeio.h: New files.
6088
6089         * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
6090         lib/mktime.c, lib/strtoll.c: Switch from LGPL to GPL.
6091
6092         * lib/quotearg.c (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
6093         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
6094
6095         * m4/Makefile.am (EXTRA_DIST): Remove isc-posix.m4.
6096         * m4/isc-posix.m4: Remove.
6097
6098         * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit.
6099
6100         * po/POTFILES.in: Add copyright notice.
6101
6102         * src/Makefile.am (LDADD): Like libtar.a before @INTLLIBS@ as
6103         well as after.
6104         * tests/Makefile.am (LDADD): Likewise.
6105
6106         * src/buffer.c (write_archive_buffer, close_archive):
6107         If an archive is a socket, treat it like a FIFO.
6108         (records_read, records_written): New vars.
6109         (write_archive_to_stdout): Now bool, not int.
6110         (open_archive, flush_write, flush_read): Keep records_read and
6111         records_written up to date.
6112
6113         * src/common.h (enum old_files): New value OVERWRITE_OLD_DIRS.
6114         (write_archive_to_stdout): Now bool, not int.
6115         (enum read_header): New value HEADER_SUCCESS_EXTENDED.
6116         (read_header): Now takes bool arg.  Existing callers modified
6117         to pass 0, unless otherwise specified.
6118
6119         * src/delete.c (records_read): Remove; now a global.
6120         (acting_as_filter): Now bool, not int.
6121         (recent_long_name, recent_long_link, recent_long_name_blocks,
6122         recent_long_link_blocks, records_read, records_written): New decls.
6123         (records_skipped): New var.
6124         (move_archive): Don't divide by zero if arg is 0.
6125         Use the above vars to compute how far to move.
6126         (write_recent_blocks): New function.
6127         (delete_archive_member): Pass 1 to read_header, so that it doesn't
6128         read more than 1 block.  Handle resulting HEADER_SUCCESS_EXTENDED code.
6129         Keep track of how many records have been skipped.
6130         Let the buffer code count records.
6131         When copying a header, copy any extended headers that came before it.
6132
6133         * src/extract.c (extract_archive): When marking a directory to be
6134         updated after symlinks, stat all directories after it in the
6135         delayed-set-stat list too, since they will be checked after
6136         symlinks.  Add support for --overwrite-dir.
6137
6138         * src/list.c (recent_long_name, recent_long_link,
6139         recent_long_name_blocks, recent_long_link_blocks): New vars.
6140         (read_and): Pass 0 to read_header.
6141         (read_header): New arg RAW_EXTENDED_HEADERS.  Store away extended
6142         headers into new vars.  Null-terminate incoming symbolic links.
6143
6144         * src/rmt.c: Include print-copyr.h, not copysym.h.
6145         (main): Use print_copyright, not copyright_symbol.
6146         * src/tar.c (decode_options): Likewise.
6147         (OVERWRITE_DIR_OPTION): New constant.
6148         (long_options, usage, decode_options): Add --overwrite-dir.
6149
6150         * src/tar.h: Put copyright notice into documentation.
6151
6152         * tests/Makefile.am (TESTS): Add delete03.sh.
6153         * tests/delete03.sh: New file.
6154
6155         * tests/genfile.c: Include print-copyr.h, not copysym.h.
6156         (main): Use print_copyright, not copyright_symbol.
6157         Include <argmatch.h>.
6158         (pattern_strings): Remove.
6159         (pattern_args, pattern_types): New constants.
6160         (main): Use XARGMATCH, not argmatch.
6161
6162 2001-09-20  Jim Meyering  <meyering@lucent.com>
6163
6164         * lib/xstrtol.c (strtoimax): Guard declaration with
6165         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
6166         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
6167         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
6168         (strtoumax): Likewise, for completeness (it wasn't necessary).
6169         * m4/xstrtoimax.m4 (jm_AC_PREREQ_XSTRTOIMAX):
6170         Check for declaration of strtoimax.
6171         * m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX):
6172         Check for declaration of strtoumax.
6173
6174 2001-09-16  Paul Eggert  <eggert@twinsun.com>
6175
6176         * fnmatch.m4 (jm_FUNC_FNMATCH): Fix typo in previous patch: yes -> no.
6177
6178 2001-09-14  Paul Eggert  <eggert@twinsun.com>
6179
6180         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.23.
6181
6182         * README-alpha: Describe automake patch.
6183
6184         * configure.ac (LIBOBJS):
6185         Remove automake 1.4 workaround, as we're using 1.5 now.
6186         (USE_INCLUDED_LIBINTL): New AC_DEFINE.
6187
6188         * lib/copysym.c: Include stddef.h, for size_t.
6189         Include langinfo.h if needed.
6190         Use locale_charset only if USE_INCLUDED_LIBINTL;
6191         if not, use nl_langinfo (CODESET) if available.
6192
6193 2001-09-13  Paul Eggert  <eggert@twinsun.com>
6194
6195         * config.guess, config.sub: Sync with canonical versions.
6196
6197         * configure.ac (jm_PREREQ_XGETCWD): Add.
6198
6199         * lib/Makefile.am (noinst_HEADERS): Add copysym.h.
6200         (libtar_a_SOURCES): Add copysym.c.
6201         * copysym.c, copysym.h: New files.
6202
6203         * lib/error.c: Sync with fileutils version.
6204
6205         * m4/Makefile.am (EXTRA_DIST): Add getcwd.m4; remove uintmax_t.m4.
6206         * m4/getcwd.m4: New file.
6207         * m4/uintmax_t.m4: Remove.
6208
6209         * m4/gettext.m4 (AM_WITH_NLS):
6210         Fix bug with calculating version of Bison 1.29.
6211         Reported by Karl Berry.
6212
6213         * src/Makefile.am (datadir): Remove.
6214
6215         * src/rmt.c: Include copysym.h.
6216         (main): Use copyright_symbol to translate copyright notice,
6217         instead of gettext.
6218         * src/tar.c: Likewise.
6219         * tests/genfile.c: Likewise.
6220
6221         * src/system.h (MB_LEN_MAX): New symbol.
6222
6223 2001-09-11  Paul Eggert  <eggert@twinsun.com>
6224
6225         * src/extract.c (struct delayed_set_stat): New member
6226         'after_symlinks'.
6227         (delay_set_stat): Initialize it to 0.
6228         (set_mode): New arg current_stat_info.  Use it (if nonnull) to avoid
6229         taking an extra stat ourselves.  All callers changed.
6230         (set_stat): Likewise.
6231         (apply_nonancestor_delayed_set_stat): New arg 'after_symlinks'.
6232         If false, stop when encountering a struct whose 'after_symlinks'
6233         member is true.  Otherwise, go through all structures but check
6234         them more carefully.  All callers changed.
6235         (extract_archive): When extracting a deferred symlink, if its parent
6236         directory's status needs fixing, then mark the directory as needing
6237         to be fixed after symlinks.
6238         (extract_finish): Fix status of ordinary directories, then apply
6239         delayed symlinks, then fix the status of directories that are
6240         ancestors of delayed symlinks.
6241
6242         * src/rtapelib.c (rexec):
6243         Remove declaration; it ran afoul of prototypes on Crays.
6244         Reported by Wendy Palm of Cray.
6245
6246 2001-09-06  Paul Eggert  <eggert@twinsun.com>
6247
6248         * lib/strtoimax.c (HAVE_LONG_LONG):
6249         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
6250         (strtoimax): Use sizeof (long), not
6251         sizeof strtol (ptr, endptr, base),
6252         to work around bug in IBM C compiler.
6253
6254 2001-09-04  Paul Eggert  <eggert@twinsun.com>
6255
6256         * lib/xgetcwd.c: Include "xalloc.h".
6257         (xgetcwd): Do not return NULL when memory is exhausted; instead,
6258         report an error and exit.
6259
6260         * m4/prereq.m4 (jm_PREREQ_XREADLINK): New macro.
6261         (jm_PREREQ): Use it.
6262
6263 2001-09-03  Paul Eggert  <eggert@twinsun.com>
6264
6265         * m4/prereq.m4 (jm_PREREQ): Add jm_PREREQ_XGETCWD.
6266         (jm_PREREQ_XGETCWD): New macro.
6267
6268         * lib/exclude.c (fnmatch_no_wildcards):
6269         Fix typo that caused us to do case-folding
6270         search even when that was not desired.  This occurred only in the
6271         no-wildcard case.
6272
6273         * lib/xgetcwd.c: Include pathmax.h if not HAVE_GETCWD.
6274         Do not include xalloc.h.
6275         (INITIAL_BUFFER_SIZE): New symbol.
6276         Do not use xmalloc / xrealloc, since the caller is responsible for
6277         handling errors.  Preserve errno around `free' during failure.
6278         Do not overrun buffer when using getwd.
6279
6280         * lib/xgetcwd.c (xgetcwd):
6281         Use HAVE_GETCWD_NULL, not defined __GLIBC__ && __GLIBC__ >= 2,
6282         to decide whether to use getcwd (NULL, 0).
6283
6284 2001-09-02  Paul Eggert  <eggert@twinsun.com>
6285
6286         * lib/xgetcwd.c: Fix typo in local var; from Jim Meyering.
6287
6288 2001-09-01  Jim Meyering  <meyering@lucent.com>
6289
6290         * exclude.c: Use `""', not `<>' to #include non-system header files.
6291         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
6292         and strncasecmp as r-values.  Unixware didn't have declarations.
6293
6294 2001-08-31  Jim Meyering  <meyering@lucent.com>
6295
6296         * lib/xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
6297         Use an initial, malloc'd, buffer of length 128 rather than
6298         a statically allocated one of length 1024.
6299
6300 2001-08-30  Paul Eggert  <eggert@twinsun.com>
6301
6302         * lib/utime.c: Include full-write.h.
6303         * lib/xstrtol.c (strtoimax): New decl.
6304
6305 2001-08-29  Paul Eggert  <eggert@twinsun.com>
6306
6307         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.22.
6308
6309         * src/create.c (dump_file): Relativize link names before dumping.
6310         This fixes a bug reported by Jose Pedro Oliveira.
6311
6312         * src/create.c (dump_file): Use offsetof when computing sizes for
6313         struct hack; this avoids wasted space in some cases.
6314         * src/incremen.c (note_directory, find_directory): Likewise.
6315         * src/names.c (name_gather, addname): Likewise.
6316
6317         * src/extract.c (extract_archive): Use strcpy, not memcpy,
6318         for consistency with other code that does similar things.
6319         * src/names.c (name_gather): Likewise.
6320
6321         * src/names.c (read_name_from_file, name_next, name_gather,
6322         add_hierarchy_to_namelist): Avoid quadratic behavior when
6323         reallocating buffers.  Check for buffer size overflow.
6324         (addname): Avoid unnecessary clearing of memory.
6325
6326 2001-08-29  "Jan D."  <Jan.Djarv@mbox200.swipnet.se>
6327
6328         * src/extract.c (delay_set_stat): Fix off-by-one error in file
6329         name size allocation that caused core dumps.
6330
6331 2001-08-28  Paul Eggert  <eggert@twinsun.com>
6332
6333         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.21.
6334
6335         * configure.ac (GNU_SOURCE): Define to 1, not /**/.
6336         (major_t, minor_t, ssize_t): Use new-style AC_CHECK_TYPE.
6337         (daddr_t): Remove; no longer used.
6338         (jm_PREREQ_HUMAN): Add.
6339
6340         * acconfig.h: Remove; no longer needed.
6341
6342         * config.guess, config.sub:
6343         New files, from automake 1.5.  Gettext 0.10.39 needs them.
6344         * depcomp, missing, mkinstalldirs: Upgrade to automake 1.5.
6345
6346         * Makefile.am (AUTOMAKE_OPTIONS): Add dist-bzip2.
6347         (SUBDIRS): Put intl before lib, as gettext requires.
6348
6349         * ABOUT-NLS: Upgrade to gettext 0.10.39.
6350         * intl: Upgrade entire directory to gettext 0.10.39.
6351         * m4/codeset.m4, m4/glibc21.m4, m4/iconv.m4:
6352         New files, from gettext 0.10.39.
6353         * m4/gettext.m4, m4/isc-posix.m4, m4/lcmessage.m4, m4/progtest.m4,
6354         Upgrade to gettext 0.10.39,
6355         * po/Makefile.in.in: Likewise, except fix a typo in its copying
6356         permissions.
6357         * po/cat-id-tbl.c, po/stamp-cat-id:
6358         Remove; no longer used by gettext 0.10.39.
6359         * po/ChangeLog: New file.
6360
6361         * doc/Makefile.am (EXTRA_DIST): Add freemanuals.texi.
6362         $(srcdir)/tar.texi: Likewise.
6363         * doc/freemanuals.texi: New file.
6364         * doc/tar.texi (Free Software Needs Free Documentation): New appendix.
6365         `fileds' -> `fields'
6366         * doc/texinfo.tex: Upgrade to version 2001-07-25.07.
6367
6368         * lib/Makefile.am (EXTRA_DIST): Add strtoll.c, strtoimax.c.
6369         (noinst_HEADERS): Add quote.h.
6370         (libtar_a_SOURCES): Add quote.c, xstrtoimax.c.
6371
6372         * lib/exclude.c: Fix typo in '#include <stdint.h>' directive.
6373
6374         * lib/full-write.c, lib/savedir.c: Comment fix.
6375
6376         * lib/pathmax.h: Remove.
6377
6378         * lib/quote.c, lib/quote.h: New files.
6379
6380         * lib/xgetcwd.c: Don't include pathmax.h.
6381         Include stdlib.h and unistd.h if available.
6382         Include xalloc.h.
6383         (xmalloc, xstrdup, free): Remove decls.
6384         (xgetcwd): Don't assume sizes fit in unsigned.
6385         Check for overflow when computing sizes.
6386         Simplify reallocation code.
6387
6388         * lib/xmalloc.c: Quote failure tests.
6389
6390         * lib/strtoumax.c, lib/xstrtoimax.c: New files.
6391
6392         * lib/strtoimax.c: Renamed from strtouxmax.c.  Make it more
6393         similar to strtol.c.
6394         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.
6395         (verify): New macro.
6396         (strtoumax, uintmax_t, strtoull, strtol): Remove.
6397         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
6398         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
6399         changed to signed values.  Check sizes at compile-time, not
6400         run-time.  Prefer strtol to strtoll if both work.
6401         (main): Remove.
6402
6403         * lib/xstrtol.h (xstrtoimax): New decl.
6404
6405         * m4/Makefile.am (EXTRA_DIST):
6406         Add codeset.m4, glibc21.m4, iconv.m4, inttypes.m4,
6407         longlong.m4, xstrtoimax.m4.
6408
6409         * m4/inttypes.m4 (jm_AC_HEADER_INTTYPES_H):
6410         Remove; now done by autoconf.
6411         (jm_AC_TYPE_INTMAX_T, jm_AC_TYPE_UINTMAX_T): Replace with
6412         Use AC_CHECK_TYPE instead of merely looking for the header.
6413
6414         * m4/uintmax_t.m4: Use shorter comment.
6415
6416         * m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX):
6417         Quote first arg of AC_DEFUN.
6418         Require jm_AC_TYPE_INTMAX_T and jm_AC_TYPE_LONG_LONG since they
6419         is needed to parse the include file.
6420         Simplify logic behind the args to AC_REPLACE.
6421
6422         * src/Makefile.am (OMIT_DEPENDENCIES): Remove.
6423
6424         * src/ansi2knr.1, src/ansi2knr.c: Remove; wasn't being used.
6425
6426         * src/rmt.c (main):
6427         Use "Copyright %d" to simplify the translator's job in the future.
6428         Advise translator about circle-C.
6429         * src/tar.c: (decode_options): Likewise.
6430         * tests/genfile.c (main): Likewise.
6431
6432 2001-08-28  Jim Meyering  <meyering@lucent.com>
6433
6434         * lib/argmatch.c: Include "quote.h".
6435         (argmatch_invalid): Quote the context.
6436
6437         * lib/dirname.c (dir_name): Fix typo on PC platforms.
6438
6439         * lib/backupfile.c, lib/basename.c, lib/dirname.c, lib/strtoul.c:
6440         Use single-quote for local .h files.
6441
6442         * lib/error.h (__attribute__): Don't depend on __STRICT_ANSI__.
6443
6444         * lib/getopt.c, lib/getopt.h, lib/getopt1.c: Upgrade to recent
6445         glibc versions.
6446
6447         * lib/getdate.y (get_date): Initialize tm_isdst to -1 before
6448         invoking mktime the last time.
6449
6450         * lib/pathmax.h: Use #if rather than #ifdef for HAVE_UNISTD_H.
6451
6452         * lib/rename.c: Major rewrite by Volker Borchert to use system
6453         rename function, but to work around problems with trailing
6454         slashes.
6455
6456         * lib/strtoll.c: New file, from glibc.
6457         * lib/strtoul.c: Update from glibc.
6458
6459         * lib/strtouxmax.c: Renamed from lib/strtoumax.c.
6460         Add support for signed numbers, too.
6461         (strtoul, strtoull): Do not declare if STRTOUXMAX_UNSIGNED
6462         is not defined.
6463         (strtol, strtoll): Declare as needed, if STRTOUXMAX_UNSIGNED is
6464         not defined.
6465         (strtoumax, uintmax_t, strtoull, strtoul): New macros.
6466         (main): Use generic names in debugging output.
6467         * lib/strtoimax.c: Plus add the following changes of my own:
6468         (main): Use accurate names in debugging output.
6469
6470         * lib/xgetcwd.c (xgetcwd): Use getcwd if glibc 2 or later.
6471         Don't use PATH_MAX.
6472
6473         * m4/c-bs-a.m4, m4/check-decl.m4, m4/d-ino.m4, m4/error.m4,
6474         m4/getline.m4, m4/jm-mktime.m4, m4/malloc.m4, m4/mbrtowc.m4,
6475         m4/mbstate_t.m4, m4/realloc.m4, m4/uintmax_t.m4, m4/utimbuf.m4,
6476         m4/utime.m4, m4/utimes.m4:
6477         Quote the first argument in each use of AC_DEFUN.
6478
6479         * m4/getline.m4: Don't use string.h.
6480
6481         * m4/inttypes.m4, m4/longlong.m4, m4/xstrtoimax.m4: New files.
6482
6483         * m4/mbrtowc.m4 (jm_FUNC_MBRTOWC): @%:@ -> #.
6484
6485 2001-08-27  Paul Eggert  <eggert@twinsun.com>
6486
6487         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.20.
6488
6489         The biggest change is the new --exclude semantics and options.
6490         The basic idea was suggested by Gerhard Poul; thanks!
6491
6492         * NEWS: Describe new --exclude semantics and options, and bug fixes.
6493         * README: ignfail.sh fails on some NFS hosts.
6494         * NEWS, README, lib/xstrtol.h: Add copyright notice.
6495
6496         * Makefile.am (ACLOCAL_AMFLAGS): Add -I m4.
6497         (M4DIR, ACINCLUDE_INPUTS, $(srcdir)/acinclude.m4):
6498         Remove; the automake bug has been fixed.
6499         * acinclude.m4: Remove.
6500
6501         * configure.ac: Renamed from configure.in.
6502         (AC_PREREQ): Bump from 2.13 to 2.52.
6503         (ALL_LINGUAS): Add id, tr.  Remove ko, as po/ko.po (dated
6504         1997-05-30) has an encoding error.
6505         (jm_AC_HEADER_INTTYPES_H): Remove; now done by autoconf.
6506         (AC_FUNC_FNMATCH): Use AC_CONFIG_LINKS, not AC_LINK_FILES.
6507
6508         * doc/fdl.texi: Update to current GNU version.
6509
6510         * doc/tar.texi: Put leading '*' in direntry.
6511         Accommodate new gfdl sectioning.
6512         New option --recursion (the default) that is the inverse of
6513         --no-recursion.
6514
6515         New options --anchored, --ignore-case, --wildcards,
6516         --wildcards-match-slash, and their negations (e.g., --no-anchored).
6517         Along with --recursion and --no-recursion, these control how exclude
6518         patterns are interpreted.  The default interpretation of exclude
6519         patterns is now --no-anchored --no-ignore-case --recursion
6520         --wildcards --wildcards-match-slash.
6521
6522         * lib/Makefile.am (OMIT_DEPENDENCIES): Remove.
6523
6524         * lib/exclude.c (bool): Declare, perhaps by including stdbool.h.
6525         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
6526         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
6527         Include if available.
6528         (<xalloc.h>): Include
6529         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
6530         (verify): New macro.  Use it to verify that EXCLUDE macros do not
6531         collide with FNM macros.
6532         (struct patopts): New struct.
6533         (struct exclude): Use it, as exclude patterns now come with options.
6534         (new_exclude): Support above changes.
6535         (new_exclude, add_exclude_file):
6536         Initial size must now be a power of two to simplify overflow checking.
6537         (free_exclude, fnmatch_no_wildcards): New function.
6538         (excluded_filename): No longer requires options arg, as the options
6539         are determined by add_exclude.  Now returns bool, not int.
6540         (excluded_filename, add_exclude):
6541         Add support for the fancy new exclusion options.
6542         (add_exclude, add_exclude_file): Now takes int options arg.
6543         Check for arithmetic overflow when computing sizes.
6544         (add_exclude_file): xrealloc might modify errno, so don't
6545         realloc until after errno might be used.
6546
6547         * lib/exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
6548         New macros.
6549         (free_exclude): New decl.
6550         (add_exclude, add_exclude_file): Now takes int options arg.
6551         (excluded_filename): No longer requires options arg, as the options
6552         are determined by add_exclude.  Now returns bool, not int.
6553
6554         * lib/prepargs.c: Include <string.h>; required for C99 since
6555         we use strlen.
6556
6557         * lib/quotearg.c:
6558         BSD/OS 4.1 wchar.h requires FILE and struct tm to be declared.
6559
6560         * lib/xstrtol.h (_DECLARE_XSTRTOL): Improve quality of
6561         diagnostic for LONGINT_INVALID_SUFFIX_CHAR.
6562
6563         * m4/Makefile.am (EXTRA_DIST): Add check-decl.m4, mbrtowc.m4.
6564         Remove inttypes_h.m4, largefile.m4, mktime.m4.
6565
6566         * m4/inttypes_h.m4, m4/largefile.m4, m4/mktime.m4: Remove;
6567         subsumed by Autoconf 2.50.
6568
6569         * m4/error.m4: Upgrade to serial 2.
6570
6571         * m4/fnmatch.m4 (jm_FUNC_FNMATCH): Upgrade to serial 4, but
6572         remove test for GNU C library.  It's not correct, as some
6573         older glibcs are buggy.
6574
6575         * m4/getline.m4, m4/malloc.m4: Upgrade to serial 4.
6576
6577         * m4/prereq.m4: Upgrade to serial 20, but then:
6578         (jm_PREREQ): Add jm_PREREQ_EXCLUDE.
6579         (jm_PREREQ_EXCLUDE): New macro.
6580         (jm_PREREQ_HUMAN): Remove jm_AC_HEADER_INTTYPES_H, as it is subsumed
6581         by autoconf 2.5x.
6582
6583         * m4/realloc.m4: Upgrade to serial 4.
6584
6585         * m4/strerror_r.m4: Revert to serial 1002.
6586
6587         * m4/uintmax_t.m4: Upgrade to autoconf 2.5x.
6588
6589         * m4/utimes.m4: Upgrade to latest version (still "serial 3").
6590
6591         * m4/xstrtoumax.m4: Upgrade to serial 3, but then:
6592         (jm_AC_PREREQ_XSTRTOUMAX): Remove jm_AC_HEADER_INTTYPES_H, as
6593         it is now subsumed by autoconf.  Add inttypes.h.
6594
6595         * po/cs.po, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
6596         po/it.po, po/pl.po, po/sl.po, po/sv.po: Sync with translation project.
6597
6598         * src/buffer.c (new_volume): Stop if the script exits with an error.
6599
6600         * src/common.h (excluded_with_slash, excluded_without_slash):
6601         Remove, replacing by:
6602         (excluded): New decl.
6603         (link_error): New decl.
6604         (excluded_name): Now returns bool.
6605
6606         * src/extract.c:
6607         (struct delayed_symlinks, extract_archive, apply_delayed_symlinks):
6608         Support hard links to symbolic links.
6609
6610         (struct delayed_symlink): Remove 'names' member, replacing it with
6611         'sources' and 'target' member.  All uses changed.
6612
6613         (struct string_list): New type.
6614
6615         (delayed_set_stat, extract_archive): Use offsetof when computing sizes
6616         for struct hack; this avoids wasted space in some cases.
6617
6618         (extract_archive): Fix test for absolute pathnames and/or "..".
6619         Use link_error to report errors for links.
6620         Remove redundant trailing '/' at "really_dir", for all uses, not
6621         just before invoking mkdir.
6622         If overwriting old files, do not worry so much about existing
6623         directories.
6624         Fix mode computation in the case where the directory exists.
6625
6626         (apply_delayed_symlinks): If we can't make a hard link to a symbolic
6627         link, make a copy of the symbolic link.
6628
6629         * src/incremen.c (get_directory_contents):
6630         If ignore_failed_read_option, only warn about
6631         stat failures.
6632
6633         * src/list.c (from_header): Do not issue a diagnostic if TYPE is zero.
6634         However, check for error even for '-' or '+' case.
6635
6636         (print_header): Try parsing uids and gids as unsigned integers first,
6637         and as a uid_t or gid_t only if that fails.  This adds support for
6638         listing positive uids and gids that are greater than UID_MAX and
6639         GID_MAX.
6640
6641         * src/misc.c (link_error): New function.
6642
6643         * src/names.c (collect_and_sort_names):
6644         If ignore_failed_read_option, only warn about
6645         stat errors.
6646
6647         (excluded_name): Now returns bool.  Simplify, as the fancy
6648         features are now all in excluded_filename.
6649
6650         * src/rtapelib.c (base_name): Remove decl, as system.h now
6651         declares it.
6652
6653         * src/system.h: Include stddef.h if available.
6654         (offsetof): Declare if stddef.h doesn't.
6655
6656         Include <dirname.h>.
6657         (FILESYSTEM_PREFIX_LEN, ISSLASH): Remove; now defined by dirname.h.
6658
6659         * src/tar.c (ANCHORED_OPTION, IGNORE_CASE_OPTION,
6660         NO_ANCHORED_OPTION, NO_IGNORE_CASE_OPTION, NO_WILDCARDS_OPTION,
6661         NO_WILDCARDS_MATCH_SLASH_OPTION, WILDCARDS_OPTION,
6662         WILDCARDS_MATCH_SLASH_OPTION):
6663         New enum values.
6664
6665         (long_options, usage, decode_options): Add support for --anchored,
6666         --ignore-case, --no-anchored, --no-ignore-case, --no-wildcards,
6667         --no-wildcards-match-slash, --recursion, --wildcards,
6668         --wildcards-match-slash.
6669
6670         (decode_options): Implement the new way of interpreting exclude
6671         patterns.
6672
6673         (usage): --newer-mtime takes a DATE operand.  DATE may be a file name.
6674
6675         (OPTION_STRING, decode_options): Add -I, -y.  Currently these options
6676         just print error messages suggesting alternatives.
6677
6678         (add_filtered_exclude): Remove.
6679
6680         * tests/Makefile.am (TESTS): Alphabetize, except put version.sh first.
6681
6682         * tests/extrac04.sh (out): Remove
6683         directory/subdirectory/file1, as the new semantics for
6684         --exclude exclude it.
6685
6686         * tests/genfile.c (main): Don't use non-ASCII char in msgid.
6687
6688 2001-08-12  Paul Eggert  <eggert@twinsun.com>
6689
6690         * lib/addext.c (<errno.h>): Include.
6691         (errno): Declare if not defined.
6692         (addext): Work correctly on the Hurd, where pathconf returns -1 and
6693         leaves errno alone, because there is no limit.  Also, work even if
6694         size_t is narrower than long.
6695
6696 2001-07-08  Paul Eggert  <eggert@twinsun.com>
6697
6698         * lib/alloca.c (alloca): Arg is of type size_t, not unsigned.
6699
6700 2001-05-10  Paul Eggert  <eggert@twinsun.com>
6701
6702         * lib/addext.c (ISSLASH, base_name): Remove decls; now in dirname.h.
6703         Include <backupfile.h> and <dirname.h> after size_t is defined.
6704         (addext): Use base_len to trim redundant trailing slashes instead of
6705         doing it ourselves.
6706
6707         * lib/backupfile.c (ISSLASH, base_name):
6708         Remove decls; now in dirname.h.
6709         Include <argmatch.h>, <backupfile.h>, <dirname.h> after size_t
6710         is defined.
6711         (find_backup_file_name): Rename locals to avoid new functions.
6712         Use base_len instead of rolling it ourselves.
6713         Work even if dirlen is 0.
6714         Use a dir of '.' if given the empty string.
6715
6716         * lib/basename.c:
6717         Do not include <stdio.h>, <assert.h>; no longer needed.
6718         (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Remove; now in dirname.h.
6719         Include <string.h>, <dirname.h>.
6720         (base_name): Allow file names ending in slashes, other than names
6721         that are all slashes.  In this case, return the basename followed
6722         by the slashes.
6723
6724         * lib/dirname.c: Include <string.h> instead of <stdlib.h>.
6725         (FILESYSTEM_PREFIX_LEN, ISSLASH): Remove; now in dirname.h.
6726         (dir_len): Renamed from dirlen.
6727         All callers changed.
6728
6729         * lib/dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
6730         New macros.
6731         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
6732
6733 2001-02-16  Paul Eggert  <eggert@twinsun.com>
6734
6735         * lib/quotearg.c (mbrtowc, mbrtowc, mbsinit):
6736         Do not declare or define if HAVE_MBRTOWC,
6737         since the test for HAVE_MBRTOWC now requires proper declarations.
6738
6739         * lib/alloca.c (malloc): Undef before defining.
6740
6741 2001-02-13  Paul Eggert  <eggert@twinsun.com>
6742
6743         * src/compare.c (read_and_process): Use off_t for size.
6744         From Maciej W. Rozycki.
6745
6746 2001-01-26  Paul Eggert  <eggert@twinsun.com>
6747
6748         * lib/quotearg.c: Include stddef.h.  From Jim Meyering.
6749
6750 2001-01-12  Paul Eggert  <eggert@twinsun.com>
6751
6752         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.19.
6753
6754         * lib/savedir.h (savedir): Remove size arg.
6755
6756         * doc/tar.texi: Add @setchapternewpage odd.
6757         Remove -I as an alias for -T, for now.
6758         Add @dircategory.
6759         Update copyright.  Remove "Published by".
6760         Dates beginning with / or . are taken to be file names.
6761
6762         * src/tar.c (<time.h>): Do not include;
6763         (time): Do not declare.
6764         (usage): Remove -I as an alias for -T.
6765         (OPTION_STRING): Remove -I.
6766         (decode_options): Dates that look like an absolute path name,
6767         or that start with '.', are presumed to be file names whose
6768         dates are taken.
6769         Remove 'I' as an aliase for 'T'.
6770         Update copyright.
6771
6772         * src/extract.c (<time.h>): Do not include; system.h now does this.
6773         (make_directories): Skip filesystem prefixes.
6774         Don't assume '/' is the only separator.
6775         (extract_sparse_file): Use new full_write semantics.
6776         On write error, return instead of invoking skip_file.
6777         Do not free sparsearray; caller does this now.
6778         (apply_nonancestor_delayed_set_stat): Do not assume '/' is the only
6779         separator.
6780         (extract_archive): Don't assume file name lengths fit in int.
6781         Report what got stripped from member name; it might be more than '/'.
6782         Use new full_write semantics.
6783         Do not pass redundant trailing "/" to mkdir, as POSIX does not allow
6784         mkdir to ignore it.
6785         Do not report mkdir error if old_files_option == KEEP_OLD_FILES.
6786
6787         * src/buffer.c (<time.h>): Do not include; system.h now does this.
6788         (time): Remove decl; likewise.
6789         (child_open_for_uncompress): Use new full_write semantics.
6790         (flush_write): Use ISSLASH instead of testing for '/'.
6791         (flush_read): Likewise.
6792
6793         * src/rmt.h (_remdev): Look for / anywhere in Path.
6794
6795         * src/misc.c (contains_dot_dot): Skip filesystem prefix.
6796         Don't assume '/' is the only separator.
6797         (safer_rmdir): Don't assume '/' is the only separator.
6798
6799         * src/compare.c (diff_archive): Don't assume '/' is the only separator.
6800
6801         * lib/dirname.h (dirlen): New decl.
6802
6803         * src/incremen.c (get_directory_contents):
6804         Remove path_size arg; all callers changed.
6805         Don't assume '/' is the only directory separator.
6806         (gnu_restore): Work even if file name length doesn't fit in int.
6807
6808         * lib/addext.c (ISSLASH): New macro.
6809         (addext): Trim any redundant trailing slashes.
6810
6811         * src/names.c (name_next):
6812         Don't assume '/' is the only directory separator.
6813         (namelist_match): Likewise.
6814         (add_hierarchy_to_namelist): Remove dirsize arg.
6815         Do not assume '/' is the only directory separator.
6816         (new_name): Likewise.
6817
6818         * lib/Makefile.am (noinst_HEADERS): Add dirname.h, full-write.h.
6819         (libtar_a_SOURCES): Add dirname.c.
6820
6821         * src/create.c (relativize):
6822         New function, with much of old start_header's guts.
6823         Handle filesystem prefixes.
6824         (start_header): Use this new function.
6825         (init_sparsearray): Don't bother to zero out the new array;
6826         it's not needed.
6827         (deal_with_sparse): Fix array allocation bug.
6828         (create_archive): Don't assume '/' is the only separator.
6829         (dump_file): Likewise.
6830         Don't worry about leading / in symlink targets.
6831
6832         * lib/savedir.c (savedir):
6833         Remove size arg; it wasn't portable.  All callers changed.
6834
6835         * lib/utime.c (utime_null): Adjust to new full_write convention.
6836
6837         * configure.in (YACC): Avoid portability problem with Ultrix sh.
6838
6839         * lib/backupfile.c: Include <dirname.h>.
6840         (ISSLASH): New macro.
6841         (find_backup_file_name): Use dirlen to calculate directory lengths.
6842         (max_backup_version): Strip redundant trailing slashes.
6843
6844         * src/common.h: Include <full-write.h>.
6845         (get_directory_contents): No longer has size arg.
6846         (gnu_restore): Arg is size_t, not int.
6847
6848         * src/system.h: Include <time.h>.
6849         (time): Declare if not defined.
6850
6851         * lib/full-write.c: Include full-write.h, not safe-read.h.
6852         full_write returns size_t, with short writes meaning failure.
6853         All callers changed.
6854
6855         * src/rtapelib.c: Include full-write.h.
6856
6857         * src/rmt.c: Include full-write.h.
6858         (main): Update copyright.
6859
6860         * doc/getdate.texi: Mention that only English is supported.
6861         Show how to use "date" so that the output is acceptable to getdate.
6862         Mention Z as an abbreviation for UTC.
6863
6864         * lib/full-write.h: New file.
6865
6866         * src/list.c: system.h now does time.h stuff.
6867
6868         * lib/dirname.c:
6869         Use HAVE_STDLIB_H, not STDC_HEADERS, to decide whether to include
6870         stdlib.h.
6871         Do not include string.h, strings.h, or assert.h; no longer needed.
6872         (strrchr, memrchr, malloc): Remove decls; no longer needed.
6873         Include <xalloc.h>.
6874         (base_name): New decl.
6875         (BACKSLASH_IS_PATH_SEPARATOR): Remove.
6876         (dir_name_r): Remove.
6877         (dirlen): New function.
6878         (dir_name): Use dirlen instead of dir_name_r.
6879         (<string.h>, <strings.h>): Include only if test program.
6880         (main): Use "return 0", not "exit (0)".
6881
6882 2000-12-08  Paul Eggert  <eggert@twinsun.com>
6883
6884         * lib/dirname.h: New file.
6885
6886 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
6887
6888         * lib/fnmatch.c: Do not comment out all the code if we are using
6889         the GNU C library, because in some cases we are replacing buggy
6890         code in the GNU C library itself.
6891
6892 2000-10-30  Paul Eggert  <eggert@twinsun.com>
6893
6894         * lib/fnmatch.c (FOLD): Do not assume that characters are unsigned.
6895
6896 2000-10-29  Paul Eggert  <eggert@twinsun.com>
6897
6898         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.18.
6899
6900         * src/tar.c: Include <fnmatch.h>, for FNM_LEADING_DIR.
6901
6902 2000-10-28  Paul Eggert  <eggert@twinsun.com>
6903
6904         * doc/tar.texi: --no-recursion now applies to extraction, too.
6905         * src/create.c (dump_file): no_recurse_option -> ! recursion_option
6906         * src/names.c (namelist_match, excluded_name):
6907         Do not match subfiles of a directory
6908         if --no-recursion is specified.
6909         * src/tar.c (NO_RECURSE_OPTION): Remove.
6910         (long_options): Have getopt set the --no-recursion flag.
6911         (decode_options): Initialize recursion_option to FNM_LEADING_DIR.
6912         Remove case for NO_RECURSE_OPTION.
6913         * src/common.h (recursion_option):
6914         Renamed from no_recurse_option, with sense
6915         negated, and with FNM_LEADING_DIR being the nonzero value.
6916
6917         * names.c (namelist_match): New function.
6918         (name_match, name_scan): Use it to eliminate duplicate code.
6919         (names_notfound): Remove special case for Amiga.
6920
6921 2000-10-27  Paul Eggert  <eggert@twinsun.com>
6922
6923         * src/misc.c (read_error_details, read_warn_details,
6924         read_fatal_details): Don't assume size_t is unsigned long.
6925
6926         * src/buffer.c (flush_read): If read_full_records_option, try to
6927         fill the input buffer, as --delete -f - needs this.
6928
6929 2000-10-24  Paul Eggert  <eggert@twinsun.com>
6930
6931         * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Port to autoconf 2.13.
6932
6933         * src/buffer.c (check_label_pattern):
6934         Make sure header name is a string before
6935         passing it to fnmatch.
6936         (init_volume_number): Check for global_volno overflow.
6937         (new_volume): Check for global_volno overflow.
6938
6939         * src/tar.c (decode_options):
6940         Check that volume label is not too long to overflow
6941         name in tar header block.
6942
6943         * Makefile.am (EXTRA_DIST): Remove rebox.el.
6944
6945         * configure.in (HAVE_DECL_STRERROR_R): Remove our handwritten code.
6946         (AC_FUNC_STRERROR_R): Use this instead.
6947
6948 2000-10-23  Paul Eggert  <eggert@twinsun.com>
6949
6950         * src/extract.c: Include <time.h>, since we invoke "time".
6951
6952         * lib/prepargs.c (prepend_default_options):
6953         Don't use NULL, for portability.
6954
6955         * m4/fnmatch.m4: Add "working" to message.
6956
6957         * src/names.c: (_GNU_SOURCE): Remove; autoconf now does this.
6958         Include <hash.h>.
6959         (getpwuid, getgrgid): Declare only if system headers don't.
6960         (gid_to_gname): Don't invoke setgrent.
6961         (namelist): Now static, not global.
6962         (nametail): New var.  All uses of namelast changed to use
6963         nametail, with one extra level of indirection.
6964         (name_gather): Use memcpy instead of strncpy + assignment of NUL.
6965         (name_match): Set nametail too, when setting namelist to null.
6966         (add_hierarchy_to_namelist): Change type of dir arg from char * to
6967         struct name *, so that we don't have to look up the name again
6968         here.  Get change_dir from dir rather than as a separate arg.  Add
6969         dirsize arg, and pass it along to get_directory_contents.  Remove
6970         unnecessary check of directory type.
6971         (new_name): Do not append a slash if PATH already ends in one.
6972         (avoided_names, struct avoided_name): Remove.
6973         (avoided_name_table): New var, replacing avoided_names.
6974         (hash_avoided_name, compare_avoided_names): New function.
6975         (add_avoided_name, is_avoided_name): Use hash table rather than
6976         linked list.
6977
6978         * src/buffer.c (_GNU_SOURCE): Remove; autoconf now does this.
6979         (child_open_for_compress, child_open_for_uncompress,
6980         close_archive): Propagate any failure of the compression process
6981         back to "tar".
6982         (open_archive, flush_write, flush_read, close_archive): Do not
6983         allocate an array of size PATH_MAX, as PATH_MAX might be (size_t)
6984         -1.  Instead, allocate an array with the size that's needed.
6985         (open_archive): Don't bother checking S_ISCHR of /dev/null.
6986         (backspace_output): Don't try to backspace past start of archive.
6987         (close_archive): Remove special case for DELETE_SUBCOMMAND.
6988
6989         * acconfig.h (_GNU_SOURCE, DEFAULT_ARCHIVE, DEFAULT_BLOCKING,
6990         DENSITY_LETTER, DEVICE_PREFIX, EMUL_OPEN3, HAVE_GETGRGID,
6991         HAVE_GETPWUID, HAVE_MKNOD, HAVE_RTAPELIB, HAVE_ST_FSTYPE_STRING,
6992         HAVE_UNION_WAIT, HAVE_UTIME_H, HAVE_VALLOC, MTIO_CHECK_FIELD, PACKAGE,
6993         PROTOTYPES, REMOTE_SHELL, STD_INC_PATH, VERSION, WITH_CATALOGS,
6994         WITH_DMALLOC, WITH_REGEX):
6995         Remove; now generated automatically.
6996
6997         * configure.in (_GNU_SOURCE): Define to empty, not 1, for
6998         compatibility for glibc fragments.
6999         (_GNU_SOURCE, HAVE_UTIME_H, MTIO_CHECK_FIELD,
7000         HAVE_ST_FSTYPE_STRING, HAVE_MKNOD, REMOTE_SHELL, DENSITY_LETTER,
7001         DEVICE_PREFIX, DEFAULT_ARCHIVE, DEFAULT_BLOCKING): Add comment so
7002         that we needn't put an entry into acconfig.h.
7003         (ALL_LINGUAS): Add da.
7004         (AC_C_BACKSLASH_A): Remove; jm_PREREQ_QUOTEARG now does this.
7005         (AC_CHECK_HEADERS): Add stdbool.h (for hash.h users), wctype.h
7006         (for strtol.c).
7007         (AC_MBSTATE_T): Add.
7008         (RMT): Append $(EXEEXT).
7009         (HAVE_GETGRGID, HAVE_GETPWUID, pe_AC_TYPE_SIGNED_CHAR): Remove.
7010         (HAVE_DECL_FREE, HAVE_DECL_GETGRGID, HAVE_DECL_GETPWUID,
7011         HAVE_DECL_GETENV, HAVE_DECL_MALLOC, HAVE_DECL_STRTOUL,
7012         HAVE_DECL_STRTOULL, HAVE_DECL_STRERROR_R): New macros.
7013         (jm_PREREQ_ADDEXT, jm_PREREQ_ERROR, jm_PREREQ_QUOTEARG): Add.
7014         (AC_REPLACE_FUNCS): Remove execlp; no longer needed.
7015         (AC_CHECK_FUNCS): Add clock_gettime; AC_SEARCH_LIBS wasn't enough.
7016         Remove mbrtowc; jm_PREREQ_QUOTEARG now does this.
7017         (EMUL_OPEN3): Remove; no longer needed.
7018         (DENSITY_LETTER, DEVICE_PREFIX): Simplify m4 quoting.
7019
7020         * m4/fnmatch.m4 (AC_FUNC_FNMATCH): Detect d*/*1 vs d/s/1 bug.
7021
7022         * src/common.h: Do not include basename.h.
7023         * src/rtapelib.c (base_name): Do not include basename.h;
7024         declare base_name instead.
7025
7026         * lib/basename.h, lib/execlp.c, lib/getpagesize.h, lib/mkdir.c:
7027         Remove these files.
7028         * lib/getstr.c, lib/getstr.h, lib/hash.h, lib/hash.h, lib/prepargs.c,
7029         lib/prepargs.h, lib/savedir.c, lib/savedir.h: New files.
7030         * lib/Makefile.am (EXTRA_DIST, noinst_HEADERS, libtar_a_SOURCES):
7031         Adjust to the above changes.
7032
7033         * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove ../src/ansi2knr.
7034
7035         * src/open3.c: Remove.
7036
7037         * src/Makefile.am (AUTOMAKE_OPTIONS): Remove ansi2knr.
7038         (tar_SOURCES): Remove open3.c.
7039         (INCLUDES): Remove -I.., as automake does that.
7040         (OMIT_DEPENDENCIES): ../lib/fnmatch.h -> fnmatch.h.  Add localedir.h.
7041
7042         The following changes are to put LOCALEDIR into localedir.h instead
7043         of passing it on the command line.
7044         (DEFS): Remove.
7045         (DISTCLEANFILES): New macro.
7046         (localedir.h): New rule.
7047         (rmt.o tar.o): Now depend on localedir.h.
7048
7049         * tests/delete02.sh, tests/extrac04.sh: New files.
7050
7051         * tests/Makefile.am (AUTOMAKE_OPTIONS): Remove ansi2knr.
7052         (TESTS): Add extrac04.sh, and restore delete02.sh.
7053         (DEFS): Remove; LOCALEDIR is now done via localedir.h.
7054         (INCLUDES): Remove -I.. as automake does this now.
7055
7056         * src/rtapelib.c (rexec): Don't declare unless using it.
7057         (do_command): Simplify signal-handling code slightly.
7058
7059         * src/delete.c (blocks_needed): Remove.  All uses changed to use
7060         blocking_factor - new_blocks.
7061         (acting_as_filter): New var.
7062         (write_record, delete_archive_members): Use acting_as_filter
7063         rather than archive == STDIN_FILENO to detect whether we're acting
7064         as a filter, as open can return STDIN_FILENO in some cases.
7065         (delete_archive_members): Ignore zero blocks if
7066         ignore_zeros_option is nonzero.  Fix bug that messed up last
7067         output block: write_eot can't be used here, as it gets confused
7068         when the input is at end of file.
7069
7070         * src/compare.c (diff_archive): Do not impose an arbitrary limit on
7071         symbolic link contents length.  Pass directory size to
7072         get_directory_contents.
7073
7074         * m4/decl.m4, m4/error.m4, m4/mbstate_t.m4, m4/prereq.m4,
7075         m4/strerror_r.m4: New files.
7076         * m4/signedchar.m4: Remove this file.
7077         * Makefile.am (ACINCLUDE_INPUTS): Adjust to above changes.
7078         * m4/Makefile.am (EXTRA_DIST): Likewise.
7079
7080         * Makefile.am (DISTCLEANFILES): Add intl/libintl.h.
7081
7082         * po/da.po: New translation file.
7083
7084         * src/mangle.c (extract_mangle):
7085         Fix diagnostic with wrong number of %s'es.
7086
7087         * lib/fnmatch.c (fnmatch):
7088         Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
7089         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
7090
7091         * lib/full-write.c (full_write): Some buggy drivers return 0 when you
7092         fall off a device's end.  Detect this.
7093
7094         * src/system.h (IN_CTYPE_DOMAIN): Renamed from CTYPE_DOMAIN.  All
7095         uses changed.
7096         (open): Remove macro; we no longer support EMUL_OPEN3.  Do not
7097         include <pathmax.h> and directory include files like <dirent.h>;
7098         no longer used.  Include <savedir.h> instead.
7099         (closedir, signed_char): remove macro; no longer used.
7100         (bool, false, true): Include <stdbool.h> if you have the include
7101         file, otherwise define.
7102
7103         * src/misc.c:
7104         (is_dot_or_dotdot, closedir_error, closedir_warn, opendir_error,
7105         opendir_warn, readdir_error): Remove; no longer needed.
7106         (safer_rmdir): Strip leading ./ (or .// or ./// or ././ or etc.)
7107         before deciding whether we're trying to remove ".".
7108         (remove_any_file): Try unlink first if we are not root.  Use
7109         savedir when recursively removing directories, to avoid exhausting
7110         file descriptors.
7111         (savedir_error, savedir_warn, symlink_error): New functions.
7112
7113         * src/list.c: (read_and): Do not invoke
7114         apply_nonancestor_delayed_set_stat; DO_SOMETHING is now
7115         responsible for that.  Do not invoke apply_delayed_set_stat; our
7116         caller is now responsible for that.
7117         (read_header): Use signed char instead of signed_char.  Prevent
7118         later references to current_header from mistakenly treating it as
7119         an old GNU header.
7120         (from_header): Quote invalid base-64 strings in diagnostics.
7121         (time_from_header): Do not warn about future timestamps in
7122         archive; check_time now does that.
7123         (print_header): Quote unknown file types.
7124         (skip_member): New function, replacing skip_extended_headers and
7125         now skipping the whole member instead of just the extended
7126         headers.  All callers changed.  This makes the code handle
7127         extended headers uniformly, and fixes some bugs.
7128
7129         * src/update.c (update_archive): Use skip_member.
7130
7131         * src/extract.c (we_are_root): Now global.
7132         (struct delayed_symlink): New type.
7133         (delayed_symlink_head): New var.
7134         (extr_init, fatal_exit): Invoke extract_finish on fatal errors,
7135         not apply_delayed_set_stat.
7136         (set_mode, set_stat): Pointer args are now const pointers.
7137         (check_time): New function.
7138         (set_stat): Warn if setting a file's timestamp to be the future.
7139         (make_directories): Do not save and restore errno.
7140         (maybe_recoverable): Set errno to ENOENT if we cannot make missing
7141         intermediate directories.
7142         (extract_archive): Invoke apply_nonancestor_delayed_set_stat here,
7143         not in caller.  Extract potentially dangerous symbolic links more
7144         carefully, deferring their creation until the end, and using a
7145         regular file placeholder in the meantime.  Do not remove trailing
7146         / and /. from file names.  Do not bother checking for ".." when
7147         checking whether a directory loops back on itself, as loopbacks
7148         can occur with symlinks too.  Also, in that case, do not bother
7149         saving and restoring errno; just set it to EEXIST.
7150         (apply_nonancestor_delayed_set_stat): A prefix is a potential
7151         ancestor if it ends in slash too (as well as ending in a char just
7152         before slash).
7153         (apply_delayed_set_stat): Remove.
7154         (apply_delayed_symlinks, extract_finish): New functions.
7155
7156         * doc/fdl.texi: New file.
7157         * doc/Makefile.am (EXTRA_DIST): Add fdl.texi.
7158         ($(srcdir)/tar.info): Add fdl.texi.  Invoke makeinfo with --no-split.
7159         * doc/tar.texi: Add Free Documentation License.  New section
7160         "Overwrite Old Files", and revamp that section to make it easier to
7161         follow.  "tar" -> "GNU tar" where appropriate.  Migrate getdate
7162         documentation into getdate.texi.  Fix several minor typos.  Describe
7163         TAR_OPTIONS.  Describe incompatibility between incremental backups and
7164         --atime-preserve.  Describe incompatibility between --verify and other
7165         options.  Mention that tar normally removes symbolic links rather than
7166         following them, when extracting a file of the same name.
7167
7168         * THANKS: Add gpoul.  Change skip's address.
7169
7170         * po/POTFILES.in: Add lib/human.c.
7171
7172         * src/common.h (namelist, namelast): Remove decls.
7173         (we_are_root, extract_finish, skip_member, savedir_error,
7174         savedir_warn, symlink_error, gnu_list_name): New decls.
7175         (apply_delayed_set_stat, apply_nonancestor_delayed_set_stat,
7176         skip_extended_headers, is_dot_or_dotdot, closedir_error,
7177         closedir_warn, opendir_error, opendir_warn, readdir_error,
7178         readdir_warn): Remove decls.
7179         (get_directory_contents): New off_t arg.
7180         (addname): Now returns struct name *.
7181
7182         * src/tar.h, tests/genfile.c: Fix comments.
7183
7184         * src/create.c: Include hash.h.
7185         (gnu_list_name): Remove decl.
7186         (struct link): Remove "next" member.
7187         (linklist): Remove.
7188         (start_header): Say "leading `FOO'" rather than "`FOO' prefix" for
7189         consistency with other diagnostics.
7190         (deal_with_sparse): Check for I/O error when closing the file.
7191         (create_archive): Do not allocate an array of size PATH_MAX, as
7192         PATH_MAX might be (size_t) -1.  Instead, allocate an array with
7193         the size that's needed.
7194         (hash_link, compare_links): New functions.
7195         (dump_file): Do not exhaust open file descriptors when descending
7196         deeply into a directory, by using savedir rather than
7197         opendir/readdir.  Do not zero-fill the name buffer unnecessarily.
7198         Hash the set of links already created, instead of using a linked
7199         list.  Fix some bugs in outputting sparse files which caused the
7200         sparse tables to be incorrect.  When a file unexpectedly shrinks,
7201         output zeros rather than garbage.  Do not allocate an array of
7202         size PATH_MAX, as PATH_MAX might be (size_t) -1.  Instead,
7203         allocate an array with the size that's needed.
7204
7205         * src/incremen.c: Include hash.h.
7206         (struct directory): Remove "next", "dir_text".  Change "name" to
7207         be char[1] with struct hack, not const char *.  Add "found".
7208         (directory_list): Remove.  Replaced by directory_table.
7209         (directory_table): New var.
7210         (nfs_string): Renamed from nfs.
7211         (hash_directory, compare_directories): New functions.
7212         (note_directory): Now returns struct directory *.  First arg is
7213         now const pointer.  struct stat arg is now dev_t, ino_t, nfs.
7214         Remove text arg.  New "found" arg, basically corresponding to the
7215         old text arg not being null.  All callers changed.
7216         (note_directory, find_directory): Use hash table rather than
7217         linked list.
7218         (get_directory_contents): New arg "device".  Use savedir to do the
7219         hard work.  Save the nfs-ness of stat_data, since it might change
7220         under us.  Use note_directory instead of find_directory to save
7221         some work.  When adding an "A" record, do it with
7222         add_to_accumulator instead of cheating with strcat.
7223         (read_directory_file): Use "+" flag before device to indicate
7224         whether it was NFS.  Fix typo in checking for strtoul error.
7225         (write_directory_file_entry): New function.
7226         (write_directory_file): Use it, and use the hash routines to
7227         traverse the directory table.
7228         (gnu_restore): Use savedir rather than opendir/readdir.
7229
7230         * src/tar.c: Include localedir.h, prepargs.h.
7231         (long_options): Now static.
7232         (long_options, usage, decode_options): -j is now short for
7233         --bzip2, and -I is now an alias for -T.
7234         (decode_options, main): argv is not const pointer now.
7235         (decode_options): Invoke prepend_default_options to support
7236         TAR_OPTIONS.  In diagnostic, mention the string that was the
7237         invalid blocking factor, tape length, group, owner, or record
7238         size.  --delete is no longer incompatible with -f -, undoing
7239         2000-01-07 change.
7240         (main): Invoke extract_finish at end of extraction.
7241
7242         * src/rmt.c: Include localedir.h.
7243         (main): Update copyright date to 2000.
7244
7245         * doc/getdate.texi: New file, taken from fileutils 4.0.27, with the
7246         following changes: Use @sc where appropriate.  Document the ranges of
7247         supported times more precisely.  Add Eggert to getdate authors.
7248         Document old Latin 12m/12pm tradition.  Remove list of alphabetic time
7249         zone names, as it wasn't correct and people shouldn't be relying on it
7250         anyway.  Relative items also account for non-DST adjustments.  Fix
7251         some misspellings.
7252
7253         * lib/prepargs.c, lib/prepargs.h, tests/extrac04.sh: New file.
7254
7255         * tests/ignfail.sh: opendir -> savedir in diagnostics.
7256
7257         * tests/preset.in: Set LANGUAGE to the empty string, for some
7258         brain damaged host.
7259
7260 2000-10-20  Paul Eggert  <eggert@twinsun.com>
7261
7262         * m4/fnmatch.m4: Mention the GNU C library.
7263
7264 2000-10-19  Paul Eggert  <eggert@twinsun.com>
7265
7266         * m4/fnmatch.m4: Add a couple more test cases to catch bugs in
7267         glibc 2.1.95.
7268
7269 2000-10-17  Paul Eggert  <eggert@twinsun.com>
7270
7271         * lib/human.c (<limits.h>): Do not include; human.h does it if needed.
7272         (CHAR_BIT): Remove.
7273
7274         * lib/human.h (<limits.h>): Include if HAVE_LIMITS_H.
7275         (CHAR_BIT): Define if not defined.
7276
7277 2000-09-09  Paul Eggert  <eggert@twinsun.com>
7278
7279         * lib/quotearg.c: From fileutils: rename ISASCII to IN_CTYPE_DOMAIN.
7280
7281 2000-08-07  Paul Eggert  <eggert@twinsun.com>
7282
7283         * lib/xmalloc.c: Memory exhausted -> memory exhausted
7284
7285         * lib/xalloc.h (xalloc_msg_memory_exhausted):
7286         change to array from char *.
7287
7288 2000-08-06  Paul Eggert  <eggert@twinsun.com>
7289
7290         * m4/mbstate_t.m4: Define mbstate_t to be int, not char, for
7291         compatibility with glibc 2.1.3 strftime.c.
7292
7293 2000-07-31  Paul Eggert  <eggert@twinsun.com>
7294
7295         * lib/quotearg.c (quotearg_n_options):
7296         Don't make the initial slot vector a constant,
7297         since it might get modified.
7298
7299         * lib/quotearg.c: Add support for more than one preallocated slot.
7300
7301 2000-07-30  Paul Eggert  <eggert@twinsun.com>
7302
7303         * lib/quotearg.c (quotearg_n_options):
7304         Preallocate a slot 0 buffer, so that the caller
7305         can always quote one small component of a "memory exhausted" message
7306         in slot 0.
7307
7308 2000-07-23  Paul Eggert  <eggert@twinsun.com>
7309
7310         * lib/quotearg.c:
7311         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX), so that
7312         mbstate_t is always defined.
7313
7314         Do not inspect MB_LEN_MAX, since it's incorrectly defined to be 1 in
7315         some GCC installations, and this configuration error is likely to be
7316         common.
7317
7318 2000-07-22  Paul Eggert  <eggert@twinsun.com>
7319
7320         * lib/quotearg.c:
7321         When the system forces us to redefine mbstate_t, shadow its mbsinit
7322         function.  From Bruno Haible.
7323
7324 2000-07-14  Paul Eggert  <eggert@twinsun.com>
7325
7326         * lib/xmalloc.c: Simplify exhausted message.
7327
7328         * lib/quotearg.h: Update copyright date; from Jim Meyering.
7329
7330 2000-07-13  Paul Eggert  <eggert@twinsun.com>
7331
7332         * lib/quotearg.h (enum quoting style):
7333         New constant clocale_quoting_style.
7334
7335         * lib/quotearg.c:
7336         (quoting_style_args, quoting_style_vals, quotearg_buffer_restyled):
7337         Add support for clocale_quoting_style, undoing previous change to
7338         locale_quoting_style.
7339
7340 2000-07-10  Paul Eggert  <eggert@twinsun.com>
7341
7342         * lib/quotearg.c:
7343         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX,
7344         since otherwise we don't need it.
7345         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
7346         since we don't do multibytes in that case.
7347         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
7348         invoke multibyte primitives.
7349
7350         * m4/mbstate_t.m4 (AC_MBSTATE_T):
7351         Renamed from AC_MBSTATE_T_OBJECT.  All uses changed.
7352         Change from a two-part test, which defines both HAVE_MBSTATE_T_OBJECT
7353         and mbstate_t, to a single-part test that simply defines mbstate_t.
7354
7355         * lib/quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
7356         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
7357         to decide whether to define the BeOS workaround macro;
7358         this adjusts to the change to AC_MBSTATE_T.
7359
7360         * m4/strerror_r.m4: New file.
7361
7362 2000-07-05  Paul Eggert  <eggert@twinsun.com>
7363
7364         * lib/quotearg.c: Use double-quote to quote.
7365
7366         * lib/quotearg.c (N_): New macro.
7367         (gettext_default): New function.
7368         (quotearg_buffer_restyled): Use gettext_default ("{LEFT QUOTATION MARK}",
7369         "\"") for left quote, and gettext_default ("{RIGHT QUOTATION MARK}", "\"")
7370         for right quote.
7371
7372         * lib/quotearg.c (struct quoting_options):
7373         Simplify quote_these_too dimension.
7374         From Bruno Haible  <haible@clisp.cons.org>.
7375
7376         * m4/mbstate_t.m4 (AC_MBSTATE_T_OBJECT):
7377         Test for mbstate_t only if the test
7378         for an object-type mbstate_t fails.
7379
7380         * lib/quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
7381
7382 2000-07-03  Paul Eggert  <eggert@twinsun.com>
7383
7384         * m4/mbstate_t.m4 (AC_MBSTATE_T_OBJECT): Port to autoconf 2.13.
7385         Add AC_CHECK_HEADERS(stdlib.h), since we use HAVE_STDLIB_H.
7386
7387         * lib/quotearg.c (mbrtowc):
7388         Assign to *pwc, and return 1 only if result is nonzero.
7389         (iswprint): Define to ISPRINT if we are substituting our own mbrtowc.
7390
7391 2000-07-02  Paul Eggert  <eggert@twinsun.com>
7392
7393         * lib/quotearg.c (mbstate_t):
7394         Do not define; it should be defined with AC_CHECK_TYPE.
7395
7396 2000-06-26  Paul Eggert  <eggert@twinsun.com>
7397
7398         * m4/mbstate_t.m4: Include stdio.h before wchar.h, to work around
7399         a bug in glibc 2.1.3.
7400
7401         * lib/xmalloc.c: Fix inaccurate comment for xrealloc.
7402
7403 2000-06-19  Paul Eggert  <eggert@twinsun.com>
7404
7405         * lib/quotearg.c (ISASCII): Add #undef and move definition to follow
7406         inclusion of wctype.h to work around solaris2.6 namespace pollution.
7407         (ISPRINT): Likewise.
7408         Reported by Tom Tromey.
7409
7410 2000-06-15  Paul Eggert  <eggert@twinsun.com>
7411
7412         * lib/human.c (adjust_value): New function.
7413         (human_readable_inexact): Apply rounding style even when printing
7414         approximate values.
7415
7416         * lib/human.c: Avoid shadowing warnings.
7417         From Jim Meyering.
7418
7419 2000-06-14  Paul Eggert  <eggert@twinsun.com>
7420
7421         * lib/human.c (human_readable_inexact): Allow an input block size
7422         that is not a multiple of the output block size, and vice versa.
7423
7424         * lib/getdate.y (get_date): Apply relative times after time zone
7425         indicator, not before.
7426
7427 2000-05-31  Paul Eggert  <eggert@twinsun.com>
7428
7429         * m4/largefile.m4: Rewrite so that we don't need to run getconf,
7430         and thus don't need AC_CANONICAL_HOST.
7431
7432         (AC_SYS_LARGEFILE_FLAGS, AC_SYS_LARGEFILE_SPACE_APPEND): Remove.
7433         (AC_SYS_LARGEFILE_TEST_INCLUDES): New macro.
7434         (AC_SYS_LARGEFILE_MACRO_VALUE): Change arguments from
7435         CODE-TO-SET-DEFAULT to VALUE, INCLUDES, FUNCTION-BODY.  All uses
7436         changed.  Instead of inspecting the output of getconf, try to
7437         compile the test program without and with the macro definition.
7438         (AC_SYS_LARGEFILE): Do not require AC_CANONICAL_HOST or check for
7439         getconf.  Instead, check for the needed flags by compiling test
7440         programs.
7441
7442         * configure.in (AC_CANONICAL_HOST): Remove; the largefile stuff no
7443         longer needs it.
7444         * config.guess, config.sub: Remove these files, for similar reasons.
7445
7446 2000-05-03  Paul Eggert  <eggert@twinsun.com>
7447
7448         * m4/largefile.m4 (AC_SYS_LARGEFILE): Define _XOPEN_SOURCE to be
7449         500, instead of _GNU_SOURCE to be 1, to work around glibc 2.1.3
7450         bug.  This avoids a clash when files like regex.c that define
7451         _GNU_SOURCE.
7452
7453 2000-05-02  Paul Eggert  <eggert@twinsun.com>
7454
7455         * m4/largefile.m4 (AC_SYS_LARGEFILE):
7456         Define _GNU_SOURCE if this is needed to make
7457         ftello visible (e.g. glibc 2.1.3).  Use compile-time test, rather than
7458         inspecting host and OS, to decide whether to define _LARGEFILE_SOURCE.
7459
7460         * lib/quotearg.c (mbrtowc, mbstat_t):
7461         Add definitions if !HAVE_MBSTATE_T_OBJECT.
7462         (<wctype.h>): Include if HAVE_WCTYPE_H.
7463         (iswprint): Define to 1 if we lack it
7464
7465 2000-04-18  Paul Eggert  <eggert@twinsun.com>
7466
7467         * m4/mbstate_t.m4: New file.
7468
7469 2000-04-17  Bruno Haible  <haible@clisp.cons.org>
7470
7471         * tests/ignfail.sh: Test for uid 0 along with user "root".
7472
7473 2000-04-05  Paul Eggert  <eggert@twinsun.com>
7474
7475         * m4/largefile.m4 (AC_SYS_LARGEFILE_FLAGS):
7476         Don't use -n32 on IRIX if the installer said
7477         otherwise.
7478
7479 2000-02-28  Paul Eggert  <eggert@twinsun.com>
7480
7481         * lib/quotearg.c (ALERT_CHAR): New macro.
7482         (quotearg_buffer_restyled): Use it.
7483
7484 2000-02-23  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
7485
7486         * src/list.c (tartime): Fix off-by-one error when copying year if
7487         OLD_CTIME.
7488
7489 2000-02-18  Paul Eggert  <eggert@twinsun.com>
7490
7491         * lib/getdate.y: Handle two-digit years with leading zeros correctly.
7492         (textint): New typedef.
7493         (parser_control): Changed from struct parser_control to typedef
7494         (for consistency).  Member year changed from int to textint.  All
7495         uses changed.
7496         (YYSTYPE): Removed; replaced by %union with int and textint
7497         members.
7498         (tID): Removed; not used.
7499         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE,
7500         tMERIDIAN, tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER,
7501         tUNUMBER, tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
7502         (tSNUMBER, tUNUMBER): Now of type <textintval>.
7503         (date, number, to_year): Use width of number in digits, not its
7504         value, to determine whether it's a 2-digit year, or a 2-digit
7505         time.
7506         (yylex): Store number of digits of numeric tokens.  Return '?' for
7507         unknown identifiers, rather than (unused) tID.
7508
7509 2000-01-16  Paul Eggert  <eggert@twinsun.com>
7510
7511         * lib/quotearg.c (quotearg_buffer_restyled):
7512         Do not quote alert, backslash, formfeed,
7513         and vertical tab unnecessarily in shell quoting style.
7514
7515 2000-01-15  Paul Eggert  <eggert@twinsun.com>
7516
7517         * m4/c-bs-a.m4:
7518         Change quoting to be compatible with future autoconf versions.
7519
7520 2000-01-11  Paul Eggert  <eggert@twinsun.com>
7521
7522         * lib/exclude.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Remove unused macros.
7523
7524 2000-01-07  Paul Eggert  <eggert@twinsun.com>
7525
7526         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.17.
7527
7528         Fix bug with fnmatch.h dependency, as follows:
7529         * src/Makefile.am (OMIT_DEPENDENCIES): New macro.
7530         * lib/Makefile.am (OMIT_DEPENDENCIES): New macro.
7531
7532         * src/common.h (apply_nonancestor_delayed_set_stat):
7533         Renamed from apply_delayed_set_stat.
7534         (apply_delayed_set_stat, decode_mode, chmod_error_details,
7535         chown_error_details, close_warn, closedir_warn, mkdir_error,
7536         read_error_details, read_fatal_details, read_warn_details,
7537         seek_error_details, seek_warn_details, utime_error,
7538         write_error_details, write_fatal_details): New decls.
7539
7540         Make diagnostic messages more regular.
7541         * src/create.c (dump_file): Quote file names with colons if possible.
7542         * src/compare.c (diff_archive): Likewise.
7543         * src/extract.c (repair_delayed_set_stat, extract_archive): Likewise.
7544         * src/incremen.c (get_directory_contents, gnu_restore): Likewise.
7545         * src/mangle.c (extract_mangle): Likewise.
7546         * src/misc.c (call_arg_error, call_arg_fatal, call_arg_warn):
7547         Likewise.
7548         * src/buffer.c (archive_write_error, flush_archive, close_archive,
7549         new_volume, xclose):
7550         Use error message functions to report errors consistently.
7551         * src/compare.c (diff_sparse_files, diff_archive): Likewise.
7552         * src/create.c (finish_sparse_file, dump_file): Likewise.
7553         * src/extract.c (set_mode, set_stat, extract_sparse_file,
7554         extract_archive): Likewise.
7555         * src/list.c (list_archive): Likewise.
7556         * src/update.c (append_file): Likewise.
7557         * src/compare.c (diff_init, diff_sparse_files):
7558         Use xalloc_die to report memory exhaustion.
7559         * src/incremen.c (gnu_restore): Likewise.
7560         * src/list.c (read_header): Likewise.
7561         * src/mangle.c (extract_mangle): Likewise.
7562         * src/misc.c (maybe_backup_file): Likewise.
7563         * src/tar.c (decode_options): Likewise.
7564         * src/compare.c (read_and_process, fill_in_sparse_array,
7565         diff_sparse_files):
7566         Use consistent terminology for unexpected-EOF message.
7567         * src/extract.c (extract_sparse_file, extract_archive): Likewise.
7568         * src/list.c (list_archive, read_header, skip_file,
7569         skip_extended_headers): Likewise.
7570         * src/buffer.c (archive_write_error): Add noreturn attribute to decl.
7571         (xdup2): Regularize messages with rest of tar.
7572
7573         * src/buffer.c (flush_read): Don't read past EOF.
7574
7575         * src/extract.c (extr_init):
7576         If we run out of memory, invoke apply_delayed_set_stat.
7577         (prepare_to_extract): Don't complain if we can't remove ".".
7578         (apply_delayed_set_stat): New function.
7579         (apply_nonancestor_delayed_set_stat):
7580         Renamed from apply_delayed_set_stat.  All uses changed.
7581         Don't remove head if it doesn't apply.
7582
7583         * src/create.c (find_new_file_size):
7584         Return size instead of storing through pointer.
7585         All callers changed.
7586         (deal_with_sparse): Don't keep reading after read errors.
7587         (finish_sparse_file): Just abort if there is an internal error.
7588         (dump_file): Fix typo: stat_warn and stat_error were interchanged.
7589         Don't restore access times on directories during incremental dumps
7590         until after dealing with the directory.
7591         If ignoring failed reads, count closedir, read, and unknown
7592         file errors as warnings, not errors.
7593         Fix buffer overrun problem when dumping sparse files.
7594
7595         * src/list.c (read_and):
7596         Invoke apply_nonancestor_delayed_set_stat on file names
7597         after handling them.
7598         (decode_mode): Remove; moved to misc.c.
7599
7600         * src/misc.c (safer_rmdir): New function.
7601         (remove_any_file): Use it to avoid problems with rmdir(".").
7602         (maybe_backup_file): Regularize diagnostics.
7603         (undo_backup_file): Likewise.
7604         (decode_mode): Moved here from list.c.
7605         (chmod_error_details, chown_error_details, close_fatal,
7606         close_warn, closedir_warn, mkdir_error, read_error_details,
7607         read_warn_details, read_fatal_details, seek_error_details,
7608         seek_warn_details, utime_error, write_error_details,
7609         write_fatal_details): New functions.
7610
7611         * src/delete.c (save_record): Remove static variable (now local).
7612         (move_archive): Don't position before start of archive.
7613         (write_record): Abort if count is zero at inopportune time.
7614         Plug memory leak.
7615
7616         * src/tar.c (decode_options): --delete and -f - are now
7617         incompatible, since we didn't have time to fix their bugs.
7618
7619         * tests/Makefile.am (TESTS): Remove delete02.sh.
7620         * tests/ignfail.sh: Adjust to new quoting scheme again.
7621
7622 2000-01-06  Paul Eggert  <eggert@twinsun.com>
7623
7624         * lib/getdate.y: Sync tm_diff with the GNU C Library.
7625         (TM_YEAR_BASE): Renamed from TM_YEAR_ORIGIN.  All uses changed.
7626         (tm_diff): Renamed from difftm.  All uses changed.
7627         Replace body with that taken from GNU C Library 2.1.3pre1.
7628         (get_date): Prefer tm_gmtoff to tm_diff if available.
7629
7630 1999-12-29  "Melissa O'Neill"  <oneill@cs.sfu.ca>
7631
7632         * tests/incremen.sh: Invoke stat on newly created file so that its
7633         ctime is updated on Nextstep.
7634
7635 1999-12-21  Machael Stone  <mstone@cs.loyola.edu>
7636
7637         * lib/getdate.y (get_date):
7638         Fix typo when checking for time_t overflow in time zone calculations.
7639
7640 1999-12-13  Paul Eggert  <eggert@twinsun.com>
7641
7642         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.16.
7643
7644         * README-alpha: New file.
7645         * README: New sections for gzip and bzip2, Solaris.
7646         Remove mention of BACKLOG.
7647
7648         * configure.in (AC_C_BACKSLASH_A): Add.
7649         (AC_CHECK_HEADERS): Add wchar.h.
7650         (AC_CHECK_FUNCS): Add mbrtowc.
7651         (AC_FUNC_CLOSEDIR_VOID): Add.
7652
7653         * tests/Makefile.am (TESTS): Add delete02.sh.
7654         (POSTPONED_TESTS): Remove.
7655         (EXTRA_DIST): Remove $(POSTPONED_TESTS).
7656
7657         * tests/preset.in:
7658         Set LC_ALL rather than LANGUAGE, LANG, and LC_MESSAGES.
7659
7660         * tests/ignfail.sh (err): Adjust to new quoting scheme.
7661
7662         * tests/delete02.sh: Fix typo: need to list archive2, not archive.
7663
7664         * tests/extrac03.sh: Use -P option, so that .. doesn't get diagnosed.
7665
7666         * src/tar.c ("quotearg.h"): New include.
7667         (usage): Now has __attribute__ ((noreturn)).
7668         (confirm): Report errno if we can't open tty.
7669         (confirm, decode_options):
7670         Quote arbitrary strings in diagnostics.
7671         (OVERWRITE_OPTION): New constant.
7672         (long_options, usage, decode_options): New --overwrite option.
7673         (decode_options): --keep-old-files, --overwrite, and --unlink-first
7674         are now mutually exclusive.
7675         Don't assume that gettext preserves errno.
7676         (main): Set default quoting style to escape_quoting_style.
7677
7678         * src/update.c (<quotearg.h>): New include.
7679         (append_file):
7680         Don't assume that gettext preserves errno.
7681         Quote arbitrary strings in diagnostics.
7682         Check for close error.
7683
7684         * src/names.c (<quotearg.h>): New include.
7685         (name_init, name_next, name_close, names_notfound,
7686         collect_and_sort_names): Don't assume that gettext preserves
7687         errno.  Quote arbitrary strings in diagnostics.
7688         (excluded_name): Fix typo that caused empty patterns to be
7689         mishandled.
7690
7691         * src/misc.c (<quotearg.h>): New include.
7692         (quote_copy_string): Quote only newline and backslash; the output is no
7693         longer meant for humans, and is locale-independent.
7694         (contains_dot_dot): New function.
7695         (remove_any_file): Don't use lstat; just rmdir the file and then use
7696         unlink if the rmdir fails because the file isn't a directory.
7697         Check for readdir and closedir errors.
7698         (maybe_backup_file): Report "stat" for stat errors.
7699         (maybe_backup_file, chdir_do):
7700         Quote arbitrary strings in diagnostics.
7701         (maybe_backup_file, undo_last_backup):
7702         Don't assume that gettext preserves errno.
7703         (call_arg_error, call_arg_fatal, call_arg_warn,
7704         chdir_fatal, close_error, closedir_error, exec_fatal, mkfifo_error,
7705         mknod_error, open_error, open_fatal, open_warn, opendir_error,
7706         opendir_warn, read_error, read_fatal, readdir_error, readdir_warn,
7707         readlink_error, readlink_warn, seek_error, seek_warn, stat_error,
7708         stat_warn, truncate_error, truncate_warn, unlink_error, waitpid_error,
7709         write_error, write_fatal, xfork, xpipe, quote_n, quote): New functions.
7710
7711         * src/system.h (__attribute__): New macro.
7712         (O_NDELAY, O_NONBLOCK, O_APPEND): Remove.
7713         (S_ISDOOR): New macro.
7714         (closedir): New macro, if CLOSEDIR_VOID.
7715
7716         * src/rmt.c, src/rtapelib.c (decode_oflag):
7717         O_APPEND might not be defined.
7718
7719         * src/list.c: (read_and, list_archive):
7720         Quote arbitrary strings in diagnostics.
7721         (from_header): Use locale_quoting_style to quote diagnostics.
7722         (print_header, print_for_mkdir): Quote with quotearg, not quote_copy_string.
7723
7724         * src/rmt.h (REM_BIAS): Increase from 128 to (1 << 30).
7725
7726         * src/Makefile.am: Use ## for copyright comments.
7727
7728         * src/extract.c (<quotearg.h>): New include.
7729         (enum permstatus): New enum.
7730         (struct delayed_set_stat): file_name is now at end of buffer, to avoid
7731         two mallocs.  New members file_name_len, invert_permissions, permstatus.
7732         (extr_init): Remove hack that silently adjusted newdir_umask.
7733         (set_mode, set_stat): New args invert_permissions, permstatus, typeflag.
7734         Use these args to decide whether and how to set modes.
7735         (set_mode, set_stat, prepare_to_extract, extract_sparse_file, extract_archive):
7736         Don't assume that gettext preserves errno.
7737         (set_stat): Remove arg symlink_flag; subsumed by typeflag.
7738         (delay_set_stat, repair_delayed_set_stat): New functions.
7739         (make_directories): Avoid mkdir where last part of path is "..".
7740         Create a struct delayed_set_stat for each directory made.
7741         (prepare_to_extract): Renamed from unlink_destination, and
7742         return 0 immediately if to_stdout_option; all callers changed.
7743         (maybe_recoverable): New parameter interdir_made.
7744         Add support for --overwrite.
7745         (extract_sparse_file, extract_archive):
7746         Quote arbitrary strings in diagnostics.
7747         (extract_archive): By default, warn about ".." in member names, and skip them.
7748         Don't open files with O_NONBLOCK or O_APPEND.
7749         Open with O_TRUNC only if --overwrite; otherwise, use O_EXCL to avoid
7750         overwriting them.  Pass only rwxrwxrwx permissions to `open' and `mkdir',
7751         minus the current umask.  Keep track of intermediate directories made,
7752         to avoid looping when making x/../x when x doesn't exist; the
7753         earlier code solved this in a different way that didn't fit well
7754         into the new scheme.  Don't extract permissions onto existing
7755         directories unless --overwrite is given.  Do not add -wx------
7756         permissions to new directories permanently; just do it temporarily.
7757         Remove no-longer-needed hack with MSDOS and directory time stamps.
7758         (apply_delayed_set_stat): New argument specifies which directories to
7759         fix statuses of.  Do not wait until the end of extraction to fix
7760         statuses; instead, fix a directory's status once we exit that directory.
7761         This requires less memory and does the right thing in some cases
7762         where the old method didn't.
7763         (fatal_exit): New function.
7764
7765         * src/incremen.c (<quotearg.h>): New include.
7766         (get_directory_contents, gnu_restore):
7767         Check for readdir and closedir errors.
7768         (get_directory_contents, read_directory_file, gnu_restore):
7769         Quote arbitrary strings in diagnostics.
7770         (get_directory_contents, read_directory_file, write_directory_file):
7771         Don't assume that gettext preserves errno.
7772
7773         * src/create.c (<quotearg.h>): New include.
7774         (start_header): Use `member names' to refer to archive member names, not
7775         `archive names'.  Warn about `..' in member names.
7776         (finish_sparse_file, dump_file):
7777         Quote arbitrary strings in diagnostics.
7778         (finish_sparse_file, dump_file):
7779         Don't assume that gettext preserves errno.
7780         (dump_file): Don't use `access' to determine whether a directory is readable;
7781         this isn't reliable if tar is setuid.  Use `opendir' instead.
7782         Check for readdir and closedir failures.
7783         Don't dump sockets as if they were fifos; just warn and skip.
7784
7785         * src/delete.c (move_archive):
7786         Don't report fatal error merely because sizes don't fit
7787         into struct mtop values; fall back on lseek instead.
7788         Say `Cannot' uniformly, instead of `Could not' sometimes and `Cannot' others.
7789         Say `reposition' instead of `re-position'.
7790         (delete_archive_members):
7791         Set archive to STDOUT_FILENO before outputting trailing buffer.
7792
7793         * src/compare.c (<quotearg.h>): New include.
7794         (diff_init): Use `Cannot' uniformly, instead of `Could not' sometimes
7795         and `Cannot' others.
7796         (report_difference, diff_archive):
7797         Quote arbitrary strings in diagnostics.
7798         (process_rawdata, diff_sparse_files, get_stat_data, diff_archive, seek_warn):
7799         Don't assume that gettext preserves errno.
7800         (diff_archive): Don't open regular files with O_NONBLOCK.
7801         Preserve access times of files if --atime.
7802
7803         * src/common.h (FATAL_ERROR): Use new fatal_exit function to exit.
7804         (FATAL_ERROR, USAGE): Don't return 0.
7805         (enum old files): New enum.
7806         (old_files_option): New variable, replacing keep_old_files_option and
7807         unlink_first_option.
7808         (apply_delayed_set_stat): Now takes char const * param.
7809         (fatal_exit, contains_dot_dot, chdir_fatal, close_error,
7810         closedir_error, exec_fatal, mkfifo_error, mknod_error, open_error,
7811         open_fatal, open_warn, opendir_error, opendir_warn, read_error,
7812         read_fatal, readdir_error, readdir_warn, readlink_error,
7813         readlink_warn, seek_error, seek_warn, stat_error, stat_warn,
7814         truncate_error, truncate_warn, unlink_error, waitpid_error,
7815         write_error, write_fatal, xfork, xpipe, quote, quote_n): New decls.
7816
7817         * src/buffer.c:
7818         (xclose, xdup2, child_open_for_compress, child_open_for_uncompress,
7819         archive_write_error, archive_read_error, flush_archive, close_archive,
7820         init_volume_number, new_volume):
7821         Don't assume that gettext preserves errno.
7822
7823         (xdup2): Don't report errno if dup returns an unexpected nonnegative value.
7824         (open_archive): Reject multivolume verify attempts a bit earlier.
7825         Rename local variable `access', in case it's defined by system header.
7826
7827         (open_archive, backspace_output): Use `Cannot' uniformly, instead of
7828         `Could not' sometimes and `Cannot' others.
7829
7830         (open_archive, flush_read, flush_archive, close_archive, new_volume):
7831         Quote arbitrary strings in diagnostics.
7832
7833         (read_error): Set archive to STDOUT_FILENO temporarily when writing
7834         archive buffer.
7835
7836         (init_volume_number): Check for input and output errors in volno_file.
7837
7838         (new_volume): Use new fatal_exit function to exit, and new xfork
7839         function to fork.
7840
7841         * m4/Makefile.am (EXTRA_DIST): Add c-bs-a.m4.
7842
7843         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/c-bs-a.m4.
7844
7845         * doc/tar.texi: Add --overwrite.
7846         --absolute-names rejects ".." in names.
7847
7848         * lib/quotearg.c: Add support for multibyte characters.
7849         (ISGRAPH): Remove.
7850         (ISPRINT): New macro.
7851         (<wchar.h>): Include if HAVE_MBRTOWC && HAVE_WCHAR_H.
7852         (isprint, mbrtowc, mbsinit, mbstate_t): New macros,
7853         defined if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
7854         (quotearg_buffer_restyled): New function, with most of the old
7855         quotearg_buffer's contents.
7856         Major rewrite to support multibyte characters.
7857         (quotearg_buffer): Now just calls quotearg_buffer_restyled.
7858
7859         * m4/c-bs-a.m4: New file.
7860
7861         * lib/Makefile.am: Use ## for copyright notice.
7862
7863         * scripts/Makefile.am: Use ## on copyright notice.
7864
7865         * doc/Makefile.am:
7866         ($(srcdir)/tar.info, tar.dvi): We now use texinfo 4.0.
7867
7868 1999-12-05  Paul Eggert  <eggert@twinsun.com>
7869
7870         * doc/ChangeLog, lib/ChangeLog, scripts/ChangeLog,
7871         src/ChangeLog, tests/ChangeLog: Remove these files.
7872         * ChangeLog.1: New file, incorporating the above files, plus old
7873         ChangeLog entries.
7874         * Makefile.am (EXTRA_DIST): Add ChangeLog.1.
7875
7876 1999-12-05  Dale Worley  <worley@ariadne.com>
7877
7878         * src/compare.c (<utime.h>, struct utimbuf): Add.
7879         (diff_archive): Restore access times if --atime.
7880         * doc/tar.texi: Explain that --atime also preserves modification time.
7881
7882 1999-12-04  Gerhard Poul  <gpoul@gnu.org>
7883
7884         * ABOUT-NLS: Update to latest version from ftp.gnu.org.
7885         * BACKLOG, TODO: Remove.
7886         * Makefile.am (all-local, BABYL, dist-zoo, id, ID): Remove.
7887         * README: Bring up to date.
7888
7889 1999-12-03  Paul Eggert  <eggert@twinsun.com>
7890
7891         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.15.
7892
7893         * src/compare.c (diff_archive):
7894         Do not set errno to EPIPE; we no longer use perror.
7895
7896         * src/create.c (dump_file):
7897         If a parent directory said that a file should be there but it is
7898         absent, diagnose it as being removed in the meantime.
7899         Do not pass meaningless errno to ERROR when reporting that the
7900         file changed as we read it.
7901         Report that a file changed if its ctime changes; this is more
7902         sensitive than mtime+size, and more accurate.
7903
7904         * src/incremen.c (enum children): New type.
7905         (struct directory): Change old char allnew member to new enum children
7906         children member.
7907         All uses changed.
7908         (get_directory_contents): When doing an incremental dump that does
7909         not cross filesystem boundaries, dump the mount points, even though
7910         they are in a different filesystem.  This is for convenience when
7911         restoring, and for consistency with non-incremental dumps.
7912         This requires a 3-way flag for keeping track of which children we want,
7913         so we use enum children rather than boolean.
7914
7915         * src/open3.c (modes): Remove.
7916         (open3): Remove unportable assumptions about flag encodings.
7917         Use `stat' instead of `access' for testing file existence,
7918         to avoid problems with setuid programs.
7919
7920         * src/names.c (name_next): If file names are given both in the
7921         command line (e.g. via -C) and in a file (via -T), do not
7922         ignore the command-line names.
7923
7924         * m4/uintmax_t.m4: Backport to autoconf 2.13.
7925
7926         * doc/tar.texi: Clarify getdate authorship.
7927
7928 1999-11-23  Paul Eggert  <eggert@twinsun.com>
7929
7930         * lib/Makefile.am (DISTCLEANFILES): New macro.
7931
7932         * configure.in (tar_fnmatch_hin):
7933         Remove; it runs afoul of a bug in autoconf 2.13.
7934         Instead, always link fnmatch.h to some file, even if it's a throwaway.
7935
7936 1999-11-19  Paul Eggert  <eggert@twinsun.com>
7937
7938         * m4/largefile.m4: Update serial.
7939
7940 1999-11-18  Paul Eggert  <eggert@twinsun.com>
7941
7942         * m4/largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Work around a bug in
7943         the QNX shell, which doesn't propagate exit status of failed
7944         commands inside shell assignments.
7945
7946 1999-11-07  Paul Eggert  <eggert@twinsun.com>
7947
7948         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.14.
7949
7950         * configure.in (AC_PREREQ): Bump to 2.13.
7951         (ALL_LINGUAS): Add pt_BR, ja.
7952         (AC_FUNC_FNMATCH): Remove lib/funmatch.h before invoking, not after.
7953         (tar_cv_path_RSH): Prefer a non-symlink rsh to a symlink one,
7954         for AIX crossbuilds.
7955
7956         * doc/tar.texi: New node create options for --ignore-failed-read.
7957         Remove unused version control symbols.
7958         Modernize texinfo usage.
7959
7960         * src/tar.c (usage): Add examples.
7961
7962         * m4/fnmatch.m4 (AC_FUNC_FNMATCH):
7963         Include fnmatch.h when testing fnmatch.
7964
7965         * src/common.h (collect_and_sort_names): New decl.
7966
7967         * src/list.c (from_header):
7968         Handle 32-bit two's complement negative time stamps
7969         even if the leading octal digit is 2 or 3.
7970
7971         * src/extract.c (set_stat): Remove duplicate code.
7972
7973         * src/create.c (to_chars): Remove trailing newline from warning.
7974         (dump_file): Ignore doors.
7975         (finish_header): Report block numbers with origin 0, not origin 1.
7976
7977         * src/rmt.c: Include getopt.h.
7978         (long_opts): New constant.
7979         (usage): New function.
7980         (main): Implement --help and --version.
7981         Output usage message if arguments are bad.
7982
7983 1999-10-10  Paul Eggert  <eggert@twinsun.com>
7984
7985         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.13.
7986
7987         * README: Remove --with-dmalloc.
7988         Add --disable-largefile.
7989         Remove old NeXT dirent problems, or AIX valloc problems.
7990         Remove old union wait advice, and old %lld advice.
7991         Remove advice about FreeBSD 2.1.7, ISC 4.1mu, Ultrix `make'.
7992
7993         * doc/tar.texi: Clarify documentation for portable file names.
7994
7995         * configure.in (AM_WITH_DMALLOC): Remove.
7996         (ALL_LINGUAS): Add ja.
7997
7998         * src/tar.c (decode_options):
7999         Invalid dates are now treated as (time_t) -1.
8000         Redo version message to conform to GNU standards.
8001
8002         * src/create.c (dump_file):
8003         Fix typo: last two args to dump_file were interchanged.
8004         * src/update.c (update_archive): Likewise.
8005
8006         * src/common.h (tartime): New decl.
8007
8008         * src/list.c (tartime): Now extern.
8009         (read_and): Invalid headers cause errors, not warnings.
8010
8011 1999-10-03  Paul Eggert  <eggert@twinsun.com>
8012
8013         * lib/getdate.y (__attribute__):
8014         Don't use if GCC claims to be before 2.8; this is
8015         needed for OPENStep 4.2 cc.  Also, don't use if strict ANSI.
8016
8017 1999-09-25  Paul Eggert  <eggert@twinsun.com>
8018
8019         * lib/fnmatch.c, lib/fnmatch.hin: Merge changes from latest glibc.
8020         * lib/getopt.c, lib/getopt.h, lib/getopt1.c: Likewise.
8021
8022         * tests/incremen.sh: Add yet another sleep.
8023
8024 1999-09-24  Paul Eggert  <eggert@twinsun.com>
8025
8026         * NEWS: A read error now causes a nonzero exit status.
8027
8028         * src/create.c (to_chars): Fix base-256 output.
8029
8030         * src/buffer.c (write_error):
8031         Read error is an error, not just a warning.
8032
8033 1999-09-24  Paul Eggert  <eggert@twinsun.com>
8034
8035         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.12.
8036
8037         * src/tar.c (<time.h>): Include.
8038         (time): Declare if not defined.
8039         (confirm): Don't read past EOF.
8040         (long_options, usage): Add --no-same-owner, --no-same-permissions.
8041         (main): Use clock_gettime if available.
8042
8043         * tests/Makefile.am (TESTS): Add incremen.sh
8044         (INCLUDES): Add -I../lib, for fnmatch.h.
8045
8046         * src/update.c (update_archive):
8047         Remove call to name_expand; had no effect.
8048         Use chdir_do to change into directory.
8049         Use deref_stat instead of stat.
8050         Use add_avoided_name to mark names to be avoided; the old method of
8051         setting a bit with the name caused all descendants of that name to
8052         be avoided, in some circumstances.
8053
8054         * tests/incremen.sh: Remove unnecessary sleeps.
8055
8056         * src/names.c (name_next): Go back to using plain chdir.
8057         (name_gather): Use chdir_arg to keep track of arguments to chdir.
8058         (addname): Likewise.
8059         (name_match): Use chdir_do to act on chdir args.
8060         (merge_sort): Moved here from incremen.c.
8061         (compare_names, add_hierarchy_to_namelist, collect_and_sort_names):
8062         Likewise.
8063         (name_expand): Remove.
8064         (name_from_list): Skip fake names.
8065         Use chdir_do to act on chdir args.
8066         (struct avoided_name): New struct.
8067         (avoided_names): New var.
8068         (add_avoided_name, is_avoided_name): New functions.
8069
8070         * src/system.h (stat, lstat): Define in terms of statx on
8071         STX_HIDDEN && !_LARGE_FILES /* AIX */ hosts.
8072         (UCHAR_MAX): New macro.
8073         (TYPE_MAXIMUM): Cast to arg type, for types narrow than int.
8074
8075         * m4/largefile.m4: Work around GCC 2.95.1 bug with HP-UX 10.20.
8076
8077         * src/incremen.c (<time.h>): Remove include; no longer used.
8078         (time): Remove decl.
8079         (time_now): Remove.
8080         (get_directory_contents): Use deref_stat.
8081         Consider a subdirectory to be all new only if
8082         listed_incremental_option or if it its timestamp is newer than the
8083         cutoff.
8084         (add_hierarchy_to_namelist, merge_sort): Move to names.c.
8085         (read_directory_file): Now extern.  Do not set time_now.
8086         (write_directory_file): Renamed from write_dir_file.
8087         Use start_time instead of time_now.
8088         (compare_names, collect_and_sort_names): Move to names.c.
8089
8090         * src/mangle.c (<time.h>): Remove; not used.
8091         (time): Do not declare.
8092
8093         * src/misc.c (chdir_from_initial_wd): Remove.
8094         (deref_stat): New function.
8095         (struct wd): New struct.
8096         (wd, wds, wd_alloc): New variables.
8097         (chdir_arg, chdir_do): New function.
8098
8099         * src/compare.c (get_stat_data): Use deref_stat.
8100
8101         * src/common.h (name_expand): Remove.
8102
8103         * src/list.c (time): Declare if not defined.
8104         (base_64_digits): Moved here from create.c.
8105         (base64_map): Use UCHAR_MAX for size, not less-clear (unsigned char)
8106         -1.
8107         (read_and): Don't get time from header unless we need it now;
8108         as getting time can cause duplicate diagnostics if bogus.
8109         Remove "Hmm, " from diagnostic.
8110         Use "Skipping to next header" uniformly.
8111         (from_header): Renamed from from_chars.  All uses changed.
8112         Allow different forms for unportable 2's complement numbers.
8113         Don't check for extended forms when parsing checksums.
8114         Parse base-256 output.
8115         (gid_from_header): Renamed from gid_from_chars.  All uses changed.
8116         (major_from_header): Renamed from major_from_chars.  All uses changed.
8117         (minor_from_header): Renamed from minor_from_chars.  All uses changed.
8118         (mode_from_header): Renamed from mode_from_chars.  All uses changed.
8119         (off_from_header): Renamed from off_from_chars.  All uses changed.
8120         (size_from_header): Renamed from size_from_chars.  All uses changed.
8121         (time_from_header): Renamed from time_from_chars.  All uses changed.
8122         Warn about future timestamps.
8123         (uid_from_header): Renamed from uid_from_chars.  All uses changed.
8124         (uintmax_from_header): Renamed from uintmax_from_chars.
8125         All uses changed.
8126         (tartime): New function, incorporating isotime.
8127         (isotime): Delete.
8128         (print_header): Use tartime.
8129
8130         * src/create.c (to_chars): Fix typo in decl.
8131         Don't assign through char const *.
8132         Rename name_expand back to collect_and_sort_names.
8133
8134         * src/extract.c (<time.h>): No need to include.
8135         (time): No need to declare.
8136         (now): Remove variable.
8137         (extr_init): Don't initialize `now'.
8138         Increment same_permissions_option and same_owner_option if we_are_root
8139         is nonzero; this supports the new --no-same-owner option.
8140         (set_stat): Use start_time instead of `now'.
8141
8142         * src/create.c (struct link): Remove unused linkcount member.
8143         (base_64_digits): Move to list.c.
8144         (base_8_digits): Remove.
8145         (to_octal): New function, with some of old contents of to_base.
8146         (to_base): Remove.
8147         (to_base256): New function.
8148         (to_chars): Use base 256, not base 64, for huge values.
8149         (mode_to_chars): Don't use two's complement in GNU format or POSIX
8150         format.
8151         (dump_file): Interchange last two arguments. If TOP_LEVEL is negative,
8152         it means we have an incremental dump where we don't know whether this
8153         is a top-level call.
8154         Use deref_stat instead of statx / stat / lstat.
8155         Cast result of alloca.
8156         Check for dates if 0 < top_level, not if listed_incremental_option.
8157         Move multiple-link check after directory check.
8158         Do not dump avoided names.
8159         Dump hard links to symbolic names as links, not as separate
8160         symbolic links.
8161         start_header cannot return a null pointer, so don't test for it.
8162         Likewise for find_next_block.
8163
8164         * src/buffer.c, src/common.h (<human.h>): Include.
8165         (read_error): Read error is an error, not just a warning.
8166         (print_total_written): Also print human-readable byte count, and
8167         bytes/s.
8168         (open_archive, flush_write): Use start_time, not current time.
8169         (flush_read): Report about garbage bytes ignored at end of archive,
8170         but act on non-garbage bytes (instead of ignoring them).
8171         (new_volume): Use WARN for warnings.
8172
8173         * doc/Makefile.am:
8174         ($(srcdir)/tar.info): Add -I$(srcdir) so that subdir builds work.
8175
8176         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/fnmatch.m4.
8177
8178         * m4/Makefile.am (EXTRA_DIST): Add fnmatch.m4.
8179
8180         * lib/Makefile.am (noinst_HEADERS):
8181         Rename fnmatch.h to fnmatch.hin; add human.h.
8182         (libtar_a_SOURCES): Add human.c, xstrtoul.c.
8183         (INCLUDES): Remove -I.. -I$(srcdir) -- automake adds this for us.
8184
8185         * src/Makefile.am (rmt_LDADD, tar_LDADD): New macros.
8186
8187         * lib/fnmatch.c (strchrnul):
8188         Define to __strchrnul if _LIBC, to our own replacement otherwise.
8189         Do not define if !_LIBC and if it already exists.
8190         (internal_fnmatch): Use it.
8191
8192         * configure.in (tar_LDADD): New variable, used only when linking tar.
8193         (rmt_LDADD): Similarly, for rmt.
8194         (AC_FUNC_FNMATCH): Link fnnmatch.hin to fnmatch.h if we're using our
8195         fnmatch.c; otherwise, use the system fnmatch.h.
8196
8197         * doc/tar.texi: Add --no-same-owner, --no-same-permissions.
8198         Modernize sample backup script.
8199
8200         * THANKS: Martin Goik's email address has changed.
8201
8202         * m4/fnmatch.m4: New file.
8203
8204 1999-09-03  Paul Eggert  <eggert@twinsun.com>
8205
8206         * lib/lchown.h (ENOSYS): Don't use ENOMSG; it's not in NeXTStep3.3.
8207         Use EINVAL instead.
8208
8209 1999-08-29  Paul Eggert  <eggert@twinsun.com>
8210
8211         * lib/getdate.y (get_date):
8212         Rename outermost local `probe' to `quarter'.
8213         Rename latter local `tm' to probe_tm.
8214         From: Jim Meyering <meyering@ascend.com>
8215         Message-ID: <uryn1vafyyc.fsf@ixi.eng.ascend.com>
8216
8217 1999-08-28  Paul Eggert  <eggert@twinsun.com>
8218
8219         * lib/getdate.y (PC): New macro; use it when possible.
8220         (number): Handle `Nov 11 1996' example correctly.
8221         See Risks Digest 20.55 (1999-08-27)
8222         http://catless.ncl.ac.uk/Risks/20.55.html#subj18
8223
8224 1999-08-23  Paul Eggert  <eggert@twinsun.com>
8225
8226         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.11.
8227
8228         Remove minor cases of lint from many source files: this includes
8229         unnecessary casts, uses of NULL, etc.
8230
8231         * configure.in (AC_PROG_YACC): Remove.
8232         (YACC): Always use bison.
8233         (AC_STRUCT_TIMEZONE): Add.
8234         (AC_REPLACE_FUNCS): Add strcasecmp, strncasecmp.
8235
8236         * doc/tar.texi: --bzip2 is now -I.  Remove obsolete time zone info.
8237         Fix spelling.
8238
8239         * lib/Makefile.am (EXTRA_DIST): Add strcasecmp.c, strncasecmp.c.
8240         ($(srcdir)/getdate.c): Rename y.tab.c to getdate.c only if successful.
8241
8242         * lib/strcasecmp.c, lib/strncasecmp.c: New files.
8243
8244         * src/common.h (merge_sort): Remove decl; no longer exported.
8245
8246         * src/system.h (voidstar): Remove.
8247         (memcpy, memcmp): Cast args.
8248         ("xalloc.h"): Add include.
8249         (xmalloc, xrealloc): Remove decl.
8250
8251         * src/mangle.c (time): Do not declare if defined.
8252         (first_mangle, mangled_num): Remove.
8253
8254         * src/list.c (from_chars): Report out-of-range values more precisely.
8255         (off_from_chars): Do not allow negative offsets.
8256         (uid_from_chars): Allow negative uids.
8257
8258         * src/create.c (linklist): Now static.
8259         (to_chars): Fix wording of message to match from_chars.
8260
8261         * src/misc.c (merge_sort): Move to incremen.c.
8262         * src/incremen.c (merge_sort): Move here from misc.c; now static.
8263         It's too painful to make it both generic and portable.
8264         (read_directory_file): "timestamp" -> "time stamp" in messages.
8265
8266         * src/tar.c (long_options, usage, main): -y is now -I (for --bzip).
8267         (usage): Fix misspelling.
8268         (OPTION_STRING): -y is now -I.
8269         (decode_options): Use -1, not EOF, for getopt_long result.
8270         Fix typo when invoking xstrtoumax: look for LONGINT_OK, not LONG_MAX.
8271         Handle operands after any "--" argument.
8272         (main): Report any output errors.
8273
8274         * src/rmt.c (main): status is ssize_t, not long.
8275
8276         * src/names.c (name_gather): Handle trailing -C option correctly.
8277         (addname): use memcpy, not strncpy, to copy a string of known length.
8278         (name_match): Handle trailing -C option correctly.
8279         Propagate -C option to following files.
8280         (name_match, name_scan): Remove redundant matching code.
8281
8282         * src/buffer.c (open_archive): Use American spelling in diagnostic.
8283
8284         * lib/getdate.y: Major rewrite.  Add copyright notice.
8285         (<stdio.h>): Include only if testing.
8286         (ISUPPER): Remove.
8287         (ISLOWER): New macro.
8288         (<string.h>): Include if HAVE_STRING_H, not USG.
8289         (bcopy): Remove.
8290         (yymaxdepth, ..., yycheck): Don't bother to redefine, since we assume
8291         bison.
8292         (EPOCH_YEAR): Renamed from EPOCH.
8293         (table): Renamed from TABLE.
8294         (meridian): Now an anonymous enum.
8295         (struct parser_control): New type.
8296         (YYLEX_PARAM, YYPARSE_PARAM, YYSTYPE): New macros.
8297         (yyInput, ..., yyRelYear): Migrated into struct parser_control.
8298         (%pure_parser): Added, so that the parser is pure.
8299         (%union): Removed; the type is now just plain int.
8300         All %type directives removed.
8301         (tLOCAL_ZONE): New %token.
8302         (month_day_table): Renamed from MonthDayTable.
8303         (gmtime, localtime, mktime, time): Declare only if not defined.
8304         (meridian_table): New table.
8305         (dst_table): New table.
8306         (units_table): renamed from UnitsTable.
8307         (relative_time_table): Renamed from OtherTable.
8308         (time_zone_table): Renamed from TimezoneTable.  Modernized.
8309         (military_table): Renamed from MilitaryTable.
8310         (to_hour): Renamed from ToHour.
8311         (to_year): Renamed from ToYear.
8312         (lookup_zone): New function.
8313         (LookupWord): Renamed from lookup_word.  Use lookup_zone for time
8314         zones.
8315         (yylex): Now reentrant.  All callers changed.
8316         (get_date): Add support for local time zone abbreviations.
8317         Make it reentrant.
8318
8319 1999-08-20  Paul Eggert  <eggert@twinsun.com>
8320
8321         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.10.
8322
8323         * src/create.c (to_chars): Generate GNU base-64 representation
8324         if we are generating an old or new GNU format tar file for a
8325         number that can't be represented with the POSIX format.
8326
8327         * configure.in (AC_CHECK_FUNCS): Add fchdir.
8328         (AM_FUNC_GETLINE): Add.
8329         (LIBOBJS): Add getline.o to workaround comment.
8330         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/getline.m4.
8331         * m4/Makefile.am (EXTRA_DIST): Add getline.m4.
8332         * lib/Makefile.am (noinst_HEADERS): Add getline.h, save-cwd.h.
8333         (libtar_a_SOURCES): Add save-cwd.c, xgetcwd.c.
8334         * lib/getline.c, lib/getline.h, lib/save-cwd.c,
8335         lib/save-cwd.h, m4/getline.m4: New files.
8336
8337         * src/misc.c (<save-cwd.h>): Include.
8338         (chdir_from_initial_wd): New function.
8339
8340         * src/names.c (name_next): Use chdir_from_initial_wd, not chdir.
8341         (name_gather): Handle `-C x -C y' correctly.
8342         Do not rely on addname to handle -C.
8343         (addname): New CHANGE_DIR parameter.  All callers changed.
8344         Remove ugly calls to getcwd; no longer needed.
8345         (name_match, name_from_list): Use chdir_from_initial_wd, not chdir.
8346
8347         * src/incremen.c (listed_incremental_stream): New var.
8348         (read_directory_file): Remove arbitrary limits on file name length.
8349         Do not attempt to get the working directory; we can bypass this
8350         on fchdir hosts.  Open the listed_incremental_option file for both
8351         read and write instead of opening it twice.  Check for I/O errors
8352         when doing I/O to this file.  Check for invalid data in the file,
8353         and report line numbers of invalid data.
8354         (write_dir_file): Likewise.
8355         (collect_and_sort_names): Use chdir_from_initial_wd, not chdir.
8356         Do not invoke write_dir_file; that's our caller's responsibility.
8357
8358         * src/list.c (max): New macro.
8359         (isotime): Now takes time_t, not time_t *.  Report the decimal values
8360         of times that can't be broken down.
8361         (print_header): Don't assume that major and minor device numbers can
8362         fit into uintmax_t.
8363
8364         * src/common.h (struct name): change_dir is now char const *.
8365         (write_directory_file): Remove unused decl.
8366         (STRINGIFY_BIGINT): Assume b always points to UINTMAX_STRSIZE_BOUND
8367         chars; the old `sizeof (b)' broke when b was a pointer not an array.
8368         (chdir_from_initial_wd): New decl.
8369         (addname): New 2nd arg.
8370
8371         * THANKS: Torsten Lull -> Catrin Urbanneck
8372
8373 1999-08-18  Paul Eggert  <eggert@twinsun.com>
8374
8375         * configure.in (HAVE_GETHOSTENT, HAVE_SETSOCKOPT):
8376         Don't depend on ac_cv_func variables.
8377         From Albert Chin-A-Young <china@thewrittenword.com>.
8378
8379 1999-08-18  Paul Eggert  <eggert@twinsun.com>
8380
8381         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.9
8382
8383         * m4/signedchar.m4: New file.
8384         * configure.in (pe_AC_TYPE_SIGNED_CHAR): Add.
8385         * src/system.h (signed_char): New macro.
8386         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/signedchar.m4.
8387         * m4/Makefile.am (EXTRA_DIST): Add signedchar.m4.
8388
8389         * src/create.c (write_eot): Write at least two zero blocks.
8390
8391         * src/extract.c (extract_archive): Fix sparse array bug:
8392         we did not find end of array correctly.
8393
8394         * src/compare.c: (fill_in_sparse_array, diff_sparse_files):
8395         Don't assume find_next_block yields nonnull.
8396         * src/extract.c (extract_sparse_file, extract_archive): Likewise.
8397         * src/list.c (skip_extended_headers): Likewise.
8398
8399         * src/list.c (read_and, list_archive): Simplify code.
8400         (read_header): Fix computation of signed checksums on machines where
8401         char is unsigned.
8402         Do not consider a block to be zero unless all its bytes are zero,
8403         even the checksum bytes.  Do not attempt to parse the checksum of
8404         a zero block.  Fix memory leak with long names and links.
8405         (from_chars): Accommodate a buggy tar that outputs leading NUL
8406         if the previous field overflows.
8407
8408         * src/misc.c (quote_copy_string): Generate \177 for '\177', not
8409         \?, for portability to non-ASCII hosts.
8410
8411 1999-08-16  Paul Eggert  <eggert@twinsun.com>
8412
8413         * configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.8.
8414
8415         * src/extract.c (make_directories): Do not chown intermediate
8416         directories, even if we are root.
8417
8418         * src/list.c (read_header): Fix bugs when interpreting
8419         POSIX-compliant headers that do not contain null bytes in the
8420         header or link names.
8421
8422 1999-08-14  Paul Eggert  <eggert@twinsun.com>
8423
8424         * configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.7.
8425
8426         * configure.in (AC_CHECK_HEADERS): Remove sys/wait.h.
8427         (AC_HEADER_SYS_WAIT): Add.
8428         (AC_REPLACE_FUNCS): Add waitpid.
8429         (tar_cv_header_union_wait, HAVE_UNION_WAIT): Remove.
8430         * lib/waitpid.c: New file.
8431         * lib/Makefile.am (EXTRA_DIST): Add waitpid.c.
8432         * src/system.h (WCOREDUMP): Remove; no longer used.
8433         (WIFSTOPPED): Likewise.
8434         (WEXITSTATUS, WIFSIGNALED): Default to Solaris 7 versions.
8435         * src/buffer.c (child_open_for_compress): Undo previous change.
8436         (close_archive): Use waitpid, POSIX-style, instead of old BSD style.
8437         (new_volume): Likewise.
8438
8439         * src/buffer.c, src/extract.c, src/incremen.c (time):
8440         Don't declare if defined.
8441         * src/extract.c (extr_init): Remove unneeded cast around 0 arg to time.
8442         * src/incremen.c (read_directory_file):
8443         Invoke `time' the same way everyone else does.
8444         Check validity of --listed-incremental file contents a bit better.
8445         Do not worry about --after-date-option; tar.c now checks this.
8446         * src/list.c (isotime): Report ??? if localtime returns null.
8447         Don't assume years fit into four digits.
8448         Don't append trailing newline.
8449         (print_header): Report ??? if localtime returns null;
8450         Don't assume years fit into four digits.
8451
8452         * src/compare.c (diff_archive): Do not fall back on absolute name
8453         when --absolute-names is not specified.
8454
8455         * src/create.c (start_header):
8456         Include text of ignored filesystem prefix in warning.
8457         (create_archive): Check for excluded names when doing incremental
8458         pass through directory.
8459         (dump_file): Do not dump old files explicitly given on command line
8460         when using --listed-incremental.  Do not strip ./ prefix from names.
8461
8462         * src/tar.c: -g now implies after_date_option = 1.
8463         -g and -N are now incompatible options.
8464
8465         * doc/tar.texi: Explain --exclude better.  Don't strip leading `./'.
8466
8467 1999-08-11  Jeff Dairiki  <dairiki@dairiki.org>
8468
8469         * src/list.c (read_header): Don't parse OLDGNU_FORMAT
8470         incremental headers as POSIX prefixes.
8471
8472 1999-08-11  Paul Eggert  <eggert@twinsun.com>
8473
8474         * NEWS, configure.in: Version 1.13.6.
8475
8476         * configure.in (ALL_LINGUAS): Add pt_BR.
8477         * po/pt_BR.po: New file.
8478
8479         * doc/Makefile.am ($(srcdir)/tar.info, $(srcdir)/header.texi):
8480         Renamed from tar.info and header.texi; adjust actions so that
8481         they work in other directories.
8482
8483         * doc/tar.texi: Add -y and --bzip2.
8484         Patterns containing / now exclude only file names whose prefix match.
8485
8486         * lib/exclude.h (excluded_filename): New option parameter.
8487         (add_exclude_file): New ADD_FUNC parameter.
8488         (excluded_pathname): Remove decl.
8489         * lib/exclude.c (_GNU_SOURCE):
8490         Remove; no longer needed since we don't use FNM_ macros.
8491         (excluded_filename): Renamed from excluded_filename_opts.
8492         (excluded_filename, excluded_pathname): Remove.
8493         (add_exclude_file): New ADD_FUNC parameter.
8494
8495         * po/POTFILES.in: Add lib/quotearg.c.
8496
8497         * src/buffer.c (_GNU_SOURCE): Define.
8498         (<fnmatch.h>): Include unconditionally.
8499         (child_open_for_compress): Dup after closing, to avoid possible file
8500         descriptor exhaustion.
8501         (flush_write): Use FILESYSTEM_PREFIX_LEN instead of MSDOS ifdef.
8502         (flush_read): Likewise.
8503
8504         * src/common.h (LG_8, LG_64): New macros.
8505         (excluded_with_slash, excluded_without_slash): New vars.
8506         (excluded): Remove.
8507         (base_64_digits): New decl.
8508         (gid_to_chars, major_to_chars, minor_to_chars, mode_to_chars,
8509         off_to_chars, size_to_chars, time_to_chars, uid_to_chars,
8510         uintmax_to_chars,
8511         GID_TO_CHARS, MAJOR_TO_CHARS, MINOR_TO_CHARS, MODE_TO_CHARS,
8512         OFF_TO_CHARS, SIZE_TO_CHARS, TIME_TO_CHARS, UID_TO_CHARS,
8513         UINTMAX_TO_CHARS):
8514         Renamed from gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct,
8515         off_to_oct, size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct,
8516         GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT, MODE_TO_OCT, OFF_TO_OCT,
8517         SIZE_TO_OCT, TIME_TO_OCT, UID_TO_OCT, UINTMAX_TO_OCT,
8518         respectively.  All definitions and uses changed.
8519         (excluded_name): New decl.
8520
8521         * src/compare.c (diff_archive):
8522         Open files with O_NONBLOCK instead of O_NDELAY.
8523
8524         * src/create.c (base_64_digits): New constant.
8525         (base_8_digits): New macro.
8526         (MAX_VAL_WITH_DIGITS): New macro.
8527         (to_base): First half of old to_oct.  Support base 64 too.
8528         (to_chars): Other half of old to_oct, for 64-bit support.
8529         (GID_NOBODY, UID_NOBODY): Don't define if the headers don't.
8530         (gid_substitute, uid_substitute): Look up names dynamically if
8531         GID_NOBODY and UID_NOBODY aren't defined; use -2 if all else fails.
8532         (mode_to_chars): Renamed from mode_to_oct.
8533         Support negative values in all the _to_chars functions.
8534         (start_header): Use FILESYSTEM_PREFIX_LEN instead of MSDOS ifdef.
8535         Abort if archive format is DEFAULT_FORMAT when it shouldn't be.
8536         (dump_file): Inspect entire pathname, not just new file name
8537         component, when deciding whether to exclude it.
8538
8539         * src/extract.c (extract_archive):
8540         Open files with O_NONBLOCK instead of O_NDELAY.
8541
8542         * src/incremen.c (get_directory_contents):
8543         Inspect entire pathname, not just new file name
8544         component, when deciding whether to exclude it.
8545
8546         * src/list.c (<fnmatch.h>): Do not include.
8547         (from_chars): Renamed from from_oct.  New parameter specifying
8548         the negative of the minimum allowed value.  Support negative
8549         and base-64 values.
8550         (base64_map): New var.
8551         (base64_init): New function.
8552         (print_header): Output numeric uids and gids if numeric_owner_option.
8553
8554         * src/misc.c (quote_copy_string): Use LG_8 instead of constants.
8555
8556         * src/names.c (_GNU_SOURCE): Define.
8557         (<fnmatch.h>): Include unconditionally.
8558         (excluded_name): New function, taking over duties of excluded_pathname.
8559         All uses changed.
8560
8561         * src/rmt.c (decode_oflag): New function.
8562         (main): Use it to support symbolic open flags.
8563
8564         * src/rtapelib.c (encode_oflag): New function.
8565         (rmt_open__): Do not allow newlines in the path.
8566         Propagate errno correctly.
8567         Decode symbolic open flags, if present.
8568
8569         * src/system.h (FILESYSTEM_PREFIX_LEN, ISSLASH, O_ACCMODE, O_NONBLOCK):
8570         New macros.
8571
8572         * src/tar.c: (long_options, usage, OPTION_STRING, decode_options):
8573         New -y or --bzip2 option.
8574         (add_filtered_exclude): New function.
8575         (decode_options): Put excluded patterns with / into
8576         excluded_with_slash, and without / into excluded_without_slash.
8577         Compare newer_mtime_option to its new initial value
8578         TYPE_MINIMUM (time_t) when deciding whether more than one
8579         threshold date was specified.
8580
8581 1999-07-20  Paul Eggert  <eggert@twinsun.com>
8582
8583         * NEWS, configure.in: Version 1.13.5.
8584
8585         * src/common.h (FATAL_ERROR): Invoke apply_delayed_set_stat
8586         before exiting.
8587         * src/buffer.c (new_volume): Likewise.
8588         * src/incremen.c (read_directory_file): Likewise.
8589         * src/tar.c (decode_options):
8590         ERROR ((TAREXIT_FAILURE, ... -> FATAL_ERROR ((0,
8591         for consistency.
8592
8593         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.4.
8594         * configure.in (AC_CHECK_FUNCS): Add lstat, readlink, symlink.
8595
8596         * src/system.h (lstat): Define only if !HAVE_LSTAT && !defined lstat.
8597         (S_ISMPB, S_ISMPC, S_ISNWK): Remove unused macros.
8598         (S_ISBLK, S_ISCHR, S_ISCTG, S_ISFIFO, S_ISLNK, S_ISSOCK):
8599         Define to 0 if the corresponding S_IF* macro is not defined.
8600         (mkfifo): Do not define if already defined, or if S_IFIFO
8601         is not defined.
8602
8603         * src/compare.c (diff_archive): Use HAVE_READLINK, not
8604         S_ISLNK, to determine whether to invoke readlink.
8605         * src/create.c (dump_file): Likewise.
8606
8607         * src/extract.c (set_mode):
8608         Do not chmod unless we are root or the -p option was given;
8609         this matches historical practice.
8610         (unlink_destination): New function, which checks for unlink failures.
8611         (maybe_recoverable): Stay quiet if -U.
8612         (extract_archive): Use O_EXCL if unlink_first_option.
8613         Report unlink failures.
8614         Use HAVE_SYMLINK, not S_ISLNK, to determine whether symlink exists.
8615         Use HAVE_MKFIFO || defined mkfifo, not S_ISFIFO, to determine whether
8616         mkfifo exists.
8617
8618         * src/incremen.c (get_directory_contents): Depend on
8619         S_ISHIDDEN, not AIX, to determine whether to invoke S_ISHIDDEN.
8620
8621         * src/list.c: Remove S_IS* ifdefs.
8622         * src/misc.c (maybe_backup_file): Likewise.
8623
8624         * src/misc.c (maybe_backup_file):
8625         "Virtual memory exhausted" -> "Memory exhausted",
8626         to conform to the other places this message is issued.
8627
8628         * src/mangle.c (extract_mangle):
8629         Replace #ifdef S_ISLNK with #ifdef HAVE_SYMLINK.
8630
8631         * src/rtapelib.c (rmt_open__):
8632         Remove typo that caused us to omit the first char
8633         of the basename.
8634
8635 1999-07-16  Paul Eggert  <eggert@twinsun.com>
8636
8637         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.13.3.
8638
8639         * doc/tar.texi: A path name is excluded if any of its file name
8640         components matches an excluded pattern, even if the path name was
8641         specified on the command line.
8642         * src/create.c (create_archive): Likewise.
8643         * src/list.c (read_and): Likewise.
8644         * src/update.c (update_archive): Likewise.
8645         * lib/exclude.h (excluded_pathname): New decl.
8646         * lib/exclude.c (_GNU_SOURCE): Define.
8647         (FILESYSTEM_PREFIX_LEN, ISSLASH): New macros.
8648         (excluded_filename_opts): New function.
8649         (excluded_pathname): New function.
8650
8651         * lib/Makefile.am (EXTRA_DIST):
8652         xstrtol.c moved here from libtar_a_SOURCES.
8653         (libtar_a_SOURCES): Move xstrtol.c to EXTRA_DIST.
8654         Remove xstrtoul.c; no longer needed.
8655         * lib/xstrtol.c: Remove.
8656
8657         * src/tar.c (decode_options):
8658         Set newer_time_option to TYPE_MINIMUM, so that
8659         negative timestamps are handled correctly.
8660         Replace invocations of xstrtol and xstrtoul with xstrtoumax, for
8661         uniformity (and so that we don't need to have the other fns).
8662         (main): Remove call to init_total_written; no longer needed.
8663
8664         * configure.in (AC_CHECK_SIZEOF): Remove no-longer-needed
8665         checks for unsigned long and long long.
8666         * src/arith.c: Remove.
8667         * src/Makefile.am (tar_SOURCES): Remove arith.c.
8668         * po/POTFILES.in: Remove src/arith.c.
8669         * src/arith.h: Use double, to simplify configuration gotchas.
8670         (tarlong): Now double.
8671         (TARLONG_FORMAT): New macro.
8672         (BITS_PER_BYTE, BITS_PER_TARLONG, SUPERDIGIT, BITS_PER_SUPERDIGIT,
8673         LONGS_PER_TARLONG, SIZEOF_TARLONG, struct tarlong,
8674         zerop_tarlong_helper, lessp_tarlong_helper, clear_tarlong_helper,
8675         add_to_tarlong_helper, mult_tarlong_helper, print_tarlong_helper,
8676         zerop_tarlong, lessp_tarlong, clear_tarlong, add_to_tarlong,
8677         mult_tarlong, print_tarlong): Remove.  All callers replaced with
8678         arithmetic ops.
8679
8680         * src/common.h (init_total_written): Remove decl.
8681
8682         * src/buffer.c (total_written):
8683         Remove; replaced with prev_written + bytes_written.
8684         (prev_written): New var.
8685         (init_total_written): Remove.
8686         (print_total_written): Use TARLONG_FORMAT instead of print_tarlong.
8687
8688         * m4/ulonglong.m4 (jm_AC_TYPE_UNSIGNED_LONG_LONG):
8689         Make sure that we can shift, multiply
8690         and divide unsigned long long values; Ultrix cc can't do it.
8691
8692         * lib/modechange.c (mode_compile): Use uintmax_t, not unsigned long.
8693         Check for any unknown bits, not just unknown bits left of the leftmost
8694         known bit.
8695
8696         * lib/quotearg.c (quotearg_buffer):
8697         Don't quote spaces if C quoting style.
8698         * src/list.c (from_oct):
8699         Use C quoting style for error; omit trailing NULs.
8700
8701 1999-07-14  Paul Eggert  <eggert@twinsun.com>
8702
8703         * configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.2.
8704
8705         * m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX): Check whether
8706         <inttypes.h> defines strtoumax as a macro (and not as a function).
8707         HP-UX 10.20 does this.
8708
8709         * src/tar.c (usage): tar-bugs@gnu.org -> bug-tar@gnu.org
8710         * PORTS, README, TODO, doc/tar.texi: Likewise.
8711
8712 1999-07-12  Paul Eggert  <eggert@twinsun.com>
8713
8714         * configure.in (AM_INIT_AUTOMAKE): Version 1.13.1.
8715         (LIBOBJS): Add mktime.o to automake 1.4 bug workaround.
8716
8717         * src/list.c (decode_header):
8718         Do not assume that S_IFBLK and S_IFCHR are defined.
8719
8720         * src/create.c (start_header): Do not assume S_IFMT is defined.
8721         (dump_file): Remove unnecessary check for screwy apollo lossage.
8722         Do not assume S_IFBLK and S_IFCHR are defined.
8723
8724         * src/extract.c (extract_archive):
8725         Test whether S_IFCHR and S_IFBLK are nonzero,
8726         not whether they are defined, for consistency with other tests.
8727
8728         * src/buffer.c (is_regular_file):
8729         Don't succeed on files that we can't access due to
8730         permissions problems.
8731         (open_archive): Fix wording on fatal error message.
8732         Don't bother to stat /dev/null if the archive is not a character
8733         special device.
8734
8735         * src/compare.c (process_rawdata, diff_sparse_files, diff_archive):
8736         Report an error, not a warning, for I/O errors.
8737         (process_rawdata, process_dumpdir, diff_sparse_files):
8738         Change ungrammatical "Data differs" to "Contents differ".
8739         (get_stat_data): Find hidden files on AIX.
8740         Accept file name as argument; all uses changed.
8741         (get_stat_data, diff_archive): Use system error message for
8742         nonexistent files rather than rolling our own.
8743         (diff_archive): Unknown file types are errors, not warnings.
8744         Normalize spelling of message to "File type differs".
8745         Use get_stat_data to get link status, for consistency.
8746         Do not inspect st_rdev for fifos.
8747         Do not assume st_mode values contain only file types and mode bits.
8748         Check for mode changes and device number changes separately.
8749
8750         * src/update.c (append_file):
8751         Open the file before statting it, to avoid a race.
8752         Complain about file shrinkage only when we reach EOF.
8753
8754 1999-07-08  Paul Eggert  <eggert@twinsun.com>
8755
8756         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13 released.
8757
8758         * configure.in (AC_EXEEXT): Add.
8759
8760         * lib/Makefile.am (noinst_HEADERS):
8761         Add basename.h, exclude.h.  Remove full-write.h.
8762         (libtar_a_SOURCES): Add exclude.c.
8763
8764         * lib/basename.h, lib/exclude.c, lib/exclude.h, lib/safe-read.h:
8765         New files.
8766         * lib/full-write.c: Include safe-read.h instead of full-write.h.
8767         * lib/safe-read.h (safe_read): New decl.
8768         * src/rmt.c: Include safe-read.h.
8769         * src/rtapelib.c: Include basename.h, save-read.h.
8770         (rmt_open__): Use base_name to compute base name.
8771
8772         * src/common.h:
8773         Include basename.h, exclude.h; don't include full-write.h.
8774         (exclude_option): Remove decl.
8775         (excluded): New decl.
8776         (add_exclude, add_exclude_file, check_exclude): Remove decls.
8777
8778         * src/list.c (read_and):
8779         Use excluded_filename instead of check_exclude.
8780         Check base name of incoming file name, not entire file name, when
8781         deciding whether to exclude it.
8782
8783         * src/create.c (finish_sparse_file):
8784         Use excluded_filename instead of check_exclude.
8785         Don't bother to stat excluded file names.
8786         * src/incremen.c (get_directory_contents): Likewise.
8787
8788         * src/names.c (exclude_pool, exclude_pool_size,
8789         allocated_exclude_pool_size, simple_exclude_array,
8790         simple_excludes, allocated_simple_excludes,
8791         pattern_exclude_array, pattern_excludes,
8792         allocated_pattern_excludes, add_exclude, add_exclude_file,
8793         check_exclude):
8794         Remove; now done in ../lib/exclude.c.
8795
8796         * src/tar.c (decode_options): Initialize `excluded'.
8797         Use new add_exclude_file and add_exclude functions.
8798
8799 1999-07-05  Paul Eggert  <eggert@twinsun.com>
8800
8801         * m4/gettext.m4: Use changequote rather than [[ ]].
8802
8803         * lib/safe-read.c: Renamed from lib/full-read.c.
8804         (safe_read): Renamed from full_read.  All uses changed.
8805         * lib/safe-read.h, lib/full-write.h: New files.
8806         * lib/Makefile.am (noinst_HEADERS): Add full-write.h, safe-read.h.
8807         (libtar_a_SOURCES): Rename full-read.c to safe-read.c.
8808         * lib/full-write.c: Include full-write.h.
8809         * src/common.h: Include full-write.h, safe-read.h.
8810         * src/system.h: (full_read, full_write): Remove decls.
8811
8812         * src/Makefile.am (datadir): New var; needed for Solaris gettext.
8813
8814         * src/system.h (bindtextdomain, textdomain): undef before
8815         defining, to avoid preprocessor warnings with --disable-nls
8816         on hosts whose locale.h includes libintl.h.
8817
8818         * lib/xstrtol.c (__strtol): Remove decl; it doesn't work if __strtol
8819         expands to a macro, which occurs in HP-UX 10.20 with strtoumax.
8820         (strtol, strtoul): New decls (for pre-ANSI hosts), to replace
8821         the above decl.
8822
8823 1999-07-02  Paul Eggert  <eggert@twinsun.com>
8824
8825         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/mktime.m4.
8826         * m4/mktime.m4: New file.
8827         * m4/Makefile.am.in, m4/README: Remove these files.
8828         * m4/Makefile.am (EXTRA_DIST): Add mktime.m4;
8829         remove README, Makefile.am.in.
8830         (Makefile.am): Remove rule; it didn't work in BSD/OS 4.0.
8831         * m4/jm-mktime.m4 (jm_FUNC_MKTIME): Invoke AC_FUNC_MKTIME,
8832         not AM_FUNC_MKTIME.
8833
8834         * src/tar.c: Include signal.h.
8835         (SIGCHLD): Define to SIGCLD if SIGCLD is defined but SIGCHLD is not.
8836         (main): Ensure SIGCHLD is not ignored.
8837
8838         (BACKUP_OPTION, DELETE_OPTION, EXCLUDE_OPTION, GROUP_OPTION,
8839         MODE_OPTION, NEWER_MTIME_OPTION, NO_RECURSE_OPTION, NULL_OPTION,
8840         OWNER_OPTION, POSIX_OPTION, PRESERVE_OPTION, RECORD_SIZE_OPTION,
8841         RSH_COMMAND_OPTION, SUFFIX_OPTION, USE_COMPRESS_PROGRAM_OPTION,
8842         VOLNO_FILE_OPTION, OBSOLETE_ABSOLUTE_NAMES,
8843         OBSOLETE_BLOCK_COMPRESS, OBSOLETE_BLOCKING_FACTOR,
8844         OBSOLETE_BLOCK_NUMBER, OBSOLETE_READ_FULL_RECORDS, OBSOLETE_TOUCH,
8845         OBSOLETE_VERSION_CONTROL): Make sure they can't be valid chars, so
8846         they don't overlap with char codes.  Use an enum instead of a lot
8847         of #defines.
8848
8849         * src/system.h (ISASCII): Remove.
8850         (CTYPE_DOMAIN, ISDIGIT, ISODIGIT, ISPRINT, ISSPACE, S_ISUID,
8851         S_ISGID, S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP,
8852         S_IROTH, S_IWOTH, S_IXOTH, MODE_WXUSR, MODE_R, MODE_RW,
8853         MODE_RWX, MODE_ALL, SEEK_SET, SEEK_CUR, SEEK_END, CHAR_MAX,
8854         LONG_MAX): New macros.
8855
8856         * src/incremen.c (ISDIGIT, ISSPACE): Remove; now in system.h.
8857         (read_directory_file): Cast ISSPACE arg to unsigned char.
8858         * src/misc.c (ISPRINT): Remove; now in system.h.
8859         (remove_any_file): Add brackets to pacify gcc -Wall.
8860         * src/list.c: Don't include <ctype.h>; system.h already does this.
8861         (ISODIGIT, ISSPACE): Remove; now in system.h.
8862         (decode_header): No need to AND mode with 07777; MODE_FROM_OCT
8863         does this now.
8864         (from_oct): Cast ISSPACE arg to unsigned char.
8865
8866         * src/create.c (mode_to_oct): Translate modes from internal to
8867         external form.
8868         * src/list.c (mode_from_oct): Translate modes from external to
8869         internal form.  Do not complain about unrecognized mode bits.
8870         * src/common.h (TSUID, TSGID, TSVTX, TUREAD, TUWRITE, TUEXEC,
8871         TGREAD, TGWRITE, TGEXEC, TOREAD, TOWRITE, TOEXEC): Remove undefs.
8872
8873         * src/extract.c: (extr_init, make_directories, extract_archive):
8874         Do not assume mode bits have traditional Unix values.
8875         * src/list.c (decode_mode): Likewise.
8876         * src/create.c (start_header, dump_file): Likewise.
8877         * src/buffer.c (child_open_for_compress,
8878         child_open_for_uncompress, open_archive, (close_archive): Likewise.
8879         * src/compare.c (diff_archive): Likewise.
8880
8881         * src/extract.c (set_mode): Use %04 not %0.4 format.
8882         (extract_sparse_file): Do not use data_block uninitialized.
8883         Check for lseek failures.
8884
8885         * src/rtapelib.c (rmt_lseek__):
8886         Convert lseek whence values to portable integers on the wire.
8887         * src/rmt.c (main): Likewise.  Check for whence values out of range.
8888
8889         * src/create.c (finish_sparse_file): Use lseek whence macros
8890         instead of integers.
8891         * src/buffer.c (backspace_output): Likewise.
8892         * src/compare.c (diff_archive, verify_volume): Likewise.
8893         * src/delete.c (move_archive): Likewise.
8894         * src/extract.c (extract_sparse_file): Likewise.
8895
8896         * src/create.c (dump_file): Do not invoke finish_sparse_file
8897         on a negative file descriptor.
8898
8899         * src/buffer.c: Add braces to pacify gcc -Wall.
8900
8901         * src/compare.c (diff_sparse_files): Report lseek errors.
8902
8903         * configure.in (ALL_LINGUAS): Add cs, es, ru.
8904
8905         * PORTS, TODO: gnu.ai.mit.edu -> gnu.org
8906
8907         * src/arith.c, src/buffer.c (new_volume): Don't put ^G in
8908         message to be internationalized; \a doesn't work with msgfmt.
8909
8910         * src/tar.c (long_options, main, usage, OPTION_STRING):
8911         Remove -E or --ending-file.
8912         * src/list.c (read_and): Likewise.
8913         * src/common.h (ending_file_option): Likewise.
8914         * src/buffer.c (close_archive): Likewise.
8915
8916         * tests/after: Don't run two commands together in a pipeline,
8917         as some old shells mishandle pipeline exit status.
8918
8919 1999-06-28  Paul Eggert  <eggert@twinsun.com>
8920
8921         * configure.in (AM_INIT_AUTOMAKE): version 1.12.64015.
8922         * NEWS: Describe changes since 1.12.
8923         * README: Update bug reporting address; move paxutils ref to NEWS.
8924
8925         Handle EINTR correctly.
8926         * lib/Makefile.am (libtar_a_SOURCES): Add full-read.c, full-write.c.
8927         * lib/full-read.c, lib/full-write.c: New files.
8928         * src/buffer.c (child_open_for_compress, child_open_for_uncompress):
8929         Prefer full_read to read and full_write to write.
8930         * src/compare.c (process_rawdata, diff_sparse_files): Likewise.
8931         * src/create.c (deal_with_sparse, finish_sparse_file, dump_file):
8932         Likewise.
8933         * src/extract.c (extract_sparse_file): Likewise.
8934         * src/rmt.c (get_string, main, report_error_message,
8935         report_numbered_error): Likewise.
8936         * src/rmt.h (rmtread, rmtwrite): Likewise.
8937         * src/rtapelib.c (do_command, get_status_string, rmt_read__,
8938         rmt_write__, rmt_ioctl__): Likewise.
8939         * src/update.c (append_file): Likewise.
8940         * src/system.h (full_read, full_write): New decls.
8941
8942         * po/POTFILES.in: Add lib/argmatch.c, lib/error.c lib/getopt.c,
8943         lib/xmalloc.c, src/arith.c, src/misc.c.
8944
8945         * src/system.h (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO):
8946         New macros.  All uses of STDIN and STDOUT changed.
8947         * src/rmt.c (prepare_record_buffer, main): Use STDIN_FILENO
8948         instead of 0 and STDOUT_FILENO instead of 1.
8949         * src/rtapelib.c (_rmt_rexec): Use STDIN_FILENO and STDOUT_FILENO
8950         instead of fileno (stdin) and fileno (stdout) or 0 and 1.
8951
8952         * src/rmt.c (private_strerror): Avoid const.  Translate results.
8953
8954         * tests/Makefile.am (TESTS): Remove incremen.sh; it doesn't work
8955         in the presence of NFS clock skew.
8956
8957 1999-06-25  Paul Eggert  <eggert@twinsun.com>
8958
8959         * configure.in (AM_INIT_AUTOMAKE): version 1.12.64014.
8960
8961         * src/buffer.c (write_archive_buffer): New function.
8962         (child_open_for_compress, flush_write, flush_read): Use it to write
8963         buffers.
8964         (open_archive): Report error if fstat of archive fails.
8965         Improve efficiency of check for /dev/null.
8966         Also, fix some corner cases with remote archives and /dev/null checking.
8967         (close_archive): Test for input fifo only if not remote.
8968         Truncate output archive only if it's not remote.
8969
8970         * src/misc.c (remove_any_file):
8971         Don't terminate if you see . or ..; just skip them.
8972
8973 1999-06-18  Paul Eggert  <eggert@twinsun.com>
8974
8975         * configure.in (AM_INIT_AUTOMAKE): version 1.12.64013.
8976
8977         Output sizes using a format that's more compatible with
8978         traditional tar (and with GNU Emacs).
8979         * src/common.h (GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT,
8980         MODE_TO_OCT, SIZE_TO_OCT, UID_TO_OCT, UINTMAX_TO_OCT):
8981         Don't subtract 1 from size.
8982         * src/create.c (to_oct): Prepend leading zeros, not spaces.
8983         Output a trailing NUL unless the value won't fit without it.
8984         (finish_header): No need to append NUL to chksum, now that
8985         to_oct is doing it.
8986
8987 1999-06-16  Paul Eggert  <eggert@twinsun.com>
8988
8989         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64012.
8990
8991         * src/Makefile.am (LDADD): Link libtar.a after @INTLLIBS@, since
8992         @INTLLIBS@ might invoke rpl_realloc.
8993
8994         * src/tar.c (backup_type): Remove decl; backupfile.h now has it.
8995         (intconv): Remove; use xstrto* fns instead.
8996         ("xstrtol.h"): Include.
8997         (check_decimal): Remove.
8998         (long_options, usage, OPTION_STRING, decode_options):
8999         Remove -y, --bzip2, --unbzip2.
9000         (decode_options): Use xget_version instead of get_version.
9001         Check for overflow with -b and -L and RECORD_SIZE_OPTION.
9002         Replace invocations of check_decimal  with xstrtoumax.
9003
9004         * tests/preset.in (echo_n, echo_c): Remove.
9005
9006         * tests/after: Don't rely on $echo_c and $echo_n.
9007
9008         * lib/addext.c, lib/dirname.c, lib/lchown.c, lib/lchown.h,
9009         lib/malloc.c, lib/mktime.c, lib/realloc.c, lib/strtol.c, lib/strtoul.c,
9010         lib/strtoull.c, lib/strtoumax.c, lib/utime.c, lib/xstrtol.c,
9011         lib/xstrtol.h, lib/xstrtoul.c, lib/xstrtoumax.c,
9012         m4/Makefile.am.in, m4/README, m4/ccstdc.m4, m4/d-ino.m4,
9013         m4/gettext.m4, m4/inttypes_h.m4, m4/isc-posix.m4,
9014         m4/jm-mktime.m4, m4/largefile.m4, m4/lcmessage.m4,
9015         m4/malloc.m4, m4/progtest.m4, m4/realloc.m4, m4/uintmax_t.m4,
9016         m4/ulonglong.m4, m4/utimbuf.m4, m4/utime.m4, m4/utimes.m4,
9017         m4/xstrtoumax.m4: New files.
9018
9019         * configure.in(fp_PROG_ECHO): Remove; no longer needed.
9020         (AC_SYS_LARGEFILE): Renamed from AC_LFS.
9021         (jm_AC_HEADER_INTTYPES_H): Replaces inline code.
9022         (jm_STRUCT_DIRENT_D_INO, jm_AC_TYPE_UINTMAX_T, jm_AC_PREREQ_XSTRTOUMAX): Add.
9023         (AC_CHECK_FUNCS): Remove lchown.
9024         (AC_REPLACE_FUNCS): Remove basename, dirname.
9025         Add lchown, strtol, strtoul.
9026         (jm_FUNC_MKTIME): Add.
9027         (LIBOBJS): Replace .o with $U.o, so that the .o files in LIBOBJS
9028         are also built via the ANSI2KNR-filtering rules.
9029         Use a no-op line to work around bug in automake 1.4 with malloc and
9030         realloc.
9031         (AC_OUTPUT): Add m4/Makefile.
9032
9033         * lib/Makefile.am (EXTRA_DIST):
9034         Add lchown.c, malloc.c, mktime.c, realloc.c,
9035         strtol.c, strtoul.c, strtoull.c, strtoumax.c, utime.c.
9036         (noinst_HEADERS): Add lchown.h, modechange.h, xstrtol.h.
9037         (libtar_a_SOURCES): Add addext.c, basename.c, xstrtol.c,
9038         xstrtoul.c, xstrtoumax.c.  Remove getversion.c.
9039         ($(srcdir)/getdate.c:): Remove `expect conflicts' line.
9040
9041         * src/system.h (uintmax_t): Don't declare; configure now does this.
9042
9043         * src/common.h (backup_type): New decl.
9044         * src/common.h, src/misc.c, src/tar.c:
9045         Move include of backupfile.h to common.h.
9046
9047         * src/misc.c (maybe_backup_file):
9048         Pass backup_type to find_backup_file_name.
9049
9050         * src/list.c (print_header): Change sizes of uform and gform from 11 to
9051         UINTMAX_STRSIZE_BOUND.
9052
9053         * doc/tar.texi: Remove --bzip2.
9054         Fix @xref typos reported by latest makeinfo.
9055
9056         * Makefile.am (ACLOCAL_AMFLAGS): New macro.
9057         (SUBDIRS): Add m4.
9058         (M4DIR, ACINCLUDE_INPUTS): New macros.
9059         ($(srcdir)/acinclude.m4): New rule.
9060
9061         * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT,
9062         HAVE_INTTYPES_H, HAVE_LC_MESSAGES, HAVE_STPCPY): Remve #undefs;
9063         now generated automatically by autoconf.
9064
9065 1999-05-15  Paul Eggert  <eggert@twinsun.com>
9066
9067         * doc/tar.texi: Remove -y.
9068
9069 1999-04-09  Paul Eggert  <eggert@twinsun.com>
9070
9071         * src/system.h (INT_STRLEN_BOUND): Fix off-by-factor-of-10 typo
9072         (we were allocating too much storage).
9073         (uintmax_t): Don't declare; configure now does this.
9074
9075         * ABOUT-NLS: Update to gettext 0.10.35 edition.
9076
9077 1999-03-22  Paul Eggert  <eggert@twinsun.com>
9078
9079         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64010
9080
9081         * acinclude.m4 (AC_LFS_FLAGS):
9082         Don't use -mabi=n32 with GCC on IRIX 6.2; it's the default.
9083         (AC_LFS): -n32, -o32, and -n64 are CPPFLAGS, not CFLAGS.
9084         (jm_FUNC_MALLOC, jm_FUNC_REALLOC): New macros.
9085
9086         * configure.in (jm_FUNC_MALLOC, jm_FUNC_REALLOC):
9087         New macros; needed for latest GNU xmalloc.c.
9088
9089         * Makefile.am (noinst_HEADERS): Add quotearg.h, xalloc.h.
9090         (libtar_a_SOURCES): Add quotearg.c.
9091         * list.c: Include <quotearg.h>.
9092         (from_oct): Add forward decl.
9093         (read_header): Return HEADER_FAILURE if we can't parse the checksum.
9094         (from_oct): Report an error only if TYPE is nonzero.
9095         Quote any funny characters in bad header.
9096
9097 1999-03-20  Paul Eggert  <eggert@twinsun.com>
9098
9099         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64009
9100
9101         * acinclude.m4 (AC_LFS_FLAGS): Add support for IRIX 6.2 and later.
9102         (AC_LFS_SPACE_APPEND): Assume $2 is quoted properly; all callers
9103         changed.
9104         (AC_LFS): Simplify AIX revision number test.
9105
9106 1999-03-17  Paul Eggert  <eggert@twinsun.com>
9107
9108         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64008
9109
9110         * configure.in (AC_VALIDATE_CACHED_SYSTEM_TUPLE):
9111         Remove; it doesn't work that well
9112         with AC_CANONICAL_HOST.
9113         (fp_WITH_INCLUDED_MALLOC): Remove; we'll just use the system malloc.
9114
9115         * Makefile.am (EXTRA_DIST): Remove AC-PATCHES, AM-PATCHES, BI-PATCHES.
9116
9117         * Makefile.am (EXTRA_DIST): Remove gmalloc.c.
9118
9119         * acinclude.m4 (fp_WITH_INCLUDED_MALLOC): Remove.
9120
9121         * tar.texi: Fix bug-report addr.
9122
9123         * README: Remove --with-included-malloc.
9124         Upgrade version numbers of build software.
9125
9126 1999-03-07  Paul Eggert  <eggert@twinsun.com>
9127
9128         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64007.
9129
9130         * acinclude.m4 (AM_WITH_NLS): Port to Solaris 2.5.1,
9131         where bindtextdomain and gettext require -lintl.
9132         (AC_LFS_FLAGS): Simplify so that it only gets the flags;
9133         `no' means it failed.
9134         (AC_LFS_SPACE_APPEND, AC_LFS_MACRO_VALUE): New macros.
9135         (AC_LFS): Use them.  Set _FILE_OFFSET_BITS, _LARGEFILE_SOURCE, and
9136         _LARGE_FILES from LFS_CFLAGS, so that in the normal case we don't need
9137         to add anything to the command line (it's all in config.h).
9138         Put any extra -D and -I options into CPPFLAGS, the rest into CFLAGS.
9139
9140 1999-03-01  Paul Eggert  <eggert@twinsun.com>
9141
9142         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64006.
9143
9144         * acinclude.m4 (AC_LFS_FLAGS): Port to AIX 4.2.
9145
9146         * src/list.c: (gid_from_oct, major_from_oct, minor_from_oct,
9147         mode_from_oct, off_from_oct, size_from_oct, time_from_oct,
9148         uid_from_oct, uintmax_from_oct): Use TYPE_MAXIMUM instead of macros
9149         like OFF_MAX, which are not reliable
9150         (e.g. OFF_MAX in AIX 4.2 is incorrect).
9151         * src/system.h (GID_MAX, MAJOR_MAX, MINOR_MAX, MODE_MAX, OFF_MAX,
9152         SIZE_MAX, TIME_MAX,UID_MAX, UINTMAX_MAX):  Remove; no longer used.
9153
9154         * src/incremen.c (get_directory_contents):
9155         Don't use statx if _LARGE_FILES; it doesn't work under AIX 4.2.
9156         Have statx depend on STX_HIDDEN, not AIX.
9157
9158         * src/create.c (to_oct):
9159         New parameter substitute, giving a substitute value to use
9160         when the original value is out of range.  Do not append a space to the
9161         output; modern tars don't.  When a value is out of range, specify the
9162         maximum value, not the number of bits.
9163         (GID_NOBODY, UID_NOBODY): New macros.
9164         (gid_to_oct, uid_to_oct): Use them as substitutes.
9165         (finish_header): Do not assume that UINTMAX_TO_OCT appends a space.
9166         (dump_file): Check whether the file changed as we read it.
9167
9168         * src/rmt.c (main): Remove suspicious AIX/386 code.
9169
9170 1999-02-19  Paul Eggert  <eggert@twinsun.com>
9171
9172         * intl/localealias.c (read_alias_file): Don't assume that memcpy
9173         returns a type compatible with char *; it doesn't on SunOS
9174         4.1.4 with Sun cc, since <string.h> doesn't declare memcpy.
9175
9176         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64005.
9177
9178         * src/tar.c (long_options, usage): Prefer --unbzip2 to --bunzip2.
9179         * doc/tar.texi: Add --bzip2, --unbzip2 options.
9180
9181         * configure.in (AC_CANONICAL_HOST, AC_VALIDATE_CACHED_SYSTEM_TUPLE):
9182         Add.
9183         (AC_LINK_FILES): Omit; AM_GNU_GETTEXT now does this.
9184         (AC_OUTPUT): Omit munging of po/Makefile; AM_GNU_GETTEXT now does this.
9185         * acinclude.m4 (AM_WITH_NLS):
9186         Update to latest gettext version (serial 5).
9187         (AC_LFS_FLAGS): New macro
9188         (AC_LFS): Use it.  Append to CFLAGS, LDFLAGS, LDLIBS instead of
9189         working only with unset variables.  Append to CFLAGS, not CPPFLAGS.
9190         Work properly in cross-compilation scenario, by checking for getconf
9191         with AC_CHECK_TOOL and by ditching uname in favor of
9192         AC_CANONICAL_HOST and $host_os.  Add --disable-lfs option.
9193
9194         * lib/getdate.y: Update to fileutils 4.0 getdate.y, with one patch:
9195         replace FORCE_ALLOCA_H with HAVE_ALLOCA_H.
9196         * lib/Makefile.am (AUTOMAKE_OPTIONS): Append ../src/ansi2knr,
9197         since getdate.y now uses ANSI code.
9198
9199         * config.guess, config.sub: New files; taken from automake 1.4.
9200
9201         * intl/Makefile.in, intl/VERSION, intl/bindtextdom.c,
9202         intl/cat-compat.c, intl/dcgettext.c, intl/dgettext.c,
9203         intl/explodename.c, intl/finddomain.c, intl/gettext.c,
9204         intl/gettext.h, intl/gettextP.h, intl/hash-string.h,
9205         intl/l10nflist.c, intl/libgettext.h, intl/loadinfo.h,
9206         intl/loadmsgcat.c, intl/localealias.c, intl/textdomain.c:
9207         Update to GNU gettext 0.10.35, with patches as per GCC snapshot 990109.
9208
9209 1999-02-01  Paul Eggert  <eggert@twinsun.com>
9210
9211         * src/tar.c: Update copyright.
9212
9213         * NEWS: 1.12.64004
9214
9215 1999-02-01  Paul Eggert  <eggert@twinsun.com>
9216
9217         * NEWS, configure.in: Version 1.12.64004
9218
9219         * configure.in (AC_LFS): Use this macro, instead of open-coding it.
9220
9221         * acinclude.m4 (AC_LFS, AM_PROG_CC_STDC): New macros.
9222
9223         * src/extract.c (extract_archive): Fix bug when extracting sparse
9224         files: they were trashing the tar file header.
9225
9226         * src/tar.c: (long_options, usage, OPTION_STRING, decode_options):
9227         Add -y or --bzip2 or --bunzip2 option.
9228
9229 1999-01-30  Paul Eggert  <eggert@twinsun.com>
9230
9231         * src/names.c (cached_no_such_uname, cached_no_such_gname,
9232         cached_no_such_uid, cached_no_such_gid): New vars.
9233         (uid_to_uname, gid_to_gname, uname_to_uid, gname_to_gid):
9234         Cache failures, too.
9235
9236         * src/tar.c (decode_options):
9237         Don't pass names longer than UNAME_FIELD_SIZE to
9238         uname_to_uid, as it messes up the cache.  Similarly for gname_to_uid.
9239
9240 1999-01-27  Paul Eggert  <eggert@twinsun.com>
9241
9242         * NEWS, configure.in: Version 1.12.64003
9243
9244         * src/buffer.c (backspace_output, close_archive):  Cast
9245         rmtlseek position arg to off_t, for benefit of K&R compilers
9246         with long long.
9247         * src/compare.c (verify_volume): Likewise.
9248
9249         * NEWS, configure.in: Version 1.12.64002
9250
9251         * src/create.c (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct,
9252         off_to_oct, size_to_oct, time_to_oct, uid_to_oct):
9253         Cast arg to uintmax_t for benefit of pre-ANSI compilers with long long.
9254         * src/list.c: (gid_from_oct, major_from_oct, minor_from_oct,
9255         mode_from_oct, off_from_oct, size_from_oct, time_from_oct,
9256         uid_from_oct): Likewise.
9257
9258 1999-01-25  Paul Eggert  <eggert@twinsun.com>
9259
9260         * incremen.sh: Fix timing bug in regression test.
9261
9262 1999-01-22  Paul Eggert  <eggert@twinsun.com>
9263
9264         * NEWS, configure.in: Update version
9265
9266         * Makefile.am (localedir): Change to $(datadir)/locale.
9267         (DEFS): New macro, defining LOCALEDIR.
9268         (tar.o, tar._o, rmt.o, rmt._o): Remove.
9269         (INCLUDES): Add -I..
9270
9271         * Makefile.am (localedir): Change to $(datadir)/locale.
9272
9273 1999-01-21  Paul Eggert  <eggert@twinsun.com>
9274
9275         * NEWS, README, configure.in: Unofficial version 1.12.64001.
9276
9277         * tests/Makefile.am (localedir): Change to $(datadir)/locale.
9278         * src/Makefile.am (localedir): Likewise.
9279         (DEFS): New macro, defining LOCALEDIR.
9280         (tar.o, tar._o, rmt.o, rmt._o): Remove.
9281         (INCLUDES): Add `-I..'.
9282
9283         * tests/incremen.sh: Fix timing bug.
9284
9285 1999-01-20  Paul Eggert  <eggert@twinsun.com>
9286
9287         * NEWS, README, configure.in: Unofficial version 1.12.64000.
9288         `lfs.7' changed to `64000' in version number
9289         to conform to gnits standards.
9290
9291         * COPYING, INSTALL, doc/texinfo.tex, install-sh, missing,
9292         mkinstalldirs, ansi2knr.c: Update to latest public versions.
9293
9294         Rebuild with automake 1.4 and autoconf 2.13, to work around some
9295         porting problems.
9296
9297 1998-12-07  Paul Eggert  <eggert@twinsun.com>
9298
9299         * NEWS, README, configure.in: Unofficial version 1.12.lfs.6.
9300
9301         * src/list.c (read_header):
9302         Accept file names as specified by POSIX.1-1996 section 10.1.1.
9303
9304 1998-11-30  Paul Eggert  <eggert@twinsun.com>
9305
9306         * configure.in: Quote the output of uname.
9307
9308         * src/extract.c (set_stat): chmod after chown even when not root;
9309         if we are using --same-owner this is needed e.g. on Solaris 2.5.1.
9310
9311 1998-11-15  Paul Eggert  <eggert@twinsun.com>
9312
9313         * NEWS, README, configure.in: Unofficial version 1.12.lfs.5.
9314
9315         * configure.in (ac_test_CPPFLAGS, ac_test_LDFLAGS, ac_test_LIBS,
9316         ac_getconfs, ac_result): Special case for HP-UX 10.20 or later.
9317
9318 1998-10-28  Paul Eggert  <eggert@twinsun.com>
9319
9320         * NEWS, README, configure.in: Unofficial version 1.12.lfs.4.
9321
9322         * src/system.h (voidstar): Use void * if __STDC__ is defined,
9323         not merely nonzero.
9324
9325         * src/rtapelib.c: Don't use rexec code unless compiled with WITH_REXEC.
9326         On many installations, rexec is disabled.
9327
9328 1998-08-07  Paul Eggert  <eggert@twinsun.com>
9329
9330         * NEWS, README, configure.in: Unofficial version 1.12.lfs.3.
9331
9332         * src/names.c (uid_to_uname, gid_to_gname): Don't used cached name
9333         for nameless users and groups.
9334
9335 1998-02-17  Paul Eggert  <eggert@twinsun.com>
9336
9337         * NEWS, README, configure.in: Unofficial version 1.12.lfs.2.
9338         * NEWS, README: Add explanation of why this isn't an official version.
9339
9340 1998-02-02  Paul Eggert  <eggert@twinsun.com>
9341
9342         * NEWS, README, configure.in: Unofficial version 1.12.lfs.1.
9343         This is an unofficial version.
9344
9345 1997-12-17  Paul Eggert  <eggert@twinsun.com>
9346
9347         * src/incremen.c (ST_DEV_MSB): New macro.
9348         (NFS_FILE_STAT): Use most significant bit of st_dev,
9349         even if it's unsigned.
9350
9351 1997-12-08  Paul Eggert  <eggert@twinsun.com>
9352
9353         * src/system.h (ST_NBLOCKS): Fix typo in definition.
9354
9355 1997-11-19  Paul Eggert  <eggert@twinsun.com>
9356
9357         * configure.in (HAVE_INTTYPES_H):
9358         Don't ignore cache variable if it's already set.
9359
9360 1997-11-10  Paul Eggert  <eggert@twinsun.com>
9361
9362         * src/rmt.c (main): Don't assume mt_count is of type daddr_t.
9363         * src/delete.c (records_read): Now off_t.
9364         (move_archive): Don't assume mt_count is of type daddr_t.
9365
9366 1997-10-30  Paul Eggert  <eggert@twinsun.com>
9367
9368         * configure.in (CPPFLAGS, LDFLAGS, LIBS):
9369         Set to appropriate values if large file support
9370         needs explicit enabling.
9371         (HAVE_INTTYPES_H, HAVE_ST_FSTYPE_STRING, daddr_t, major_t, minor_t,
9372         ssize_t):
9373         New macros to configure.
9374         (AC_TYPE_MODE_T, AC_TYPE_PID_T, AC_TYPE_OFF_T): Add.
9375
9376         * acconfig.h (daddr_t, HAVE_INTTYPES_H, HAVE_ST_FSTYPE_STRING,
9377         major_t, minor_t, ssize_t): New macros.
9378
9379         * src/arith.h (TARLONG_FORMAT):
9380         Fix typo: %uld -> %lu.  Use unsigned when long long
9381         (%lld -> %llu).
9382         (add_to_tarlong_helper, mult_tarlong_helper): 2nd arg is now unsigned long.
9383         (add_to_tarlong, mult_tarlong): Cast 2nd arg to unsigned long.
9384
9385         * src/arith.c (add_to_tarlong_helper, mult_tarlong_helper):
9386         2nd arg is now unsigned long.
9387
9388         * src/rmt.c (allocated_size): Now size_t, and now initialized to 0.
9389         (prepare_record_buffer): Arg is now size_t.
9390         Remove now-useless casts.
9391
9392         (main): Use `long' for status, so that it can store ssize_t.
9393         Use daddr_t, mode_t, size_t, off_t when appropriate.
9394         Convert daddr_t and off_t values ourselves, since they might be longer
9395         than long.  Convert other types using `long' primitives.
9396         When processing MTIOCTOP, do not try to pass resulting
9397         count back, since it won't work (it could be too large) and it's
9398         not expected anyway.
9399
9400         * src/update.c:
9401         (append_file) Use off_t, size_t, ssize_t when appropriate.  Remove
9402         now-useless casts.  Use unsigned long to print *_t types, except use
9403         STRINGIFY_BIGINT for off_t.
9404         (update_archive): Cast -1 to dev_t when necessary.
9405
9406         * src/tar.c (check_decimal):
9407         Now returns 1 if successful, 0 otherwise, and returns
9408         uintmax_t value into new arg.  Check for arithmetic overflow.
9409         (decode_options): Avoid overflow if record_size fits in size_t but not int.
9410         Check for overflow on user or group ids.
9411
9412         * src/compare.c (diff_init, process_rawdata, read_and_process,
9413         diff_sparse_files, diff_archive):
9414         Use off_t, pid_t, size_t, ssize_t when appropriate.
9415         Remove now-useless casts.  Use unsigned long to print *_t types,
9416         except use STRINGIFY_BIGINT for off_t.
9417
9418         (process_noop, process_rawdata, process_dumpdir, read_and_process):
9419         Size arg is now size_t.
9420
9421         (diff_sparse_files): Arg is now off_t.  Check for size_t overflow
9422         when allocating buffer.
9423
9424         * src/rtapelib.c:
9425         (do_command, rmt_open__, rmt_read__, rmt_lseek__, rmt_ioctl__):
9426         Use pid_t, size_t, ssize_t when appropriate.  Remove now-useless casts.
9427         Use unsigned long to print *_t types, except use STRINGIFY_BIGINT for
9428         off_t.
9429
9430         (get_status_string, get_status_off): New function.
9431         (get_status): Now returns long, so that it can store ssize_t.
9432         Invoke get_status_string to do the real work.
9433         (rmt_read__, rmt_write__): Now returns ssize_t. Size arg is now size_t.
9434         (rmt_lseek__): Now returns off_t, using new get_status_off function.
9435         (rmt_ioctl__): Convert mt_count by hand,
9436         since it might be longer than long.
9437
9438         * src/mangle.c (extract_mangle):
9439         Check for overflow when converting off_t to size_t.
9440         Use off_t, size_t when appropriate.  Remove now-useless casts.
9441
9442         * src/system.h (mode_t): Remove; now done by autoconf.
9443         (ST_NBLOCKS): Do not overflow if st_size is near maximum.
9444         Return number of ST_NBLOCKSIZE-byte blocks,
9445         not number of 512-byte blocks;
9446         this also helps to avoid overflow.
9447         (st_blocks): Declare if needed.
9448         (ST_NBLOCKSIZE): New macro.
9449         (<limits.h>, <inttypes.h>): Include if available.
9450         (CHAR_BIT): New macro.
9451         (uintmax_t): New typedef.
9452         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_STRLEN_BOUND,
9453         UINTMAX_STRSIZE_BOUND, GID_MAX, MAJOR_MAX, MINOR_MAX, MODE_MAX,
9454         OFF_MAX, SIZE_MAX, TIME_MAX, UID_MAX, UINTMAX_MAX): New macros.
9455
9456         * src/names.c (name_init):
9457         Fix typo in error message: FILE* was passed, but char*
9458         was wanted.
9459
9460         (read_name_from_file, name_gather, addname, name_match, name_scan,
9461         add_exclude): Use size_t when appropriate.  Remove now-useless casts.
9462
9463         (exclude_pool_size, allocated_exclude_pool_size): Now size_t.
9464
9465         * src/extract.c (newdir_umask, current_umask): Now mode_t.
9466         (extract_sparse_file): Args now use off_t.
9467
9468         (set_mode, set_stat, make_directories, extract_sparse_file,
9469         extract_archive): Use off_t, size_t, ssize_t when appropriate.  Remove
9470         now-useless casts.  Use unsigned long to print *_t types, except use
9471         STRINGIFY_BIGINT for off_t.
9472
9473         * src/misc.c (quote_copy_string):
9474         Use size_t when appropriate.  Remove now-useless casts.
9475
9476         * src/list.c (read_and, list_archive, read_header, decode_mode,
9477         print_header, print_for_mkdir):
9478         Use mode_t, off_t, size_t when appropriate.  Remove
9479         now-useless casts.  Use unsigned long to print *_t types, except use
9480         STRINGIFY_BIGINT for off_t.
9481
9482         (read_header): Check for overflow when converting header size.
9483
9484         (from_oct): Now static.  Now returns uintmax_t.  `where' arg is now
9485         const char *.  Size arg is now size_t.  Now takes new type and maxval
9486         args.  Compute result using uintmax_t, not long.  Report error if
9487         field does not contain octal number in range.
9488         (gid_from_oct, major_from_oct, minor_from_oct, mode_from_oct,
9489         off_from_oct, size_from_oct, time_from_oct, uid_from_oct,
9490         uintmax_from_oct): New functions.
9491
9492         (stringify_uintmax_t_backwards): New function.
9493
9494         (decode_mode, print_for_mkdir): Mode arg is now mode_t.
9495         (skip_file): Offset arg is now off_t.
9496
9497         * src/buffer.c (record_start_block, save_totsize, save_sizeleft,
9498         real_s_totsize, real_s_sizeleft, current_block_ordinal):
9499         Now off_t.
9500         (write_error): Arg is now ssize_t.
9501         (child_pid): Now pid_t.
9502         (available_space_after): Now size_t.
9503
9504         (child_open_for_compress, child_open_for_uncompress, flush_write,
9505         open_archive, flush_write, write_error, flush_read, close_archive):
9506         Use pid_t, ssize_t, size_t when appropriate.  Remove now-useless
9507         casts.  Use unsigned long to print *_t types, except use
9508         STRINGIFY_BIGINT for off_t.
9509
9510         * src/delete.c (records_read): Now daddr_t.
9511         (move_archive): Arg is now daddr_t.  Check for overflow when
9512         computing offset.
9513         (move_archive, delete_archive_members): Use daddr_t, off_t when
9514         appropriate.  Remove now-useless casts.
9515
9516         * src/rmt.h (rmt_read__, rmt_write__): Now returns ssize_t.
9517         (rmt_lseek): Now returns off_t.
9518
9519         * src/create.c (to_oct):
9520         Now static.  Value arg is now uintmax_t.  Accept new args
9521         giving name of type of octal field, for error messages.  Report an
9522         error if the value is too large to fit in the field.
9523         (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct, off_to_oct,
9524         size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct): New functions.
9525
9526         (write_eot, write_long, finish_header, deal_with_sparse,
9527         finish_sparse_file, dump_file): Use dev_t, off_t, ssize_t, size_t when
9528         appropriate.  Remove now-useless casts.  Use unsigned long to print
9529         *_t types, except use STRINGIFY_BIGINT for off_t.
9530
9531         (find_new_file_size): 1st arg is now off_t*.
9532         (finish_sparse_file): Args now use off_t, not long.
9533         Check for lseek error.
9534         (create_archive, dump_file): Cast -1 to dev_t when necessary.
9535         (dump_file): Device arg is now dev_t.
9536         Avoid overflow when testing whether file has holes
9537         by using the new ST_NBLOCKSIZE macro.
9538
9539         * src/incremen.c (struct accumulator, add_to_accumulator,
9540         get_directory_contents, add_hierarchy_to_namelist, gnu_restore):
9541         Use size_t for sizes.
9542         (struct directory, get_directory_contents, add_hierarchy_to_namelist):
9543         Use dev_t, ino_t for devices and inodes.
9544         (gnu_restore): Use off_t for file offsets.
9545         (struct directory): Use char for flags.  Add new flag `nfs'.
9546         (nfs): New constant
9547         (NFS_FILE_STAT): New macro.
9548         (note_directory): Accept struct stat * instead of
9549         device and inode number.  All callers changed.
9550         (note_directory, get_directory_contents):
9551         Use NFS_FILE_STAT to determine whether directory is an NFS directory.
9552         (write_dir_file): Cast time_t to unsigned long before printing as %lu.
9553
9554         * src/common.h (record_size, struct name, struct sp_array,
9555         available_space_after):
9556         Use size_t for sizes.
9557         (save_sizeleft, save_totsize, current_block_ordinal, skip_file):
9558         Use off_t for file offsets.
9559         (struct name): dir_contents is now const char *, not char *.
9560         (dump_file, get_directory_contents): Use dev_t for devices.
9561         (to_oct): Remove decl.
9562         (GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT, MODE_TO_OCT, SIZE_TO_OCT,
9563         UID_TO_OCT, UINTMAX_TO_OCT, OFF_TO_OCT, TIME_TO_OCT, STRINGIFY_BIGINT,
9564         GID_FROM_OCT, MAJOR_FROM_OCT, MINOR_FROM_OCT, MODE_FROM_OCT,
9565         OFF_FROM_OCT, SIZE_FROM_OCT, TIME_FROM_OCT, UID_FROM_OCT,
9566         UINTMAX_FROM_OCT): New macros.
9567         (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct, off_to_oct,
9568         size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct,
9569         stringify_uintmax_t_backwards, gid_from_oct, major_from_oct,
9570         minor_from_oct, mode_from_oct, off_from_oct, size_from_oct,
9571         time_from_oct, uid_from_oct, uintmax_from_oct): New decls.
9572         (print_for_mkdir): 2nd arg is now mode_t.
9573
9574         -----
9575
9576         See ChangeLog.1 for earlier changes.
9577
9578         -----
9579
9580         Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007
9581         Free Software Foundation, Inc.
9582
9583         This file is part of GNU tar.
9584
9585         GNU tar is free software; you can redistribute it and/or modify
9586         it under the terms of the GNU General Public License as published by
9587         the Free Software Foundation; either version 3, or (at your option)
9588         any later version.
9589
9590         GNU tar is distributed in the hope that it will be useful,
9591         but WITHOUT ANY WARRANTY; without even the implied warranty of
9592         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9593         GNU General Public License for more details.
9594
9595         You should have received a copy of the GNU General Public License
9596         along with GNU tar; see the file COPYING.  If not, write to
9597         the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
9598         Boston, MA 02110-1301, USA.
9599 \f
9600 Local Variables:
9601 mode: change-log
9602 version-control: never
9603 buffer-read-only: t
9604 End: