Elide non-DFSG compliant upstream components
[debian/tar] / ChangeLog
1 2013-11-17  Sergey Poznyakoff  <gray@gnu.org.ua>
2
3         Version 1.27.1
4
5 2013-11-17  Sergey Poznyakoff  <gray@gnu.org.ua>
6
7         Fix star compatibility (sparse headers)
8
9         * src/sparse.c (star_get_sparse_info): Update file->dumped_size
10
11 2013-11-17  Sergey Poznyakoff  <gray@gnu.org.ua>
12
13         Fix GNU long link header.
14
15         * src/create.c (write_gnu_long_link): Set timestamp to
16         0 for backward compatibility.  Bug reported by David Barri.
17         * THANKS: Update.
18
19 2013-11-17  Sergey Poznyakoff  <gray@gnu.org.ua>
20
21         Fix unquoting of input file names.
22
23         * src/names.c (read_next_name): Unquote file names coming from the
24         -T argument.  Bug reported by Nicolas Dudebout.
25         * THANKS: Update.
26
27 2013-10-24  Paul Eggert  <eggert@cs.ucla.edu>
28
29         build: fix bug where 'configure --with-posix-acls' disables ACLs
30
31         Reported by Lars Wendler in
32         <http://lists.gnu.org/archive/html/bug-tar/2013-10/msg00022.html>.
33         * configure.ac (with_posix_acls): Fix typo.
34
35 2013-10-23  Paul Eggert  <eggert@cs.ucla.edu>
36
37         Fix core dump on Solaris 10 when "." isn't readable.
38
39         Reported by Peter Kruse in
40         <http://lists.gnu.org/archive/html/bug-tar/2013-10/msg00017.html>.
41         This doesn't fix all the Solaris 10 test failures, just the
42         core dump.
43         * src/common.h, src/misc.c (tar_getcdpath): Now static.
44         * src/misc.c (normalize_filename): Report a fatal error
45         if cdpath is null, since we don't know the absolute name
46         of the working directory in that case.  FIXME: there should
47         be no need to know absolute file names.
48         (chdir_arg): Simplify wd allocation.
49         Don't assume that xgetcwd returns non-null.
50
51 2013-10-06  Sergey Poznyakoff  <gray@gnu.org.ua>
52
53         Version 1.27
54
55         * NEWS: Update.
56         * configure.ac: Update.
57
58 2013-10-06  Sergey Poznyakoff  <gray@gnu.org.ua>
59
60         Minor fixes.
61
62         * src/names.c: Include argp.h
63         * tests/testsuite.at (AT_XATTRS_UTILS_PREREQ)
64         (AT_SELINUX_UTILS_PREREQ,AT_ACLS_UTILS_PREREQ)
65         (AT_CAPABILITIES_UTILS_PREREQ)
66         (AT_XATTRS_PREREQ,AT_SELINUX_PREREQ)
67         (AT_ACLS_PREREQ): Use POSIX-compatible syntax for
68         mktemp.
69         * tests/incr08.at: Fix find usage.
70
71 2013-10-05  Sergey Poznyakoff  <gray@gnu.org.ua>
72
73         Xfail the remfiles09b test.
74
75         * tests/remfiles09b.at: Turn into expected failure.
76
77 2013-10-05  Nathan Stratton Treadway  <nathanst@ontko.com>
78
79         Tiny change
80
81         * scripts/tar-snapshot-edit: Mention --show-snapshot-field-ranges
82         option
83
84 2013-10-05  Pavel Raiskup  <praiskup@redhat.com>
85
86         Tiny change
87
88         * configure.ac (RSH): Define as AC_ARG_VAR.
89
90 2013-10-05  Sergey Poznyakoff  <gray@gnu.org.ua>
91
92         Fix namespace contamination in testsuite.
93
94         * tests/append01.at: Use m4_pushdef/m4_popdef to define local
95         macros.
96         * tests/delete03.at: Likewise.
97         * tests/exclude06.at: Likewise.
98         * tests/incr04.at: Likewise.
99         * tests/link03.at: Likewise.
100         * tests/long01.at: Likewise.
101         * tests/longv7.at: Likewise.
102         * tests/lustar01.at: Likewise.
103         * tests/lustar02.at: Likewise.
104         * tests/lustar03.at: Likewise.
105         * tests/multiv05.at: Likewise.
106         * tests/sparse04.at: Likewise.
107
108 2013-10-05  Nathan Stratton Treadway  <nathanst@ontko.com>
109
110         Provide comprehensive testcases for various file removal modes.
111
112         * tests/Makefile.am: Add new testcases.
113         * tests/testsuite.at: Likewise.
114         * tests/incr09.at: Add description.
115         * tests/remfiles04a.at: New file.
116         * tests/remfiles05.at: Rename to ...
117         * tests/remfiles04b.at: ... this.
118         * tests/remfiles04.at: Rename to ...
119         * tests/remfiles04c.at: ... this.
120         * tests/remfiles05a.at: New file.
121         * tests/remfiles05b.at: New file.
122         * tests/remfiles06.at: Rename to ...
123         * tests/remfiles05c.at: ... this.
124         * tests/remfiles06a.at: New file.
125         * tests/remfiles06b.at: New file.
126         * tests/remfiles06c.at: New file.
127         * tests/remfiles07a.at: New file.
128         * tests/remfiles07b.at: New file.
129         * tests/remfiles07c.at: New file.
130         * tests/remfiles08a.at: New file.
131         * tests/remfiles08b.at: New file.
132         * tests/remfiles08c.at: New file.
133         * tests/remfiles08.at: Rename to ...
134         * tests/remfiles09a.at: ... this.
135         * tests/remfiles09b.at: New file.
136         * tests/remfiles07.at: Rename to ...
137         * tests/remfiles09c.at: ... this.
138
139 2013-10-03  Sergey Poznyakoff  <gray@gnu.org.ua>
140
141         Tiny changes.
142
143         * src/misc.c: Fix comments, rename wd.cwd to wd.abspath (Nathan
144         Stratton
145         Treadway);
146         * src/tar.c (options): Reword description of the --starting-file
147         and
148         --preserve-order options.
149         (decode_options): Both --starting-file and --preserve-order
150         have meaning
151         only when used together with an archive reading command. (Pavel
152         Raiskup).
153
154 2013-10-01  Sergey Poznyakoff  <gray@gnu.org.ua>
155
156         Revamp tar_getcwd/normalize_filename stuff.
157
158         The changes are based on the discussion with Nathan.
159
160         * src/common.h (normalize_filename): Take two arguments. All
161         callers updated.
162         (tar_getcwd): Replaced with ..
163         (tar_getcdpath): New proto.
164         * src/misc.c (normalize_filename): Take two arguments.
165         (chdir_arg): Populate cwd along with creating the
166         structure.
167         (tar_getcwd): Removed.
168         (tar_getcdpath): New function.
169
170         * tests/incr09.at: New test case.
171         * tests/Makefile.am: Add new tests.
172         * tests/testsuite.at: Likewise.
173
174 2013-09-27  Sergey Poznyakoff  <gray@gnu.org.ua>
175
176         Bugfix
177
178         * tests/remfiles08.at: Restore missing find
179
180 2013-09-26  Sergey Poznyakoff  <gray@gnu.org.ua>
181
182         Use relative addressing in deferred unlinks.
183
184         * src/common.h (tar_dirname): New function.
185         * src/misc.c (normalize_filename_x): Make extern.
186         (tar_dirname): New function.
187         (tar_getcwd): Take into account absoulte pathnames.
188         * src/unlink.c (deferred_unlink) <dir_idx>: New member; keeps the
189         value of chdir_current at the moment of structure allocation.
190         (flush_deferred_unlinks): Use chdir_do and relative addressing.
191         (queue_deferred_unlink): Initialize dir_idx.
192         * tests/Makefile.am: Add new tests.
193         * tests/testsuite.at: Add new tests.
194         * tests/remfiles06.at: Fix description.
195         * tests/remfiles07.at: Fix description.
196         * tests/remfiles08.at: New test case.
197
198 2013-09-25  Nathan Stratton Treadway  <nathanst@ontko.com>
199
200         Improve tar-snapshot-edit
201
202         Support architecture-specific field ranges for the "-c" function.
203         Better handle negative or larger-than-32-bit field values even
204         when running in 32-bit Perl (for the default "print a summary"
205         function)
206
207 2013-09-25  Sergey Poznyakoff  <gray@gnu.org.ua>
208
209         Improve tar_getcwd
210
211         * src/common.h (tar_getcwd): Return pointer is const.
212         * src/misc.c (wd) <cwd>: New member.
213         (chdir_arg): Initialize cwd.
214         (tar_getcwd): Use cwd member to cache the result.  Take into
215         account absolute pathnames,
216         (normalize_filename): Don't free the value
217         returned from tar_getcwd.
218         * src/names.c (name_next_elt): Remove leftover call chdir().
219         * tests/Makefile.am: Add new tests.
220         * tests/testsuite.at: Likewise.
221
222         * tests/incr08.at: New testcase.
223         * tests/remfiles04.at: New testcase.
224         * tests/remfiles05.at: New testcase.
225         * tests/remfiles06.at: New testcase.
226         * tests/remfiles07.at: New testcase.
227
228 2013-09-24  Sergey Poznyakoff  <gray@gnu.org.ua>
229
230         Fix normalize_filename.
231
232         The function did not take into account eventual -C options, which
233         in particular led to various problems when using -C and
234         --remove-files
235         together.
236
237         * src/common.h (namebuf_add_dir,namebuf_finish)
238         (tar_getcwd): New prototypes.
239         * src/misc.c (namebuf_add_dir,namebuf_finish)
240         (tar_getcwd): New functions.
241         (normalize_filename): Use tar_getcwd.
242
243 2013-09-23  Sergey Poznyakoff  <gray@gnu.org.ua>
244
245         Changes for compatibility with Slackware installation scripts.
246
247         * src/buffer.c (short_read): the "Record size" message
248         is controlled by the WARN_RECORD_SIZE warning_option bit.
249         * src/common.h (keep_directory_symlink_option): New global.
250         (WARN_RECORD_SIZE): New constant.
251         (WARN_VERBOSE_WARNINGS): Add WARN_RECORD_SIZE.
252         * src/extract.c (extract_dir): If keep_directory_symlink_option is
253         set, follow symlinks to directories.
254         * src/suffix.c (compression_suffixes): Add support for txz
255         suffix.
256         * src/tar.c (KEEP_DIRECTORY_SYMLINK_OPTION): New constant.
257         (options): New option --keep-directory-symlink.
258         (parse_opt): Handle this option.
259         * src/warning.c: Implement "record-size" warning control.
260
261         * NEWS: Update.
262         * doc/tar.texi: Document new features.
263
264 2013-09-21  Sergey Poznyakoff  <gray@gnu.org.ua>
265
266         Fix error message (complements 0ea6e686)
267
268         * src/tar.c (set_subcommand_option): Mention --delete in the
269         error message.
270
271 2013-09-15  Sergey Poznyakoff  <gray@gnu.org.ua>
272
273         Improve the incr07 test
274
275 2013-09-15  Nathan Stratton Treadway  <nathanst@ontko.com>
276
277         Implement the --show-snapshot-field-ranges option
278
279         * src/common.h (show_snapshot_field_ranges): New prototype.
280         * src/incremen.c (show_snapshot_field_ranges): New function.
281         * src/tar.c: New option --show-snapshot-field-ranges.
282         * doc/snapshot.texi: Document the --show-snapshot-field-ranges
283         option.
284         * doc/tar.texi: Likewise.
285
286 2013-09-15  Sergey Poznyakoff  <gray@gnu.org.ua>
287
288         Take into account chdir_fd when extracting from incremental dumps.
289
290         * src/common.h (tar_savedir): New prototype.
291         * src/misc.c (tar_savedir): New function.
292         (remove_any_file): Use tar_savedir.
293         * src/incremen.c (try_purge_directory): Use tar_savedir.
294         * src/update.c (update_archive): Use tar_savedir.
295         * tests/incr07.at: New testcase.
296         * tests/Makefile.am (TESTSUITE_AT): Add new test.
297         * tests/testsuite.at: Likewise.
298         * THANKS: Updated.
299
300 2013-09-15  Sergey Poznyakoff  <gray@gnu.org.ua>
301
302         Minor fix
303
304         * src/tar.c (main): Mention --delete in the error message.
305         * THANKS: Update
306
307 2013-09-13  Paul Eggert  <eggert@cs.ucla.edu>
308
309         * src/names.c (file_list_name): Properly prototype.
310
311 2013-09-13  Paul Eggert  <eggert@cs.ucla.edu>
312
313         tar: don't warn about zero timestamps
314
315         * src/extract.c (check_time): Suppress warniing when t.tv_sec
316         == 0.
317         Problem reported by Denis Excoffier.
318
319 2013-08-19  Pavel Raiskup  <praiskup@redhat.com>
320
321         Minor fix in the testsuite.
322
323         * tests/T-cd.at: sort the 'tar cf' output.
324
325 2013-08-17  Sergey Poznyakoff  <gray@gnu.org.ua>
326
327         Improve error diagnostics
328
329         * src/names.c (file_list_name): New static function.
330         (add_file_id): If a filelist is being read twice, print the names
331         of the files that caused it.
332         * tests/T-rec.at: New test case.
333         * tests/Makefile.am: Add new file.
334         * tests/testsuite.at: Include new file.
335
336 2013-08-16  Sergey Poznyakoff  <gray@gnu.org.ua>
337
338         Revamp initial name collection functions to ensure proper
339         argument ordering.
340
341         * src/names.c (NELT_NOOP): New constant
342         (name_elt) <next,prev>: New members.
343         (name_array,allocated_entries,entries,scanned): Remove.
344         (check_name_alloc): Remove function.
345         (name_elt_alloc): New static.
346         (name_list_adjust,name_list_advance): New functions.
347         (name_add_name,name_add_dir)
348         (name_add_file): Use new allocation functions.
349         (read_next_name): Advance list head pointer as necessary
350         before returning.
351         (name_next_elt): Read elements from list.
352         * tests/T-cd.at: New file.
353         * tests/T-mult.at: New file.
354         * tests/T-nest.at: New file.
355         * tests/Makefile.am: Add new testcases.
356         * tests/testsuite.at: Likewise.
357
358 2013-08-16  Sergey Poznyakoff  <gray@gnu.org.ua>
359
360         Don't treat attempts to read an already read file list as
361         fatal errors.
362
363         * src/names.c (add_file_id): Report error and return 1 if the file
364         has already been read.
365         (read_next_name): Don't try to open file if add_file_id returns 1.
366         (name_next_elt): Simplify conditional.
367
368 2013-08-16  Sergey Poznyakoff  <gray@gnu.org.ua>
369
370         Minor change.
371
372         * src/names.c (name_next_elt): Simplify conditional.
373
374 2013-08-15  Pavel Raiskup  <praiskup@redhat.com>
375
376         Fix use of uninitialized memory
377
378         * src/names.c (name_add_file): Initialize the ep->v.file.fp
379         pointer
380         after structure allocation.
381
382 2013-08-05  Sergey Poznyakoff  <gray@gnu.org.ua>
383
384         Minor changes
385
386         * src/names.c (handle_option): Use program_invocation_short_name
387         instead of the constant string.
388         (read_next_name): Remove unused variable.
389
390 2013-08-04  Sergey Poznyakoff  <gray@gnu.org.ua>
391
392         Update the docs.
393
394         * doc/tar.texi: Parsing of the options found in the file list
395         follows the same rules as for command line.  Remove the obsolete
396         description.  This complements 26538c9b.
397
398 2013-08-04  Sergey Poznyakoff  <gray@gnu.org.ua>
399
400         Fix interacton of --verbose and --append.
401
402         * src/buffer.c (_open_archive): don't overwrite existing archive
403         if given the --verify option.
404         * tests/append04.at: New file.
405         * tests/Makefile.am: Add new testcase.
406         * tests/testsuite.at: Add new testcase.
407         * THANKS: Update.
408
409 2013-08-04  Sergey Poznyakoff  <gray@gnu.org.ua>
410
411         Bugfix.
412
413         * src/names.c (read_name_from_file): Fix a typo. Remove
414         unused variable.
415
416 2013-08-04  Sergey Poznyakoff  <gray@gnu.org.ua>
417
418         Reduce memory consuption when handling the -T option.
419
420         The commit cdb27293 made the -T option more flexible, but
421         incurred a very considerable memory overhead by storing
422         all file names in the argument array.  In case of very
423         big file lists this caused tar to run out of memory.  This
424         was reported by Christian Wetzel <wetzel@phoenix-pacs.de>
425         on March 14, 2013
426         (http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00018.html).
427
428         On the other hand, Michal Å½eidl discovered that tar misfunctioned
429         when given empty file lists or lists with the trailing newline
430         misssing in the last entry.  This was reported by Pavel Raiskup
431         on July 23
432         (http://lists.gnu.org/archive/html/bug-tar/2013-07/msg00009.html
433         and
434         msg00010.html).
435
436         This change fixes both issues.
437
438         * src/common.h (name_add_file,request_stdin): New prototype.
439         (more_options): New prototype.
440         * src/names.c (NELT_FILE): New entry type.
441         (name_elt) <file>: New union member.
442         (name_add_file): New function.
443         (read_name_from_file): New function, a rewrite of
444         the same function from tar.c
445         (read_next_name,copy_name): New static functions.
446         (name_next_elt): Handle NELT_FILE entries.
447         * src/tar.c (request_stdin): Make extern.
448         (read_name_from_file,add_file_id)
449         (update_argv): Removed.
450         (parse_opt): Change handling of the -T option.
451         (more_options): New function.
452
453         * tests/T-null.at: Rewrite test.
454         * tests/T-zfile.at: New file.
455         * tests/T-nonl.at: New file.
456         * tests/Makefile.am: Add new testcases.
457         * tests/testsuite.at: Likewise.
458
459         * THANKS: Update.
460
461 2013-06-29  Sergey Poznyakoff  <gray@gnu.org.ua>
462
463         Fix the compatibility check for the --occurrence option.
464
465         * src/tar.c (SUBCL_OCCUR): New class.
466         (subcommand_class): Update.
467         (decode_options): Accept the --occurrence option
468         with any subcommand from the SUBCL_OCCUR class.
469
470 2013-06-29  Pavel Raiskup  <praiskup@redhat.com>
471
472         testsuite: do not resist on file order in archive
473
474         On my Fedora 19 box, the exclude08 & exclude11 tests failed before
475         this fix.  The reason was that the directory traversing chosen the
476         file order differently than the testsuite expected.
477
478         * tests/exclude08.at: Sort the tarball content output.
479         * tests/exclude09.at: Likewise.
480         * tests/exclude10.at: Likewise.
481         * tests/exclude11.at: Likewise.
482         * tests/exclude12.at: Likewise.
483         * tests/exclude13.at: Likewise.
484         * tests/exclude14.at: Likewise.
485         * tests/exclude15.at: Likewise.
486         * tests/exclude16.at: Likewise.
487
488 2013-06-29  Sergey Poznyakoff  <gray@gnu.org.ua>
489
490         Improve checks for incompatible options.
491
492         * src/common.h (READ_LIKE_SUBCOMMAND): Remove define.
493         * src/tar.c (IS_SUBCOMMAND_CLASS): New macro.
494         (decode_options): Use IS_SUBCOMMAND_CLASS in checking
495         option compatibility.
496         Accept the --verify option only with subcommands that
497         write to the archive.
498
499         * tests/opcomp01.at: New test case.
500         * tests/opcomp02.at: New test case.
501         * tests/opcomp03.at: New test case.
502         * tests/opcomp04.at: New test case.
503         * tests/opcomp05.at: New test case.
504         * tests/opcomp06.at: New test case.
505         * tests/Makefile.am: Add new testcases.
506         * tests/testsuite.at: Likewise.
507
508 2013-06-28  Paul Eggert  <eggert@cs.ucla.edu>
509
510         tar: port to Mingw Shell
511
512         * src/extract.c (extract_symlink) [!HAVE_SYMLINK]:
513         Fix typo by replacing WARN_SYMBOLIC_CAST with WARN_SYMLINK_CAST.
514         Problem reported by kaka in
515         <http://lists.gnu.org/archive/html/bug-tar/2013-06/msg00008.html>.
516
517 2013-05-06  Paul Eggert  <eggert@cs.ucla.edu>
518
519         maint: revert previous change
520
521         It wasn't actually needed.  Reported by Stefano Lattarini in
522         <http://lists.gnu.org/archive/html/bug-tar/2013-04/msg00041.html>.
523         * configure.ac (AM_GNU_GETTEXT_VERSION): Decrease from 0.18.2
524         back to 0.16.
525
526 2013-04-25  Paul Eggert  <eggert@cs.ucla.edu>
527
528         maint: port to bleeding-edge Automake by assuming Gettext 0.18.2
529
530         Reported by Stefano Lattarini in
531         <http://lists.gnu.org/archive/html/bug-tar/2013-04/msg00009.html>.
532         * configure.ac (AM_GNU_GETTEXT_VERSION): Increase from 0.16
533         to 0.18.2.
534         README-alpha says that we do not make any efforts to accommodate
535         older versions of Gettext.
536
537 2013-04-25  Paul Eggert  <eggert@cs.ucla.edu>
538
539         tar: port to --without-xattrs --enable-gcc-warnings
540
541         Reported by Pavel Raiskup in
542         <http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00029.html>.
543         * src/xattrs.c (xattrs__fd_set) [!HAVE_XATTRS]: Omit.
544
545 2013-04-25  Paul Eggert  <eggert@cs.ucla.edu>
546
547         doc: port to texinfo 5
548
549         * doc/tar.texi (Reports, assumptions, Mixing):
550         Put FIXMEs at line start.
551
552 2013-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>
553
554         Continue extracting from a separate volume after skipping a
555         partial member.
556
557         Reported by Göran Udeborg on 2013-03-09.
558
559         * src/extract.c (extract_skip): New function.
560         (prepare_to_extract): Set extractor to extract_skip if starting
561         at a partial member.
562
563 2013-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>
564
565         Fix interaction of various --exclude-tag options with
566         --listed-incremental.
567
568         * src/incremen.c (procdir): Set directory->tagfile in
569         the exclusion_tag_contents case.
570         (makedumpdir): Mark all entries as ignored if directory->tagfile
571         is set.
572         Free new_dump before returning.
573         (maketagdumpdir): New function.
574         (scan_directory): If directory->children is set to
575         NO_CHILDREN and directory->tagfile is set, create a
576         dumpdir consisting of the tagfile only.
577
578         * tests/exclude08.at: New testcase.
579         * tests/exclude09.at: New testcase.
580         * tests/exclude10.at: New testcase.
581         * tests/exclude11.at: New testcase.
582         * tests/exclude12.at: New testcase.
583         * tests/exclude13.at: New testcase.
584         * tests/exclude14.at: New testcase.
585         * tests/exclude15.at: New testcase.
586         * tests/exclude16.at: New testcase.
587         * tests/Makefile.am: Add new tests.
588         * tests/testsuite.at: Include new tests.
589         * tests/atlocal.in (mkexcltest): New function.
590         * tests/chtype.at: Update keywords.
591         * tests/filerem01.at: Likewise.
592         * tests/filerem02.at: Likewise.
593         * tests/incremental.at: Likewise.
594         * tests/multiv04.at: Likewise.
595
596 2013-02-20  Paul Eggert  <eggert@cs.ucla.edu>
597
598         tar: remove lint
599
600         * lib/wordsplit.c (_wsplit_error): Mark with printf attribute.
601         (expvar): "Use" defstr to pacify GCC.
602         * src/system.c (xexec): Now _Noreturn, to pacify GCC.
603         (run_decompress_program): Add cast to pacify GCC.
604         (sys_exec_command, sys_exec_info_script,
605         sys_exec_checkpoint_script):
606         Remove unused variables.
607
608 2013-02-10  Sergey Poznyakoff  <gray@gnu.org.ua>
609
610         Pass command line arguments to external commands.
611
612         Any option taking a command name as its argument accepts
613         additional arguments as well.
614
615         * lib/wordsplit.c: New file.
616         * lib/wordsplit.h: New file.
617         * lib/Makefile.am: Add new files.
618         * src/system.c (xexec): New function.
619         (run_decompress_program): Use wordsplit.
620         (sys_child_open_for_compress,sys_exec_command)
621         (sys_exec_info_script)
622         (sys_exec_checkpoint_script): Use xexec to invoke external
623         command.
624
625         * NEWS: Update.
626         * doc/tar.texi: Update.
627
628 2013-01-29  Nathan Stratton Treadway  <nathanst@ontko.com>
629
630         tar: improve compile-time diagnostics
631
632         * src/misc.c (sysinttostr, strtosysint): Improve #error wording.
633
634 2013-01-27  Paul Eggert  <eggert@cs.ucla.edu>
635
636         tar: improve quality of diagnostics with incrementals
637
638         Inspired by a prototype by Nathan Stratton Treadway in
639         <http://lists.gnu.org/archive/html/bug-tar/2013-01/msg00000.html>.
640         * src/incremen.c (read_num): Rewrite by merging read_negative_num
641         and read_unsigned_num.  Use strtosysint rather than rolling this
642         stuff ourselves.  Change return type to bool.  All uses changed.
643         (read_negative_num, read_unsigned_num): Remove.
644         (read_num, read_timespec, read_incr_db_2): Improve quality of
645         diagnostics, e.g., by supplying byte offset of error.
646
647 2013-01-26  Paul Eggert  <eggert@cs.ucla.edu>
648
649         tar: fix bug with sparse files with effective size of 8 GiB
650         or more
651
652         Reported by Pavel Raiskup in
653         <http://lists.gnu.org/archive/html/bug-tar/2013-01/msg00001.html>.
654         * NEWS: Document the fix.
655         * src/sparse.c (pax_start_header): New function.
656         (pax_dump_header_0, pax_dump_header_1): Use it.
657
658 2012-12-31  Paul Eggert  <eggert@cs.ucla.edu>
659
660         maint: update copyrights for 2013 and as per current GNU standards
661
662 2012-12-31  Paul Eggert  <eggert@cs.ucla.edu>
663
664         maint: remove unnecessary file
665
666         * src/configure.in: Remove.  This file has been obsolete for
667         a while.
668
669 2012-12-24  Paul Eggert  <eggert@cs.ucla.edu>
670
671         maint: don't enable warnings by default unless GCC 4.6 or later
672
673         * configure.ac (gl_GCC_VERSION_IFELSE): New macro, from coreutils.
674         (gl_gcc_warnings): By default, disable warnings for GCC versions
675         before 4.6.  This works around a failure when building from git on
676         Ubuntu 10, reported privately by Nathan Stratton Treadway.
677
678 2012-12-23  Paul Eggert  <eggert@cs.ucla.edu>
679
680         Handle incremental format 2 with negative numbers, too.
681
682         * src/incremen.c (read_unsigned_num): Last arg is intmax_t *, not
683         uintmax_t, for consistency with other readers.  All callers
684         changed.
685         Avoid signed integer overflow.
686         (read_num):
687
688 2012-12-23  Paul Eggert  <eggert@cs.ucla.edu>
689
690         Fix some problems with negative and out-of-range integers.
691
692         Original problem reported for HP-UX LVM v2.2 by Michael White in
693         <http://lists.gnu.org/archive/html/bug-tar/2012-10/msg00000.html>.
694         This patch fixes some other gotchas that I noticed.
695         * gnulib.modules: Add extern-inline.
696         * src/common.h: Use _GL_INLINE_HEADER_BEGIN,
697         _GL_INLINE_HEADER_END.
698         (COMMON_INLINE, max, min): New macros.
699         (represent_uintmax, valid_timespec): New inline functions.
700         (SYSINT_BUFSIZE): New constant.
701         (sysinttostr, strtosysint, decode_timespec): New decls.
702         * src/create.c (start_private_header): Silently bring the time_t
703         value into range; it is now the caller's responsibility to deal
704         with any overflow error.  Use uid 0 and gid 0 rather than the
705         user's uid/gid, since the faked header isn't "owned" by the user
706         and the uid/gid could in theory be out of range.  Leave major and
707         minor zeroed.
708         (FILL): Remove.
709         (write_gnu_long_link): Let start_private_header zero things out.
710         * src/create.c (write_gnu_long_link, write_extended):
711         * src/xheader.c (xheader_write_global):
712         Use start_time, not current time; no point hammering on the clock.
713         * src/compare.c (diff_multivol): Check that offset, size are
714         in range.
715         * src/incremen.c (read_incr_db_01, write_directory_file_entry):
716         Allow negative time_t, dev_t, and ino_t.
717         * src/list.c (max): Remove (moved to common.h).
718         (read_header): Check that size is in range.
719         (from_header): Return intmax_t, not uintmax_t, to allow negative.
720         All callers changed.  At compile time, check assumptions about
721         intmax_t and uintmax_t.  Use bool for booleans.  Avoid overflow
722         hassles on picky hosts.
723         (mode_from_header): Last arg is now bool *, not unsigned *.
724         All callers changed.
725         (simple_print_header): Do not assume UID, GID fit in 'long'.
726         * src/list.c (from_header):
727         * src/xheader.c (out_of_range_header):
728         Arg is now a plain minimum value, not minus minval converted to
729         uintmax_t.  All callers changed.
730         * src/misc.c (COMMON_INLINE): New macro.
731         (sysinttostr, strtosysint, decode_timespec): New functions.
732         * src/sparse.c (oldgnu_add_sparse, oldgnu_fixup_header)
733         (star_fixup_header):
734         Check for offset overflow.
735         (decode_num): Clear errno before calling strtoumax.
736         * src/tar.c (expand_pax_option): Don't discard nanoseconds.
737         * src/xheader.c (assign_time_option): Allow negative time_t.
738         (decode_record): Simplify, since out-of-range string is guaranteed
739         to produce a value exceeding len_max.
740         (xheader_read): Last arg is off_t, not size_t.
741         Caller should diagnose negative arg, as needed.
742         Check that it's in range.
743         (enum decode_time_status): Remove.
744         (_decode_time): Remove, folding into decode_time.
745         (decode_time): Return bool, not enum decode_time_status.
746         Rely on decode_timespec to do most of the work.
747         (code_signed_num): New function.
748         (code_num): Use it.
749         (decode_signed_num): New function.
750         (decode_num): Use it.
751         (gid_coder, gid_decoder, uid_coder, uid_decoder,
752         sparse_map_decoder)
753         (sparse_map_decoder): Code and decode negative values.
754         (sparse_map_decoder): Improve check for out-of-range values.
755         * tests/time01.at: New file.
756         * tests/Makefile.am (TESTSUITE_AT): Add it.
757         * tests/testsuite.at: Include it.
758
759 2012-12-22  Paul Eggert  <eggert@cs.ucla.edu>
760
761         Port use of mkdirat etc. to Solaris 10.
762
763         * gnulib.modules (fchmodat, fchownat, fstatat, mkdirat, unlinkat):
764         Add.  These were split out in gnulib, so we now need to request
765         them separately.  mkdirat, for example, is not in Solaris 10.
766
767 2012-12-22  Paul Eggert  <eggert@cs.ucla.edu>
768
769         Port ACL configuration to Solaris 10.
770
771         * configure.ac (with_posix_acls): Fix misspellings.
772         Stop checking at the first failure, to speed up 'configure'.
773
774 2012-12-19  Paul Eggert  <eggert@cs.ucla.edu>
775
776         tar: remove unused externs, or make them static
777
778         * src/buffer.c (record_buffer_aligned, flush_write_ptr,
779         flush_read_ptr)
780         (duration):
781         * src/list.c (recent_global_header):
782         * src/unlink.c (deferred_unlink_delay):
783         * src/transform.c (transform_flags):
784         * src/xattrs.c (acl_get_file_at, acl_set_file_at,
785         file_has_acl_at):
786         Now static.
787         * src/common.h (rmt_command_option): Remove; unused.
788         * src/tar.c (check_links_option, allocated_archive_names):
789         Move decls here from common.h; these are now static.
790
791 2012-12-19  Paul Eggert  <eggert@cs.ucla.edu>
792
793         * .gitignore: Regenerate.
794
795 2012-12-19  Paul Eggert  <eggert@cs.ucla.edu>
796
797         build: new configure option --enable-gcc-warnings
798
799         This has a similar meaning as in other GNU applications
800         such as coreutils and Emacs.
801         * NEWS: Document it.
802         * .gitignore: Remove redundant build-aux.
803         Remove gnu, since gnu/Makefile.am is now in git.
804         Add gnu/.gitignore, gnu/charset.alias, gnu/*.h, gnu/*/ to cover
805         autogenerated files.
806         * bootstrap.conf (gnulib_mk): Remove.
807         * configure.ac: Add support for --enable-gcc-warnings,
808         taken from coreutils and simplified.
809         * gnu/Makefile.am: New file.  Formerly this was autogenerated,
810         but the autogenerated file has been renamed to gnulib.mk,
811         its usual name when bootstrapping from gnulib.
812         This way, AM_CFLAGS can incorporate warning options.
813         * gnulib.modules: Add manywarnings.
814         * lib/Makefile.am, src/Makefile.am (AM_CFLAGS): New macro,
815         incorporating warning options.
816         * lib/attr-xattr.in.h (ENOATTR): New macro, if not already
817         defined.
818         * src/buffer.c (magic): Don't rely on incomplete initializers.
819         * src/common.h (report_difference): Add printf format attribute.
820         * src/system.c (sys_exec_command, sys_exec_info_script)
821         (sys_exec_checkpoint_script):
822         * src/tar.c (update_argv):
823         Add casts to char * to pacify GCC warnings about using string
824         literals in a char * context.
825         * src/xattrs.c, src/xattrs.h (xattrs_clear_setup):
826         Declare parameters as (void), not ().
827         * src/xheader.c (xheader_format_name): Initialize pptr to null,
828         to pacify GCC.  Remove unnecessary test of nptr versus null.
829
830 2012-12-19  Paul Eggert  <eggert@cs.ucla.edu>
831
832         tar: don't truncate diagnostic
833
834         * src/list.c (from_header): Fix buffer size calculation when
835         generating a diagnostic.
836
837 2012-12-03  Sergey Poznyakoff  <gray@gnu.org.ua>
838
839         Bugfix.
840
841         * tests/Makefile.am: Fix double AM_CPPFLAGS
842
843 2012-12-01  Sergey Poznyakoff  <gray@gnu.org.ua>
844
845         Use AM_CPPFLAGS instead of INCLUDES.
846
847 2012-11-19  Sergey Poznyakoff  <gray@gnu.org.ua>
848
849         Housekeeping.
850
851         * NEWS: Mention the support for POSIX ACLs, extended
852         attributes and SELinux context.
853         * THANKS: List James Antill and Pavel Raiskup.
854
855 2012-11-19  Sergey Poznyakoff  <gray@gnu.org.ua>
856
857         Fix indentation.
858
859 2012-11-19  Pavel Raiskup  <praiskup@redhat.com>
860
861         Allow to store/extract '=' character in xattr keyword
862
863         * src/xheader.c (xattr_decode_keyword)
864         (xattr_encode_keyword): New functions.
865         (xheader_print_n,xattr_decoder): Use them.
866         * tests/xattr05.at: New test case.
867         * tests/Makefile.am: Add new test case.
868         * tests/testsuite.at: Likewise.
869
870 2012-11-19  Pavel Raiskup  <praiskup@redhat.com>
871
872         Bugfixes.
873
874         * configure.ac: Avoid linking against -lacl when
875         --without-posix-acls is given.
876         * tests/selacl01.at: Call restorecon
877         * tests/selnx01.at: Likewise.
878         * tests/testsuite.at (AT_SELINUX_UTILS_PREREQ): Likewise.
879         (AT_SELINUX_PREREQ,AT_ACLS_PREREQ): Use the right _PREREQ macros.
880
881 2012-11-19  Pavel Raiskup  <praiskup@redhat.com>
882
883         Fix bootstrapping.
884
885         * bootstrap (gnulib_extra_files): Remove $build_aux/missing
886
887 2012-11-19  Sergey Poznyakoff  <gray@gnu.org.ua>
888
889         Various fixes.
890
891         * src/xattrs.c: Don't mix variable declarations and statements.
892         Use proper data types.  Remove improper use of const qualifiers.
893         Use x2nrealloc to reallocate memory buffers.
894
895 2012-11-18  Sergey Poznyakoff  <gray@gnu.org.ua>
896
897         Minor change.
898
899         * src/xattrs.c: Fix indentation. Fix copyleft statement, promote
900         to GPLv3+.
901         * src/xattrs.h: Likewise
902
903 2012-11-18  Pavel Raiskup  <praiskup@redhat.com>
904
905         Add SELinux context store/restore/list support.
906
907         * gnulib.modules: Add selinux-at.
908         * src/Makefile.am (tar_LDADD): Add LIB_SELINUX.
909
910         * src/create.c (start_header, dump_file0): Handle selinux
911         contexts.
912         * src/extract.c (delayed_set_stat) <cntx_name>: New member.
913         (delayed_link) <cntx_name>: New member.
914         (set_stat, delay_set_stat)
915         (apply_nonancestor_delayed_set_stat): Handle selinux contexts.
916         * src/tar.c: New options: "--selinux", "--no-selinux".
917         (tar_stat_destroy): Free cntx_name.
918         * src/tar.h (tar_stat_info) <cntx_name>: New member.
919         * src/xattrs.c (xattrs_selinux_get)
920         (xattrs_selinux_set): New functions.
921         (xattrs_print_char): Honor selinux_context_option.
922         (xattrs_print): Print selinux context.
923         * src/xheader.c: Handle new keyword "RHT.security.selinux".
924         * tests/Makefile.am: Add new tests.
925         * tests/testsuite.at: Likewise.
926         * tests/selacl01.at: New test.
927         * tests/selnx01.at: New test.
928
929 2012-11-18  Pavel Raiskup  <praiskup@redhat.com>
930
931         Support for POSIX ACLs
932
933         * configure.ac: Check whether ACLs are available on the
934         host system.
935         * gnulib.modules: Add acl
936         * src/create.c (start_header): Store ACLs when creating
937         a POSIX archive.
938         (dump_file0): Handle ACLs.
939         * src/extract.c (delayed_set_stat) <acls_a_ptr, acls_a_len>
940         <acls_d_ptr, acls_d_len>: New members.
941         (delayed_link): Likewise.
942         (set_stat,delay_set_stat)
943         (apply_nonancestor_delayed_set_stat): Set ACLs.
944         * src/tar.c: New options: "--acls", "--no-acls"
945         (tar_stat_destroy): Free acls_a_ptr and acls_d_ptr fields.
946         * src/tar.h (tar_stat_info) <acls_a_ptr, acls_a_len>
947         <acls_d_ptr, acls_d_len>: New members.
948         * src/xattrs.c (xattrs_acls_get, xattrs_acls_set): New functions.
949         * src/xheader.c: Support new keywors: "SCHILY.acl.access" and
950         "SCHILY.acl.default".
951         * tests/Makefile.am: Add new tests.
952         * tests/testsuite.at: Likewise.
953         * tests/acls01.at: New test.
954         * tests/acls02.at: New test.
955
956 2012-11-18  Pavel Raiskup  <praiskup@redhat.com>
957
958         Add basic suuport for extended attributes.
959
960         * src/Makefile.am: Add xattrs.[ch]
961         * src/xattrs.c: New file.
962         * src/xattrs.h: New file.
963         * src/common.h (READ_LIKE_SUBCOMMAND): New define.
964         (selinux_context_option, acls_option, xattrs_option): New globals.
965         (xheader_xattr_init, xheader_xattr_free)
966         (xheader_xattr_copy, xheader_xattr_add): New protos.
967         (WARN_XATTR_WRITE): New mask.
968         * src/create.c (start_header): Handle xattrs pairs if in POSIX
969         format.
970         (dump_file0): Handle extended attributes.
971         * src/extract.c (delayed_set_stat,delayed_link) <xattr_map_size>
972         <xattr_map>: New members.
973         (set_xattr): New static function.
974         (open_output_file): Accept an additional argument indicating
975         whether the file has already been created.
976         (set_stat,delay_set_stat)
977         (apply_nonancestor_delayed_set_stat)
978         (extract_file): Handle extended attributes.
979         * src/list.c (decode_header, simple_print_header): Display
980         extended attributes.
981         * src/tar.c: New options --xattrs, --no-xattrs, --xattrs-include,
982         --xattrs-exclude
983         (tar_stat_destroy): Free the xattr_map storage.
984         * src/tar.h (xattr_array): New struct.
985         (tar_stat_info) <xattr_map_size, xattr_map>: New members.
986         * src/warning.c: New warning control keyword "xattr-write".
987         * src/xheader.c (xheader_xattr_init)
988         (xheader_xattr_free, xheader_xattr_add)
989         (xheader_xattr_copy): New functions.
990         (struct xhdr_tab) <prefix>: New member.
991         (locate_handler): Permit selecting the keyword based on its
992         prefix.
993         (xheader_protected_pattern_p)
994         (xheader_protected_keyword_p): Likewise.
995         (xattr_coder, xattr_decoder): New functions.
996         (xhdr_tab): Reflect the changes to struct xhdr_tab.
997         New keyword "SCHILY.xattr".
998         * tests/Makefile.am: Add new tests.
999         * tests/testsuite.at: Likewise.
1000         (AT_CHECK_UTIL, AT_XATTRS_UTILS_PREREQ)
1001         (AT_CAPABILITIES_UTILS_PREREQ, AT_XATTRS_PREREQ): New defuns.
1002         * tests/xattr01.at: New test.
1003         * tests/xattr02.at: New test.
1004         * tests/xattr03.at: New test.
1005         * tests/xattr04.at: New test.
1006         * tests/capabs_raw01.at: New test.
1007
1008 2012-11-18  Sergey Poznyakoff  <gray@gnu.org.ua>
1009
1010         Prepare for implementing extended attribute support.
1011
1012         This patch adds *xattr() stubs in case extended attribute
1013         support is
1014         not present and implements the *attrat() family of functions.
1015         Based
1016         on the patch by Pavel Raiskup <pavel@raiskup.cz> for gnulib.
1017
1018         * acinclude.m4 (TAR_HEADERS_ATTR_XATTR_H): New defun.
1019         * configure.ac: Call TAR_HEADERS_ATTR_XATTR_H
1020         * lib/Makefile.am: Add xattr-at.[ch], distribute attr-xattr.in.h
1021         [!TAR_COND_XATTR_H]: Build attr/xattr.h
1022         * lib/attr-xattr.in.h: New file.
1023         * lib/xattr-at.c: New file.
1024         * lib/xattr-at.h: New file.
1025
1026 2012-11-14  Sergey Poznyakoff  <gray@gnu.org.ua>
1027
1028         Fix creation of incremental archives when a subdirectory becomes
1029         a mountpoint.
1030
1031         When used with --listed-incrfental and --one-file-system, tar
1032         was unable to cope with directories that had once been part of the
1033         dumped system and became separate mount points afterwards.
1034         The bug
1035         has been reported and a fix proposed by Nathan Stratton Treadway.
1036
1037         * src/incremen.c (procdir): If one_file_system_option is in
1038         effect,
1039         clear out dumpdir info from the directory.
1040         * tests/Makefile.am: Add new testcase.
1041         * tests/listed05.at: New testcase.
1042         * tests/testsuite.at (AT_PRIVILEGED_PREREQ): New macro.
1043         include listed05.at.
1044         * THANKS: Update.
1045
1046 2012-07-27  Jim Meyering  <jim@meyering.net>
1047
1048         maint: try to avoid unwanted chatter in ChangeLog
1049
1050         * bootstrap.conf: Do not alter ChangeLog if it already exists.
1051
1052 2012-07-26  Paul Eggert  <eggert@cs.ucla.edu>
1053
1054         doc: improve discussion of compressed archives
1055
1056         * doc/tar.texi (gzip): Don't claim that -I 'gzip --best' works.
1057         Problem reported by Davide Brini in
1058         <http://lists.gnu.org/archive/html/bug-tar/2012-07/msg00025.html>.
1059         Also, improve some of the surrounding text.
1060
1061         This file is a placeholder. It will be replaced with the actual
1062         ChangeLog
1063         by make dist.  Run make ChangeLog if you wish to create it
1064         earlier.
1065
1066 2012-06-27  Paul Eggert  <eggert@cs.ucla.edu>
1067
1068         tests: fix permissions-assumption bug in test
1069
1070         * tests/owner.at: Don't assume umask is 022.
1071         Reported by Pavel Raiskup in
1072         <http://lists.gnu.org/archive/html/bug-tar/2012-06/msg00015.html>.
1073
1074 2012-06-27  Paul Eggert  <eggert@cs.ucla.edu>
1075
1076         tar: don't assume root is uid 0
1077
1078         This is not true for Tandem NonStop Kernel.  See Joachim Schmitz's
1079         comment in <http://bugs.gnu.org/10305#111>.
1080         * gnulib.modules: Add root-uid.
1081         * src/extract.c: Include <root-uid.h>.
1082         (extr_init): Don't assume root is uid 0.
1083
1084 2012-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1085
1086         * src/compare.c (diff_dumpdir): Omit useless 'stat'.
1087
1088 2012-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1089
1090         * doc/tar.texi (Option Summary): Fix xref typo.
1091
1092         Reported by Nathan Stratton Treadway in
1093         <http://lists.gnu.org/archive/html/bug-tar/2012-04/msg00035.html>.
1094
1095         This file is a placeholder. It will be replaced with the actual
1096         ChangeLog
1097         by make dist.  Run make ChangeLog if you wish to create it
1098         earlier.
1099
1100 2012-03-29  Sergey Poznyakoff  <gray@gnu.org.ua>
1101
1102         Fix unrecognized option.
1103
1104         * src/tar.c (parse_opt): Handle OLD_ARCHIVE_OPTION.
1105
1106 2012-03-11  Paul Eggert  <eggert@cs.ucla.edu>
1107
1108         tar: remove lint
1109
1110         This lint was found by GCC 4.6.2 on Fedora 15 x86-64.
1111         * src/buffer.c (buffer_write_global_xheader, mv_end,
1112         set_start_time)
1113         (compute_duration, print_total_stats, flush_read, flush_write):
1114         * src/checkpoint.c (checkpoint_finish_compile):
1115         * src/list.c (test_archive_label):
1116         * src/misc.c (chdir_count):
1117         * src/names.c (const):
1118         * src/unlink.c (finish_deferred_unlinks):
1119         Define with (void) instead of with (), for slightly-better C type
1120         checking and to avoid a GCC warning.
1121         * src/compare.c (diff_dumpdir):
1122         * src/tar.c (parse_owner_group): Remove unused local.
1123         * src/misc.c (chdir_do):
1124         * src/tar.c (add_exclude_array): Rename local to avoid shadowing.
1125         (LOW_DENSITY_NUM, MID_DENSITY_NUM, HIGH_DENSITY_NUM):
1126         Define only if needed.
1127         * src/update.c (update_archive): Initialize a local; this fixes
1128         what appears to be a real bug.
1129
1130 2012-02-14  Paul Eggert  <eggert@cs.ucla.edu>
1131
1132         doc: suggest Bash for large-fd script
1133
1134         * doc/tar.texi (Multi-Volume Archives): Suggest Bash for shell
1135         script that might use >&10.  Problem reported by Edward F
1136         Eaglehouse in
1137         <http://lists.gnu.org/archive/html/bug-tar/2012-02/msg00002.html>.
1138
1139 2012-01-18  Paul Eggert  <eggert@cs.ucla.edu>
1140
1141         tar: quote 'like this', not `like this'
1142
1143         This fixes some test failures recently introduced by gnulib
1144         updates
1145         prompted by recent changes to the GNU coding standards,
1146         which now advise to use quotes 'like this' or "like this"
1147         rather than `like this'.
1148         * NEWS: Document this.
1149         * README, README-hacking, doc/Makefile.am, scripts/backup.in:
1150         * scripts/backup.sh.in, scripts/dump-remind.in:
1151         * src/buffer.c, src/checkpoint.c, src/create.c, src/incremen.c:
1152         * src/misc.c, src/names.c, src/sparse.c, src/transform.c:
1153         * tests/incr02.at, tests/incremental.at, tests/multiv08.at:
1154         * tests/sparse04.at, tests/star/README, tests/update01.at:
1155         Quote 'like this' in comments.
1156         * src/tar.h:
1157         Quote "like this" in comments, when quoting English phrases rather
1158         than code.
1159         * configure.ac:
1160         * scripts/xsparse.c (get_var, read_xheader, main):
1161         * src/compare.c (diff_archive):
1162         * src/extract.c (prepare_to_extract):
1163         * src/tar.c (request_stdin, tar_set_quoting_style, doc, options)
1164         (set_subcommand_option, report_textual_dates, parse_opt)
1165         (decode_options, main):
1166         * src/xheader.c (decx):
1167         Quote 'like this' in diagnostics.
1168         * doc/tar.texi (list, warnings, override)
1169         (Selecting Archive Members, quoting styles, after, hard links)
1170         (Sparse Recovery, Multi-Volume Archives, label):
1171         Adjust documentation to match new output.
1172         * tests/backup01.at, tests/incr01.at, tests/incr04.at:
1173         * tests/label04.at, tests/label05.at, tests/link03.at:
1174         * tests/listed02.at, tests/multiv03.at, tests/multiv05.at:
1175         * tests/rename01.at, tests/rename02.at, tests/rename03.at:
1176         * tests/volume.at:
1177         Adjust tests to match new quoting behavior.
1178
1179 2012-01-18  Paul Eggert  <eggert@cs.ucla.edu>
1180
1181         tar: port --overwrite symlink test to GNU/Hurd
1182
1183         Problem reported by Pino Toscano in
1184         <http://lists.gnu.org/archive/html/bug-tar/2012-01/msg00040.html>.
1185         * gnulib.modules: Add fcntl-h, which defines
1186         HAVE_WORKING_O_NOFOLLOW.
1187         * src/extract.c (open_output_file): Use HAVE_WORKING_O_NOFOLLOW,
1188         not O_NOFOLLOW, when testing whther O_NOFOLLOW works.
1189
1190         This file is a placeholder. It will be replaced with the actual
1191         ChangeLog
1192         by make dist.  Run make ChangeLog if you wish to create it
1193         earlier.
1194
1195 2012-01-11  Paul Eggert  <eggert@cs.ucla.edu>
1196
1197         tar: fix core dump with --index-file=bad_path
1198
1199         * src/tar.c (decode_options): Exit cleanly if index file won't
1200         open.
1201         Problem reported by Khanh-Dang Nguyen Thu Lam in
1202         <http://lists.gnu.org/archive/html/bug-tar/2012-01/msg00018.html>.
1203
1204 2012-01-06  Paul Eggert  <eggert@cs.ucla.edu>
1205
1206         tar: don't assume O_NONBLOCK is benign on regular files
1207
1208         On Data Migration Facility (DMF), High Peformance Storage System
1209         (HPSS),
1210         and presumably other file systems based on hierarchical storage,
1211         opening
1212         a regular file with O_NONBLOCK can cause later reads to fail with
1213         errno == EAGAIN.  We need the O_NONBLOCK to avoid some security
1214         races.
1215         Work around the problem by using fcntl to clear the O_NONBLOCK
1216         flag if I/O fails with that errno value.
1217         Problem reported by Vitezslav Cizek in
1218         <http://lists.gnu.org/archive/html/bug-tar/2012-01/msg00000.html>.
1219         * src/common.h (blocking_read, blocking_write): New decls.
1220         * src/misc.c (blocking_read, blocking_write): New functions.
1221         * src/compare.c (process_rawdata):
1222         * src/create.c (dump_regular_file):
1223         * src/extract.c (extract_file):
1224         * src/sparse.c (sparse_scan_file, sparse_extract_region):
1225
1226 2011-11-26  Sergey Poznyakoff  <gray@gnu.org.ua>
1227
1228         Fix --keep-old-files option.
1229
1230         The regression was introduced by 8f390db9.  This patch implements
1231         additional
1232         option --skip-old-files, which silently skips members which
1233         would cause
1234         writing over existing files, and restores --keep-old-files to
1235         its traditional
1236         behavior.
1237
1238         * NEWS: Update.
1239         * configure.ac: Update.
1240         * doc/tar.texi: Document the changes.
1241         * src/common.h (SKIP_OLD_FILES): New old_files mode.
1242         * src/extract.c (maybe_recoverable): Restore KEEP_OLD_FILES
1243         behavior.
1244         Handle SKIP_OLD_FILES.
1245         * src/tar.c: New option --skip-old-files.
1246         * tests/extrac18.at: New file.
1247         * tests/extrac19.at: New file.
1248         * tests/Makefile.am: Add new test cases.
1249         * tests/testsuite.at: Likewise.
1250
1251 2011-11-17  Sergey Poznyakoff  <gray@gnu.org.ua>
1252
1253         Warn about existing files in keep-old-files mode (complements
1254         8f390db9).
1255
1256         This is controlled by "existing-file" warning code, which is off
1257         by default.
1258
1259         * src/common.h (WARN_EXISTING_FILE): New warning code.
1260         (WARN_VERBOSE_WARNINGS): Add WARN_EXISTING_FILE.
1261         * src/extract.c (maybe_recoverable): warn about existing file
1262         if WARN_EXISTING_FILE is set.
1263         * src/warning.c: New warning type: "existing-file"
1264
1265 2011-11-17  Sergey Poznyakoff  <gray@gnu.org.ua>
1266
1267         Fix the "Creating directory:" output
1268
1269         * src/list.c (print_for_mkdir): don't use unquoted name length for
1270         computing its output width.
1271
1272 2011-11-15  Sergey Poznyakoff  <gray@gnu.org.ua>
1273
1274         Fix operation of --verify in conjunction with --listed-incremental
1275
1276         * src/common.h (clear_directory_table): New proto.
1277         * src/incremen.c (clear_directory_table): New function.
1278         * src/compare.c (diff_dumpdir): Take a pointer to struct
1279         tar_stat_info as argument.
1280         Initialize its fd.
1281         (diff_archive): Update call to diff_dumpdir.
1282         (verify_volume): Call clear_directory_table.
1283
1284 2011-10-18  Paul Eggert  <eggert@cs.ucla.edu>
1285
1286         * doc/tar.texi (Option Summary, absolute): Document -P better,
1287
1288         by describing how it deals with symbolic links on extraction.
1289
1290 2011-09-28  Paul Eggert  <eggert@cs.ucla.edu>
1291
1292         2011-09-27 Paul Eggert <eggert@cs.ucla.edu>
1293
1294         * src/tar.c (stat_on_signal): Use SA_RESTART if available.
1295
1296 2011-09-20  Paul Eggert  <eggert@cs.ucla.edu>
1297
1298         * doc/tar.texi: Remove front- and back-cover texts.
1299
1300         These are no longer needed for this manual, according to the
1301         GNU maintainers guide.  Update copyright date to 2011.
1302
1303 2011-09-19  Sergey Poznyakoff  <gray@gnu.org.ua>
1304
1305         Minor changes.
1306
1307         * scripts/tar-snapshot-edit: License under GPLv3+.
1308         Remove trailing whitespace.
1309
1310 2011-09-19  Nathan Stratton Treadway  <nathanst+bugtar@ontko.com>
1311
1312         Minor changes.
1313
1314         * doc/snapshot.texi: Clarify the use of nfs field in 0 and
1315         1 formats.
1316         Give more precise information about which versions of tar
1317         used each
1318         format.
1319
1320 2011-09-19  Nathan Stratton Treadway  <nathanst+bugtar@ontko.com>
1321
1322         Upgrade tar-snapshot-edit script.
1323
1324         * scripts/tar-snapshot-edit: Update Perl syntax to work
1325         correctly with more recent versions of Perl.  (The original
1326         code worked with in the v5.8 timeframe but not with
1327         Perl v5.10.1 and later.)
1328         Add a "-c" option to check the snapshot file for invalid
1329         field values.
1330         Handle NFS indicator character ("+") in version 0 and 1 files.
1331         Preserve the original header/version line when editing version 1
1332         or 2 files.
1333         Tweak output formatting.
1334         * doc/tar-snapshot-edit.texi: Update documentation.
1335
1336 2011-08-13  Paul Eggert  <eggert@cs.ucla.edu>
1337
1338         tar: --owner and --group names and numbers
1339
1340         The --owner and --group options now accept operands of the form
1341         NAME:NUM, so that you can specify both symbolic name and numeric
1342         ID for owner and group.  Also, in these options, NAME no longer
1343         needs to be present in the current host's user and group
1344         databases; this implements Debian enhancement request 136231
1345         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=136231> reported
1346         by Mark W. Eichin, communicated by Thayne Harbaugh to bug-tar in
1347         <http://lists.gnu.org/archive/html/bug-tar/2011-08/msg00001.html>.
1348         * NEWS, doc/tar.texi (Option Summary, override): Document
1349         enhancement.
1350         * src/common.h (group_name_option, owner_name_option): New decls.
1351         * src/create.c (start_header): Don't assume owner and group names
1352         are in current host database.
1353         * src/tar.c (parse_owner_group): New function, for parsing
1354         NAME:NUM.
1355         (parse_opt): Use it.
1356         (decode_options): Initialize owner_name_option, group_name_option.
1357         * tests/owner.at: New file, to test this enhancement.
1358         * tests/Makefile.am (TESTSUITE_AT): Add it.
1359         * tests/testsuite.at: Include it.
1360
1361 2011-08-13  Paul Eggert  <eggert@cs.ucla.edu>
1362
1363         .gitignore: update
1364
1365         * .gitignore: Add rmt.
1366         * lib/.gitignore: New file.
1367
1368 2011-07-30  Sergey Poznyakoff  <gray@gnu.org.ua>
1369
1370         Fix the --exclude-backups option.
1371
1372         * src/tar.c (add_exclude_array): Take exclude option filags in its
1373         second argument.
1374         (parse_opt): Register backup_file_table with the EXCLUDE_WILDCARDS
1375         flag.
1376         * tests/exclude07.at: New testcase.
1377         * tests/Makefile.am (TESTSUITE_AT): Add testsuite.at.
1378         * tests/testsuite.at: Include exclude07.at.
1379
1380 2011-06-08  Paul Eggert  <eggert@cs.ucla.edu>
1381
1382         tar: simplify birthtime calculations
1383
1384         * src/extract.c (same_birthtime): Remove.
1385         (extract_link, apply_delayed_links): Go back to using
1386         timestamp_cmp
1387         instead of same_birthtime, as this is a bit simpler.  This fix
1388         relies
1389         on an up-to-date gnulib.
1390
1391 2011-06-08  Paul Eggert  <eggert@cs.ucla.edu>
1392
1393         tar: use birthtime rather than ctime when checking identity
1394
1395         Without this fix, tar would sometimes mishandle the extraction of
1396         hard links to symbolic links.  Problem reported in
1397         <http://lists.gnu.org/archive/html/bug-tar/2011-06/msg00000.html>
1398         by Andreas Stolcke.
1399         * src/extract.c (struct delayed_link): Change ctime member
1400         to birthtime.
1401         (same_birthtime): New function.
1402         (create_placeholder_file, extract_link, apply_delayed_links):
1403         Use it to compare birthtimes (when available) instead of ctime.
1404
1405 2011-05-26  Paul Eggert  <eggert@cs.ucla.edu>
1406
1407         * doc/tar.texi (Old Options): Clarify distinction from short
1408         options.
1409
1410         Adjust other parts of the manual to use examples that parse the
1411         same regardless of whether "-" is in front of the option clump.
1412         See
1413         <http://lists.gnu.org/archive/html/bug-tar/2011-05/msg00022.html>.
1414
1415 2011-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>
1416
1417         Testsuite fix.
1418
1419         * tests/sparse04.at: Use the -f option.
1420
1421 2011-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>
1422
1423         Version 1.26
1424
1425         * NEWS, configure.ac: Update.
1426         * po/POTFILES.in: Remove paxexit.c (see bb971a1e).
1427
1428 2011-03-08  Paul Eggert  <eggert@cs.ucla.edu>
1429
1430         --atime-preserve=replace: fix correctness and performance bugs
1431
1432         reported by Eric Blake in
1433         <http://lists.gnu.org/archive/html/bug-tar/2011-03/msg00000.html>.
1434         * src/compare.c (diff_file): Do not restore atime of size-zero
1435         files.
1436         * src/create.c (dump_file0): Likewise.  Also, do not restore atime
1437         when fd is zero, because that indicates a file we haven't opened.
1438
1439 2011-02-23  Paul Eggert  <eggert@cs.ucla.edu>
1440
1441         * doc/tar.texi: Adjust example commands and output for accuracy.
1442
1443         The original problem was reported by Michael Witten in
1444         <http://lists.gnu.org/archive/html/bug-tar/2011-02/msg00033.html>.
1445
1446 2011-02-16  Paul Eggert  <eggert@cs.ucla.edu>
1447
1448         tar: if (p) free (p); -> free (p);
1449
1450         There is no longer (since SunOS 4) any need to guard against
1451         free (NULL), so replace each "if (p) free (p);" with "free (p);".
1452         From Jim Meyering in
1453         <http://lists.gnu.org/archive/html/bug-tar/2011-01/msg00026.html>.
1454         * src/incremen.c (scan_directory, read_directory_file): As above.
1455         (try_purge_directory): Likewise.
1456         * src/list.c (read_header): Likewise.
1457         * src/misc.c (assign_string): Likewise.
1458
1459 2010-12-14  Sergey Poznyakoff  <gray@gnu.org.ua>
1460
1461         Correctly store long sparse file names in PAX archives.
1462
1463         * src/sparse.c (pax_dump_header_1): Make sure the created header
1464         name is
1465         shorter than NAME_FIELD_SIZE bytes.
1466         * tests/sparse04.at: New testcase.
1467         * tests/Makefile.am (TESTSUITE_AT): Add sparse04.at.
1468         * tests/testsuite.at: Include sparse04.at.
1469         * NEWS: Update.
1470
1471 2010-12-07  Paul Eggert  <eggert@cs.ucla.edu>
1472
1473         tests: make the truncate test smaller and less buggy (tiny change)
1474
1475         Reported by Solar Designer in
1476         <http://lists.gnu.org/archive/html/bug-tar/2010-12/msg00003.html>.
1477         * tests/truncate.at: Use a smaller test case, and make its
1478         race condition less likely.
1479
1480 2010-11-27  Paul Eggert  <eggert@cs.ucla.edu>
1481
1482         tests: skip SIGPIPE-dependent tests in environments ignoring
1483         SIGPIPE
1484
1485         Problem reported by Sven Joachim in
1486         <http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00043.html>.
1487         * tests/remfiles01.at: Use AT_SIGPIPE_PREREQ.
1488         * tests/sigpipe.at: Likewise.
1489         * tests/testsuite.at (AT_SIGPIPE_PREREQ): New macro.
1490
1491 2010-11-25  Paul Eggert  <eggert@cs.ucla.edu>
1492
1493         tar: work around NetBSD and Tru64 symlink incompatibility
1494         with POSIX
1495
1496         Problem reported by Bruno Haible in
1497         <http://lists.gnu.org/archive/html/bug-gnulib/2010-11/msg00306.html>.
1498         * src/extract.c (maybe_recoverable):  Also treat EFTYPE (if
1499         defined)
1500         and ENOTSUP like ELOOP.
1501
1502 2010-11-24  Paul Eggert  <eggert@cs.ucla.edu>
1503
1504         tar: adjust to paxutils change: paxexit.c -> paxexit-status.c
1505
1506         * lib/Makefile.am (libtar_a_SOURCES): paxexit.c renamed to
1507         paxexit-status.c.
1508
1509 2010-11-24  Paul Eggert  <eggert@cs.ucla.edu>
1510
1511         tar: remove unused function dir_removed_diag
1512
1513         * src/common.h (dir_removed_diag): Remove unused decl.
1514         * src/misc.c (dir_removed_diag): Remove unused function.
1515
1516 2010-11-23  Paul Eggert  <eggert@cs.ucla.edu>
1517
1518         tar: work around FreeBSD symlink incompatibility with POSIX
1519
1520         * src/extract.c (maybe_recoverable): Treat EMLINK like ELOOP, for
1521         FreeBSD.  Problem reported by Christian Weisgerber in
1522         <http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00080.html>.
1523
1524 2010-11-23  Paul Eggert  <eggert@cs.ucla.edu>
1525
1526         * src/names.c: tar: fix bug with --one-file-system
1527         --listed-incremental
1528
1529         Problem (and idea for fix) reported by Martin Weigel
1530         <http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00071.html>.
1531         * src/common.h (is_individual_file): Remove decl.
1532         * src/create.c (dump_file0): Replace "is_individual_file (p)"
1533         with "top_level".
1534         * src/incremen.c (procdir): Replace "!is_individual_file
1535         (name_buffer)" with "st->parent".  Fix bug with --one-file-system
1536         and --listed-incremental.
1537         * src/names.c (individual_file_table, register_individual_file):
1538         (is_individual_file): Remove.  All uses removed.
1539
1540 2010-11-23  Paul Eggert  <eggert@cs.ucla.edu>
1541
1542         tests: new test listed04 for --one-file-system
1543         --listed-incremental
1544
1545         * tests/Makefile.am (TESTSUITE_AT): Add listed04.at.
1546         * tests/listed04.at: New file.
1547         * tests/testsuite.at: Include it.
1548
1549 2010-11-23  Paul Eggert  <eggert@cs.ucla.edu>
1550
1551         scripts: fix option parsing
1552
1553         Problem reported by Dennis Wydra in
1554         <http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00082.html>.
1555         * scripts/backup.in: Accept "-l LEVEL".  Be more systematic about
1556         backslashes inside ``; it shouldn't matter for modern shells but
1557         it might matter for older ones.
1558         * scripts/restore.in: Likewise.
1559         * scripts/backup.in: Adjust implementation of -t/--time to match
1560         the new implementation of -l/--level.
1561
1562 2010-11-15  Sergey Poznyakoff  <gray@gnu.org.ua>
1563
1564         Issue a warning if the archive being compared contais transformed
1565         file names.
1566
1567         * src/common.h (transform_program_p): New proto.
1568         * src/transform.c (transform_program_p): New function.
1569         * src/compare.c (verify_volume): Warn if the archive contains
1570         transformed file names.
1571
1572 2010-11-15  Sergey Poznyakoff  <gray@gnu.org.ua>
1573
1574         Minor change.
1575
1576         * doc/tar.texi: Reword the description of decompress-program.
1577
1578 2010-11-15  Paul Eggert  <eggert@cs.ucla.edu>
1579
1580         tar: fix --verify option, which broke in 1.24
1581
1582         * NEWS: Document this.
1583         * src/compare.c (verify_volume): Decode the header before invoking
1584         diff_archive, as diff_archive no longer does this as of the
1585         2010-06-28 commit.  Also, don't try to invoke diff_archive on a
1586         zero block.
1587         * tests/Makefile.am (TESTSUITE_AT): Add verify.at.
1588         * tests/testsuite.at: Include verify.at.
1589         * tests/verify.at: New file.
1590
1591 2010-11-08  Paul Eggert  <eggert@cs.ucla.edu>
1592
1593         Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/tar
1594
1595 2010-11-08  Jim Meyering  <meyering@redhat.com>
1596
1597         tests: avoid spurious failure when VERSION_CONTROL envvar is set
1598
1599         * tests/backup01.at: Unset VERSION_CONTROL.  Otherwise,
1600         when set to e.g., 'always', it would cause this test to fail.
1601
1602 2010-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>
1603
1604         Version 1.25
1605
1606         * configure.ac: Version 1.25
1607         * NEWS: Describe the changes.
1608
1609 2010-11-05  Sergey Poznyakoff  <gray@gnu.org.ua>
1610
1611         Run alternative decompression programs if the principal one is
1612         not available.
1613
1614         Some compression programs are able to handle various compression
1615         formats
1616         (e.g. `gzip' can decompress files created by `compress', `xz'
1617         is able
1618         to handle lzma, etc.)  Tar tries to use such programs for
1619         decompression
1620         if the principal decompressor cannot be started.
1621
1622         * src/buffer.c (compress_type): Swap ct_none and ct_tar.
1623         (archive_compression_type): New static variable.
1624         (zip_magic): Remove program and option fields.
1625         (zip_program): New structure and static.
1626         (compress_program): Remove macro.
1627         (find_zip_program): New static function.
1628         (first_decompress_program,next_decompress_program): New functions.
1629         (open_compressed_archive): Set archive_compression_type instead of
1630         use_compress_program_option.
1631         * src/common.h (first_decompress_program)
1632         (next_decompress_program): New functions.
1633         (WARN_DECOMPRESS_PROGRAM): New flag.
1634         (WARN_VERBOSE_WARNINGS): Include WARN_DECOMPRESS_PROGRAM.
1635         * src/warning.c (warning_args): Add "decompress-program".
1636         (warning_types): Add WARN_DECOMPRESS_PROGRAM.
1637         * src/system.c (run_decompress_program): New function.
1638         (sys_child_open_for_uncompress): Use run_decompress_program
1639         instead of calling execlp directly.
1640
1641 2010-11-02  Paul Eggert  <eggert@cs.ucla.edu>
1642
1643         tests: fix some issues with signals, timestamps, "test" typo
1644
1645         * tests/extrac17.at: Add --warning=no-timestamp, to avoid
1646         bogus warning due to NFS clock skew.
1647         * tests/remfiles01.at: Discard diagnostics that some shells
1648         generate about broken pipes.
1649         * tests/sigpipe.at: Likewise.
1650         * tests/remfiles01.at: Fix typo: "test $EC" was written where
1651         "test $EC -ne 0" was intended.
1652
1653 2010-11-01  Sergey Poznyakoff  <gray@gnu.org.ua>
1654
1655         Fix extraction of device nodes.
1656
1657         * src/extract.c (extract_node): Do not mask out node type.
1658         The bug was introduced in commit ea964cce.
1659
1660 2010-10-28  Paul Eggert  <eggert@cs.ucla.edu>
1661
1662         tar: don't cross struct member boundaries with OLDGNU_MAGIC
1663
1664         * src/create.c (write_gnu_long_link, start_header): Access
1665         header->buffer + offsetof (struct posix_header, magic), instead of
1666         header->header.magic, when reading or writing the OLDGNU_MAGIC
1667         pattern.  The code violates the C standard without this change,
1668         and GCC warns about this if fortify checking is enabled.  It's not
1669         a bug on traditional (i.e., non-debugging) platforms, but it does
1670         violate the C standard so it should be fixed.  Problem originally
1671         reported by John Emil Karlson in
1672         <http://lists.gnu.org/archive/html/bug-tar/2010-04/msg00023.html>.
1673         * src/list.c (decode_header): Likewise.
1674
1675 2010-10-28  Paul Eggert  <eggert@cs.ucla.edu>
1676
1677         tests: port to sh variants that squirrel away file descriptors
1678
1679         OpenBSD /bin/sh, and some other sh variants, squirrel away file
1680         descriptors before closing them.  For example, for "cat 3<&-" they
1681         first dup file descriptor 3 to a fd that is 10 or greater, then
1682         close 3 (because if "cat" had been a builtin command like ":" then
1683         they would have wanted to avoid the fork and restore the fd after
1684         ":" finished); and they treat ordinary (forking) commands the same
1685         as builtin commands.  This approach fails after "ulimit -n 10".
1686         Work around this deficiency by closing the file descriptors before
1687         invoking ulimit.  Problem reported by Christian Weisgerber in
1688         <http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00041.html>;
1689         solution suggested by Jilles Tjoelker in
1690         <http://article.gmane.org/gmane.comp.shells.dash/415>.
1691
1692         * tests/extrac11.at (scarce file descriptors): Close file
1693         descriptors before invoking ulimit -n.
1694
1695 2010-10-27  Sergey Poznyakoff  <gray@gnu.org.ua>
1696
1697         Transform file names when updating and appendig to archives.
1698
1699         This complements 28e91b48.
1700
1701         * src/common.h (transform_stat_info): New prototype.
1702         * src/list.c (transform_stat_info): Remove static qualifier.
1703         * src/update.c (update_archive): Call transform_stat_info.
1704         * tests/Makefile.am (TESTSUITE_AT): Add append03.at
1705         * tests/testsuite.at: Include append03.at
1706
1707 2010-10-27  Paul Eggert  <eggert@cs.ucla.edu>
1708
1709         tests: port to Solaris diff
1710
1711         * tests/extrac13.at: Don't assume that "diff -c" outputs nothing
1712         when there are no differences.  This is not true on Solaris,
1713         where it outputs "No differences encounted".
1714
1715 2010-10-27  Paul Eggert  <eggert@cs.ucla.edu>
1716
1717         tar: fix -x --overwrite bug (no --dereference, ! O_NOFOLLOW)
1718
1719         This bug was discovered on Solaris 8.  On older hosts lacking
1720         O_NOFOLLOW, tar -x --overwrite (without --dereference) follows
1721         symbolic links, causing the "extract over symlinks" test to fail.
1722
1723         * src/extract.c (open_output_file): If O_NOFOLLOW is needed but
1724         does not work, check for a symlink separately.
1725
1726 2010-10-27  Paul Eggert  <eggert@cs.ucla.edu>
1727
1728         tar: don't use "((" in shell scripts
1729
1730         * tests/extrac11.at: Replace "((" with "( (" in shell scripts, as
1731         "((" is not portable to the Korn shell, and POSIX 1003.1-2008 says
1732         that "((" is not portable.
1733
1734 2010-10-26  Sergey Poznyakoff  <gray@gnu.org.ua>
1735
1736         Make sure name matching occurs before name transformation.
1737
1738         The commit 9c194c99 altered that order.
1739
1740         * src/list.c (transform_stat_info): New function.  Split off from
1741         decode_header.
1742         (read_and): Call transform_stat_info right before do_something,
1743         and after deciding if we should proceed with this member name,
1744         so that name matching occurs before name transformation.
1745
1746         * tests/extrac17.at: New file.
1747         * tests/Makefile.am (TESTSUITE_AT): Add extrac17.at
1748         * tests/testsuite.at: Include extrac17.at.
1749
1750 2010-10-26  Paul Eggert  <eggert@cs.ucla.edu>
1751
1752         tar: don't assume stdin is open when testing fd limits
1753
1754         * tests/extrac11.at: Redirect stdin from /dev/null, in case
1755         the parent 'make' is running with stdin closed.
1756
1757 2010-10-26  Sergey Poznyakoff  <gray@gnu.org.ua>
1758
1759         Further fixes in bootstrap.
1760
1761         * bootstrap: Restore the default for gnulib_path
1762         (symlink_to_dir): Re-apply 67cad07.
1763
1764 2010-10-26  Paul Eggert  <eggert@cs.ucla.edu>
1765
1766         tar: fix bug with -C and extracting directories
1767
1768         Problem reported by Denis Excoffier in
1769         <http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00034.html>.
1770
1771         * src/extract.c (extract_dir): Use mkdirat, not mkdir.
1772         * tests/extrac16.at: New file, to test for this bug.
1773         * tests/Makefile.am (TESTSUITE_AT): Add it.
1774         * tests/testsuite.at: Include it.
1775
1776         This file is a placeholder. It will be replaced with the actual
1777         ChangeLog
1778         by make dist.  Run make ChangeLog if you wish to create it
1779         earlier.
1780
1781 2010-10-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1782
1783         Version 1.24
1784
1785         * configure.ac, NEWS: Version 1.24
1786         * bootstrap: Restore tar-specific code lost during last
1787         sync from gnulib (241b72ffad).
1788         * src/misc.c (chdir_do): Remove unused automatic variable.
1789
1790 2010-10-16  Paul Eggert  <eggert@cs.ucla.edu>
1791
1792         tar: use more-accurate diagnostic when intermediate mkdir fails
1793
1794         Without this change, if tar tried to extract a file A/B/C, noticed
1795         that A/B didn't exist, attempted to mkdir A/B, and the mkdir
1796         failed, it did not diagnose the mkdir failure, but simply reported
1797         the failure to open A/B/C.  This sometimes led to confusion
1798         because it wasn't clear what tar was trying to do, in particular
1799         that tar tried to mkdir A/B.  With this patch, tar issues two
1800         diagnostics in this case: one for A/B and the other for A/B/C.
1801         Problem reported by Hauke Laging in
1802         <http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00020.html>.
1803         * gnulib.modules: Remove faccessat.
1804         * src/extract.c (make_directories): New arg INTERDIR_MADE.
1805         Diagnose mkdir failure.  Return 0 on success, nonzero on failure,
1806         as opposed to nonzero iff some directory was created.  All callers
1807         changed.  Simplify the code when mkdir fails, by checking whether
1808         the desired file exists unless errno==EEXIST: this is more robust.
1809         * tests/extrac15.at: New test, to check this.
1810         * tests/Makefile.am (TESTSUITE_AT): Add it.
1811         * tests/testsuite.at: Include it.
1812
1813 2010-10-16  Paul Eggert  <eggert@cs.ucla.edu>
1814
1815         tests: port to NFS file servers with clock skew
1816
1817         Several of the tests assumed that a newly created file cannot
1818         have a time stamp dated in the future.  This assumption is not
1819         true when files are served by a remote host whose clock is
1820         slightly in advance of ours.  Fix the problems that I observed
1821         when running "make check" a couple of times on such a server.
1822
1823         * tests/backup01.at: Use --warning=no-timestamp to suppress
1824         clock-skew warnings.
1825         * tests/chtype.at, tests/comprec.at, tests/exclude06.at:
1826         * tests/extrac01.at, tests/extrac03.at, tests/extrac05.at:
1827         * tests/extrac06.at, tests/extrac08.at, tests/extrac13.at:
1828         * tests/extrac14.at, tests/incr01.at, tests/incr03.at,
1829         tests/link01.at:
1830         * tests/multiv01.at, tests/multiv02.at, tests/multiv03.at:
1831         * tests/pipe.at, tests/rename02.at, tests/rename03.at:
1832         * tests/rename05.at, tests/same-order01.at, tests/same-order02.at:
1833         * tests/sparse01.at:
1834         Likewise.
1835
1836 2010-10-12  Paul Eggert  <eggert@cs.ucla.edu>
1837
1838         gnulib: sync from latest gnulib, notably bootstrap and
1839         parse-datetime
1840
1841         * bootstrap: Sync from gnulib.
1842         * doc/.gitignore: Rename getdate.texi to parse-datetime.texi.
1843         * doc/Makefile.am (tar_TEXINFOS): Likewise.
1844         * doc/tar.texi (Top): Adjust to renaming of getdate to
1845         parse-datetime.
1846         * gnulib.modules: Likewise.  Also, remove ftruncate (now
1847         obsolete).
1848         And add inttostr (we missed this dependency).
1849         * src/tar.c: Include parse-datetime.h, not getdate.h.  All calls
1850         to get_date replaced with parse_datetime.
1851
1852 2010-09-24  Paul Eggert  <eggert@cs.ucla.edu>
1853
1854         tar: -x -C symlink fix
1855
1856         * src/misc.c (chdir_do): Don't use O_NOFOLLOW when opening the
1857         argument to -C.  This is for consistency with "tar -c -C FOO", and
1858         matches the new documentation.
1859         * tests/extrac14.at: New file.
1860         * tests/Makefile.am (TESTSUITE_AT): Add it.
1861         * tests/testsuite.at: Include it.
1862
1863 2010-09-24  Paul Eggert  <eggert@cs.ucla.edu>
1864
1865         tar: --dereference consistency
1866
1867         This closes another race condition, that occurs when overwriting a
1868         symlink with a regular file.
1869         * NEWS (--dereference consistency): New section.
1870         * doc/tar.texi (Option Summary): Describe new --deference
1871         behavior.
1872         (dereference): Likewise.  Remove discussion that I didn't follow,
1873         even before --dereference was changed.
1874         * src/common.h (deref_stat, set_file_atime): Adjust signatures.
1875         * src/compare.c (diff_file, diff_multivol): Respect
1876         open_read_flags
1877         instead of rolling our own flags.  This implements the new
1878         behavior
1879         for --dereference.
1880         (diff_file, diff_dumpdir): Likewise, for fstatat_flags.
1881         * src/create.c: Adjust to set_file_atime signature change.
1882         * src/extract.c (mark_after_links, file_newer_p, extract_dir):
1883         Likewise.
1884         * src/incremen.c (try_purge_directory): Likewise.
1885         * src/misc.c (maybe_backup_file): Likewise.
1886         * src/extract.c (file_newer_p): New arg STP.  All callers changed.
1887         (maybe_recoverable): New arg REGULAR.  All callers changed.
1888         Handle the case of overwriting a symlink with a regular file,
1889         when --overwrite is specified but --dereference is not.
1890         (open_output_file): Add O_CLOEXEC, O_NOCTTY, O_NONBLOCK for
1891         consistency with file creation.  Add O_NOFOLLOW if
1892         overwriting_old_files && ! dereference_option.
1893         * src/incremen.c (update_parent_directory): Use fstat, not
1894         fstatat;
1895         there's less to go wrong.
1896         * src/misc.c (deref_stat): Remove DEREF arg.  All callers changed.
1897         Instead, use fstatat_flags.
1898         (set_file_atime): Remove ATFLAG arg.  All callers changed.
1899         Instead, use fstatat_flags.
1900         * src/names.c, src/update.c: Adjust to deref_stat signature
1901         change.
1902         * src/tar.c (get_date_or_file): Use stat, not deref_stat, as this
1903         is not a file to be archived.
1904         * tests/Makefile.am (TESTSUITE_AT): Add extrac13.at.
1905         * tests/extrac13.at: New file.
1906         * tests/testsuite.at: Include it.
1907
1908 2010-09-20  Paul Eggert  <eggert@cs.ucla.edu>
1909
1910         tar: do not crash with --listed-incremental
1911
1912         Problem reported by Frantisek Hanzlik in
1913         <https://bugzilla.redhat.com/635318> via Kamil Dudka in
1914         <http://lists.gnu.org/archive/html/bug-tar/2010-09/msg00066.html>.
1915         I don't understand this code either, but Sergey can take a look at
1916         this patch, and perhaps install a better one, when he has
1917         the time.
1918         * src/incremen.c (append_incremental_renames): Don't actually
1919         append
1920         anything to DIR if DIR is null.
1921
1922 2010-09-19  Paul Eggert  <eggert@cs.ucla.edu>
1923
1924         tar: prefer openat-style functions
1925
1926         This change replaces traditional functions like 'open' with the
1927         POSIX.1-2008 functions like 'openat'.  Mostly this is an internal
1928         refactoring change, in preparation for further changes to close
1929         some races.
1930         * gnulib.modules: Add faccessat, linkat, mkfifoat, renameat,
1931         symlinkat.
1932         Remove save-cwd.
1933         * src/Makefile.am (tar_LDADD): Add $(LIB_EACCESS).
1934         * tests/Makefile.am (LDADD): Likewise.
1935         * src/common.h (chdir_fd): New extern var.
1936         * src/compare.c (diff_file, diff_multivol): Use openat instead
1937         of open.
1938         * src/create.c (create_archive, restore_parent_fd): Likewise.
1939         * src/extract.c (create_placeholder_file): Likewise.
1940         * src/names.c (collect_and_sort_names): Likewise.
1941         * src/update.c (append_file): Likewise.
1942         * src/compare.c (diff_symlink): Use readlinkat instead of
1943         readlink.
1944         * src/compare.c (diff_file): Use chdir_fd instead of AT_FDCWD.
1945         * src/create.c (subfile_open, dump_file0): Likewise.
1946         * src/extract.c (fd_chmod, fd_chown, fd_stat, set_stat):
1947         (repair_delayed_set_stat, apply_nonancestor_delayed_set_stat):
1948         Likewise.
1949         * src/extract.c (mark_after_links, file_newer_p, extract_dir):
1950         (extract_link, apply_delayed_links):
1951         Use fstatat rather than stat or lstat.
1952         * src/misc.c (maybe_backup_file, deref_stat): Likewise.
1953         * src/extract.c (make_directories): Use mkdirat rather than mkdir.
1954         Use faccessat rather than access.  This fixes a minor permissions
1955         bug when tar is running setuid (who would want to do that?!).
1956         (open_output_file): Use openat rather than open.
1957         In the process, this removes support for Masscomp's O_CTG files,
1958         which aren't compatible with openat's signature.  Masscomp!  Wow!
1959         That's a blast from the past.  As far as I know, that operating
1960         system hasn't been supported for more than 20 years.
1961         (extract_link, apply_delayed_links):
1962         Use linkat rather than link.
1963         (extract_symlink, apply_delayed_links):
1964         Use symlinkat rather than symlink.
1965         (extract_node): Use mknodat rather than mknod.
1966         (extract_fifo): Use mkfifoat rather than mkfifo.
1967         (apply_delayed_links): Use unlinkat rather than unlink or rmdir.
1968         * src/misc.c (safer_rmdir, remove_any_file): Likewise.
1969         * src/unlink.c (flush_deferred_unlinks): Likewise.
1970         * src/extract.c (rename_directory): Use renameat rather than
1971         rename.
1972         * src/misc.c (maybe_backup_file, undo_last_backup): Likewise.
1973         * src/misc.c: Don't include <save-cwd.h>; no longer needed now
1974         that we're using openat etc.
1975         (struct wd): Add member fd.  Remove members err and fd.  All uses
1976         changed.
1977         (CHDIR_CACHE_SIZE): New constant.
1978         (wdcache, wdcache_count, chdir_fd): New vars.
1979         (chdir_do): Use openat rather than save_cwd.  Keep the cache up
1980         to date.  This code won't scale well, but is good enough for now.
1981         * src/update.c (update_archive): Use openat + fdopendir +
1982         streamsavedir rather than savedir.
1983
1984         This file is a placeholder. It will be replaced with the actual
1985         ChangeLog
1986         by make dist.  Run make ChangeLog if you wish to create it
1987         earlier.
1988
1989 2010-09-18  Paul Eggert  <eggert@cs.ucla.edu>
1990
1991         tar: add utimens.h includes
1992
1993         * src/extract.c: Include <utimens.h>, needed for fdutimens
1994         prototype.
1995         * src/misc.c: Likewise.
1996
1997 2010-09-18  Paul Eggert  <eggert@cs.ucla.edu>
1998
1999         tar: switch to gnulib fdutimensat module
2000
2001         * gnulib.modules: Add fdutimensat.
2002         * src/common.h (fd_utimensat): Remove decl.
2003         * src/extract.c (set_stat): Call fdutimensat, not fd_utimensat.
2004         * src/misc.c (set_file_atime): Likewise.
2005         (fd_utimensat): Remove.
2006
2007 2010-09-17  Paul Eggert  <eggert@cs.ucla.edu>
2008
2009         tar: extract permissions for . last
2010
2011         * src/common.h (must_be_dot_or_slash): New decl.
2012         * src/extract.c (mark_after_links): New function, taking code
2013         that used to be in create_placeholder_file.
2014         (create_placeholder_file): Use it.
2015         (delay_set_stat): Always delay setting status for . and /.
2016         * src/misc.c (must_be_dot_or_slash): Now extern.
2017         * tests/extrac12.at: New file.
2018         * tests/Makefile.am (TESTSUITE_AT): Add it.
2019         * tests/testsuite.at: Likewise.
2020
2021 2010-09-17  Paul Eggert  <eggert@cs.ucla.edu>
2022
2023         tar: don't check for getdtablesize; use AC_CHECK_FUNCS_ONCE
2024
2025         * configure.ac: Don't check for getdtablesize; no longer needed.
2026         Use AC_CHECK_FUNCS_ONCE rather than AC_CHECK_FUNCS, for
2027         efficiency.
2028
2029 2010-09-17  Paul Eggert  <eggert@cs.ucla.edu>
2030
2031         tar: extract symlink attributes, close some symlink-related races
2032
2033         * NEWS: Describe symlink-extraction improvements.
2034         * src/extract.c (enum permstatus): Remove.
2035         (fchmod, fchown): Define dummy replacement macros if the system
2036         does not supply them.
2037         (implemented): New function.
2038         (struct delayed_set_stat): Remove members invert_permissions,
2039         permstatus.  They were too confusing, and tried to do too much
2040         in too-little space.  Instead, add members current_mode,
2041         current_mode_mask, interdir, atflag.  All users changed.
2042         (struct delayed_link): Add members mode, atime, mtime, to support
2043         platforms such as BSD where symlinks have these attributes.
2044         All users changed.
2045         (fd_chmod): Renamed from fdchmod.  New argument atflag.  Check for
2046         operation not supported at run-time, not at configure-time.  Put
2047         fd argument first.  All callers changed.
2048         (fd_chown): Likewise, renaming from fdchown.
2049         (fd_stat): Likewise, renaming from fdstat.
2050         (set_mode): Remove args stat_info, cur_info, invert_permissions,
2051         permstatus.  Add args mode, mode_mask, current_mode,
2052         current_mode_mask,
2053         atflag.  All callers changed.  Close some races.  Use an easier-to
2054         understand method for computing permissions.  Work around POSIX
2055         incompatibility in Linux fchmodat.  Support extraction of symlink
2056         modes, if the OS allows it.
2057         (set_stat): Remove args cur_info, invert_permissions, permstatus.
2058         Add args current_mode, current_mode_mask, interdir, atflag.
2059         All callers changed.  Close some races.  Support extraction of
2060         attributes on symlinks, if the OS allows it.
2061         (delay_set_stat): Remove args invert_permissions, permstatus.
2062         Add args current_mode, current_mode_mask, mode, atflag.
2063         The ST arg can be null now, indicating that it's an intermediate
2064         directory.  All callers changed.
2065         (repair_delayed_set_stat, apply_nonancestor_delayed_set_stat):
2066         Close some races.
2067         (extract_dir): Also be paranoid if only --same-permissions, due
2068         to semantics of setgid and setuid directories on some hosts.
2069         This closes a race on those hosts.  Simplify calculation of
2070         delay_set_stat arguments; the old code was truly strange and
2071         probably wrong in some border cases.
2072         (extract_dir, extract_file, extract_node, extract_fifo): Don't
2073         rely on
2074         unspecified behavior in mode arg of open, mknod, etc.  Instead,
2075         mask out those bits when creating the file, and add them later via
2076         fchmod or chmodat.
2077         (open_output_file): file_name is now const.  Add arg current_mode,
2078         current_mode_mask.  All callers changed.  When overwriting
2079         old files,
2080         refuse to overwrite something that is not a regular file, since
2081         we're extracting a regular file.
2082         (extract_file): Remove the FIXME comment.  Whatever the protection
2083         issues were, they should be fixed now.  As a result of all
2084         the other
2085         API changes, we now use fchmod etc. rather than chmod etc.,
2086         closing
2087         some races.
2088         (create_placeholder_file, apply_delayed_links): Record desired
2089         mode and times for symlinks, for OSes that support that.
2090
2091 2010-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2092
2093         tar: tar -x without --incremental no longer sets atime again
2094
2095         * src/extract.c (set_stat): Use UTIME_OMIT rather than UTIME_NOW.
2096         The UTIME_NOW was there only to emulate the previous behavior of
2097         using the current time, and the previous behavior was there only
2098         because before we started assuming POSIX.1-2008 there was no
2099         portable way to get the effect of UTIME_NOW.
2100
2101 2010-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2102
2103         tar: another --atime-preserve race fix
2104
2105         * src/common.h (set_file_atime): Add parentfd arg.
2106         * src/compare.c (diff_file): Use it.
2107         * src/create.c (dump_file0): Likewise.  This closes yet another
2108         race condition with symbolic links.
2109         * src/misc.c (set_file_atime): Add parentfd arg.
2110
2111 2010-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2112
2113         tar: --atime-preserve fixes for races etc.
2114
2115         This patch fixes a race condition in the --atime-preserve=replace
2116         option, which might cause tar to improperly follow a symbolic
2117         link.
2118
2119         It also drops the use of the _FIOSATIME ioctl of Solaris 2.x
2120         and later, which loses resolution on time stamps.  Modern Solaris
2121         systems support full-resolution time stamps in the kernel, and
2122         it's not worth the hassle of testing this call, useful only in
2123         no-longer-supported Solaris variants.
2124
2125         Also, it undoes a change I recently introduced to the --compare
2126         option, which caused it to not follow symbolic links unless the
2127         --dereference option was also used.  Quite possibly this change is
2128         a good idea, but the old behavior was documented and the change
2129         should not have been installed casually.
2130
2131         * configure.ac: Don't check for stropts.h and sys/filio.h.
2132         * gnulib.modules: Add futimens, utimensat.  Remove futimens.
2133         * src/common.h (fd_utimensat): New decl.
2134         * src/compare.c (diff_file, diff_multivol):
2135         Don't use open_read_flags: those are for --create only.
2136         * src/create.c (dump_file0): Adjust to set_file_atime changes.
2137         Pass fstatat_flags to set_file_atime, so that symbolic links are
2138         not followed inadvertantly.
2139         * src/extract.c: Don't include utimens.h.
2140         (set_stat): Use fd_utimensat ant UTIME_NOW rather than fdutimens.
2141         * src/misc.c: Don't include utimens.h, stropts.h, sys/filio.h.
2142         (fd_utimensat): New function.
2143         (set_file_atime): Use it.  New arg atflag, controlling symlink
2144         handling.  All callers changed.
2145
2146 2010-09-14  Paul Eggert  <eggert@cs.ucla.edu>
2147
2148         * configure.ac: tar: close some race conditions when extracting
2149
2150         * configure.ac: Check for fchmod and fchown.  Don't check
2151         for utimes.
2152         * src/extract.c (fdchmod, fdchown, fdstat): New functions.
2153         (set_mode, set_stat): New arg FD.  All callers changed.
2154         This avoids some race conditions between closing a regular file
2155         and setting its metadata, and it's a bit faster.
2156
2157 2010-09-13  Paul Eggert  <eggert@cs.ucla.edu>
2158
2159         tar: don't worry about fdopendir closing its argument
2160
2161         * NEWS: Don't mention dirfd; no longer needed.
2162         * gnulib.modules: Remove dirfd.
2163         * src/create.c (get_directory_entries): Remove the code dealing
2164         with dirfd failures, as the new fdopendir replacement doesn't
2165         close its argument so we don't need to call dirfd.  See
2166         <http://lists.gnu.org/archive/html/bug-gnulib/2010-09/msg00208.html>
2167         and gnulib commit 970c9038e4cca46e1b037ae0a6d574dfae6a7327.
2168
2169 2010-09-13  Paul Eggert  <eggert@cs.ucla.edu>
2170
2171         * NEWS: Fix wording typo in previous change.
2172
2173         Reported by Jim Meyering.
2174
2175 2010-09-13  Paul Eggert  <eggert@cs.ucla.edu>
2176
2177         tar: live within system-supplied limits on file descriptors
2178
2179         * NEWS: Note the change.  Mention dirfd and fdopendir.
2180         * gnulib.modules: Add dirfd and fdopendir.  The code was already
2181         using fdopendir; dirfd is a new need.
2182         * src/common.h (open_searchdir_flags, get_directory_entries):
2183         (subfile_open, restore_parent_fd, tar_stat_close): New decls.
2184         (check_exclusion_tags): Adjust signature to match code change.
2185         * src/create.c (IMPOSTOR_ERRNO): New constant.
2186         (check_exclusion_tags): First arg is now a struct tar_stat_info
2187         const *, not an fd.  All callers changed.
2188         (dump_regular_file, dump_file0): A zero fd represents an unused
2189         slot, so play it safe if the fd member is zero here.  A negative
2190         fd represents the negation of an errno value, so play it safe and
2191         do not assign -1 to fd merely because an open fails.
2192         (open_failure_recover, get_directory_entries, restore_parent_fd):
2193         (subfile_open): New functions.  These help to recover from file
2194         descriptor exhaustion.
2195         (dump_dir, dump_file0): Use them.
2196         (dump_file0): Use tar_stat_close instead of rolling our own close.
2197         * src/incremen.c (scan_directory): Use get_directory_entries,
2198         subfile_open, etc., to recover from file descriptor exhaustion.
2199         * src/names.c (add_hierarchy_to_namelist): Likewise.
2200         (collect_and_sort_names): A negative fd represents the negation
2201         of an errno value, so play it safe and do not assign -1 to fd.
2202         * src/tar.c (decode_options): Set open_searchdir_flags.
2203         Add O_CLOEXEC to all the open flags.
2204         (tar_stat_close): New function, which knows how to deal with
2205         new convention for directory streams and file descriptors.
2206         Diagnose 'close' failures.
2207         (tar_stat_destroy): Use it.
2208         * src/tar.h (struct tar_stat_info): New member dirstream.
2209         fd now has the negative of an errno value, not merely -1, if
2210         the file could not be opened, so that failures to reopen
2211         directories
2212         are better-diagnosed later.
2213         * tests/Makefile.am (TESTSUITE_AT): Add extrac11.at.
2214         * tests/testsuite.at: Likewise.
2215         * tests/extrac11.at: New file.
2216
2217 2010-09-08  Paul Eggert  <eggert@cs.ucla.edu>
2218
2219         tar: improve documentation of reliability and security issues
2220
2221         * doc/tar.texi (Reliability and security, Reliability):
2222         (Permissions problems, Data corruption and repair, Race
2223         conditions):
2224         (Security, Privacy, Integrity, Live untrusted data):
2225         (Security rules of thumb): New nodes.
2226
2227 2010-09-06  Paul Eggert  <eggert@cs.ucla.edu>
2228
2229         tar: more reliable directory traversal when creating archives
2230
2231         * NEWS: Document this.
2232         * gnulib.modules: Add openat, readlinkat.
2233         * src/common.h (open_read_flags, fstatat_flags): New global
2234         variables.
2235         (cachedir_file_p, dump_file, check_exclusion_tags,
2236         scan_directory):
2237         Adjust to new signatures, described below.
2238         (name_fill_directory): Remove.
2239         * src/compare.c (diff_file, diff_multivol): Use open_read_flags.
2240         * src/create.c (struct exclusion_tag): Exclusion predicates
2241         now take
2242         a file descriptor, not a file name.
2243         (add_exclusion_tag): Likewise.  All uses changed.
2244         (cachedir_file_p): Likewise.
2245         (check_exclusion_tags): The directory is now a file descriptor,
2246         not a file name.  All uses changed.  Use openat for better
2247         traversal.
2248         (file_dumpable_p): Arg is now a struct stat, not a struct
2249         tar_stat_info.  All uses changed.  Check the arg's file types too.
2250         (dump_dir0, dump_dir, dump_file0, dump_file): Omit top_level and
2251         parent_device args, since st->parent tells us that now.  All uses
2252         changed.
2253         (dump_dir): Likewise.  Also, omit fd arg for similar reasons.
2254         Apply fdsavedir to a dup of the file descriptor, since we need a
2255         file descriptor for openat etc. as well, and fdsavedir (perhaps
2256         unwisely) consumes its file descriptor when successful.
2257         Do not consume st->fd when successful; this simplifies the caller.
2258         (create_archive): Allocate a file descriptor when retraversing
2259         a directory, during incremental dumps.
2260         (dump_file0): Use fstatat, openat, and readlinkat for better
2261         traversal.
2262         When opening a file, use the result of fstat on the file
2263         descriptor
2264         rather than the fstatat on the directory entry, to avoid some race
2265         conditions.  No need to reopen the directory since we now
2266         no longer
2267         close it.  Change "did we open the file?" test from 0 <= fd to
2268         0 < fd since fd == 0 now represents uninitialized.
2269         (dump_file): Now accepts struct tar_stat_info describing parent,
2270         not parent_device.  Also, accept basename and fullname of entry.
2271         All uses changed.
2272         * src/incremen.c (update_parent_directory): Accept struct
2273         tar_stat_info for parent, not name.  All callers changed.
2274         Use fstatat for safer directory traversal.
2275         (procdir): Accept struct tar_stat_info, not struct stat and
2276         dev_t, for info about directory.  All callers changed.
2277         (scan_directory): Accept struct tar_stat_info, not name,
2278         device, and cmdline, for info about directory.  All callers
2279         changed.  Do not consume the file descriptor, since caller
2280         might need it.  Use fstatat and openat for safer directory
2281         traversal; also, use fstat after opening to double-check.
2282         (name_fill_directory): Remove.
2283         * src/names.c (add_hierarchy_to_namelist): Accept struct
2284         tar_stat_info instead of device and cmdline.  All callers changed.
2285         When descending into a subdirectory, use openat and fstat for
2286         safer directory traversal.
2287         (collect_and_sort_names): Use open and fstat for safer directory
2288         traversal.  Set up struct tar_stat_info for callee's new API.
2289         * src/tar.c (decode_options): Initialize open_read_flags
2290         and fstatat_flags.
2291         (tar_stat_destroy): Close st->fd if it is positive (not zero!).
2292         * src/tar.h (struct tar_stat_info): New members parent, fd.
2293         * src/update.c (update_archive): Adjust to dump_file's API change.
2294         * tests/filerem02.at: Ignore stderr since its contents now depend
2295         on the file system implementation.
2296
2297 2010-09-05  Paul Eggert  <eggert@cs.ucla.edu>
2298
2299         tar: remove lint discovered by Sun C compiler
2300
2301         * src/common.h (WARN_ALL): Don't mask with 0xffffffff; on a 32-bit
2302         host, 0xffffffff is of type 'unsigned int', which makes WARN_ALL
2303         an unsigned int value that is too large to fit into an int, and
2304         the C standard says that this has undefined behavior.  The mask is
2305         not needed, so omit it.
2306
2307 2010-09-04  Paul Eggert  <eggert@cs.ucla.edu>
2308
2309         tar: restore macros that are used in some cases
2310
2311         * src/tar.c (LOW_DENSITY_NUM, MID_DENSITY_NUM, HIGH_DENSITY_NUM):
2312         Restore these macros, undoing the previous change to this file.
2313         The macros are used after all, in some cases.  Sorry about that.
2314
2315 2010-09-03  Paul Eggert  <eggert@cs.ucla.edu>
2316
2317         tar: remove unused macros
2318
2319         * src/create.c (UINTMAX_TO_CHARS): Remove; no longer used.
2320         * src/tar.c (LOW_DENSITY_NUM, MID_DENSITY_NUM, HIGH_DENSITY_NUM):
2321         Likewise.
2322         * src/incremen.c (DIR_IS_NEW): Comment out; not used.
2323         Mark this with a FIXME, since it looks like it should be used.
2324
2325 2010-08-27  Sergey Poznyakoff  <gray@gnu.org.ua>
2326
2327         Fix --remove-files in update/append mode.
2328
2329         * src/update.c (update_archive): Call finish_deferred_unlinks when
2330         done.
2331
2332 2010-08-26  Paul Eggert  <eggert@cs.ucla.edu>
2333
2334         tar: avoid assumptions about root access and chmod -w in test
2335         cases
2336
2337         * tests/extrac07.at, tests/extrac09.at, tests/listed03.at: Use
2338         AT_UNPRIVILEGED_PREREQ, since this test requires non-root
2339         privileges.
2340         * tests/extrac07.at: Don't use "chmod -w", as POSIX says it's not
2341         portable to start a chmod permissions-list with "-" as it may be
2342         confused with an option.  Use "chmod a-w" instead.
2343
2344 2010-08-26  Paul Eggert  <eggert@cs.ucla.edu>
2345
2346         tar: fix bug with -C and delayed setting of metadata
2347
2348         * src/common.h (chdir_current): New decl.
2349         * src/extract.c (struct delayed_set_stat, struct delayed_link):
2350         New member change_dir.
2351         (delay_set_stat, create_placeholder_file): Set it.
2352         (apply_nonancestor_delayed_set_stat, apply_delayed_links): Use it.
2353         (extract_link): Check that the links are all relative to the same
2354         directory.
2355         (extract_archive): Restore the current directory after
2356         apply_nonancestor_delayed_set_stat has possibly changed it.
2357         * src/misc.c (chdir_current): New external var; this used to
2358         be the private static variable 'previous' inside chdir_dir.
2359         All uses changed.
2360         * tests/Makefile.am (TESTSUITE_AT): New test extrac10.at.
2361         * tests/extrac10.at: New file.
2362         * tests/testsuite.at: Include it.
2363
2364 2010-08-25  Sergey Poznyakoff  <gray@gnu.org.ua>
2365
2366         Don't apply file transformations to volume names.
2367
2368         * src/list.c (decode_header): Don't apply file transformations
2369         to volume names.
2370         * tests/xform01.at: New testcase.
2371         * tests/xform-h.at (xform): Rename macro to xformtest. Use
2372         pushdef/popdef.
2373         * tests/Makefile.am, tests/testsuite.at: Add xform01.at
2374
2375 2010-08-25  Paul Eggert  <eggert@cs.ucla.edu>
2376
2377         tar: optimize -c --sparse when file is entirely sparse
2378
2379         * src/sparse.c (sparse_scan_file): If the file is entirely sparse,
2380         that is, if ST_NBLOCKS is zero, don't bother scanning for nonzero
2381         blocks.  Idea by Kit Westneat, communicated by Bernd Schubert in
2382         <http://lists.gnu.org/archive/html/bug-tar/2010-08/msg00038.html>.
2383         Also, omit unnecessary lseek at start of file.
2384
2385 2010-08-25  Paul Eggert  <eggert@cs.ucla.edu>
2386
2387         tar: don't assume size of a sparse file chunk fits in size_t
2388
2389         * src/tar.h (struct sp_array): Change numbytes from size_t
2390         to off_t.
2391         All uses changed.
2392         * scripts/xsparse.c (struct sp_array): Likewise.
2393         Include <stdint.h>, for SIZE_MAX.
2394         (expand_sparse): Don't try to allocate a buffer bigger than
2395         SIZE_MAX bytes.
2396         * src/common.h (SIZE_TO_CHARS, size_to_chars, SIZE_FROM_HEADER):
2397         (size_from_header): Remove decls.
2398         * src/create.c (size_to_chars): Remove.
2399         * src/list.c (size_from_header): Remove.
2400         * src/sparse.c (sparse_extract_region, check_data_region):
2401         (oldgnu_add_sparse, oldgnu_store_sparse_info, pax_decode_header):
2402         Don't assume chunk sizes fit in size_t.
2403         (oldgnu_add_sparse): Check for off_t overflow.
2404         * src/xheader.c (sparse_numbytes_decoder, sparse_map_decoder):
2405         Likewise.
2406
2407 2010-08-25  Paul Eggert  <eggert@cs.ucla.edu>
2408
2409         tar: use ctime, not mtime, when checking placeholders
2410
2411         * src/extract.c (struct delayed_link): Rename member mtime
2412         to ctime.
2413         All uses changed to use ctime rather than mtime.
2414
2415 2010-08-24  Paul Eggert  <eggert@cs.ucla.edu>
2416
2417         tar: add comment to link04.at test
2418
2419         * tests/link04.at: Add explanatory comment at head.
2420
2421 2010-08-24  Paul Eggert  <eggert@cs.ucla.edu>
2422
2423         tar: fix 1.23 Solaris regression related to PRIV_SYS_LINKDIR
2424
2425         The idea was suggested by Petr Sumbera in the thread starting
2426         here:
2427         http://lists.gnu.org/archive/html/bug-tar/2010-08/msg00000.html
2428         * src/extract.c (set_mode): Save the errno of the chmod that
2429         failed, for the benefit of chmod_error_details.  Do not bother
2430         retrying chmod unless the mode suggests setuid is the issue.
2431         (extract_archive): Remove redundant call to
2432         priv_set_remove_linkdir.
2433         * src/system.c: Include priv-set.h.
2434         (sys_spawn_shell, sys_child_open_for_compress):
2435         (sys_child_open_for_uncompress, sys_exec_command):
2436         (sys_exec_info_script, sys_exec_checkpoint_script):
2437         Invoke priv_set_restore_linkdir before execv or execlp, so that
2438         the subprocess has the same privileges that tar originally did.
2439
2440 2010-08-24  Paul Eggert  <eggert@cs.ucla.edu>
2441
2442         tar: handle files that occur multiple times but have link count 1
2443
2444         This patch was inspired by the following patch that addressed a
2445         similar problem in GNU coreutils du:
2446         http://git.savannah.gnu.org/gitweb/?p=coreutils.git;h=efe53cc72b599979ea292754ecfe8abf7c839d22
2447         * src/common.h (name_count): New decl.
2448         * src/create.c (trivial_link_count): New static var.
2449         (create_archive): Initialize it.
2450         (dump_hard_link, file_count_links): Use it, so that files with
2451         link count 1 are handled correctly when they are found multiple
2452         times.
2453         * src/names.c (allocated_entries): Renamed from allocated_names,
2454         since the identifier's name was misleading.  All uses changed.
2455         (entries): Renamed from names.  All uses changed.
2456         (scanned): Renamed from name_index.  All uses changed.
2457         (name_count): New var.
2458         (name_add_name): Increment it.
2459         * tests/link04.at: New file.
2460         * tests/testsuite.at: Add it.
2461         * tests/Makefile.am (TESTSUITE_AT): Likewise.
2462
2463 2010-08-23  Paul Eggert  <eggert@cs.ucla.edu>
2464
2465         tar: use nlink_t for link counts
2466
2467         * src/create.c (struct link): nlink is now of type nlink_t,
2468         not size_t.
2469
2470 2010-08-23  Paul Eggert  <eggert@cs.ucla.edu>
2471
2472         tar: don't export names that aren't used elsewhere
2473
2474         * src/common.h (file_dumpable_p, gid_to_chars, major_to_chars):
2475         (minor_to_chars, mode_to_chars, uid_to_chars, uintmax_to_chars):
2476         (string_to_chars, dumpdir_creat0, dumpdir_create, dumpdir_free):
2477         (dumpdir_locate, dumpdir_next, dumpdir_first, gid_from_header):
2478         (major_from_header, minor_from_header, mode_from_header):
2479         (time_from_header, uid_from_header, quote_copy_string,
2480         request_stdin):
2481         (xheader_init, transform_header_name):
2482         Remove declarations; these are no longer exported from their
2483         modules.
2484         (GID_TO_CHARS, MAJOR_TO_CHARS, MINOR_TO_CHARS, MODE_TO_CHARS):
2485         (UID_TO_CHARS, UINTMAX_TO_CHARS, UNAME_TO_CHARS, GNAME_TO_CHARS):
2486         Move to src/create.c, since no other module uses these.
2487         (GID_FROM_HEADER, MAJOR_FROM_HEADER, MINOR_FROM_HEADER):
2488         (MODE_FROM_HEADER, TIME_FROM_HEADER, UID_FROM_HEADER):
2489         Move to src/extract.c, since no other module uses these.
2490         (dumpdir_t, dumpdir_iter_t): Remove; no longer used.
2491         * src/create.c (gid_to_chars, major_to_chars, minor_to_chars):
2492         (mode_to_chars, uid_to_chars, uintmax_to_chars, string_to_chars):
2493         (file_dumpable_p): Now static.
2494         * src/incremen.c (dumpdir_create0, dumpdir_create, dumpdir_free):
2495         (dumpdir_locate, dumpdir_next, dumpdir_first): Now static.
2496         (scan_directory, write_directory_file_entry):
2497         Use struct dumpdir_iter * rather than dumpdir_iter_t.
2498         * src/list.c (gid_from_header, major_from_header,
2499         minor_from_header):
2500         (mode_from_header, time_from_header, uid_from_header):
2501         (transform_member_name): Now static.
2502         * src/misc.c (quote_copy_string): #if 0 out, as it's not used
2503         anywhere.
2504         * src/system.c (wait_for_grandchild): Now static.
2505         * src/tar.c (request_stdin): Now static.
2506         * src/xheader.c (xheader_init): Now static.
2507
2508 2010-08-23  Paul Eggert  <eggert@cs.ucla.edu>
2509
2510         tar: fix misspelled identifier "set_comression_program_by_suffix"
2511
2512         * src/suffix.c (set_compression_program_by_suffix): Renamed from
2513         set_comression_program_by_suffix.
2514         * src/buffer.c, src/common.h, src/tar.c: All uses changed.
2515
2516 2010-08-20  Paul Eggert  <eggert@cs.ucla.edu>
2517
2518         tar: change interdir_made from int to bool
2519
2520         * src/extract.c (maybe_recoverable, create_placeholder_file):
2521         Change interdir_made from int * to bool *, since the flag has just
2522         two values 0 and 1.  All uses changed.  This does not affect tar's
2523         behavior.
2524
2525 2010-08-20  Paul Eggert  <eggert@cs.ucla.edu>
2526
2527         tar: remove trailing white space from source files
2528
2529         * ChangeLog.1, ChangeLog.CVS, Makefile.am, NEWS, README:
2530         * README-hacking, directory, doc/Makefile.am, doc/dumpdir.texi:
2531         * doc/gendocs_template, doc/intern.texi, doc/mastermenu.el:
2532         * doc/snapshot.texi, doc/sparse.texi, doc/tar-snapshot-edit.texi:
2533         * doc/value.texi, lib/Makefile.am, scripts/backup-specs:
2534         * scripts/dump-remind.in, scripts/tar-snapshot-edit,
2535         scripts/tarcat:
2536         * scripts/xsparse.c, src/arith.h, src/buffer.c, src/compare.c:
2537         * src/create.c, src/delete.c, src/exit.c, src/suffix.c, src/tar.c:
2538         * src/tar.h, src/update.c, src/warning.c, src/xheader.c:
2539         * tests/append01.at, tests/append02.at, tests/atlocal.in:
2540         * tests/delete03.at, tests/exclude.at, tests/exclude06.at:
2541         * tests/extrac04.at, tests/extrac05.at, tests/extrac06.at:
2542         * tests/extrac07.at, tests/filerem01.at, tests/filerem02.at:
2543         * tests/incr01.at, tests/incr02.at, tests/incr03.at,
2544         tests/incr06.at:
2545         * tests/label02.at, tests/label03.at, tests/label04.at:
2546         * tests/label05.at, tests/link02.at, tests/link03.at:
2547         * tests/listed01.at, tests/listed02.at, tests/long01.at:
2548         * tests/longv7.at, tests/multiv01.at, tests/multiv02.at:
2549         * tests/multiv03.at, tests/multiv05.at, tests/multiv06.at:
2550         * tests/multiv07.at, tests/multiv08.at, tests/options.at:
2551         * tests/options02.at, tests/remfiles03.at, tests/rename01.at:
2552         * tests/rename02.at, tests/rename03.at, tests/rename04.at:
2553         * tests/rename05.at, tests/same-order01.at, tests/same-order02.at:
2554         * tests/shortfile.at, tests/shortupd.at, tests/sparse01.at:
2555         * tests/sparse02.at, tests/sparsemv.at, tests/sparsemvp.at:
2556         * tests/star/README, tests/star/gtarfail2.at:
2557         * tests/star/multi-fail.at:
2558         * tests/star/pax-big-10g.at, tests/star/quicktest.sh:
2559         * tests/star/ustar-big-2g.at, tests/star/ustar-big-8g.at:
2560         * tests/update01.at, tests/update02.at, tests/volsize.at:
2561         * tests/volume.at:
2562         Remove trailing spaces and tabs from lines, and remove
2563         trailing empty lines from files.  This makes it a bit easier
2564         to share code among coreutils and other projects that do this.
2565
2566 2010-08-19  Paul Eggert  <eggert@cs.ucla.edu>
2567
2568         tar: update licenses to latest versions from www.gnu.org
2569
2570         * COPYING: Update to latest version; this is just minor
2571         formatting.
2572         * doc/fdl.texi: Update from GFDL 1.2 to 1.3.
2573         * doc/tar.texi: Adjust to new format of fdl.texi.  Omit trailing
2574         white space.
2575
2576 2010-07-18  Paul Eggert  <eggert@cs.ucla.edu>
2577
2578         * src/misc.c (struct wd): Fix comment to match code.
2579
2580 2010-07-18  Paul R. Eggert  <eggert@cs.ucla.edu>
2581
2582         tar: no need to report getcwd error if never using the result
2583
2584         * src/misc.c (struct wd): Rename 'saved' to 'err', with new
2585         semantics.
2586         (chdir_arg, chdir_do): Adjust to new semantics.  Do not report an
2587         error merely because save_cwd fails; report an error only if
2588         save_cwd's result is needed later.
2589         * tests/extrac09.at: New file, to test for bug that was fixed.
2590         * tests/testsuite.at: Include it.
2591         * tests/Makefile.am (TESTSUITE_AT): Add it.
2592
2593 2010-07-18  Paul R. Eggert  <eggert@cs.ucla.edu>
2594
2595         tar: go back to absolutifying filenames in normalize_filename
2596         for now
2597
2598         * src/misc.c (normalize_filename): For now, go back to making
2599         filenames absolute, even though this causes 'tar' to fail when
2600         getcwd fails.  However, do not attempt to resolve ".." as this
2601         does not work with symlinks.  Also, do the right thing with
2602         leading file system prefixes and on hosts where // != /.
2603
2604 2010-07-17  Sergey Poznyakoff  <gray@gnu.org.ua>
2605
2606         Allow for size suffixes in -L and --record-size options.
2607
2608         * src/tar.c (TAR_SIZE_SUFFIXES): New define.
2609         (parse_opt): Allow for size suffixes in arguments to
2610         -L and --record-size options.
2611         * NEWS, doc/tar.texi: Update.
2612
2613 2010-07-15  Paul R. Eggert  <eggert@cs.ucla.edu>
2614
2615         tar: don't crash if getcwd fails
2616
2617         * src/extract.c: Don't include xgetcwd.h.
2618         (extract_dir): stat "." rather than statting getcwd's output.
2619         * src/misc.c (normalize_filename_x): Rewrite so as not to resolve
2620         /../, which can't be done reliably in the presence of symlinks.
2621         Don't reject valid names such as ".".
2622         (normalize_filename): Don't make it absolute; that way, we don't
2623         have to invoke xgetcwd which might fail.  Don't bother to realloc
2624         at the end, since that uses time and now saves little space.
2625         (chdir_do): Don't crash if xgetcwd fails.
2626         * tests/Makefile.am (TESTSUITE_AT): Add listed03.at.
2627         * tests/listed03.at: New file.
2628         * tests/testsuite.at: Include listed03.at.
2629
2630 2010-07-11  Sergey Poznyakoff  <gray@gnu.org.ua>
2631
2632         Keep a detailed map of archive members stored in the record
2633         buffer.
2634
2635         A separate map (bufmap) provides information for creating
2636         multi-volume continuation headers.
2637
2638         * src/buffer.c (bufmap): New struct.
2639         (bufmap_head, bufmap_tail, inhibit_map): New variables.
2640         (mv_begin_write): New function.
2641         (mv_begin): Rename to mv_begin_read. Rewrite using mv_begin_write.
2642         All callers changed.
2643         (mv_total_size): Remove.
2644         (bufmap_locate, bufmap_free, bufmap_reset): New functions.
2645         (_flush_write): Update bufmap.
2646         (close_archive): Free bufmap.
2647         (add_chunk_header): Take a bufmap argument.
2648         (gnu_add_multi_volume_header): Likewise.
2649         (add_multi_volume_header): Likewise.
2650         (_gnu_flush_write): Rewrite using bufmap.
2651         (real_s_name, real_s_totsize)
2652         (real_s_sizeleft)
2653         (save_name, save_totsize, save_sizeleft): Removed. All
2654         uses updated.
2655         (mv_size_left): Update bufmap_head.
2656         (mv_end): Rewrite.
2657         (multi_volume_sync): Remove.
2658
2659         * src/common.h (mv_begin_write): New prototype.
2660         (mv_begin): Rename to mv_begin_read.
2661         * src/create.c: Use mv_begin_write instead of mv_begin.
2662         Remove calls to mv_size_left and mv_end.
2663         * src/sparse.c: Likewise.
2664
2665         * tests/multiv07.at: Close stdin.
2666         * tests/spmvp00.at: Update AT_KEYWORDS.
2667         * tests/spmvp10.at: Likewise.
2668
2669         * tests/multiv08.at: New testcase.
2670         * tests/Makefile.am, tests/testsuite.at: Add multiv08.at.
2671
2672 2010-07-11  Sergey Poznyakoff  <gray@gnu.org.ua>
2673
2674         Version 1.23.90
2675
2676         * NEWS, configure.ac: Version 1.23.90
2677         * doc/tar.texi: Document the use of lbzip2.
2678
2679 2010-06-28  Sergey Poznyakoff  <gray@gnu.org.ua>
2680
2681         Fix exclusion of long file names when extracting from pax format
2682         archives.
2683
2684         * src/list.c (read_and): Call decode_header before attempting
2685         name_match.
2686         (list_archive): Remove call to decode_header.
2687
2688         * src/compare.c (diff_archive): Remove call to decode_header.
2689         * src/extract.c (extract_archive): Likewise.
2690
2691         * test/exclude06.at: New test case.
2692         * tests/testsuite.at: Include exclude06.at.
2693         * tests/Makefile.am (TESTSUITE_AT): Add exclude06.at.
2694
2695 2010-06-28  Sergey Poznyakoff  <gray@gnu.org.ua>
2696
2697         Minor fix.
2698
2699         * src/buffer.c (magic): Split the character constant to help
2700         cc recognize character boundaries (7 is a valid hex character).
2701
2702 2010-06-27  Sergey Poznyakoff  <gray@gnu.org.ua>
2703
2704         Minor fix.
2705
2706         * src/buffer.c (magic): Fix xz magic.
2707
2708 2010-06-16  Paul Eggert  <eggert@cs.ucla.edu>
2709
2710         Remove some lint, found by gcc -W etc.
2711
2712         * src/common.h (label_notfound): New decl.
2713         * src/buffer.c (set_volume_start_time, compress_type):
2714         (guess_seekable_archive, open_compressed_archive, init_buffer):
2715         (_flush_write, archive_is-dev, increase_volume_number):
2716         (change_tape_menu, try_new_volume, add_chunk_header):
2717         (multi_volume_sync):
2718         Declare as 'static' if it's not exported.
2719         Use function prototype (void) rather than old-style ().
2720         * src/checkpoint.c (expand_checkpoint_string): Likewise.
2721         * src/incremen.c (dirlist_replace_prefix, makedumpdir,
2722         read_incr_db_2):
2723         Likewise.
2724         * src/list.c (print_volume_label): Likewise.
2725         * src/misc.c (normalize_filename_x): Likewise.
2726         * src/names.c (make_name, free_name, check_name_alloc,
2727         name_next_elt):
2728         Likewise.
2729         * src/tar.c (tar_list_quoting_style, add_exclude_array):
2730         (set_stat_signal): Likewise.
2731         * src/transform.c (new_transform,
2732         _single_transform_name_to_obstack):
2733         (_transform_name_to_obstack): Likewise.
2734         * src/unlink.c (dunlink_alloc): Likewise.
2735
2736         * src/buffer.c (struct zip_magic): Use const when appropriate.
2737         * src/incremen.c (obstack_code_rename,
2738         write_directory_file_entry):
2739         Likewise.
2740         * src/sparse.c (COPY_STRING): Likewise.
2741         * src/system.c (dec_to_env, time_to_env, oct_to_env, str_to_env):
2742         (chr_to_env): Likewise.
2743         * src/tar.c (tar_list_quoting_style, set_stat_signal): Likewise.
2744
2745         * src/extract.c (extract_node): Don't return garbage.
2746
2747         * src/names.c: Remove old-style declarations of getgrnam etc.
2748         All modern systems declare these, and it's not worth the hassle
2749         of ignoring the warnings on modern systems for old-style decls.
2750
2751 2010-05-17  Sergey Poznyakoff  <gray@gnu.org.ua>
2752
2753         Bugfix.
2754
2755         * src/incremen.c (make_directory): Retain the slash if it is the
2756         only character in a filename.
2757
2758 2010-04-02  Sergey Poznyakoff  <gray@gnu.org.ua>
2759
2760         Recode NEWS back to UTF-8
2761
2762 2010-04-01  Sergey Poznyakoff  <gray@gnu.org.ua>
2763
2764         Fix the gzip.at test case.
2765
2766         * tests/gzip.at: Suppress gzip error output, as it can differ
2767         depending on its version etc. Bug reported by Ludovic Courtès.
2768
2769 2010-03-28  Sergey Poznyakoff  <gray@gnu.org.ua>
2770
2771         New option --full-time.
2772
2773         * src/common.h (full_time_option): New global.
2774         * src/tar.c (FULL_TIME_OPTION): New constant.
2775         (options): New option --full-time.
2776         (parse_opt): Handle the --full-time option.
2777         * src/list.c (simple_print_header): Pass full_time_option
2778         as the 2nd argument to tartime.
2779         * doc/tar.texi: Update.
2780         * NEWS: Update.
2781
2782 2010-03-27  Sergey Poznyakoff  <gray@gnu.org.ua>
2783
2784         Minor fixes in the testsuite.
2785
2786         * tests/extrac07.at: Fix a typo (invalid number
2787         of arguments before format list).
2788         * tests/link02.at: Use `ln' instead of `link'.
2789         * tests/link03.at: Likewise.
2790
2791 2010-03-27  Sergey Poznyakoff  <gray@gnu.org.ua>
2792
2793         Fix coredump.
2794
2795         * src/names.c (collect_and_sort_names): Remove
2796         entry from the table before freeing it.
2797
2798 2010-03-27  Sergey Poznyakoff  <gray@gnu.org.ua>
2799
2800         Fix dead loop on extracting existing symlinks with the -k option.
2801
2802         * src/extract.c (create_placeholder_file)
2803         (extract_link, extract_symlink)
2804         (extract_node, extract_fifo): Handle all possible
2805         return values from maybe_recoverable. This complements
2806         8f390db92fc. Reported by Ico Doornekamp <bug-tar@zevv.nl>.
2807         * NEWS: Update.
2808
2809 2010-03-20  Sergey Poznyakoff  <gray@gnu.org.ua>
2810
2811         Fix undesired error exit on receiving SIGPIPE.
2812
2813         * src/tar.c: Do not ignore SIGPIPE.
2814         * tests/sigpipe.at: New testcase.
2815         * tests/Makefile.am, tests/testsuite.at: Add sigpipe.at
2816         * tests/remfiles01.at: Fix error code expectation.
2817         * NEWS: Update.
2818
2819 2010-03-17  Sergey Poznyakoff  <gray@gnu.org.ua>
2820
2821         Fix --remove-files.
2822
2823         Tar --remove-files relied on canonicalize_file_name,
2824         which replaces symlinks in file name components with
2825         the directories they point to. Due to this, tar
2826         effectively ignored existence of symbolic links and
2827         was unable to remove a directory that contained any
2828         (Alexander Kozlov <akozlov@nada.kth.se>, 2010-03-15).
2829
2830         * gnulib.modules: Remove canonicalize.
2831         * src/misc.c (normalize_filename): Rewrite
2832         from scratch. The function operates only on
2833         its input string, it makes no attempt to test
2834         components for existence or to resolve symbolic
2835         links.
2836         * tests/Makefile.am (TESTSUITE_AT): Add remfiles03.at.
2837         * tests/testsuite.at: Likewise.
2838         * tests/remfiles03.at: New test case.
2839         * NEWS: Update.
2840
2841 2010-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>
2842
2843         Bugfixes.
2844
2845         * src/buffer.c (check_label_pattern): Initialize result.
2846         * tests/remfiles01.at: Skip if run with root privileges.
2847
2848 2010-03-11  Sergey Poznyakoff  <gray@gnu.org.ua>
2849
2850         Fix `--test-label' and `--label -r' behavior.
2851
2852         * doc/tar.texi (Including a Label in the Archive): Revise
2853         the section.
2854         * NEWS: Update
2855
2856         * src/buffer.c (open_archive): Check volume label on
2857         ACCESS_UPDATE as well.
2858         * src/list.c (test_archive_label): Rewrite to match the
2859         documentation.
2860         * src/names.c (regex_usage_warning): Return int.
2861         (names_notfound): Rewrite the conditional.
2862         (label_notfound): New function.
2863
2864         * tests/label03.at: New testcase.
2865         * tests/label04.at: New testcase.
2866         * tests/label05.at: New testcase.
2867         * tests/Makefile.am: Add new testcases.
2868         * tests/testsuite.at: Likewise.
2869
2870 2010-03-11  Sergey Poznyakoff  <gray@gnu.org.ua>
2871
2872         Doc fixes.
2873
2874         * doc/tar.texi: Consistently use lowercase `see' within sentences.
2875         More fixes spotted by Denis Excoffier.
2876         * THANKS: Update.
2877
2878 2010-03-11  Sergey Poznyakoff  <gray@gnu.org.ua>
2879
2880         Shut up a gcc warning message.
2881
2882         * src/tar.c (tar_help_filter): Use a separate const
2883         variable to hold returns from gettext. Reported by
2884         Peter Breitenlohner.
2885
2886 2010-03-11  Sergey Poznyakoff  <gray@gnu.org.ua>
2887
2888         Bugfix.
2889
2890         * src/names.c (collect_and_sort_names): Initialize prev_name.
2891         Reported by Dmitry V. Levin.
2892
2893 2010-03-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2894
2895         Version 1.23
2896
2897         * configure.ac, NEWS: Update version number.
2898
2899 2010-03-10  Sergey Poznyakoff  <gray@gnu.org.ua>
2900
2901         Doc changes.
2902
2903         * NEWS: Update.
2904         * THANKS: Update.
2905         * doc/snapshot.texi, doc/snapshot.texi,
2906         doc/sparse.texi, doc/tar-snapshot-edit.texi,
2907         doc/tar.texi: Spellchecked and proof-read. Thanks
2908         to Denis Excoffier.
2909         * gnulib.modules: Remove utime.
2910
2911 2010-03-08  Kamil Dudka  <kdudka@redhat.com>
2912
2913         Fix possible overflow in code_timespec (tiny change)
2914
2915         * src/misc.c (code_timespec): ignore invalid values of ns
2916
2917 2010-03-08  Sergey Poznyakoff  <gray@gnu.org.ua>
2918
2919         Minor fix in the testsuite.
2920
2921         * tests/extrac05.at: Skip test if creating
2922         sparse file fails.
2923
2924 2010-03-08  Sergey Poznyakoff  <gray@gnu.org.ua>
2925
2926         Fix eventual memory override and fd exhaustion in create.c Both
2927         bugs reported by Kamil Dudka.
2928
2929         * src/create.c (check_exclusion_tags): Do not keep
2930         pointer to a location within tagname: it may change
2931         after xrealloc. Use byte offset instead.
2932         (dump_file0): Close fd before returning without
2933         dumping the directory.
2934
2935 2010-03-02  Sergey Poznyakoff  <gray@gnu.org.ua>
2936
2937         Minor change.
2938
2939         * doc/tar.texi: Improve some wording.
2940
2941 2010-03-02  Antonio Diaz Diaz  <ant_diaz@teleline.es>
2942
2943         Add Lzip support
2944
2945         * configure.ac: Add TAR_COMPR_PROGRAM(lzip)
2946         * doc/tar.texi: Reflect lzip support.
2947         * src/buffer.c (compress_type) <ct_lzip>: New constant.
2948         (magic): Add magic for lzip.
2949         * src/suffix.c (compression_suffixes): Add lz.
2950         * src/tar.c: New option --lzip.
2951
2952 2010-03-02  Sergey Poznyakoff  <gray@gnu.org.ua>
2953
2954         Minor fix.
2955
2956         * tests/exclude05.at: Rewrite awk invocation to avoid
2957         overflowing awk's file table on Solaris.
2958
2959 2010-03-02  Eric Blake  <ebb9@byu.net>
2960
2961         Fix large file support.
2962
2963         * scripts/xsparse.c (read_map): Use fseeko.
2964         * src/incremen.c (write_directory_file): Likewise.
2965
2966 2010-03-02  Sergey Poznyakoff  <gray@gnu.org.ua>
2967
2968         Bugfix
2969
2970         * src/buffer.c (seek_archive): Rewrite size computation
2971         to prevent it from reaching negative values. Based on
2972         report by Denis Excoffier <Denis.Excoffier@free.fr>.
2973
2974 2010-02-25  Sergey Poznyakoff  <gray@gnu.org.ua>
2975
2976         Supply more information to the --to-command script.
2977
2978         * src/system.c (stat_to_env): Pass information about the current
2979         volume in variables TAR_ARCHIVE, TAR_VOLUME, TAR_BLOCKING_FACTOR,
2980         TAR_FORMAT.
2981         * doc/tar.texi: Document new environment variables.
2982         * NEWS: Likewise.
2983         * configure.ac: Version number 1.22.91.
2984
2985 2010-02-17  Sergey Poznyakoff  <gray@gnu.org.ua>
2986
2987         Minor change.
2988
2989         * src/names.c (regex_usage_warning): Fix warning message.
2990
2991 2010-02-05  Sergey Poznyakoff  <gray@gnu.org.ua>
2992
2993         Update THANKS
2994
2995 2010-02-05  OndÅ™ej Vašík  <ovasik@redhat.com>
2996
2997         Bugfix (tiny change)
2998
2999         * src/xheader.c (xheader_read): Remove unnecessary call
3000         to xheader_init.
3001
3002 2010-01-26  Sergey Poznyakoff  <gray@gnu.org.ua>
3003
3004         Enable silent build mode.
3005
3006         * configure.ac: Require automake 1.11, autoconf 2.63. Enable
3007         silent rules.
3008         * NEWS: Update.
3009         * lib/Makefile.am (rmt-command.h): Silent the rule.
3010
3011 2010-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
3012
3013         Read POSIX multivolume archives split at the header boundary.
3014
3015         * src/common.h (read_header_mode): New enum.
3016         (read_header): Change type of the 3rd argument.
3017         * src/list.c (read_header): Change type of the 3rd argument.
3018         All callers updated.
3019         * src/buffer.c (try_new_volume): Allow for volumes split at the
3020         extended/ustar header boundary. This is against POSIX specs, but
3021         we must be able to read such archives anyway.
3022
3023         * tests/multiv07.at: New test case.
3024         * tests/Makefile.am: Add multiv07.at
3025         * tests/testsuite.at: Likewise.
3026
3027         * src/compare.c: Update calls to read_header.
3028         * src/delete.c: Likewise.
3029         * src/update.c: Likewise.
3030
3031 2010-01-24  Sergey Poznyakoff  <gray@gnu.org.ua>
3032
3033         Minor change.
3034
3035         * NEWS: Update.
3036         * doc/tar.texi: Update.
3037         * src/create.c (finish_header): Minor change.
3038
3039 2010-01-24  Rob Vermaas  <rob.vermaas@gmail.com>
3040
3041         Bugfix (tiny change).
3042
3043         * src/tar.c (format_default_settings)[REMOTE_SHELL]: Fix
3044         misplaced comma.
3045
3046 2010-01-24  Sergey Poznyakoff  <gray@gnu.org.ua>
3047
3048         Minor fix.
3049
3050         * src/incremen.c (read_incr_db_01)
3051         (read_directory_file): Initialize bufsize to 0.
3052         Suggested by noordsij@cs.helsinki.fi.
3053
3054 2010-01-24  Sergey Poznyakoff  <gray@gnu.org.ua>
3055
3056         Improve handling of --test-label.
3057
3058         * src/list.c (print_volume_label): New function.
3059         (print_header): Call print_volume_label.
3060         (test_archive_label): New function.
3061         * src/buffer.c (VOLUME_LABEL_APPEND): Remove.
3062         (VOLUME_TEXT, VOLUME_TEXT_LEN): New macros
3063         (drop_volume_label_suffix): New function.
3064         (check_label_pattern): Use drop_volume_label_suffix.
3065         * src/common.h (subcommand): New constant TEST_LABEL_SUBCOMMAND.
3066         (test_label_option): Remove.
3067         (drop_volume_label_suffix): New proto.
3068         (test_archive_label): New proto.
3069         * src/names.c (all_names_found): Remove test for
3070         test_label_option.
3071         * src/tar.c (subcommand_string): Handle TEST_LABEL_SUBCOMMAND.
3072         (set_subcommand_option): Improve diagnostics.
3073         (parse_opt): Set subcommand if --test-label is given.
3074         (main): Handle TEST_LABEL_SUBCOMMAND.
3075
3076 2010-01-24  Sergey Poznyakoff  <gray@gnu.org.ua>
3077
3078         Fix listing of volume labels (in particular in PAX archives).
3079
3080         * src/buffer.c (match_volume_label): Call set_volume_label.
3081         (check_label_pattern): Get label string
3082         as argument.
3083         (match_volume_label): Handle volume labels stored in
3084         global PAX headers.
3085         * src/common.c (print_header,read_header): Change signature.
3086         (read_header_primitive): Remove prototype.
3087         * src/list.c (recent_global_header): New static.
3088         (list_archive): Always print volume labels.
3089         (read_header_primitive): Remove.
3090         (read_header): Change the signature (all callers updated)
3091         Save the recent global header.
3092         (volume_label_printed): New static.
3093         (simple_print_header): New function (ex-print_header).
3094         (print_header): Change the signature (all callers updated).
3095         For POSIX formats, print first volume header (if set).
3096         * src/xheader.c (xheader_write_global): Write the data
3097         accumulated in xhdr->stk even if keyword_global_override_list
3098         is empty.
3099         (xheader_read): On unexpected EOF, report error instead of
3100         coredumping.
3101         (XHDR_PROTECTED, XHDR_GLOBAL): New defines.
3102         (struct xhdr_tab): Remove `protected' with `flags'. All uses
3103         updated.
3104         (decg): If XHDR_GLOBAL bit is set, call the keyword's decode
3105         method instead of adding it to `kwl'.
3106
3107         * src/compare.c: Update calls to read_header.
3108         * src/create.c: Likewise.
3109         * src/delete.c: Likewise.
3110         * src/update.c: Likewise.
3111         * src/extract.c: Likewise.
3112         (extract_volhdr): Do not print "Reading <label>" statement,
3113         because
3114         it is inconsistent: it is not printed if the volume begins with a
3115         member continued from the previous volume.
3116
3117         * tests/label01.at: New testcase.
3118         * tests/label02.at: New testcase.
3119         * tests/Makefile.am, tests/testsuite.at: Add new testcases.
3120
3121 2010-01-22  Sergey Poznyakoff  <gray@gnu.org.ua>
3122
3123         Fix prefix length calculation in ustar mode.
3124
3125         * src/create.c (split_long_name): Fix prefix length
3126         calculation.
3127         (write_ustar_long_name): Improve ustar mode compatibility
3128         with the Sun version.
3129
3130 2009-10-14  Sergey Poznyakoff  <gray@gnu.org.ua>
3131
3132         Rewrite update algorithm.
3133
3134         * src/common.h (namebuf_t): New typedef.
3135         (namebuf_create, namebuf_free)
3136         (namebuf_name): New prototypes.
3137         (remname): New prototype.
3138         * src/misc.c (struct namebuf): New structure.
3139         (namebuf_create, namebuf_free)
3140         (namebuf_name): New functions.
3141         * src/create.c (dup_dir0): Remove is_avoided_name
3142         checks. This is taken care of in update_archive.
3143         * src/incremen.c (scan_directory): Use namebuf
3144         to produce full file names.
3145         * src/names.c (nametail): Remove extra level of
3146         indirection. All uses updated.
3147         (avoided_name_table, add_avoided_name)
3148         (is_avoided_name): Remove.
3149         * src/update.c (update_archive): Change algorithm.
3150         Instead of adding unmodified files to the avoided_name
3151         table, create namelist so that it contains only
3152         modified files.
3153
3154         * tests/Makefile.am: Add update01.at, update02.at
3155         * tests/testsuite.at: Likewise.
3156         * tests/update.at (AT_KEYWORDS): Add update00.
3157
3158 2009-10-14  Sergey Poznyakoff  <gray@gnu.org.ua>
3159
3160         Minor changes.
3161
3162         * src/tar.c (main): Ignore SIGPIPE.
3163         * src/system.c (sys_child_open_for_compress)
3164         (sys_child_open_for_uncompress): Reset SIGPIPE
3165         in child to default.
3166         * tests/remfiles01.at: Avoid race conditions.
3167         * tests/remfiles02.at: Likewise.
3168
3169 2009-10-14  Sergey Poznyakoff  <gray@gnu.org.ua>
3170
3171         Bugfix.
3172
3173         * src/buffer.c (_open_archive): Call guess_seekable_archive
3174         only if the call to open_compressed_archive succeeded.
3175
3176 2009-10-10  Sergey Poznyakoff  <gray@gnu.org.ua>
3177
3178         Improve previous changes.
3179
3180         * acinclude.m4: Fix typos.
3181         * gnulib.modules: Add xvasprintf.
3182         * src/common.h: Include xvasprintf.h.
3183         * src/tar.c (options): Remove docstrings for --gzip, --bzip2,
3184         --compress, --lzop, --lzma and --xz.
3185         (tar_help_filter): Generate these using actual values of
3186         *_PROGRAM constants.
3187         (format_default_settings): Use xasprintf.
3188         (parse_opt): Use *_PROGRAM defines instead of hardcoded
3189         program names.
3190
3191 2009-10-10  Sergey Poznyakoff  <gray@gnu.org.ua>
3192
3193         Allow installers to specify alternative program names for
3194         compression programs.
3195
3196         This adds --with-gzip, --with-bzip2 etc. switches to the
3197         configure, so that
3198         one can do, e.g. ./configure --with-bzip2=lbzip2 and have
3199         lbzip2 executed
3200         whenever user calls `tar --bzip2'.
3201
3202         * acinclude.m4: New file.
3203         * configure.ac: Add TAR_COMPR_PROGRAM invocations for
3204         the supported compressors.
3205         * src/buffer.c (magic): Use *_COMPRESSOR defines instead
3206         of hardcoded program names.
3207         * src/suffix.c (compression_suffixes): Likewise.
3208
3209 2009-10-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3210
3211         Minor fix.
3212
3213         * src/buffer.c (magic): Fix `xz' entry: add the name of the
3214         program.
3215         * src/suffix.c (compression_suffixes, nsuffixes): Mark as static.
3216
3217 2009-10-07  Sergey Poznyakoff  <gray@gnu.org.ua>
3218
3219         Provide a way to explicitly set mtime for extended header
3220         ustar blocks.
3221
3222         * src/tar.c (struct textual_date): ts is a copy of the structure,
3223         not a pointer to it. Date is a copy as well, hence the `const' is
3224         taken away.
3225         (get_date_or_file): Return 0/1 depending on success/failure.
3226         Copy timestamp to the `ts' member. Store a copy of the string
3227         in `date'.
3228         (report_textual_dates): Report only if verbose_option is set,
3229         but always free the list.
3230         (expand_pax_option): New function.
3231         (parse_opt): Preprocess the argument to xheader_set_option with
3232         expand_pax_option.
3233         (decode_options): Call report_textual_dates unconditionally.
3234         * src/xheader.c (exthdr_mtime_option, exthdr_mtime)
3235         (globexthdr_mtime_option, globexthdr_mtime): New statics.
3236         (xheader_set_keyword_equal): handle exthdr.mtime and
3237         globexthdr.mtime.
3238         (xheader_write): Override `t' argument if a corresponding
3239         exthdr.mtime or globexthdr.mtime option is set.
3240         * NEWS: Update
3241         * doc/tar.texi: Document the changes.
3242
3243 2009-10-07  Sergey Poznyakoff  <gray@gnu.org.ua>
3244
3245         Use file's mtime as mtime for its extended header.
3246
3247         This makes two pax archives binary equivalent if they
3248         have the same contents and care is taken to make extended
3249         headers otherwise reproducible, e.g. by using:
3250
3251           --pax-option=exthdr.name=%d/PaxHeaders/%f,atime:=0
3252
3253         Proposed by Michael D. Adams <mdmkolbe@gmail.com>.
3254
3255         * src/common.h (start_private_header): Take time_t as 3rd param.
3256         (xheader_write): Likewise.
3257         * src/create.c (start_private_header): Take time_t as 3rd param.
3258         All callers updated.
3259         (write_extended): Use file's mtime as mtime for its extended
3260         header,
3261         Use current time stamp as mtime for global headers.
3262         (xheader_write): Take time_t as 3rd param.
3263
3264 2009-10-07  Sergey Poznyakoff  <gray@gnu.org.ua>
3265
3266         Fix bugs in handling the --remove-files option.
3267
3268         Make sure the files are deleted only if they were succesfully
3269         stored
3270         to the archive.
3271
3272         * src/exit.c: New file.
3273         * src/unlink.c: New file.
3274         * src/Makefile.am (tar_SOURCES): Add exit.c and unlink.c.
3275         * src/common.h: Include progname.h
3276         (program_name): Remove global.
3277         (records_written): New extern.
3278         (queue_deferred_unlink, finish_deferred_unlinks): New prototypes.
3279         (fatal_exit_hook): New extern.
3280         * src/create.c (create_archive): Call finish_deferred_unlinks.
3281         (dump_hard_link, dump_file0): Don't actually unlink the file,
3282         queue it to deferred_unlinks instead.
3283         * src/delete.c (records_written): Remove extern: declared in
3284         common.h.
3285         * src/extract.c (extract_archive): Set fatal_exit_hook.
3286         (fatal_exit, xalloc_die): Move to exit.c
3287         * src/system.c (sys_wait_for_child): Exit immediately
3288         if the child dies or exits with a non-zero status.
3289         (sys_child_open_for_compress)
3290         (sys_child_open_for_uncompress): Use set_program_name,
3291         instead of setting program_name directly.
3292         * src/tar.c (main): Use set_program_name,
3293         instead of setting program_name directly.
3294
3295         * tests/Makefile.am (TESTSUITE_AT): Add remfiles01.at
3296         and remfiles02.at.
3297         * tests/testsuite.at: Likewise.
3298         * tests/gzip.at: Reflect the above changes.
3299
3300 2009-10-04  Sergey Poznyakoff  <gray@gnu.org.ua>
3301
3302         Fix bug in OLDGNU format creation.
3303
3304         See tests/append02.at for a detailed description
3305
3306         * src/common.h (MODE_FROM_HEADER): Take additional argument.
3307         (mode_from_header): Likewise.
3308         * src/create.c (mode_to_chars): Store all mode bits if
3309         using OLDGNU_FORMAT. This reverses f4e4adea80a.
3310         * src/list.c (decode_header): Use header mode field
3311         to discern between GNU and OLDGNU formats.
3312         (mode_from_header): Store unrecognized mode bits (from 10th up)
3313         in the location pointed to by the third parameter.
3314         * tests/append02.at: Update documentation and references.
3315
3316 2009-09-16  Sergey Poznyakoff  <gray@gnu.org.ua>
3317
3318         Restore extra help output.
3319
3320         * src/tar.c (tar_list_quoting_styles): Change first argument to
3321         struct obstack.
3322         (format_default_settings): New function.
3323         (show_default_settings)
3324         (show_default_settings_fs): Removed.
3325         (tar_help): Removed.
3326         (tar_help_filter): New function.
3327         (argp): Set help_filter.
3328         (parse_opt): Fix error message.
3329
3330 2009-09-08  Sergey Poznyakoff  <gray@gnu.org.ua>
3331
3332         Improve command line option handling.
3333
3334         * gnulib.modules: Add argp-version-etc and progname,
3335         use getopt-gnu instead of getopt.
3336         * src/tar.c (HANG_OPTION, USAGE_OPTION)
3337         (VERSION_OPTION): Remove.
3338         (options): Remove corresponding options. Let argp
3339         handle them.
3340         (parse_opt): Likewise.
3341         (_argp_hang): Removed.
3342         (tar_authors): New variable.
3343         (decode_options): Call argp_version_setup.
3344         Do not use ARGP_NO_HELP flag in the call to argp_parse.
3345
3346 2009-09-08  Sergey Poznyakoff  <gray@gnu.org.ua>
3347
3348         Avoid overwriting exit_status with a value indicating less
3349         important condition.
3350
3351         * src/tar.c (set_exit_status): New function.
3352         * src/common.h (set_exit_status): New prototype.
3353         * src/compare.c: Use set_exit_status instead of
3354         exit_status assignments.
3355         * src/create.c: Likewise.
3356         * src/misc.c: Likewise.
3357
3358         * src/system.c (wait_for_grandchild): Use auto variable
3359         instead of the global exit_status.
3360         * src/incremen.c (scan_directory): Use file_removed_diag
3361         instead of stat_diag.
3362
3363 2009-09-08  Sergey Poznyakoff  <gray@gnu.org.ua>
3364
3365         Automatic detection of seekable archives.
3366
3367         * src/buffer.c (guess_seekable_archive): New function.
3368         (_open_archive): Call guess_seekable_archive for archives
3369         open for reading.
3370         (new_volume): Likewise.
3371         * src/common.h (seek_option): New global.
3372         * src/tar.c (options): New option --no-seek.
3373         (parse_opt): --seek and --no-seek set seek_option,
3374         not seekable_archive.
3375         (decode_options): Initialize seek_option to -1.
3376
3377         * NEWS: Update.
3378         * doc/tar.texi: Update.
3379
3380 2009-08-27  Sergey Poznyakoff  <gray@gnu.org.ua>
3381
3382         Fix testcases.
3383
3384         * tests/extrac08.at: Ensure a predictable umask value.
3385         * tests/xform-h.at (xform): do not depend on file name
3386         ordering.
3387
3388 2009-08-13  Sergey Poznyakoff  <gray@gnu.org.ua>
3389
3390         Fix interaction between --listed-incremental and -C
3391
3392         * src/incremen.c (read_directory_file): Execute eventual -C dir
3393         after opening the snapshot file.
3394         (collect_and_sort_names): Remove call to chdir_do
3395         * tests/incr05.at, tests/incr06.at: Use relative file names for
3396         snapshot files.
3397
3398 2009-08-12  Sergey Poznyakoff  <gray@gnu.org.ua>
3399
3400         Update for new exclude module from gnulib. Add testcases by
3401         Phil Proudman.
3402
3403         * src/names.c (is_pattern): Remove.
3404         (regex_usage_warning): Use fnmatch_pattern_has_wildcards
3405         instead of
3406         is_pattern.
3407         * src/tar.c: New option --exclude-backups.
3408         (vcs_file_table, backup_file_table): New globals.
3409         (add_exclude_array): New function.
3410         * tests/exclude01.at, tests/exclude02.at,
3411         tests/exclude03.at, tests/exclude04.at,
3412         tests/exclude05.at: New testcases. Supplied by Phil Proudman.
3413         * tests/Makefile.am (TESTSUITE_AT): Add new tests.
3414         * tests/testsuite.at: Add new tests.
3415         * THANKS: Update.
3416
3417 2009-08-10  Sergey Poznyakoff  <gray@gnu.org.ua>
3418
3419         Remove src/version.c (reappeared after migration to Git)
3420
3421 2009-08-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3422
3423         Minor fixes.
3424
3425         * src/misc.c (file_removed_diag): Set exit code to
3426         TAREXIT_DIFFERS.
3427
3428 2009-08-08  Sergey Poznyakoff  <gray@gnu.org.ua>
3429
3430         Minor fixes
3431
3432 2009-08-08  Sergey Poznyakoff  <gray@gnu.org.ua>
3433
3434         Fix handling of files removed during incremental dumps.
3435
3436         Changes to src/create.c and src/incremen.c are partially
3437         based on patch from Alexander Peslyak <solar at openwall.com>.
3438
3439         The new testcases require paxutils commit f653a2b or later.
3440
3441         * src/common.h (struct name): New member `cmdline'.
3442         (dump_file): Change type of the 2nd argument to bool.
3443         (file_removed_diag, dir_removed_diag): New prototypes.
3444         (addname): New argument `cmdline'.
3445         (name_from_list): Change return value.
3446         * src/create.c (dump_dir0, dump_dir): top_level is bool.
3447         (create_archive): Update calls to name_from_list.
3448         Take advantage of the name->cmdline to set top_level argument
3449         during incremental backups.
3450         (dump_file0): top_level is bool.
3451         Do not bail out if a no-top-level file disappears during
3452         incremental
3453         backup, use file_removed_diag instead.
3454         (dump_filed): top_level is bool.
3455         * src/incremen.c (update_parent_directory): Silently ignore
3456         ENOENT.  It should have already been reported elsewhere.
3457         (scan_directory): Use dir_removed_diag to report missing
3458         directories.
3459         * src/misc.c (file_removed_diag, dir_removed_diag): New functions.
3460         * src/names.c (name_gather): Set ->cmdname.
3461         (addname): Likewise. All uses updated.
3462         (name_from_list): Return struct name const *. All uses updated.
3463
3464         * tests/filerem01.at: New testcase.
3465         * tests/filerem02.at: New testcase.
3466         * tests/Makefile.am, tests/testsuite.at: Add filerem01.at,
3467         filerem02.at
3468         * tests/grow.at, test/truncate.at: Use new syntax for genfile
3469         --run.
3470
3471         * NEWS: Update.
3472         * doc/tar.texi: Minor fix.
3473
3474 2009-08-08  Sergey Poznyakoff  <gray@gnu.org.ua>
3475
3476         Optimize searches for directory structures by keeping a pointer
3477         to struct directory in struct name.
3478
3479         * src/common.h (struct name): New member `directory' replaces
3480         dir_contents. Rearrange members.
3481         (rebase_directory): Change signature.
3482         (scan_directory): Change signature.
3483         (name_fill_directory)
3484         (directory_contents, safe_directory_contents): New prototypes.
3485         (append_incremental_renames): Change signature.
3486         (replace_prefix): New proto.
3487         * src/compare.c (diff_dumpdir): Use directory_contents +
3488         scan_directory.
3489         * src/create.c
3490         * src/incremen.c (replace_prefix): Move to misc.c
3491         (rebase_directory): Rewrite.
3492         (scan_directory): Return pointer to struct directory.
3493         (directory_contents, safe_directory_contents): New functions.
3494         (get_directory_contents): Remove.
3495         (name_fill_directory): New function.
3496         (append_incremental_renames): Rewrite. This also fixes a memory
3497         leak.
3498         * src/names.c (name_gather, addname): Reflect changes in struct
3499         name.
3500         (add_hierarchy_to_namelist): Rewrite using name_fill_directory and
3501         directory_contents.
3502         (rebase_child_list): Update call to rebase_directory.
3503         (collect_and_sort_names): Optimize
3504
3505         * src/misc.c (replace_prefix): New function.
3506         * src/names.c (add_hierarchy_to_namelist): Use new
3507         get_directory_contents.
3508
3509         * tests/incr05.at: New test case.
3510         * tests/incr06.at: New test case.
3511         * tests/Makefile.am, test/testsuite.at: Add incr05.at and
3512         incr06.at.
3513
3514         * doc/Makefile.am (check-options): Improve rule.
3515         * doc/tar.texi, NEWS: Update.
3516
3517 2009-08-07  Sergey Poznyakoff  <gray@gnu.org.ua>
3518
3519         Minor fixes.
3520
3521         * src/common.h (rebase_directory): New prototype.
3522         * src/incremen.c (rebase_directory): Use replace_prefix.
3523         * src/names.c (collect_and_sort_names): Abort if
3524         hash_insert fails.
3525
3526 2009-08-07  Sergey Poznyakoff  <gray@gnu.org.ua>
3527
3528         Improve listed incremental dumps.
3529
3530         The modified algorithm tries to avoid dumping the same
3531         directory twice and ensures the order of the directories
3532         in the resulting archive is the same, whatever their order
3533         on the command line.  It also fixes the operation of
3534         --listed-incremental -C.
3535
3536         * gnulib.modules: Add canonicalize
3537         * src/common.h (incremental_level): New global.
3538         (check_exclusion_tags): first argument is const.
3539         (get_directory_contents): Add third argument.
3540         (zap_slashes, normalize_filename): New prototypes.
3541         (chdir_count): New prototype.
3542         (WARN_VERBOSE_WARNINGS): New define.
3543         (WARN_ALL): Exclude WARN_VERBOSE_WARNINGS.
3544         * src/compare.c (diff_dumpdir): Update the call to
3545         get_directory_contents.
3546         * src/create.c (check_exclusion_tags): First argument is const.
3547         Use ISSLASH and DIRECTORY_SEPARATOR instead of referring to '/'.
3548
3549         * src/incremen.c (struct directory): New member `caname'.
3550         (hash_directory_name): Rename to
3551         hash_directory_canonical_name. Operate
3552         on the canonical name.
3553         (compare_directory_names): Rename to
3554         compare_directory_canonical_names.
3555         Operate on the canonical name.
3556         (make_directory): Take two arguments.
3557         (free_directory): Free caname.
3558         (attach_directory): Create caname.
3559         (find_directory): Use caname for lookups.
3560         (PD_VERBOSE): Remove.
3561         (PD_FORCE_INIT): New define.
3562         (procdir): First argument is const.
3563         Reinitialize directory if PD_FORCE_INIT bit is set.
3564         Do not use PD_VERBOSE or verbose_option for issuing warnings.
3565         Rely on WARNOPT instead.
3566         Always set *entry.
3567         (scan_directory): Take three arguments. The third one is a boolean
3568         which is true if the directory is explicitly mentioned on
3569         the command
3570         line.
3571         (get_directory_contents): Remove.  Use scan_directory instead.
3572         All callers updated.
3573         (read_directory_file): Truncate the file if --level=0 is given.
3574         * src/misc.c: Include canonicalize.h
3575         (zap_slashes, normalize_filename): New functions.
3576         (chdir_count): New function.
3577         * src/names.c (add_hierarchy_to_namelist): Take three arguments,
3578         as
3579         get_directory_contents and scan_directory.
3580         (collect_and_sort_names): Allow at most one -C, before file name
3581         arguments.
3582         Read directory file after eventual changing to another directory.
3583         Avoid adding the same directory under different pathnames to
3584         the list.
3585         * src/tar.c: New option --level.
3586
3587         * tests/incr03.at, tests/incr04.at, tests/listed01.at,
3588         tests/listed02.at, tests/rename01.at, tests/rename02.at,
3589         tests/rename03.at: Update for new tar behavior.
3590         * tests/multiv01.at: Do not use --listed-incremental.
3591
3592 2009-08-05  Sergey Poznyakoff  <gray@gnu.org.ua>
3593
3594         Forgotten to push src/warning.c
3595
3596 2009-08-05  Sergey Poznyakoff  <gray@gnu.org.ua>
3597
3598         Implement the --warning option.
3599
3600         * src/warning.c: New file.
3601         * src/Makefile.am: Add warning.c
3602         * src/common.h: Provide definitions for warning classes.
3603         (warning_option): New global.
3604         (WARNOPT): New define.
3605         (set_warning_option): New prototype.
3606         * src/tar.c: New option `--warning'.
3607         * src/compare.c: When applicable WARNOPT instead of WARN.
3608         * src/create.c: Likewise.
3609         * src/extract.c: Likewise.
3610         * src/incremen.c: Likewise.
3611         * src/list.c: Likewise.
3612
3613         * NEWS, doc/tar.texi: Update.
3614
3615 2009-08-05  Carl Worth  <cworth@cworth.org>
3616
3617         Fix descriptions of some options (tiny change)
3618
3619 2009-08-05  Sergey Poznyakoff  <gray@gnu.org.ua>
3620
3621         Fix backup handling and restoring file modes of existing
3622         directories
3623
3624         * NEWS, THANKS: Update
3625         * src/extract.c (extract_dir): reset status to 0 if the
3626         directory already exists.
3627         * src/misc.c (maybe_backup_file): Assign before_backup_name
3628         and clear after_backup_name before checking if we really need
3629         to backup the file.
3630         * tests/backup01.at: New testcase.
3631         * tests/extrac08.at: New testcase.
3632         * tests/Makefile.am, tests/testsuite.at: Add extrac08.at and
3633         backup01.at
3634
3635 2009-07-30  Sergey Poznyakoff  <gray@gnu.org.ua>
3636
3637         Fix hard links recognition with -c --remove-files
3638
3639         * src/create.c (dump_hard_link): Always look up in the link table
3640         if remove_files_option is set. Patch suggested by Theodore Ts'o
3641         <tytso@mit.edu>.
3642         (check_links): Remove extra newline from the warning message.
3643         * tests/link02.at, tests/link03.at: New testcases.
3644         * tests/Makefile.am (TESTSUITE_AT): Add link02.at and link03.at
3645         * tests/testsuite.at: Include link02.at and link03.at
3646
3647 2009-07-30  Sergey Poznyakoff  <gray@gnu.org.ua>
3648
3649         Fix handling of hard link targets by -c --transform
3650
3651         * src/create.c (file_count_links): Transform link target
3652         before the look up.
3653         * tests/xform-h.at: New test case.
3654         * tests/Makefile.am (TESTSUITE_AT): Add xform-h.at.
3655         * tests/testsuite.at: Add xform-h.at
3656
3657 2009-06-23  Sergey Poznyakoff  <gray@gnu.org.ua>
3658
3659         Minor fix.
3660
3661         * src/extract.c (file_newer_p): Do not report error on ENOENT
3662
3663 2009-06-19  Sergey Poznyakoff  <gray@gnu.org.ua>
3664
3665         Remove rebox.el (reappeared after migration to Git)
3666
3667 2009-06-18  Sergey Poznyakoff  <gray@gnu.org.ua>
3668
3669         Remove files that were removed in CVS, but reappeared after
3670         migration to Git
3671
3672 2009-06-18  David Bartley  <dtbartle@csclub.uwaterloo.ca>
3673
3674         Fix Solaris bug where chmod fails if we don't have
3675         PRIV_SYS_LINKDIR
3676
3677         * gnulib.modules: Add priv-set.
3678         * src/extract.c (set_mode, extract_archive): Restore
3679         PRIV_SYS_LINKDIR on chmod failure.
3680         * src/tar.c (main): Drop PRIV_SYS_LINKDIR on startup.
3681
3682 2009-06-18  Sergey Poznyakoff  <gray@gnu.org.ua>
3683
3684         Ensure default behavior for SIGPIPE
3685
3686         * src/tar.c (main): Install default handler for SIGPIPE.
3687         Proposed by Bastian Blank.
3688
3689 2009-06-18  Eric Blake  <ebb9@byu.net>
3690
3691         Follow autoconf recommendation for TESTSUITEFLAGS.
3692
3693         * tests/Makefile.am (check-local, installcheck-local): Honor
3694         TESTSUITEFLAGS.
3695
3696 2009-06-18  Sergey Poznyakoff  <gray@gnu.org.ua>
3697
3698         Fix handling of sub-subprocess returns.
3699
3700         * src/system.c (wait_for_grandchild): New function.
3701         (sys_child_open_for_compress)
3702         (sys_child_open_for_uncompress): Use wait_for_grandchild
3703         to manage grandchild return.
3704
3705 2009-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
3706
3707         Report record size only if the archive refers to a device.
3708
3709         * Makefile.am (INCLUDES): Add ../lib, for rmt-command.h
3710         * src/buffer.c (short_read): Report the actual record size
3711         only if the archive descriptor refers to a device.
3712         * tests/pipe.at, tests/shortrec.at,
3713         tests/sparsemvp.at: Reflect the above change.
3714         * NEWS, configure.ac: Version 1.22.90
3715
3716 2009-05-14  Sergey Poznyakoff  <gray@gnu.org.ua>
3717
3718         Do not issue errors on existing files when given the -k option
3719
3720         * Makefile.am (dist-hook): Fix rule.
3721         * src/extract.c (maybe_recoverable): Return three-state value.
3722         (extract_dir): Skip extraction if maybe_recoverable indicates so.
3723         (extract_file): Likewise.
3724
3725 2009-05-12  Eric Blake  <ebb9@byu.net>
3726
3727         Avoid undefined behavior
3728
3729         * src/xheader.c (xheader_set_keyword_equal): Pass correct type to
3730         ctype macros.
3731         * src/transform.c (run_case_conv): Likewise.
3732
3733 2009-05-12  Sergey Poznyakoff  <gray@gnu.org.ua>
3734
3735         Remove src/Makefile.in
3736
3737 2009-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>
3738
3739         Bugfixes.
3740
3741         * bootstrap (symlink_to_dir): Fix symlink calculation.
3742         * doc/tar.texi: Minor fixes by Victor Villa and Stepan Kasal.
3743
3744 2009-03-07  Sergey Poznyakoff  <gray@gnu.org.ua>
3745
3746         Remove Makefile.in
3747
3748         Migrate to Git
3749
3750 Currently the ChangeLog is generated automatically from the Git
3751 revision history, but from 1997 to 2009 the ChangeLog file was
3752 maintained by hand, under CVS.  This file records the older log.
3753
3754 Copyright 1997-2001, 2003-2009, 2013 Free Software Foundation, Inc.
3755
3756 This file is part of GNU tar.
3757
3758 GNU tar is free software; you can redistribute it and/or modify
3759 it under the terms of the GNU General Public License as published by
3760 the Free Software Foundation; either version 3 of the License, or
3761 (at your option) any later version.
3762
3763 GNU tar is distributed in the hope that it will be useful,
3764 but WITHOUT ANY WARRANTY; without even the implied warranty of
3765 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3766 GNU General Public License for more details.
3767
3768 You should have received a copy of the GNU General Public License
3769 along with this program.  If not, see <http://www.gnu.org/licenses/>.
3770
3771 2009-03-05  Sergey Poznyakoff  <gray@gnu.org.ua>
3772
3773         * src/incremen.c: --no-recursive works with --incremental.
3774
3775 2009-03-04  Sergey Poznyakoff  <gray@gnu.org.ua>
3776
3777         Add xz support.
3778
3779         * src/buffer.c, src/suffix.c: Add support for xz compression.
3780         * src/tar.c: New option --xz, for compression/decompression using xz.
3781         Re-assign -J as a short equivalent of --xz.
3782
3783 2009-01-19  Sergey Poznyakoff  <gray@gnu.org.ua>
3784
3785         * doc/tar.texi: Fix typo.
3786
3787 2008-12-29  Sergey Poznyakoff  <gray@gnu.org.ua>
3788
3789         * bootstrap.conf: Include size_max.
3790         * gnulib.modules: Remove memset, rmdir. Replace strdup with
3791         strdup-posix. Patch by Eric Blake.
3792         * src/tar.c: Implement -I as a shorthand for --use-compress-program.
3793         * doc/tar.texi: Document -I.
3794         * tests/pipe.at, tests/shortrec.at: Account for eventual 'Record
3795         size' output.
3796         * tests/testsuite.at (AT_TAR_CHECK_HOOK): New define
3797         (AT_TAR_WITH_HOOK, TAR_IGNREC_HOOK): New macros.
3798
3799 2008-11-30  Sergey Poznyakoff  <gray@gnu.org.ua>
3800
3801         * src/xheader.c: Remove duplicate inclusion of fnmatch.h. Reported
3802         by Jim Meyering.
3803
3804 2008-11-25  Sergey Poznyakoff  <gray@gnu.org.ua>
3805
3806         Do not try to drain the input pipe before closing the
3807         archive.
3808
3809         * src/buffer.c (close_archive): Remove call to
3810         sys_drain_input_pipe. Pass hit_eof as the second
3811         argument to sys_wait_for_child.
3812         * src/common.h (sys_drain_input_pipe): Remove
3813         (sys_wait_for_child): Declare second argument.
3814         * src/system.c (sys_drain_input_pipe): Remove.
3815         (sys_wait_for_child): Take two arguments. The second one helps to
3816         decide whether to tolerate child termination on SIGPIPE.
3817
3818 2008-11-03  Sergey Poznyakoff  <gray@gnu.org.ua>
3819
3820         * src/buffer.c (_write_volume_label): Fix typo, which prevented
3821         `-V label -M' from working.
3822
3823 2008-10-30  Sergey Poznyakoff  <gray@gnu.org.ua>
3824
3825         * NEWS, configure.ac: Version 1.20.91
3826         * doc/tar.texi: Document transformation scope flags.
3827         * src/common.h (transform_symlinks_option): Remove in favor of
3828         transformation scope flags.
3829         (XFORM_REGFILE, XFORM_LINK, XFORM_SYMLINK, XFORM_ALL): New macros.
3830         (transform_name, transform_member_name, transform_name_fp): Take
3831         an additional argument, specifying scope flags.
3832         * src/create.c: Reflect changes to transform_name.
3833         * src/extract.c (extract_link, extract_symlink): Remove calls to
3834         transform_member_name. It is done in read_header.
3835         * src/list.c (decode_xform): Reflect change in data type of 2nd
3836         argument.
3837         (transform_member_name): 2nd arg is int.
3838         (decode_header): Transform file name and link target names.
3839         * src/tar.c: Remove --transform-symlinks.
3840         * src/transform.c (struct transform): New member `flags'.
3841         (transform_flags): New variable.
3842         (parse_transform_expr): Parse transformation scope flags. Allow to
3843         set global flags using `flags=' syntax.
3844         (_transform_name_to_obstack, transform_name_fp)
3845         (transform_name): Take an additional argument, specifying scope
3846         flags.
3847
3848 2008-10-19  Sergey Poznyakoff  <gray@gnu.org.ua>
3849
3850         * THANKS: Add Ed Leaver.
3851         * src/buffer.c (short_read): Remove !read_full_records condition,
3852         which was always false on a first record and thus disabled record
3853         size autodetection.  Thanks Ed Leaver for the patch.
3854         (_gnu_flush_read): Handle blocking_factor == 1.
3855         * tests/sparsemv.at: Reflect changes to buffer.c.
3856         * tests/sparsemvp.at: Likewise.
3857         * tests/volsize.at: Likewise.
3858         * NEWS: Update.
3859
3860 2008-10-16  Sergey Poznyakoff  <gray@gnu.org.ua>
3861
3862         * src/common.h (transform_symlinks_option): New global.
3863         * src/create.c (dump_file0): Transform symlink targets only if
3864         explicitly required.  Thanks Cyril Strejc for reporting the
3865         problem.
3866         * src/tar.c (parse_opt): New options --transform-symlinks and
3867         --no-transform-symlinks. New alias --xform to the --transform
3868         option.
3869         * doc/tar.texi: Document --transform-symlinks
3870         * NEWS: Update.
3871         * THANKS: Update.
3872
3873         * src/names.c (name_gather): Use xzalloc.
3874         * src/buffer.c (short_read): Move record size detection before
3875         the loop.
3876
3877 2008-10-07  Sergey Poznyakoff  <gray@gnu.org.ua>
3878
3879         * src/tar.c (options): Add --lzop option.
3880
3881 2008-10-05  Xavier Hienne <xavier.hienne@free.fr> (tiny change)
3882
3883         * src/checkpoint.c (checkpoint_compile_action): Add missing
3884         `else'.
3885
3886 2008-09-24  Sergey Poznyakoff  <gray@gnu.org.ua>
3887
3888         * NEWS: Update.
3889         * doc/tar.texi: Update.
3890         * src/tar.c: New option --no-null.
3891
3892 2008-09-23  Sergey Poznyakoff  <gray@gnu.org.ua>
3893
3894         * src/common.h (filename_terminator): Remove global.
3895         * src/tar.c (filename_terminator): New static.
3896         * src/names.c (name_next_elt): Do not depend on
3897         filename_terminator, this was a leftover from 1.13.
3898
3899 2008-09-18  Sergey Poznyakoff  <gray@gnu.org.ua>
3900
3901         * doc/tar.texi: Remove incorrect example.
3902
3903 2008-09-07  Sergey Poznyakoff  <gray@gnu.org.ua>
3904
3905         * src/incremen.c (dumpdir_create0): Eliminate gcc warning.
3906         (attach_directory): Bugfix - add missing return statement.
3907         * THANKS: Add Enric Hernandez
3908
3909 2008-07-31  Sergey Poznyakoff  <gray@gnu.org.ua>
3910
3911         * src/incremen.c (struct directory): New member `next'.  Change
3912         type of `name'.
3913         (dirhead, dirtail): New statics.
3914         (make_directory): Reflect changes to struct directory.
3915         (free_directory, attach_directory): New functions.
3916         (dirlist_replace_prefix): New function.
3917         (note_directory): Use attach_directory, instead of make_directory,
3918         (find_directory, find_directory_meta): Use free_directory.
3919         (procdir): Replace directory prefixes in directory list to avoid
3920         marking subdirectories as renamed after renaming their parent
3921         directory.
3922         (append_incremental_renames): Iterate over directory list, not
3923         hash table, to preserve logical ordering of renames.
3924         * tests/rename04.at, tests/rename05.at: New test cases.
3925         * tests/Makefile.am, tests/testsuite.at: Add rename04.at and
3926         rename05.at.
3927         * tests/atlocal.in (decho): New function.
3928         * tests/multiv06.at: Use decho instead of echo2.
3929         * tests/incremental.at: Raise wait interval to 2 seconds.
3930
3931 2008-07-24  Sergey Poznyakoff  <gray@gnu.org.ua>
3932
3933         * src/tar.c (decode_options): Do not allow volume length less
3934         than record size.
3935         * src/buffer.c (_gnu_flush_write): Compensate for the effect
3936         of eventual flush_archive occurring in the middle of buffer
3937         move.
3938         Increment records_written only if _flush_write was able to write
3939         something.
3940         * tests/multiv06.at: New testcase.
3941         * tests/Makefile.am, test/testsuite.at: Add tests/multiv06.at
3942
3943 2008-06-26  Sergey Poznyakoff  <gray@gnu.org.ua>
3944
3945         * configure.ac, NEWS: Version 1.20.90
3946         * doc/tar.texi: Document -J, --no-auto-compress, etc.
3947         * src/buffer.c (ct_tar): New constant.
3948         (magic): Add lzop support.  Proposed by Kevin Day
3949         <thekevinday@gmail.com>.
3950         (check_compressed_archive): Do not use autodetect if the
3951         compression program was specified explicitly.
3952         Fall back to analyzing archive name, if the autodetection fails.
3953         * src/suffix.c: Add .lzo
3954         * src/tar.c: New options --lzop and --no-auto-compress.
3955         New short option -J (alias for --lzma).
3956
3957         * src/buffer.c (try_new_volume): Print more information with error
3958         diagnostics.
3959         (_gnu_flush_write): Improve error checking.  Adjust
3960         real_s_sizeleft before calling new_volume to avoid creating
3961         malformed multivolume headers.
3962         * tests/delete05.at, tests/gzip.at, tests/ignfail.at,
3963         tests/longv7.at, tests/lustar01.at, tests/lustar02.at,
3964         tests/shortfile.at: Update to match new diagnostic wording
3965         (see 2008-05-06).
3966
3967         * NEWS: Update.
3968
3969 2008-06-14  Sergey Poznyakoff  <gray@gnu.org.ua>
3970
3971         * doc/tar.texi (exclude): Document support for new VCS.
3972         * THANKS: Update.
3973         * NEWS: Update.
3974         * tests/multiv05.at: Fix typos.
3975         * tests/volsize.at: Remove a TZ dependency.
3976
3977 2008-06-14  Dan Drake <dan@dandrake.org> (tiny change)
3978
3979         * src/tar.c (exclude_vcs_files): Support for Bazaar, Mercurial and
3980         Darcs.
3981
3982 2008-05-06  Sergey Poznyakoff  <gray@gnu.org.ua>
3983
3984         * src/tar.c (main): Reword the "delayed error" message. New
3985         wording proposed by Karl Berry.
3986
3987 2008-02-20  Sergey Poznyakoff  <gray@gnu.org.ua>
3988
3989         * configure.ac: Raise version number to 1.20
3990         * src/compare.c (diff_dumpdir): const.
3991         * src/common.h (dumpdir_t,dumpdir_iter_t): New data types.
3992         (dumpdir_create0,dumpdir_create,dumpdir_free,dumpdir_locate)
3993         (dumpdir_first,dumpdir_next): New functions.
3994         * src/incremen.c (dumpdir_create0,dumpdir_create,dumpdir_free)
3995         (dumpdir_first,dumpdir_next): New functions.
3996         (dumpdir_locate): Rewrite using binary search.
3997         (struct directory): Change members char *contents, *icontents to
3998         struct dumpdir *dump, *idump. All references updated.
3999         (note_directory): Last arg is const.
4000         * src/names.c (add_hierarchy_to_namelist): buffer is const.
4001         * tests/incr03.at, tests/incr04.at, tests/rename02.at,
4002         tests/rename03.at: Insert calls to sleep between creation of files
4003         and adding them to the archive.
4004
4005 2008-03-31  Sergey Poznyakoff  <gray@gnu.org.ua>
4006
4007         * src/create.c (dump_file0): Count links only for actually dumped
4008         files.
4009
4010 2008-03-27  Sergey Poznyakoff  <gray@gnu.org.ua>
4011
4012         * NEWS: Document --no-check-device and --check-device.
4013         * doc/rendition.texi: Change the way FIXME-*refs are handled in
4014         !PROOF.
4015         * doc/intern.texi, doc/tar.texi: Update.
4016         * doc/untabify.el: New file.
4017         * doc/Makefile.am (EXTRA_DIST): Add untabify.el
4018         (untabify, final, check-format, check-refs, check-fixmes)
4019         (check-unrevised, all-check-docs, check-docs): New rules.
4020
4021         * src/common.h (check_device_option): New global.
4022         * src/incremen.c (procdir): Use boolean and instead of bitwise
4023         one. Patch by Jean-Louis Martineau.
4024         Compare device numbers only if check_device_option is set.
4025         * src/tar.c: New command line options --no-check-device and
4026         --check-device. Proposed by Jean-Louis Martineau.
4027         (parse_opt): Hanlde new options.
4028         (decode_options): Initialize check_device_option to true.
4029
4030         * THANKS: Update
4031
4032 2008-03-06  Sergey Poznyakoff  <gray@gnu.org.ua>
4033
4034         * bootstrap: Use rsync to get translations.
4035         * doc/tar.texi: Minor change.
4036         * lib/.cvsignore: Update
4037         * po/.cvsignore: Update
4038         * src/system.c: Remove include setenv.h.
4039         * tests/atlocal.in (STAR_DATA_URL): Update.
4040         * tests/star/README: Update URL.
4041
4042 2008-02-09  Sergey Poznyakoff  <gray@gnu.org.ua>
4043
4044         * doc/tar.texi: Fix a typo. Reported by Denis Excoffier.
4045
4046 2008-02-08  Sergey Poznyakoff  <gray@gnu.org.ua>
4047
4048         * NEWS: Update.
4049         * configure.ac: Version 1.19.90
4050         * po/POTFILES.in: Add missing files.
4051         * src/compare.c (verify_volume): Honor --ignore-zeros.
4052         Proposed by Jan-Benedict Glaw.
4053         * tests/shortfile.at (AT_KEYWORDS): Add shortfile0.
4054
4055 2008-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
4056
4057         * NEWS: Update.
4058         * src/create.c (dump_file0): Apply transform_name to symlink
4059         targets.
4060
4061 2008-02-04  Sergey Poznyakoff  <gray@gnu.org.ua>
4062
4063         * src/transform.c: Support multiple --transform options. Support
4064         semicolon-separated lists of replace expressions.
4065         * NEWS, tar.texi: Document changes to the --transform option.
4066
4067 2008-01-30  Paul Eggert  <eggert@cs.ucla.edu>
4068
4069         * doc/tar.texi: Update Back-Cover text to reflect new GNU wording.
4070
4071 2007-12-17  Paul Eggert  <eggert@cs.ucla.edu>
4072
4073         Exit with nonzero status if a close fails on an archive.
4074         Problem (and initial trivial fix)
4075         * src/buffer.c (close_archive, new_volume): close_error, not
4076         close_warn.
4077
4078 2007-12-05  Sergey Poznyakoff  <gray@gnu.org.ua>
4079
4080         * src/buffer.c (check_compressed_archive): Do not bail out if the
4081         file is too short, set boolean flag, passed as an argument
4082         instead.  This fixes a bug introduced on 2007-08-24. See also
4083         tests/shortupd.at.
4084
4085         * tests/Makefile.am, tests/testsuite.at: Add shortupd.at.
4086         * tests/shortupd.at: New test.
4087
4088 2007-11-12  Jim Meyering  <meyering@redhat.com>
4089
4090         Don't read from name[-1].
4091         * src/incremen.c (make_directory): Handle namelen == 0, since
4092         find_directory_meta calls make_directory ("").
4093
4094 2007-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>
4095
4096         * bootstrap (checkout): Use URL of the gnulib CVS mirror.
4097         * gnulib.modules: Add fseeko and snprintf.
4098
4099 2007-10-31  Sergey Poznyakoff  <gray@gnu.org.ua>
4100
4101         * src/checkpoint.c: New actions: bell and ttyout
4102         * src/system.c (sys_exec_info_script)
4103         (sys_exec_checkpoint_script): pass the current blocking factor in
4104         TAR_BLOCKING_FACTOR environment variable.
4105         * doc/tar.texi: Update
4106         * NEWS: Update
4107
4108 2007-10-30  Sergey Poznyakoff  <gray@gnu.org.ua>
4109
4110         * doc/Makefile.am: Use texi2html and the CVS version of gendocs.sh
4111         to create HTML versions of the manual.
4112         * doc/gendocs_template: Likewise.
4113         * doc/tar.texi: Document --hard-dereference and
4114         --checkpoint-action options. Improve documentation of
4115         --check-links.
4116
4117 2007-10-29  Sergey Poznyakoff  <gray@gnu.org.ua>
4118
4119         * NEWS: Update
4120         * configure.ac: Version 1.19.1
4121         * po/POTFILES.in: Add src/checkpoint.c
4122         * src/Makefile.am (tar_SOURCES): add checkpoint.c
4123         * src/checkpoint.c: New file - checkpoint handling.
4124         * src/buffer.c (checkpoint, do_checkpoint): Remove.
4125         (_flush_write, simple_flush_read, _gnu_flush_read): Use
4126         checkpoint_run.
4127         * src/common.h (enum checkpoint_style): Remove.
4128         (checkpoint_style): Remove.
4129         (DEFAULT_CHECKPOINT): New define.
4130         (hard_dereference_option): New variable.
4131         (sys_exec_checkpoint_script): New declaration.
4132         * src/create.c (file_count_links): do nothing if
4133         hard_dereference_option is set.
4134         * src/system.c (sys_exec_checkpoint_script): New function.
4135         (sys_exec_info_script): Restore SIGPIPE handler.
4136         * src/tar.c: (parse_opt): New options --hard-dereference,
4137         --checkpoint-action.
4138         (decode_options): Call checkpoint_finish_compile.
4139
4140         * src/system.c (sys_exec_info_script): Initialize buf. Problem
4141         reported by Bengt-Arne Fjellner.
4142
4143 2007-10-18  Jim Meyering  <jim@meyering.net>
4144
4145         Avoid compiler warnings.
4146         * src/list.c (read_header_primitive): Define two locals, to
4147         avoid incorrect "may be used uninitialized" warnings.
4148         * src/incremen.c (procdir): Remove decl of unused local, "len".
4149
4150 2007-10-18  Sergey Poznyakoff  <gray@gnu.org.ua>
4151
4152         * doc/tar.texi (gzip): Remove compression patent
4153         warning. According to Brett Smith, the patent is
4154         expired.
4155
4156 2007-10-17  Sergey Poznyakoff  <gray@gnu.org.ua>
4157
4158         * src/suffix.c: New file. Compress format detection by archive
4159         suffix (when creating). Suggested by Jean-Pierre Demailly.
4160         * src/Makefile.am: Add suffix.c
4161         * src/buffer.c (magic): Add an entry for new lzma format. Proposed
4162         by Lasse Collin.
4163         * src/common.h (set_comression_program_by_suffix): New prototype.
4164         * src/tar.c: New options --auto-compress (-a) and --lzma
4165         * THANKS: Add Lasse Collin and Jean-Pierre Demailly.
4166         * NEWS: Update
4167         * doc/tar.texi: Update
4168
4169 2007-10-12  Paul Eggert  <eggert@cs.ucla.edu>
4170
4171         * src/utf8.c (string_ascii_p): Recode to avoid bogus GCC 4.2.1
4172         warning about "comparison is always true due to limited range of
4173         data type" when char is unsigned.
4174
4175 2007-10-11  Paul Eggert  <eggert@cs.ucla.edu>
4176
4177         Adjust to recent gnulib changes.
4178         * configure.ac: Dont' check for strerror, since gnulib now does this.
4179         * .cvsignore: Add m4, tar-[0-9]*.
4180         * lib/.cvsignore: Adjust to various gnulib file name changes.
4181         Add .deps, rmt-command.h.
4182
4183 2007-10-10  Sergey Poznyakoff  <gray@gnu.org.ua>
4184
4185         * configure.ac, NEWS: Raise version number to 1.19
4186         * tests/star/README: Update
4187
4188 2007-10-05  Sergey Poznyakoff  <gray@gnu.org.ua>
4189
4190         * src/create.c (dump_regular_file): Fix file padding in case of
4191         truncation to zero size.
4192         * NEWS: Update
4193
4194 2007-10-04  Sergey Poznyakoff  <gray@gnu.org.ua>
4195
4196         * tests/T-null.at: Use AT_DATA for sample output.
4197
4198 2007-10-03  Sergey Poznyakoff  <gray@gnu.org.ua>
4199
4200         * src/incremen.c (try_purge_directory): Ensure that arguments to T
4201         and R are safe.
4202
4203 2007-09-29  Sergey Poznyakoff  <gray@gnu.org.ua>
4204
4205         * src/incremen.c (obstack_code_rename): Apply safer_name_suffix to
4206         name arguments before storing them in T and R records. Reported by
4207         Nicholas Cole.
4208
4209 2007-09-27  Sergey Poznyakoff  <gray@gnu.org.ua>
4210
4211         * configure.ac: Raise version number to 1.18.90
4212         * NEWS: Likewise
4213
4214         * doc/snapshot.texi: Document version 2.
4215         * doc/dumpdir.texi: Update.
4216
4217         Implement --exclude-tag* and --exclude-cache* options for listed
4218         incremental archives.
4219         New option --exclude-vcs to exclude VCS-specific files and
4220         directories.
4221
4222         * NEWS: Update
4223         * doc/tar.texi: Document --exclude-vcs option
4224         * src/common.h (exclusion_tag_warning, check_exclusion_tags): New
4225         prototypes.
4226         * src/create.c (exclusion_tag_warning, check_exclusion_tags):
4227         Remove static qualifier.
4228         (check_exclusion_tags): account for dirname without terminating
4229         slash.
4230         (dump_dir0): exclusion_tag_all is handled elsewhere.
4231         * src/incremen.c (struct directory): New member tagfile
4232         (make_directory): Initialize tagfile to NULL
4233         (procdir): New argument: entry
4234         Hanlde exclusion tags.
4235         (makedumpdir): Take into account directory->tagfile.
4236         (scan_directory): Hanlde exclusion tags.
4237         * src/tar.c: New option --exclude-vcs
4238         (exclude_vcs_files): New function
4239
4240 2007-09-14  Paul Eggert  <eggert@cs.ucla.edu>
4241
4242         * AUTHORS: Remove unnecessary information.  Just list the
4243         principal authors.
4244         * THANKS: Remove info duplicated from AUTHORS.
4245
4246 2007-08-25  Jim Meyering  <jim@meyering.net>
4247
4248         Don't include <getline.h>.  No longer needed.
4249         * src/incremen.c: Don't include <getline.h>.  No longer needed.
4250         * src/buffer.c: Likewise.
4251         * src/system.c: Likewise.
4252         * src/tar.c: Likewise.
4253
4254         Avoid shadowing and unused-variable warnings.
4255         * src/create.c (check_exclusion_tags): Remove declaration of unused
4256         local, "ret".
4257         * src/compare.c (diff_dumpdir): Rename stat->stat_data to avoid
4258         shadowing the syscall.
4259         * src/buffer.c (do_checkpoint): Don't shadow the write syscall.
4260         (try_new_volume): Avoid shadowing "access".
4261         * src/tar.c (decode_options): Rename index->idx to avoid shadowing.
4262         (find_argp_option): Rename option->o to avoid shadowing.
4263         * src/incremen.c (scan_directory): Rename local, dir_name->dir,
4264         to avoid shadowing the function.
4265         (get_directory_contents): Likewise.
4266         * src/system.c (global_pid): Rename from "pid", to avoid being
4267         shadowed by locals.
4268         * src/extract.c (apply_nonancestor_delayed_set_stat):
4269         Rename st->sb to avoid shadowing another local.
4270
4271 2007-08-24  Sergey Poznyakoff  <gray@gnu.org.ua>
4272
4273         * configure.ac, NEWS: Raise version number to 1.18.1
4274
4275         * src/buffer.c (check_compressed_archive): Detect files smaller
4276         than 512 bytes.
4277         * tests/shortfile.at: New test case for the above change.
4278         * tests/testsuite.at, tests/Makefile.am: Add shortfile.at
4279
4280 2007-08-19  Sergey Poznyakoff  <gray@gnu.org.ua>
4281
4282         * bootstrap: Gnulib initialization destroyed paxutils m4 files.
4283         Initialize paxutils structure after that of gnulib.
4284
4285 2007-08-12  Sergey Poznyakoff  <gray@gnu.org.ua>
4286
4287         * src/names.c (contains_dot_dot): Fix double-dot recognition in
4288         case of duplicate /. Patch by Dmitry V. Levin.
4289
4290         * bootstrap (symlink_to_gnulib): Make sure the target directory
4291         exists and create it if it does not.
4292
4293         * doc/tar.texi: Fix a typo.
4294
4295 2007-06-28  Sergey Poznyakoff  <gray@gnu.org.ua>
4296
4297         * bootstrap: Update for the change of the TP URL
4298
4299 2007-06-27  Sergey Poznyakoff  <gray@gnu.org.ua>
4300
4301         Relicense under GPLv3
4302
4303 2007-06-21  Sergey Poznyakoff  <gray@gnu.org.ua>
4304
4305         * tests/testsuite.at (AT_TAR_MKHIER): Skip test if genfile is
4306         unable to create the file
4307         * tests/lustar01.at: Likewise
4308
4309 2007-06-21  Eric Blake  <ebb9@byu.net>
4310
4311         Resolve testsuite failures 40-42 on cygwin.
4312         * tests/testsuite.at (AT_TAR_MKHIER): Skip tests when long
4313         file names cannot be created.
4314
4315 2007-06-16  Sergey Poznyakoff  <gray@gnu.org.ua>
4316
4317         * doc/Makefile.am (tar_TEXINFOS): Add tar-snapshot-edit.texi
4318         * doc/tar-snapshot-edit.texi: New file
4319         * doc/tar.texi (Fixing Snapshot Files): New appendix
4320
4321         * scripts/tar-snapshot-edit: New file
4322         * tests/extrac07.at: Add back write permissions on dir
4323
4324 2007-06-09  Sergey Poznyakoff  <gray@gnu.org.ua>
4325
4326         * tests/exclude.at: Sort the output.
4327
4328 2007-06-08  Sergey Poznyakoff  <gray@gnu.org.ua>
4329
4330         * configure.ac, NEWS: Raise version number to 1.17
4331
4332         * doc/tar.texi, doc/intern.texi: Replace: s/filename/file name/;
4333         s/(ASCII|ID|BSD)/@acronym{&}/;s/"[^"]+"/``&''/
4334         Use `path' only when it refers to search paths, use
4335         `file name' otherwise.
4336         Fix various errors (based on patch by Benno Schulenberg)
4337
4338         * doc/tar.texi (Operation Summary): Restore alphabetical order of
4339         the options.
4340
4341 2007-06-02  Sergey Poznyakoff  <gray@gnu.org.ua>
4342
4343         Fix bug, introduced on 2007-03-30.
4344
4345         * src/common.h (xform_type): New data type
4346         (transform_member_name): Last argument is of xform_type type
4347         All callers updated
4348
4349         * src/extract.c: Update calls to transform_member_name
4350         * src/list.c (decode_xform): Exempt symbolic links from component
4351         stripping and name suffix normalization.
4352
4353         * tests/extrac07.at: Update
4354
4355 2007-05-30  Sergey Poznyakoff  <gray@gnu.org.ua>
4356
4357         * src/xheader.c (decx): Unknown pax keywords produce a warning,
4358         not error.
4359
4360 2007-05-29  Paul Eggert  <eggert@cs.ucla.edu>
4361
4362         * src/misc.c (set_file_atime): Use gl_futimens, not futimens,
4363         due to gnulib change.
4364
4365 2007-05-19  Sergey Poznyakoff  <gray@gnu.org.ua>
4366
4367         * src/common.h (buffer_write_global_xheader): New function
4368         (struct xheader): Move definition to tar.h
4369         (extended_header): Remove global
4370         (xheader_init): New function
4371         (xheader_decode_global,xheader_store,xheader_read)
4372         (xheader_write_global,xheader_write,xheader_string_begin)
4373         (xheader_string_add,xheader_string_end): Take xhdr as first
4374         argument.
4375         * src/tar.h (struct xheader): New definition
4376         (struct tar_stat_info): New member xhdr (extended header).
4377
4378         * src/xheader.c (xheader_init): New function
4379         (xheader_decode_global,xheader_store,xheader_read)
4380         (xheader_write_global,xheader_write,xheader_string_begin)
4381         (xheader_string_add,xheader_string_end): Take xhdr as first
4382         argument.
4383
4384         * src/buffer.c (buffer_write_global_xheader): New function
4385         Update to use new xheader calls.
4386
4387         * src/compare.c, src/create.c, src/delete.c, src/list.c,
4388         src/sparse.c, src/tar.c, src/update.c: Global extended_header
4389         removed, use new xheader calls instead.
4390
4391         * tests/T-null.at: Minor fix
4392         * tests/atlocal.in (tarball_prereq): Discard eventual md5sum
4393         output.
4394
4395 2007-05-18  Sergey Poznyakoff  <gray@gnu.org.ua>
4396
4397         * src/create.c (dump_file0): Original ctime cannot be used as a
4398         directory change indicator if --remove-files is given.
4399
4400 2007-04-12  Paul Eggert  <eggert@cs.ucla.edu>
4401
4402         Adjust to latest Gnulib.
4403         * lib/.cvsignore: Add dirfd.c, dirfd.h, float+.h, mbscasecmp.c,
4404         stdio.h, stdio_.h, stdlib.h, stdlib_.h, time.h, time_.h, unistd.h.
4405         Remove exit.h, getcwd.h, mempcpy.h, memrchr.h, mkdtemp.h, stpcpy.h,
4406         strcase.h, strchrnul.h, strdup.h, strndup.h, strnlen.h, time_r.h,
4407         vsnprintf.h.
4408         * m4/.cvsignore: Remove localedir.h.  Sort.
4409
4410 2007-04-03  Paul Eggert  <eggert@cs.ucla.edu>
4411
4412         * src/common.h (closeopen): Remove decl.
4413         * src/misc.c: Don't include <sys/time.h>, <sys/resource.h>; no longer
4414         needed.
4415         (get_max_open_files, closeopen): Remove.  All callers removed.
4416         (chdir_dir): Use a different technique, which doesn't rely on closing
4417         all open files.
4418         * src/tar.c (main): Don't call closeopen.
4419
4420 2007-04-04  Sergey Poznyakoff  <gray@gnu.org.ua>
4421
4422         * NEWS: Update
4423         * doc/tar.texi: Update
4424         * src/system.c (sys_exec_info_script): Store the
4425         inter-communication fd in the environment variable TAR_FD
4426
4427 2007-04-03  Sergey Poznyakoff  <gray@gnu.org.ua>
4428
4429         * src/tar.c (main): Move closeopen after decode_options to
4430         allow shell process substitution to work.
4431         * tests/extrac07.at: Expect a warning on stderr.
4432
4433 2007-03-30  Sergey Poznyakoff  <gray@gnu.org.ua>
4434
4435         * src/common.h (transform_name_fp): Change signature
4436         (transform_member_name): New function
4437         * src/extract.c (extract_link, extract_symlink): Use
4438         transform_member_name instead of safer_name_suffix so that
4439         --transform and --strip-components affect links as well.
4440         * src/list.c (transform_member_name): New function
4441         (decode_header): Use transform_member_name
4442         * src/names.c (all_names_found): Remove check for matching_flags.
4443         * NEWS: Update
4444
4445         * TODO: Update
4446         * bootstrap (slurp): Remove any occurrences of $bt from the
4447         generated gnulib.mk
4448         * src/incremen.c: Do not include mkdtemp.h
4449
4450 2007-01-26  Paul Eggert  <eggert@cs.ucla.edu>
4451
4452         Adjust to recent gnulib changes.
4453         * lib/.cvsignore: Add fchownat.c, rmt-command.h, strerror.c, string.h,
4454         string_.h, sys, sys_time_.h, unistd_.h, wchar_.h, wctype_.h.
4455         Remove localedir.h, size_max.h, xsize.h.
4456         * src/xheader.c: Don't include stpcpy.h; no longer needed, now that
4457         gnulib string.h defines stpcpy on all platforms.
4458
4459 2007-01-23  Sergey Poznyakoff  <gray@gnu.org.ua>
4460
4461         * doc/tar.texi: Document --exclude-caches* and --exclude-tag*
4462         options.
4463         * src/common.h (exclude_caches_option): Remove
4464         (enum exclusion_tag_type): New data type
4465         (add_exclude_tag): Rename to add_exclusion_tag
4466         (cachedir_file_p): New prototype
4467         * src/create.c (struct exclude_tag): rename to exclusion_tag
4468         (check_exclusion_tags): New function
4469         (cachedir_file_p): New function (from check_cache_directory)
4470         (dump_dir0,dump_file0): Use check_exclusion_tags
4471         * src/tar.c: New options --exclude-caches-all,
4472         --exclude-caches-under, --exclude-tag-all, --exclude-tag-under
4473         * tests/exclude.at: New file
4474         * tests/Makefile.am (TESTSUITE_AT): Add exclude.at
4475         * tests/testsuite.at: Add exclude.at
4476
4477 2007-01-19  Sergey Poznyakoff  <gray@gnu.org.ua>
4478
4479         * gnulib.modules: Require strerror
4480         * doc/gendocs_template: Fix typos
4481         * scripts/xsparse.c (expand_sparse): use ftruncate to handle the
4482         trailing hole
4483         * src/sparse.c (sparse_skip_file,pax_dump_header_1)
4484         (pax_decode_header): Keep track of the number of bytes
4485         written.
4486         * configure.ac: Version 1.16.2
4487         * NEWS: Update
4488
4489 2007-01-04  Sergey Poznyakoff  <gray@gnu.org.ua>
4490
4491         * src/compare.c (diff_dumpdir): Compare directory contents using
4492         dumpdir_cmp.  Do not free dumpdir_buffer, it will leave the
4493         incremental directory table in the inconsistent state and trigger
4494         full dump.
4495         (read_and_process): Process dumpdirs no matter what the archive
4496         format.
4497         * src/incremen.c (list_dumpdir): Minor fixes.
4498
4499         * src/compare.c (read_and_process): Fix type of "size"
4500
4501 2006-12-13  Sergey Poznyakoff  <gray@gnu.org.ua>
4502
4503         * tests/T-null.at: Skip the test if genfile is not able to create
4504         the filename with an embedded newline.
4505
4506 2006-12-12  Paul Eggert  <eggert@cs.ucla.edu>
4507
4508         Port to Forte Developer 7 C 5.4 and C99.
4509         * src/common.h (add_exclude_tag): Add decl; C99 requires this
4510         and Forte warns about it.
4511         * src/incremen.c: Include <mkdtemp.h> for mkdtemp prototype,
4512         for same reason.
4513         * src/misc.c (get_max_open_files): Rewrite to avoid code that
4514         Forte C complains about as being unreachable.
4515         * src/xheader.c (mtime_code): Rewrite to avoid Forte error
4516         reported by Trond Hasle Amundsen.
4517
4518         * src/incremen.c (compare_dirnames): Rewrite to avoid casts.
4519         * src/utf8.c (string_ascii_p): Likewise.
4520         * src/xheader.c (mtime_coder, volume_size_coder, volume_offset_coder):
4521         Likewise.
4522
4523 2006-12-08  Sergey Poznyakoff  <gray@gnu.org.ua>
4524
4525         * bootstrap: Add paxutils files to dot_ignore.
4526
4527         * configure.ac: Raise version number to 1.16.1
4528         * bootstrap (slurp): Create .(cvs|git)ignore if not present
4529         * po/.cvsignore, m4/.cvsignore: Remove automatically generated
4530         files.
4531
4532 2006-12-07  Sergey Poznyakoff  <gray@gnu.org.ua>
4533
4534         * NEWS: Update
4535         * Makefile.am (distclean-local): Fixed
4536         * doc/tar.texi: Update documentation of --exclude-tag
4537         * src/create.c (dump_dir0): Move checks for exclude tags to
4538         dump_file0.
4539         (dump_dir): Move calls to ensure_slash to dump_file0
4540         * src/extract.c (extract_file): Call skip_member if open fails.
4541         Patch proposed by Jan-Benedict Glaw <jbglaw@lug-owl.de>
4542         * tests/truncate.at: Use genfile instead of dd, because on some
4543         systems /dev/zero is not available.
4544
4545 2006-12-04  Paul Eggert  <eggert@cs.ucla.edu>
4546
4547         * NEWS: Fix some race conditions with tar -x --same-owner.
4548         * src/extract.c (ARCHIVED_PERMSTATS): Add a comment saying that
4549         S_IRWXG | S_IRWXO might be masked out.
4550         (set_mode): Set the mode if some bits were masked out originally.
4551         (set_stat): Don't chmod before chown, as that might temporarily
4552         grant permissions that we don't want to grant.  The chmod was
4553         there only to work around broken hosts, so add a comment advising
4554         users not to use those broken hosts instead.
4555         (repair_delayed_set_stat, extract_dir):
4556         Remember to mask out current umask before inverting permissions.
4557         (extract_dir): If the owner might change, or if the mode has
4558         special bits, create the directory 700 at first, but restore it later.
4559         (open_output_file): New arg mode; all uses changed.
4560         (extract_file, extract_node, extract_fifo): If the owner might
4561         change, omit group and other bits at first, but restore them after
4562         changing the owner.
4563
4564 2006-12-04  Jim Meyering  <jim@meyering.net>
4565
4566         * doc/tar.texi (Long Options): Remove doubled word.
4567
4568 2006-11-30  Sergey Poznyakoff  <gray@gnu.org.ua>
4569
4570         * src/xheader.c (xheader_read): Remove unused variable
4571
4572         * po/POTFILES.in: Remove src/mangle.c
4573
4574         * bootstrap: Implement --update-po and .bootstrap
4575
4576         * src/create.c (dump_dir0): Implement --exclude-tag option
4577         * src/tar.c: Likewise
4578         * doc/tar.texi (exclude): Document --exclude-tag
4579
4580 2006-11-29  Paul Eggert  <eggert@cs.ucla.edu>
4581
4582         * NEWS: Remove support for mangled names.
4583         * doc/tar.texi (verbose tutorial): Likewise.
4584         * src/Makefile.am (tar_SOURCES): Remove mangle.c.
4585         * src/common.h (extract_mangle): Remove decl.
4586         * src/extract.c (extract_mangle_wrapper): Remove.
4587         (prepare_to_extract): Remove support for mangled names.
4588         * src/list.c (read_and, print_header): Likewise.
4589         * src/mangle.c: Remove.
4590         * src/tar.h (GNUTYPE_NAMES): Remove.
4591
4592         Port to latest gnulib.  There were a lot of changes, so the
4593         simplest way to get this up and running was to switch to coreutils
4594         bootstrap procedure.  I noticed one feature missing after this
4595         merge: the ability to update a single .po file.  I can add that
4596         later if need be.
4597         * README-cvs, bootstrap.conf: New files.
4598         * lib/.cvsignore: Remove Makefile.am, printf-parse.c, vasnprintf.c.
4599         Add fstatat.c, gnulib.mk, openat-proc.c, same-inode.h, stat_.h,
4600         tempname.c, tempname.h, uinttostr.c.
4601         * lib/printf-parse.c, lib/vasnprintf.c: New files, from coreutils,
4602         to override gnulib, so that we don't need xsize.h.
4603         * bootstrap: Replace with coreutils bootstrap, except add support
4604         for paxutils.
4605         * configure.ac (gl_USE_SYSTEM_EXTENSIONS): Remove, as gl_EARLY now
4606         does this.
4607         (gl_EARLY, gl_INIT): Add.
4608         (tar_GNULIB): Remove.
4609         * gnulib.modules: Add configmake.
4610         * lib/Makefile.tmpl: Remove, replacing with....
4611         * lib/Makefile.am: New file.
4612         * src/Makefile.am (tar.o): Remove dependency: Automake does this
4613         for us.
4614         * src/tar.c: Include <configmake.h> and <rmt-command.h>, not
4615         <localedir.h>.
4616
4617 2006-11-13  Sergey Poznyakoff  <gray@gnu.org.ua>
4618
4619         * src/xheader.c (mtime_coder): Treat non-null data as a pointer to
4620         struct timespec, overriding st->mtime
4621         * src/create.c (start_header): Pass mtime as a call-specific data
4622         to xheader_store.
4623
4624         * tests/truncate.at: Do not use 'k' modifier in dd options.
4625         * tests/append02.at: Do not depend on command timing.
4626
4627 2006-11-01  Sergey Poznyakoff  <gray@gnu.org.ua>
4628
4629         * src/tar.c (enum read_file_list_state.file_list_skip): New value
4630         (read_name_from_file): Skip zero-length entries
4631
4632         * tests/T-empty.at: New test case
4633         * tests/T-null.at: New test case
4634         * tests/extrac07.at: New test case
4635         * tests/Makefile.am: Add new test cases.
4636         * tests/testsuite.at: Add new test cases.
4637         * tests/extrac02.at: Add more keywords
4638         * tests/extrac04.at: Likewise
4639         * tests/extrac06.at: Likewise
4640         * tests/shortrec.at: Do not assume tar's default archive is stdout
4641
4642 2006-10-31  Sergey Poznyakoff  <gray@gnu.org.ua>
4643
4644         * src/extract.c, src/xheader.c: Call last_component instead of
4645         base_name. The latter returns a malloced string since 2006-03-11.
4646
4647 2006-10-21  Sergey Poznyakoff  <gray@gnu.org.ua>
4648
4649         * NEWS, configure.ac: Version 1.16
4650         * Makefile.am (distclean-local): New rule
4651
4652 2006-10-17  Sergey Poznyakoff  <gray@gnu.org.ua>
4653
4654         * src/tar.c: Fix help output formatting.  Thanks Benno
4655         Schulenberg.
4656
4657 2006-10-16  Sergey Poznyakoff  <gray@gnu.org.ua>
4658
4659         * Makefile.am (dist-hook): Create a cpio archive.
4660         * NEWS: Update
4661
4662 2006-10-14  Sergey Poznyakoff  <gray@gnu.org.ua>
4663
4664         * doc/tar.texi (Synopsis): Document tar exit codes.
4665         * src/create.c (dump_regular_file,dump_file0): Set exit_status to
4666         TAREXIT_DIFFERS if the file being dumped was truncated or
4667         otherwise changed.
4668         * src/tar.c: Do not attempt to close stderr after call to
4669         close_stdout.
4670         * tests/grow.at: New test case
4671         * tests/Makefile.am: New test grow.at
4672         * tests/testsuite.at: Likewise
4673         * tests/truncate.at (AT_KEYWORDS): Keyword `filechange'
4674         Test tar exit status.
4675
4676         * src/buffer.c (_open_archive): Make sure stdlis is set to stderr
4677         when we are writing archive to stdout (unless --index-file is
4678         used). Bug introduced on 2006-07-06.
4679         * tests/Makefile.am: New test verbose.at
4680         * tests/testsuite.at: Likewise
4681         * tests/indexfile.at (AT_KEYWORDS): Add stdout keyword
4682         * tests/verbose.at: New test case
4683
4684 2006-10-02  Sergey Poznyakoff  <gray@gnu.org.ua>
4685
4686         * THANKS: Add Joerg Weilbier
4687         * src/buffer.c (new_volume): Initialize current_block
4688         * src/xheader.c (xheader_string_end): Fix diagnostic message.
4689         * tests/multiv05.at: New testcase.
4690         * tests/Makefile.am, tests/testsuite.at: Add multiv05.at
4691
4692 2006-09-27  Sergey Poznyakoff  <gray@gnu.org.ua>
4693
4694         * bootstrap: Use ${package} instead of hardcoding package name
4695         * doc/tar.texi: Minor fix
4696         * src/tar.c (doc0, doc1, initialize_argp_doc): Removed.  Rely on
4697         the new argp method instead.
4698
4699 2006-09-12  Sergey Poznyakoff  <gray@gnu.org.ua>
4700
4701         * README: Fix a typo
4702
4703 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
4704
4705         Adjust to latest gnulib.
4706         * lib/.cvsignore: Add at-func.c, configmake.h, fchmodat.c,
4707         fcntl.h, fcntl_.h, inttypes_.h, lstat.c, lstat.h.
4708         * tests/testsuite.at (AT_TAR_MKHIER): Use install-sh -d
4709         rather than the no-longer-included mkinstalldirs.
4710
4711 2006-09-08  Sergey Poznyakoff  <gray@gnu.org.ua>
4712
4713         * src/incremen.c (try_purge_directory): Initialize struct st.  Fix
4714         condition for selecting candidates for removal.
4715         * README-alpha: List texinfo among build prerequisites for the CVS
4716         version.
4717
4718         * bootstrap (intl_files_to_remove): Do not remove m4/inttypes-h.m4
4719         and m4/inttypes-pri.m4
4720
4721 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
4722
4723         * bootstrap: Set XGETTEXT_OPTIONS to flag our printf-format functions,
4724         so that translators are warned about strings that are formats but
4725         don't look like formats.  This might help prevent core dumps.
4726         * configure.ac (AM_GNU_GETTEXT): Upgrade to need-formatstring-macros.
4727         Suggested by Eric Blake to avoid problems like
4728         <http://lists.gnu.org/archive/html/bug-coreutils/2006-07/msg00087.html>.
4729         (AM_GNU_GETTEXT_VERSION): Upgrade from 0.12.1 to 0.15.  The gettext
4730         manual says we should use the version number normally expected of
4731         maintainers, neither more nor less.
4732
4733         * bootstrap (get_translations):
4734         Don't exclude ky.po; it is working again.
4735
4736 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
4737
4738         * bootstrap (get_translations):
4739         Don't exclude ja.po; it is working again.
4740         Don't remove all old .po files if we're merely updating one.
4741         * po/.cvsignore: Add Makevars.
4742
4743 2006-08-07  Paul Eggert  <eggert@cs.ucla.edu>
4744
4745         * src/tar.c: Work around limitation imposed by gettext 0.15
4746         by concatenating strings with "\v" after translation.
4747         (doc): Remove, splitting into:
4748         (doc0, doc1): New constants.
4749         (argp): Don't use doc; just initialize to NULL.
4750         (initialize_argp_doc): New function.
4751         (decode_options): Use it.
4752
4753         * bootstrap: Redo po file retrieval to match Bison's method,
4754         since the translation project changed its index format.
4755         Don't use --assume-autoconf; it's now replaced
4756         by looking in configure.ac.
4757         (m4/codeset.m4, m4/intdiv.m4, m4/inttypes-pri.m4, m4/isc-posix.m4):
4758         (m4/lcmessage.m4, m4/onceonly_2_57.m4, m4/gettext.m4, m4/glibc21.m4):
4759         (m4/inttypes_h.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4):
4760         (m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4):
4761         Don't rename to ..._gl.m4, as this is no longer needed.
4762         (m4/geteext.m4): Patch to remove the need for intl/*.
4763         Use autopoint manually, then remove the intl files,
4764         then undo changes to gnulib files that autoreconf made,
4765         and then run aclocal/autoconf/autoheader/automake.
4766         This makes our bootstrap procedure closer to Bison's.
4767         (po/Makevars): Generate automatically.
4768         * configure.ac (AC_PREREQ): Update from 2.59 to 2.60.
4769         (gl_AC_TYPE_INTMAX_T, jm_AC_TYPE_UINTMAX_T): Remove.
4770         * gnulib.modules: Add inttypes, stdint.
4771         * lib/.cvsignore: Add close-stream.c, close-stream.h,
4772         stdint.h, stdint_.h.
4773         * po/Makefile: Remove; now automatically generated.
4774
4775         * src/incremen.c (read_incr_db_01): Check input strings more
4776         carefully.  Do not pass arbitrary char values to isspace, as
4777         this has undefined behavior.  Likewise for assigning arbitrary
4778         uintmax_t values to other types.
4779         (read_negative_num, read_unsigned_num, read_timespec):
4780         New functions, to check input values a bit more carefuly.
4781         (read_num): Use read_unsigned_num.  New arg MAX_VAL;
4782         all callers changed.
4783         (read_incr_db_2): Use these new functions.
4784         Use a consistent diagnostic for unexpected EOF.
4785         (read_directory_file): Do not assign arbitrary uintmax_t value
4786         to int.
4787         (read_timespec, write_directory_file_entry, write_directory_file):
4788         Handle negative time_t values correctly.  We don't bother to do
4789         this with pre-2 formats, since presumably the time stamps were
4790         output incorrectly.
4791
4792         * src/tar.c (doc): Don't use \v in an argument to gettext;
4793         gettext 0.15 rejects this.
4794
4795 2006-07-24  Sergey Poznyakoff  <gray@gnu.org.ua>
4796
4797         * src/tar.c (decode_options): Do not require -L with -M -Hpax.
4798         It could be needed in future, but currently it is not.
4799         * src/create.c (to_chars_subst): Update comment regarding OLDGNU
4800         vs. GNU format differences.
4801         (mode_to_chars): Treat OLDGNU_FORMAT same as GNU_FORMAT. Fixes bug
4802         reported by TAMUKI Shoichi <tamuki@linet.gr.jp>, which caused
4803         equivalent `tar cf ...' and `tar rf ...' commands to produce
4804         different archives.
4805
4806         * tests/append02.at: New test case
4807         * tests/Makefile.am, tests/testsuite.at: Add append02.at
4808
4809 2006-07-20  Paul Eggert  <eggert@cs.ucla.edu>
4810
4811         * bootstrap: Adjust to today's change to gnulib-tool by invoking
4812         it with --assume-autoconf='latest-stable'.
4813
4814 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
4815
4816         Adjust to recent gnulib changes.
4817         * lib/.cvsignore: Remove atexit.c, exit.c, getndelim2.c, getndelim2.h,
4818         pathmax.h, paxconvert.c, paxerror.h, xstrdup.c.
4819         Add inttypes.h, mktime.c, wcwidth.h, xstrndup.c, xstrndup.h.
4820         * src/create.c (start_header): Adjust to API change to mode_adjust.
4821
4822 2006-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
4823
4824         * THANKS: Add Ralf Wildenhues
4825         * NEWS: Update
4826
4827 2006-07-09  Ralf Wildenhues   <Ralf.Wildenhues@gmx.de>
4828
4829         * doc/dumpdir.texi, doc/snapshot.texi, doc/sparse.texi,
4830         doc/tar.texi: Fix some typos.
4831
4832 2006-07-06  Sergey Poznyakoff  <gray@gnu.org.ua>
4833
4834         tar --index-file=FILE --file=- sent the archive to FILE, and
4835         the listing to stderr. Bug reported by Marcin Gryszkalis
4836         <mg@fork.pl>
4837
4838         * src/buffer.c (_open_archive): Remove stdlis initialization
4839         * src/tar.c (decode_options): Initialize stdlis
4840         * tests/indexfile.at: New test case
4841         * tests/testsuite.at: Include indexfile.at
4842         * tests/Makefile.am (TESTSUITE_AT): Add indexfile.at
4843
4844 2006-07-05  Sergey Poznyakoff  <gray@gnu.org.ua>
4845
4846         * doc/Makefile.am (manual): Fix TEXINPUTS
4847         * doc/rendition.texi (FIXME): Do not use deprecated @quote-args.
4848         Do not use @allow-recursion. In its current form the macro is not
4849         recursive.
4850
4851 2006-07-03  Sergey Poznyakoff  <gray@gnu.org.ua>
4852
4853         * bootstrap (update_po): Fix single translation update
4854
4855 2006-07-03  Sergey Poznyakoff  <gray@gnu.org.ua>
4856
4857         * configure.ac (AC_CHECK_FUNCS): Check for getdtablesize
4858         * src/common.h (closeopen): New function
4859         * src/misc.c (chdir_arg): Use x2nrealloc to reallocate wd.
4860         (get_max_open_files,closeopen): New functions
4861         (chdir_do): Do not use save_cwd if it was already used more than
4862         max_open_files-4 times to avoid running off the file
4863         descriptors.
4864         * src/tar.c (main): Call closeopen
4865         * doc/tar.texi: Update --directory description
4866         * NEWS: Update
4867
4868 2006-06-26  Sergey Poznyakoff  <gray@gnu.org.ua>
4869
4870         * doc/tar.texi: Update. Add cross-references.
4871         * doc/sparse.texi: Add cross-references.
4872
4873 2006-06-25  Sergey Poznyakoff  <gray@gnu.org.ua>
4874
4875         * scripts/xsparse.c: A sample utility to expand sparse files
4876         extracted by third-party tars. It is not meant to be installed nor
4877         to be included in the distribution. It is here, so that it can be
4878         obtained either from CVS or from the tar web site.
4879         * doc/Makefile.am (tar_TEXINFOS): Sorted
4880         * doc/tar.texi (Other Tars): New node describing how to extract
4881         GNU-specific member formats using third-party tars.
4882         * src/common.h (sparse_file_p): Remove
4883         * src/sparse.c: Likewise
4884         * src/create.c: Use ST_IS_SPARSE instead of sparse_file_p (update
4885         paxutils first)
4886         * src/tar.c: --sparse-version turns on --sparse
4887
4888 2006-06-24  Sergey Poznyakoff  <gray@gnu.org.ua>
4889
4890         * src/buffer.c (print_total_stats): Add default case.
4891         * src/common.h (name_init): New prototype.
4892         (xheader_string_end): Return bool.
4893         * src/extract.c (extract_volhdr): Add missing return
4894         * src/incremen.c: Remove not used variables
4895         * src/sparse.c (pax_dump_header_0): Return false if
4896         xheader_string_end fails (for 0.1 formats).
4897         (pax_dump_header): Return meaningful value
4898         * src/transform.c (segm_count): Change type to size_t
4899         * src/xheader.c (xhdr_tab.decoder): pass keyword as a second
4900         argument. All callers changed.
4901         (decode_record): Check for numeric overflow
4902         (xheader_string_end): Return boolean value. Check for possible
4903         numeric overflow
4904
4905 2006-06-23  Sergey Poznyakoff  <gray@gnu.org.ua>
4906
4907         * doc/sparse.texi: New file
4908         * doc/Makefile.am (tar_TEXINFOS): Add sparse.texi
4909         * doc/intern.texi (Sparse Formats): New node
4910         * doc/tar.texi: Update master menu
4911
4912         * src/common.h (tar_sparse_major,tar_sparse_minor): New globals.
4913         * src/sparse.c: Implement sparse format versioning. Implement new
4914         version (1.0) of PAX sparse format.
4915         (pax_sparse_member_p): Fix condition
4916         (pax_dump_header): A dispatcher function
4917         (pax_dump_header_0,pax_dump_header_1): New functions.
4918         (pax_optab): Update
4919         (oldgnu_dump_header): Minor fix: make sure
4920         sparse_header.isextended is set before calling
4921         set_next_block_after
4922         * src/tar.c: New option --sparse-version
4923         * src/tar.h (struct tar_stat_info.sparse_major,sparse_minor): New
4924         members.
4925         * src/xheader.c: Implement new keywords: GNU.sparse.name,
4926         GNU.sparse.major, GNU.sparse.minor, GNU.sparse.realsize
4927
4928         * tests/spmpv00.at, tests/spmvp01.at, tests/spmvp10.at: New
4929         testcases.
4930
4931         * tests/Makefile.am: Add spmvp00.at, spmpv01.at, spmpv10.at
4932         * tests/shortrec.at: Explicitely give `-f -' to the tar invocation
4933         * tests/sparsemvp.at: Rewritten as an include file.
4934         (TAR_MVP_TEST): New macro
4935         * tests/testsuite.at: Include sparsemvp.at, spmvp00.at,
4936         spmvp01.at, spmvp10.at
4937
4938 2006-06-21  Sergey Poznyakoff  <gray@gnu.org.ua>
4939
4940         * doc/tar.texi (Overriding File Metadata): New node
4941         Document --mtime option.
4942         * src/common.h (set_mtime_option,mtime_option): New globals
4943         * src/create.c (start_header): Override mtime if requested
4944         * src/tar.c: Implement new option, --mtime, allowing to set
4945         modification times for all archive members during creation.
4946         (struct tar_args): textual_date_option replaced with a linked list
4947         textual_date. All references updated.
4948         (get_date_or_file,report_textual_dates): New functions.
4949         * configure.ac: Raise version number to 1.15.92
4950         * NEWS: Update
4951
4952 2006-06-20  Sergey Poznyakoff  <gray@gnu.org.ua>
4953
4954         * src/common.h (struct name.explicit): Remove
4955         Use variable names in all declarations
4956         (name_scan): Remove second argument
4957         * src/delete.c: Remove second argument from calls to name_scan
4958         * src/update.c: Likewise
4959         * src/incremen.c (procdir): Use is_individual_file to check for
4960         files explicitely specified in the command line. Fixes bug
4961         reported by Dat Head on 19 Jun 2006 (descending into mountpoints
4962         with --one-file-system in use)
4963         * src/misc.c (maybe_backup_file): Second argument is bool
4964         * src/names.c (name_next_elt): Call register_individual_file
4965         (namelist_match): Remove third argument
4966         (name_match): Change return type to bool
4967         (name_scan): Remove second argument
4968         * src/sparse.c (pax_dump_header): Store original sparse file name
4969         in GNU.sparse.name variable. The name field in the ustar header
4970         now contains generated name (%d/GNUSparseFile.%p/%f), so that
4971         non-pax-aware tars won't extract the file under the original
4972         filename.
4973         * src/xheader.c (GNU.sparse.name): New variable for storing sparse
4974         file name.
4975
4976 2006-06-13  Sergey Poznyakoff  <gray@gnu.org.ua>
4977
4978         * doc/Makefile.am (check-options): Expand macros before grepping
4979         in $(info_TEXINFOS)
4980         * doc/rendition.texi (FIXME) [!PROOF_FOOTNOTED]: Enclose in a
4981         cartouche
4982         * doc/tar.texi: Define op as codeindex. Use special macros to
4983         populate it
4984         Consequently prefer @dfn{long options} over @dfn{mnemonic
4985         options}.
4986         Document --unquote, --no-unquote
4987         (Short Option Summary): Build a table of cross-references to the
4988         corresponding long options.
4989         (Using Multiple Tapes,Multi-Volume Archives): Rewritten
4990
4991         * doc/value.texi (xopindex,opsummary): New macros
4992
4993         * doc/Makefile.am (check-options): New goal
4994         * doc/tar.texi: Update
4995         * src/tar.c: Implement --overwrite-dir option (long ago
4996         documented).
4997
4998 2006-06-12  Sergey Poznyakoff  <gray@gnu.org.ua>
4999
5000         * doc/tar.texi: Document better the --totals option
5001         * NEWS: Update
5002         * src/buffer.c (total_blocks_deleted): New variable
5003         (set_start_time): Set volume_start_time and last_stat_time as well
5004         (set_volume_start_time): New function
5005         (compute_duration): Do not call set_start_time, update
5006         last_stat_time instead. Use it in calculation instead of
5007         start_time, which is now set only once, upon startup.
5008         (print_total_written): Removed.
5009         (print_total_stats): New function for printing byte/speed statistics.
5010         (_open_archive): Detect attempts to update compressed archives.
5011         (_gnu_flush_write): Always update prev_written.
5012         (open_archive): Call set_volume_start_time.
5013         * src/common.h (volume_start_time,last_stat_time): New globals
5014         (print_total_written): Replaced with:
5015         (print_total_stats): New function
5016         * src/delete.c (records_skipped): Remove static qualifier, the
5017         variable is used by print_total_stats in buffer.c
5018         * src/extract.c (check_time): Use volume_start_time when checking
5019         for timestamp plausability.
5020         * src/tar.c: (options, parse_opt): Allow for optional argument to
5021         the --totals option, which specifies a signal upon delivery of which
5022         the statistics must be output.
5023         (main): Call print_total_stats if total_option is set.
5024
5025 2006-06-11  Sergey Poznyakoff  <gray@gnu.org.ua>
5026
5027         * src/xheader.c (xheader_set_single_keyword): Fix typo.
5028         (decode_time): Avoid using gotos.
5029
5030         * doc/mastermenu.el: New file
5031         * doc/Makefile.am (master-menu): New goal
5032         * doc/tar.texi: Update master menu
5033
5034 2006-06-10  Sergey Poznyakoff  <gray@gnu.org.ua>
5035
5036         * doc/tar.texi: Remove leftover include
5037
5038 2006-06-09  Sergey Poznyakoff  <gray@gnu.org.ua>
5039
5040         * doc/Makefile.am (tar_TEXINFOS): Add intern.texi
5041         (EXTRA_DIST): Remove convtexi.pl, add texify.sed
5042         * doc/intern.texi: New file
5043         * doc/convtexi.pl: Remove
5044         * doc/texify.sed: Auxiliary script to convert ../src/tar.h to
5045         header.texi
5046         * doc/rendition.texi: Fix typo
5047         * doc/tar.texi: Update
5048         * src/tar.h: Fix indentation, introduce end-of-format marker for
5049         texify.sed
5050
5051         * THANKS: Add Jason Armistead
5052         * doc/tar.texi: Update
5053         * NEWS: Update
5054         * src/buffer.c: Implement more flexible checkpoint style
5055         * src/common.h (checkpoint_option): Change type to unsigned
5056         (checkpoint_style): New variable.
5057         * src/tar.c: --checkpoint takes an optional argument specifying
5058         number of records between two successive checkpoints (proposed
5059         by Jason Armistead on 2004-06-22).  Optional dot starting the
5060         argument means "print dots instead of textual checkpoints".
5061         (tar_help): New function
5062         * src/transform.c: Minor fixes.
5063
5064 2006-06-08  Sergey Poznyakoff  <gray@gnu.org.ua>
5065
5066         * gnulib.modules: Add mkdtemp
5067         * doc/dumpdir.texi: New file
5068         * doc/Makefile.am (tar_TEXINFOS): Add dumpdir.texi
5069         * doc/tar.texi: Document dumpdir format
5070         * src/incremen.c (dumpdir_locate,obstack_code_rename):
5071         (purge_directory): Re-implement renaming. Introduce
5072         'X' control code.
5073         (make_tmp_dir_name): Remove
5074
5075         * src/transform.c (set_transform_expr,_transform_name_to_obstack):
5076         Implement NUMBER flag.
5077         (add_char_segment): Fix length assignement
5078
5079         * doc/tar.texi: Update
5080
5081 2006-06-07  Sergey Poznyakoff  <gray@gnu.org.ua>
5082
5083         * src/transform.c (transform_name_fp): Run fun even if
5084         _transform_name_to_obstack returns false.
5085         (_transform_name_to_obstack,set_transform_expr): Implement GNU
5086         extension case conversion operations.
5087
5088         * doc/tar.texi (transform): Document the option.
5089
5090 2006-06-02  Sergey Poznyakoff  <gray@gnu.org.ua>
5091
5092         * NEWS: Update
5093         * src/common.h (set_transform_expr): New function
5094         * tests/Makefile.am: Add incr04.at
5095         * tests/testsuite.at: Likewise
5096         * tests/incr04.at: New test case
5097         * tests/long01.at: Fix typo in the comment
5098         * tests/multiv04.at: Use genfile --files-from
5099
5100         (Above changes need new genfile.c from paxutils)
5101
5102         * TODO: Update
5103         * NEWS: Update
5104         * doc/tar.texi: Update
5105         * src/transform.c: New file
5106         * src/Makefile.am (tar_SOURCES): New module transform.c
5107         * src/common.h (transform_name, transform_name_fp): New functions
5108         (show_stored_names_option): Renamed to
5109         show_transformed_names_option. All uses changed
5110         * src/create.c (dump_file0): Transform file name
5111         * src/extract.c (extract_archive): safer_name_suffix and
5112         stripped_prefix_len are now called by decode_header
5113         * src/list.c (print_header): Update displayable name selection.
5114         * src/tar.c: New option --transform
5115         New option --show-transformed-names generalizes
5116         --show-stored-names. The latter is retained as an alias.
5117
5118 2006-05-31  Sergey Poznyakoff  <gray@gnu.org.ua>
5119
5120         * src/incremen.c (make_directory): Fix initialization of struct
5121         directory.
5122
5123 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
5124
5125         * doc/tar.texi: Document use of globbing patterns.
5126         * src/tar.c (parse_opt): Add comment before --preserve case.
5127
5128 2006-05-24  Sergey Poznyakoff  <gray@gnu.org.ua>
5129
5130         * NEWS: Update
5131         * doc/tar.texi: Update
5132         * configure.ac (AM_INIT_AUTOMAKE): Use tar-ustar option. Raise
5133         version requirement to 1.9
5134         * src/common.h (struct name): Refactured
5135         (warn_regex_usage): New variable.
5136         (dump_file): First argument is const char*.
5137         (name_init,name_add): Removed
5138         (name_add_name,name_add_dir): New functions
5139         (name_next): Return const char*.
5140         * src/create.c: (dump_file,dump_file0): First argument is const
5141         char*. All callers updated.
5142         * src/names.c: Rewritten handling of member names in the command
5143         line. Tar no longer attempts to guess globbing patterns, instead
5144         it relies on --wildcard option.
5145         (init_names): Removed.
5146         (struct name_elt): New structure.
5147         (name_array): Change type to struct name_elt. All references updated
5148         (name_add_name,name_add_dir): New functions
5149         (name_next_elt): New function
5150         (name_next): Rewritten using name_next_elt.
5151         (namelist_match): Rewritten pattern matching using
5152         exclude_fnmatch.
5153         (names_notfound): Warn if globbing patterns were used without
5154         --wildcards option
5155         * src/tar.c (options): Move globbing-related options into a
5156         separate group. Set -l as an alias to --check-links, as required
5157         by UNIX98
5158         (struct tar_args): New fields
5159         wildcards,matching_flags,include_anchored
5160         (MAKE_EXCL_OPTIONS,MAKE_INCL_OPTIONS): New macros
5161         (parse_opt): Use x2nrealloc to grow archive_name_array.
5162         Use MAKE_EXCL_OPTIONS,MAKE_INCL_OPTIONS to create appropriate
5163         fnmatch options, and name_add_name,name_add_dir to handle member
5164         name and -C arguments.
5165         (decode_options): Likewise
5166         (main): Remove call to init_names.
5167
5168         * tests/append.at, tests/append01.at, tests/extrac01.at,
5169         tests/options.at, tests/options02.at, tests/same-order01.at,
5170         tests/same-order02.at: Make AT_SETUP more readable.
5171
5172 2006-05-23  Sergey Poznyakoff  <gray@gnu.org.ua>
5173
5174         * src/buffer.c (change_tape_menu): Fix typo (uninitialized
5175         variable) introduced yesterday.
5176
5177 2006-05-22  Sergey Poznyakoff  <gray@gnu.org.ua>
5178
5179         * doc/tar.texi: Use @var{file_name} instead of @var{file name}
5180         * src/buffer.c (change_tape_menu): Break the loop after obtaining
5181         new archive name. Check for empty input line.
5182
5183 2006-05-15  Sergey Poznyakoff  <gray@gnu.org.ua>
5184
5185         * tests/atlocal.in (XFAILFILE): New variable
5186         * tests/version.at: Create $XFAILFILE on failure
5187         * tests/testsuite.at (AT_TAR_CHECK): Declare expected failure if
5188         $XFAILFILE exists.
5189
5190 2006-05-13  Sergey Poznyakoff  <gray@gnu.org.ua>
5191
5192         * THANKS: Update
5193         * src/buffer.c (read_header0): Use read_header_primitive to avoid
5194         clubbering current_tar_info. All callers updated.
5195         * src/common.h (read_header_primitive): New function
5196         * src/extract.c (extract_volhdr): New function
5197         (prepare_to_extract): Use extract_volhdr as extractor for volume
5198         names.
5199         * src/list.c (read_header_primitive): New function
5200         (read_header): Front end for read_header_primitive
5201         * tests/chtype.at: New file
5202         * tests/volsize.at: New file
5203         * tests/Makefile.am (TESTSUITE_AT): Add chtype.at, volsize.at
5204         (check-full): New target.
5205         * tests/atlocal.in (TEST_DATA_URL,STAR_DATA_URL)
5206         (STAR_TESTSCRIPTS): Provide default values.
5207         (tarball_prereq): New function
5208         * tests/testsuite.at (AT_TARBALL_PREREQ): New defun
5209         (AT_STAR_PREREQ): Rewrite using tarball_prereq
5210         Include chtype.at and volsize.at
5211         * tests/volume.at: Add keywords.
5212
5213         * tests/star/gtarfail.at, tests/star/gtarfail2.at,
5214         tests/star/multi-fail.at, tests/star/pax-big-10g.at,
5215         tests/star/ustar-big-2g.at, tests/star/ustar-big-8g.at
5216         (AT_STAR_PREREQ): Provide md5 sum.
5217
5218         * lib/.cvsignore: Update
5219
5220 2006-05-08  Sergey Poznyakoff  <gray@gnu.org.ua>
5221
5222         * tests/testsuite.at (AT_SORT_PREREQ, AT_UNPRIVILEGED_PREREQ): New
5223         defines
5224
5225         * tests/extrac04.at, tests/incr03.at, tests/listed02.at,
5226         tests/pipe.at, tests/rename01.at, tests/rename02.at,
5227         tests/rename03.at, tests/same-order01.at: Call
5228         AT_SORT_PREREQ. Remove fd 2 redirection after calls to sort
5229         * ignfail.at: Call AT_UNPRIVILEGED_PREREQ
5230
5231 2006-05-08  Sergey Poznyakoff  <gray@gnu.org.ua>
5232
5233         Listed incremental backups: keep more information about
5234         directories. Handle renamed directories more effectively
5235         (initial implementation, more updates to follow).
5236         Source tree before this point is tagged
5237         alpha_1_15_90_incremental_1.
5238
5239         * NEWS: Update
5240         * configure.ac: Raise version number to 1.15.91
5241         * src/common.h (rename_directory,append_incremental_renames): New
5242         functions.
5243         * src/extract.c (rename_directory): New function
5244         * src/incremen.c (struct directory.contents, flags): New members
5245         (nfs,found,new): Remove. Replaced by appropriate bitmask values in
5246         `flags' field. All uses updated.
5247         (directory_meta_table): New table.
5248         (hash_directory): Rename to hash_directory_name
5249         (compare_directories): Rename to compare_directory_names
5250         (hash_directory_meta,compare_directory_meta,find_directory_meta):
5251         New functions
5252         (compare_dirents): Removed
5253         (note_directory): Get 7th argument: directory contents.
5254         All callers updated
5255         (dumpdir_locate,makedumpdir): New functions
5256         (scan_directory): Rewritten. Use makedumpdir to create a sorted
5257         dumpdir array. This makes the obstack argument unnecessary. Besides,
5258         ALL_CHILDREN flag is set only for new directories.
5259         (procdir): Change return type to struct directory. Return
5260         immediately if the directory was already initialized. Discover
5261         directory renames using directory_meta_table.
5262         (append_incremental_renames): New function.
5263         (read_directory_file, write_directory_file): Use new snapshot file
5264         format.
5265         * src/names.c (collect_and_sort_names): Update dir_contents of the
5266         first non-fake name entry when in listed incremental mode.
5267
5268         * tests/incr03.at: New testcase
5269         * tests/rename01.at: New testcase
5270         * tests/rename02.at: New testcase
5271         * tests/rename03.at: New testcase
5272         * tests/Makefile.am: Add
5273         incr03.at,rename01.at,rename02.at,rename03.at
5274         * tests/testsuite.at: Likewise.
5275         * tests/listed02.at: Update for the new behavior
5276         * tests/multiv04.at (AT_KEYWORDS): Add missing incremental kw.
5277
5278 2006-05-02  Sergey Poznyakoff  <gray@gnu.org.ua>
5279
5280         * src/buffer.c (try_new_volume): Attempt to continue if the name
5281         is apparently truncated in a GNU format volume.
5282
5283         * tests/comprec.at, tests/delete01.at, tests/delete02.at,
5284         tests/delete04.at, tests/delete05.at, tests/extrac05.at,
5285         tests/listed01.at, tests/multiv01.at, tests/multiv02.at,
5286         tests/pipe.at, tests/same-order01.at, tests/same-order02.at,
5287         tests/sparse01.at, tests/sparse03.at: Always use genfile --file,
5288         this enables extra error checking.
5289
5290         * tests/multiv03.at: Attempt to extract a member with truncated
5291         file name from the archive.
5292
5293         * src/buffer.c (_open_archive): Remove unnecessary argument to
5294         check_compressed_archive.
5295
5296 2006-04-25  Sergey Poznyakoff  <gray@gnu.org.ua>
5297
5298         * tests/sparse01.at, tests/sparse02.at, tests/sparse03.at,
5299         tests/sparsemv.at, tests/sparsemvp.at: Skip the test if the file
5300         system does not support sparse files.
5301         * doc/tar.texi (@copying): Remove the reference to not existing
5302         invariant section.
5303
5304 2006-04-11  Sergey Poznyakoff  <gray@gnu.org.ua>
5305
5306         * src/extract.c (extract_dir): Fix toggling existing directory
5307         permissions (Debian bug #361077). Use parts of patch provided by
5308         Ian Jackson <iwj@ubuntu.com>.
5309         * src/compare.c: Minor changes
5310         * src/incremen.c (directory.new): New member
5311         (note_directory,find_directory: Use make_directory to create
5312         struct directory entries
5313         (procdir): Avoid duplicating  directories in the incremental
5314         backup map.
5315         * tests/Makefile.am (TESTSUITE_AT): Add extrac06.at
5316         * tests/testsuite.at: Include extrac06.at
5317
5318 2006-03-18  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de> (trivial change)
5319
5320         * tests/atlocal.in (PATH): Add build-aux from the source tree,
5321         not the build tree.
5322
5323 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
5324
5325         * THANKS: Add Benno Schulenberg
5326
5327 2006-03-13  Jim Meyering <jim@meyering.net>
5328
5329         * tests/listed02.at:  Sort the two lines of stderr from the
5330         first `tar -v --listed-incremental'.  They would come out
5331         reversed and provoke a test failure on a tmpfs
5332         file system.
5333
5334 2006-03-13  Benno Schulenberg <benno@nietvergeten.nl>
5335
5336         * doc/tar.texi: Minor fixes.
5337         * src/tar.c (options): Consistently begin help messages with a
5338         lowercase letter.
5339
5340 2006-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>
5341
5342         * tests/Makefile.am (AM_CPPFLAGS): Define LOCALEDIR
5343
5344 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
5345
5346         * src/buffer.c (record_buffer_aligned): New var.
5347         (init_buffer): Use it to ensure that the buffer is aligned.
5348         This doesn't result in any measurable performance improvement
5349         on my host (Debian GNU/Linux 3.1 stable, with default block size),
5350         but I assume it does help on some hosts.
5351
5352         * lib/.cvsignore: Sort.
5353
5354 2006-03-04  Sergey Poznyakoff  <gray@gnu.org.ua>
5355
5356         * tests/shortrec.at: Use -f - to read from stdin.
5357
5358 2006-02-21  Sergey Poznyakoff  <gray@gnu.org.ua>
5359
5360         * doc/tar.texi: Fix typo: --to-command instead of --to-program
5361
5362 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
5363
5364         * tests/multiv04.at (split directory members in a MV archive):
5365         Don't use %X in an awk printf format; this doesn't work with
5366         Solaris 10 /usr/bin/awk.  Use %x instead.
5367
5368 2006-02-20  Sergey Poznyakoff  <gray@gnu.org.ua>
5369
5370         * src/create.c (split_long_name): Fix maximum length estimation.
5371         Patch by Jim Lowe.
5372         * tests/Makefile.am (lustar01.at,lustar02.at,lustar03.at): New
5373         tests.
5374         * tests/atlocal.in: Add build-aux to the PATH
5375         * tests/long01.at: Remove mkhier, use AT_TAR_MKHIER instead
5376         * tests/longv7.at: Reword test title
5377         * tests/lustar01.at: New test
5378         * tests/lustar02.at: New test
5379         * tests/lustar03.at: New test
5380         * tests/testsuite.at (AT_TAR_MKHIER): New macro
5381         (lustar01.at,lustar02.at,lustar03.at): New tests.
5382
5383 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
5384
5385         * bootstrap: Don't claim lib/Makefile.am is generated automatically
5386         from itself.
5387
5388         Avoid installation glitches on Solaris 8 with Sun C 5.4.
5389         * lib/.cvsignore: Add system-ioctl.h.
5390         * lib/Makefile.tmpl (noinst_HEADERS): Add system-ioctl.h.
5391         * src/buffer.c: Include system-ioctl.h.
5392         * src/compare.c: Likewise.
5393         * src/delete.c: Likewise.
5394         * src/system.c: Include <getline.h>, <setenv.h>.
5395         * src/tar.c: Include <getline.h>.
5396
5397 2006-02-19  Sergey Poznyakoff  <gray@gnu.org.ua>
5398
5399         * src/buffer.c (add_chunk_header): Free st.orig_file_name after
5400         calling finish_header().
5401         (new_volume): Prompt the user for archive name if unable to open
5402         next archive.
5403
5404         * src/create.c (dump_file0): Restore file_count_links,
5405         accidentally removed on 2005-11-29.
5406         * configure.ac: Raise version number to 1.15.90
5407         * NEWS: Likewise.
5408
5409 2006-02-08  Sergey Poznyakoff  <gray@gnu.org.ua>
5410
5411         * src/tar.c (tar_set_quoting_style): Provide second argument to
5412         the format spec: program_invocation_short_name. Reported by Jim
5413         Meyering.
5414
5415 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
5416
5417         * gnulib.modules: Add closeout, exitfial.
5418         * lib/.cvsignore: Add __fpending.c, __fpending.h, closeout.c,
5419         closeout.h.
5420         * src/buffer.c: Incluse closeout.h.
5421         (_open_archive): Use freopen rather than fopen, so
5422         that stdlis is always either stdout or stderr.  Use
5423         close_stdout_set_file_name to report its name.
5424         * src/tar.c: Include closeout.h and exitfail.h.
5425         (parse_opt, usage): Call close_stdout as appropriate, to check for
5426         write errors.
5427         (decode_options): Exit with status TAREXIT_FAILURE, not 1.
5428         (main): Set exit_failure, to exit with proper status on memory
5429         allocation failure and the like.
5430         Use close_stdout rather than rolling our own test.
5431
5432         * NEWS: --version now outputs copyright etc., to conform to the
5433         GNU coding standards.  Remove --license.
5434         * gnulib.modules: Add version-etc-fsf.
5435         * doc/tar.texi: Document the change.
5436         * lib/.cvsignore: Add version-etc-fsf.c, version-etc.c, version-etc.h.
5437         * scripts/Makefile.am (SED_CMD): Update PAKCAGE_NAME, not PACKAGE.
5438         * scripts/backup.in: Remove --license.  Change --version to conform
5439         to GCS.
5440         * scripts/restore.in: Likewise.
5441         * scripts/backup.sh.in (license): Output briefer license in the
5442         style of coreutils, for consistency with other changes.
5443         * src/tar.c: Include <version-etc.h>.
5444         (LICENSE_OPTION): Remove.
5445         (options): Remove --license.
5446         (license): Remove.
5447         (parse_opt): Use version_etc instead of rolling it ourselves.
5448         Remove --license.
5449         * tests/version.at (tar --version): Check only the first line of
5450         output.
5451
5452         * ChangeLog, NEWS, src/common.h, src/extract.c, src/incremen.c:
5453         * src/list.c, src/names.c, src/tar.h, src/xheader.c:
5454         Update copyright year to 2006.
5455
5456 2006-02-07  Jim Meyering  <jim@meyering.net>
5457
5458         * src/xheader.c (sparse_map_decoder): Fix misleading diagnostic.
5459
5460 2006-01-31  Sergey Poznyakoff  <gray@gnu.org.ua>
5461
5462         * src/common.h (get_gnu_dumpdir): Remove prototype
5463         (is_dumpdir): New function
5464         * src/extract.c (prepare_to_extract): Use is_dumpdir member to
5465         check for dumpdirs.
5466         * src/incremen.c (get_gnu_dumpdir): Static
5467         (is_dumpdir): New function
5468         (purge_directory): Use is_dumpdir
5469         * src/list.c (list_archive): Use is_dumpdir
5470         Do not wrap skip_member in mv_begin/mv_end, the function itself
5471         takes care of it.
5472         (decode_header): Set stat_info->is_dumpdir
5473         (skip_member): Do nothing if skipped is true
5474         * src/tar.h (struct tar_stat_info): New members is_dumpdir and skipped.
5475
5476 2006-01-22  Sergey Poznyakoff  <gray@gnu.org.ua>
5477
5478         * src/tar.c (decode_options): Refuse using --delete with
5479         compression options.
5480
5481 2006-01-18  Sergey Poznyakoff  <gray@gnu.org.ua>
5482
5483         * NEWS: Updated.
5484         * configure.ac (DEFAULT_QUOTING_STYLE): New configuration variable
5485         * doc/tar.texi: Initial documentation for --quoting-style,
5486         --quote-chars and --no-quote-chars option.
5487         * src/tar.c: Implement new options --quoting-style, --quote-chars
5488         and --no-quote-chars.
5489
5490 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
5491
5492         * bootstrap: Default to pserver, and switch to cvs.sv.gnu.org,
5493         to accommodate recent changes to the GNU CVS server.
5494         * lib/.cvsignore: Add argp-pin.c, mkdirat.c, openat-priv.h.
5495
5496 2005-12-14  Sergey Poznyakoff  <gray@gnu.org.ua>
5497
5498         * src/names.c (name_scan): Take an additional argument requesting
5499         exact matching.
5500         * src/common.h (name_scan): Change prototype.
5501         * src/delete.c, src/incremen.c, src/update.c: Update invocations
5502         of name_scan.
5503
5504 2005-12-13  Sergey Poznyakoff  <gray@gnu.org.ua>
5505
5506         * src/common.h (struct name): New member `explicit'. Remove unused
5507         member `isdir'.
5508         * src/incremen.c (procdir): If name_scan() returns something,
5509         check if it was explicitely given in the command line
5510         * src/names.c (addname,add_hierarchy_to_namelist): Initialize
5511         explicit member appropriately.
5512
5513         * src/incremen.c (procdir): If --one-file-system is given and a
5514         directory is found to be on another device, *and* this directory
5515         is explicitely given in the command line, then do not omit it.
5516
5517 2005-12-11  Sergey Poznyakoff  <gray@gnu.org.ua>
5518
5519         * NEWS: Update
5520         * doc/tar.texi: Document --delay-directory-restore option.
5521         (Configuring Help Summary): Document usage of ARGP_HELP_FMT
5522         variable to customize help output.
5523         * src/common.h (delay_directory_restore_option): New global.
5524         * src/extract.c (directories_first): Replaced by
5525         delay_directory_restore_option. All uses changed.
5526         * src/tar.c (options,parse_opt): New options
5527         --delay-directory-restore and --no-delay-directory-restore
5528
5529 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
5530
5531         * src/buffer.c (open_archive): Add default case to shut up gcc.
5532         * src/common.h (set_file_atime): Add prototype.
5533         * src/create.c (to_chars_subst): Remove unused variable
5534         Make sure useful result code is returned.
5535         * src/incremen.c (read_directory_file): Fix format string
5536         Thanks Eric Blake for reporting.
5537
5538 2005-12-08  Sergey Poznyakoff  <gray@gnu.org.ua>
5539
5540         * doc/tar.texi (Current status): Renamed to 'Changes' and moved to
5541         appendices.
5542         (Large or Negative Values): Rewritten
5543         * src/common.h (gid_to_chars, major_to_chars, minor_to_chars)
5544         (mode_to_chars, off_to_chars, size_to_chars, time_to_chars)
5545         (uid_to_chars, uintmax_to_chars): Return bool
5546         * src/create.c (gid_to_chars, major_to_chars, minor_to_chars)
5547         (mode_to_chars, off_to_chars, size_to_chars, time_to_chars)
5548         (uid_to_chars, uintmax_to_chars): Return bool
5549         (to_chars): Return bool
5550         (start_header): Check return values of convertion routines. Fail
5551         if unable to store data in the header.
5552
5553 2005-12-07  Sergey Poznyakoff  <gray@gnu.org.ua>
5554
5555         * doc/tar.texi: Following the discussion with Karl Berry,
5556         discontinue using @value{} substitutions for Texinfo commands.
5557         Properly index all long options. Print a
5558         separate long option index.
5559         * doc/value.texi: Remove @set's
5560
5561         * doc/tar.texi: Update --info-script documentation
5562         Resolve some more FIXMEs.
5563         * scripts/dump-remind.in: Use TAR_VOLUME instead of reading volno
5564         file.
5565         * src/buffer.c (new_volume): Update invocation
5566         (change_tape_menu): New function. Disable '!' command if given
5567         --restrict option.
5568         * src/common.h (sys_exec_info_script): Update declaration
5569         (restrict_option): New global
5570         * src/system.c (sys_exec_info_script): The script can supply new
5571         archive name to use by writing it to file descriptor 3.
5572         * src/tar.c (options): Add --restrict option. Use macros for
5573         option grouping.
5574         (license): Print full list of copyright years
5575         * NEWS: Update
5576
5577 2005-12-06  Eric Blake  <ebb9@byu.net> (trivial changes)
5578
5579         * configure.ac (DENSITY_LETTER): Fix m4 overquoting.
5580         * .cvsignore: Ignore .bootstrap.
5581
5582 2005-12-06  Sergey Poznyakoff  <gray@gnu.org.ua>
5583
5584         * doc/tar.texi: Document --to-command and --info-script
5585         options. Add missing xrefs.
5586         * src/buffer.c (new_volume): Use sys_exec_info_script() instead of
5587         system().
5588         * src/common.h (archive_format_string,subcommand_string)
5589         (sys_exec_info_script): New prototypes.
5590         * src/system.c (sys_exec_info_script): New function.
5591         * src/tar.c (archive_format_string): Remove static qualifier.
5592         (subcommand_string): New function.
5593
5594 2005-12-01  Sergey Poznyakoff  <gray@gnu.org.ua>
5595
5596         * src/extract.c: Fix restoring of directory timestamps from
5597         incremental archives.
5598         (directories_first): New variable.
5599         (prepare_to_extract): Set directories_first
5600         (extract_archive): Call apply_nonancestor_delayed_set_stat() only
5601         if not extracting from an incremental archive
5602         (extract_dir): Obtain root_device here, to make sure it works
5603         correctly with -C.
5604
5605         * src/incremen.c (purge_directory): Skip the member and return if
5606         the archive is not in incremental format.
5607         * tests/incr02.at: New testcase
5608         * tests/Makefile.am: Add incr02.at
5609         * tests/testsuite.at: Likewise
5610
5611         * THANKS: Add Guerkan Karaman.
5612         * NEWS: Update
5613
5614 2005-11-30  Paul Eggert  <eggert@cs.ucla.edu>
5615
5616         * doc/tar.texi (Option Summary): Rewrite the
5617         --atime-preserve=system description in response to Ian Turner's
5618         proposed patch.
5619
5620 2005-11-30  Ian Turner  <ian@zmanda.com>
5621
5622         * doc/tar.texi (Extracting Specific Files): Remove obsolescent
5623         FIXME.
5624
5625 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
5626
5627         * NEWS: New option --atime-preserve=system, which uses O_NOATIME.
5628         * THANKS: Add Ian Turner.
5629
5630         * configure.ac: Prefer AC_CHECK_HEADERS_ONCE to AC_CHECK_HEADERS.
5631         Check for stropts.h and sys/filio.h too, for _FIOSATIME.
5632         * doc/tar.texi: Change "modification time" to "data modification
5633         time", "change time" to "status change time", and "filesystem" to
5634         "file system", so that we use terminology consistent with POSIX.
5635         Use American spacing rather than French for sentence ends.
5636         "non-dependable" -> "undependable".
5637         (Option Summary, Attributes): Explain better the pitfalls of the
5638         --atime-preserve option, and suggest read-only mounts,loopback
5639         mounts, and noatime mounts for older systems.
5640         * doc/value.texi (op-atime-preserve-system): Renamed from
5641         op-atime-preserver-system to fix a misspelling.
5642         * src/common.h (enum atime_preserve): Use lower case for enum values.
5643         * src/compare.c: Don't include utimens.h; no longer needed.
5644         (diff_file): Use set_file_atime rather than utimens; avoid closing
5645         diff_handle until after this, so that we can set the file time stamp
5646         via the file descriptor rather than via its name.
5647         * src/create.c: Don't include utimens.h; no longer needed.
5648         (dump_regular_finish): Remove.  All callers now do its work inline.
5649         (dump_dir): New arg FD.  All callers changed.
5650         Use fdsavedir rather than savedir.
5651         (unknown_file_error): Arg is a const pointer now.
5652         (dump_file0): 2nd arg is a const pointer now.
5653         Treat directories more like files, with respect to --atime-preserve.
5654         For example, also warn if a directory changes while we are dumping it.
5655         Prefer file descriptors to file names when retrieving/setting file
5656         attributes; this saves path-resolution time and allows us to avoid
5657         changing mtime/ctime on Solaris when restoring atime as root.
5658         Use O_DIRECTORY when opening directories, to avoid some race conditions.
5659         Do not reset atime if mtime has changed.  Report an error if
5660         we cannot reset atime.
5661
5662         * lib/.cvsignore: Add malloc.h, regcomp.c, regex.c, regex.h,
5663         regex_internal.c, regex_internal.h, regexc.c; used by rpmatch.
5664
5665 2005-11-29  Ian Turner  <ian@zmanda.com>
5666
5667         First cut at adding support for --atime-preserve=system.
5668         * doc/tar.texi (Option Summary): First cut at documenting it.
5669         All other uses of --atime-preserve changed to --atime-preserve=replace.
5670         * doc/value.texi (op-atime-preserve-replace, op-atime-preserver-system):
5671         New.
5672         (op-atime-preserve): Mention METHOD.
5673         * src/common.h (atime_preserve): New enum.
5674         (atime_preserve_option): Now of the enum type rather than bool.
5675         All uses changed.
5676         * src/compare.c (diff_file): Read with O_NOATIME if asked for.
5677         * src/create.c (dump_file0): Read regular and CTG files with O_NOATIME
5678         if asked for.
5679         * src/tar.c (usage): Mention new usage.
5680         (parse_opt): Parse new usage.
5681
5682 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
5683
5684         * THANKS: Convert back to UTF-8, sort (using LC_ALL=C on Debian
5685         stable), and consistently use tabs rather than spaces.
5686
5687 2005-11-27  Sergey Poznyakoff  <gray@gnu.org.ua>
5688
5689         * src/xheader.c: Remove parts of code prematurely introduced
5690         yesterday. Thanks Eric Blake.
5691
5692 2005-11-26  Sergey Poznyakoff  <gray@gnu.org.ua>
5693
5694         * src/xheader.c (xheader_format_name): Fix memory leak.
5695
5696 2005-11-11  Sergey Poznyakoff  <gray@gnu.org.ua>
5697
5698         * gnulib.modules: Add rpmatch
5699         * lib/stdopen.h, lib/stdopen.c: New file. Imported from coreutils.
5700         * lib/Makefile.tmpl: Add stdopen.h, stdopen.c
5701         * po/POTFILES.in: Add rpmatch.c
5702         * src/tar.c (confirm): Rewritten using rpmatch.
5703         (decode_options): Minor optimizations
5704         (main): Call stdopen() to ensure the first three descriptors are
5705         open.
5706
5707         * tests/multiv01.at, tests/multiv02.at, tests/multiv03.at,
5708         tests/multiv04.at, tests/sparsemv.at, tests/sparsemvp.at,
5709         tests/star/multi-fail.at: Close stdin so that if something fails
5710         causing tar to ask for the next volume, it won't hang the
5711         testsuite.
5712
5713         * src/buffer.c (flush_write,flush_read): Change data type.
5714         (flush_archive): Compute actual buffer fill level before calling
5715         low level function.
5716         (close_archive): Call flush_archive again if the first call
5717         resulted in partially filled buffer.
5718         (try_new_volume): Rewritten handling of initial headers.
5719         (add_chunk_header): New function. Write an additional header
5720         before the continuation chunk. The purpose of the header is to
5721         allow third-party tars to extract the member.
5722         (simple_flush_write): Take an argument.
5723         (_gnu_flush_write): Correctly handle partially filled buffers.
5724         * src/common.h (flush_read,flush_write): Functions, again.
5725         (write_extended): Changed declaration
5726         (xheader_format_name): New declaration
5727         * src/create.c (write_extended): Change type and meaning of
5728         the first argument. All callers updated
5729         * src/xheader.c (xheader_format_name): Remove static
5730         qualifier. Change last argument.
5731         Correct buffer size calculation (allocated too much space).
5732         (xheader_write): Increase global_header_count here ...
5733         (xheader_write_global): ... instead of here
5734
5735         * tests/testsuite.at (AT_TAR_CHECK): Define TEST_TAR_FORMAT
5736         * tests/multiv01.at: Update
5737         * tests/multiv02.at: Update
5738         * tests/multiv03.at: Update
5739         * tests/sparsemvp.at: Update
5740         * tests/star/multi-fail.at: Update
5741
5742         * scripts/tarcat: Handle archives in pax format. Improve handling
5743         of traditional archives.
5744         * doc/tar.texi (Tarcat): New node
5745
5746 2005-11-10  Sergey Poznyakoff  <gray@gnu.org.ua>
5747
5748         Fix splitting of sparse files between the volumes.
5749
5750         * src/buffer.c (try_new_volume): Bugfix. Always check
5751         continued_file_name. If it is absent, the volume is out
5752         of sync.
5753         (add_multi_volume_header): Create GNU.volume.filename keyword in
5754         the extended header.
5755         * src/sparse.c (sparse_dump_region): Call mv_size_left.
5756         (sparse_dump_file): Enclose the loop in mv_begin/mv_end.
5757         * src/system.c: Do not pad compressed output if it goes to
5758         stdout.
5759         * src/xheader.c (xhdr_tab): New keyword GNU.volume.filename.
5760
5761         * tests/sparsemv.at: New testcase
5762         * tests/sparsemvp.at: New testcase
5763         * tests/Makefile.am: Add sparsemv.at and sparsemvp.at.
5764         * tests/testsuite.at: Likewise.
5765
5766 2005-11-09  Sergey Poznyakoff  <gray@gnu.org.ua>
5767
5768         * src/buffer.c: Rewritten in a more modular fashion to provide
5769         GNU extensions (multi-volume archives and archive labels) in
5770         pax format.
5771         NOTICE, that some of the aspects (e.g. splitting the archive
5772         on the extended header boundary) are still not solved, others
5773         (splitting a sparse file between the volume) require additional
5774         testing. Wait for the next commit.
5775
5776         (volume_label,continued_file_name,continued_file_size)
5777         (continued_file_offset): New globals.
5778         (save_name,save_totsize,save_sizeleft): Make static
5779         (mv_begin,mv_end,mv_total_size,mv_size_left): New functions
5780         (open_archive,flush_write,flush_read): Rewritten
5781
5782         * src/common.h (save_name,save_sizeleft,save_totsize): Remove
5783         globals.
5784         (volume_label,continued_file_name,continued_file_size): New
5785         variables.
5786         (flush_read,flush_write): Pointers to functions
5787         (mv_begin,mv_end,mv_total_size,mv_size_left): New functions
5788         (write_extended): New function.
5789
5790         * src/compare.c, src/create.c, src/extract.c, src/incremen.c,
5791         src/list.c: Use mv_.* functions uniformly instead of fiddling
5792         with the global variables.
5793         * src/sparse.c: Use mv_.* functions where necessary.
5794         * src/tar.c (decode_options): Allow to use --multi-volume and
5795         --label with pax archives.
5796         * src/xheader.c (xhdr_tab): Support for new GNU keywords.
5797
5798         * tests/delete01.at, tests/delete02.at, tests/delete03.at,
5799         tests/delete04.at, tests/delete05.at, tests/extrac01.at,
5800         tests/extrac02.at, tests/extrac03.at, tests/extrac04.at,
5801         tests/extrac05.at, tests/incr01.at, tests/incremental.at,
5802         tests/listed01.at, tests/listed02.at, tests/long01.at,
5803         tests/longv7.at, tests/multiv01.at, tests/multiv02.at,
5804         tests/multiv03.at, tests/multiv04.at, tests/options.at,
5805         tests/options02.at, tests/same-order01.at, tests/same-order02.at,
5806         tests/sparse01.at, tests/sparse02.at, tests/sparse03.at,
5807         tests/star/multi-fail.at (AT_KEYWORDS): Improve to allow execution
5808         of related tests in groups.
5809
5810         * doc/tar.texi: Update
5811
5812 2005-11-07  Paul Eggert  <eggert@cs.ucla.edu>
5813
5814         * src/xheader.c (struct xhdr_tab.coder): Last arg is void const *,
5815         not void *, to avoid create.c warning from GCC "passing argument 3
5816         of 'xheader_store' discards qualifiers from pointer target type".
5817         (dummy_coder, atime_coder, gid_coder, gname_coder, linkpath_coder):
5818         (ctime_coder, mtime_coder, path_coder, size_coder, uid_coder):
5819         (uname_coder, sparse_size_coder, sparse_numblocks_coder):
5820         (sparse_offset_coder, sparse_numbytes_coder, dumpdir_coder):
5821         (xheader_store): Likewise.
5822         * src/common.h (xheader_store): Likewise.
5823
5824 2005-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>
5825        and  Paul Eggert  <eggert@cs.ucla.edu>
5826
5827         * src/tar.c (NS_PRECISION_FORMAT_MASK): New macro.
5828         (tar_timespec_cmp): New function. Wrapper over
5829         timespec_cmp using the timespec precision provided by the
5830         current archive format.
5831         * src/common.h (tar_timespec_cmp): New declaration.
5832         * src/compare.c (diff_file): Use tar_timespec_cmp.
5833         * src/extract.c (file_newer_p): Likewise.
5834         * src/update.c (update_archive): Likewise.
5835         * tests/truncate.at: Reverted changes
5836         * tests/update.at: Reverted changes
5837
5838 2005-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>
5839
5840         Support for incremental formats in pax archives.
5841         Fixed POSIX compatibility of `sparse' extended header keywords.
5842
5843         * src/common.h (dumpdir_size,get_gnu_dumpdir)
5844         (xheader_string_begin,xheader_string_add)
5845         (xheader_string_end): New functions.
5846         * src/create.c (dump_dir0): Handle incremental backups in pax
5847         archives.
5848         * src/incremen.c (dumpdir_size, get_gnu_dumpdir): New functions.
5849         (purge_directory): Use stat_info.dumpdir instead of getting its
5850         value explicitely.
5851         * src/list.c (list_archive): Handle incremental backups in pax
5852         format.
5853         (decode_header): Initialize stat_info.dumpdir
5854         * src/sparse.c (sparse_diff_file): Bugfix: set seekable.
5855         (pax_dump_header): Store sparse map in GNU.sparse.map. If this
5856         variable has been explicitely deleted, use GNU.sparse.offset/
5857         GNU.sparse.numbytes variables.
5858         * src/tar.c (decode_options): Incremental options are allowed with
5859         --format=pax
5860         (tar_stat_destroy): Free dumpdir
5861         * src/tar.h (struct tar_stat_info.dumpdir): New member.
5862         * src/xheader.c (xheader_keyword_deleted_p): Remove static
5863         qualifier.
5864         (struct xhdr_tab.decoder): Change prototype. POSIX allows string
5865         values to contain embedded nulls, so take an extra argument
5866         specifying the length of the string.
5867         (decx,decg,dummy_decoder,atime_decoder,gid_decoder)
5868         (gname_decoder,linkpath_decoder,ctime_decoder,mtime_decoder)
5869         (path_decoder,size_decoder,uid_decoder,uname_decoder)
5870         (sparse_size_decoder,sparse_numblocks_decoder)
5871         (sparse_offset_decoder,sparse_numbytes_decoder): Likewise.
5872         (decode_record): Pass value length to the handler
5873         (run_override_list): Pass value length to the decoder
5874         (xheader_print_n): New function
5875         (xheader_print): Rewritten using xheader_print_n
5876         (xheader_finish): Do not rely om strlen to compute the length of
5877         the collected string: it can contain embedded nulls
5878         (xheader_string_begin,xheader_string_add,xheader_string_end): New
5879         functions.
5880         (sparse_map_decoder,dumpdir_coder,dumpdir_decoder): New
5881         functions. Handle GNU.sparse.map and GNU.dumpdir variables.
5882         (xhdr_tab): Add new variables.
5883
5884         * tests/incr01.at: Test gnu, oldgnu, and posix formats
5885         * tests/incremental.at: Likewise
5886
5887 2005-11-06  Paul Eggert  <eggert@cs.ucla.edu>
5888
5889         * NEWS: Minor language and white space fixes.
5890
5891         * tests/truncate.at: Create files whose time stamps must fall on
5892         1-second boundaries.  This prevents tests from failing on hosts
5893         like Solaris 8 that have nanosecond-resolution file time stamps.
5894         * tests/update.at: Likewise.
5895
5896         * src/xheader.c (strtoimax, strtoumax): Remove decls; now done
5897         in system.h.
5898
5899 2005-11-06  Sergey Poznyakoff  <gray@gnu.org.ua>
5900
5901         * doc/tar.texi: Properly document incremental dumps
5902         * doc/value.texi: Likewise.
5903         * doc/snapshot.texi: Likewise.
5904
5905 2005-11-05  Sergey Poznyakoff  <gray@gnu.org.ua>
5906
5907         Improve listed incremental format:
5908
5909         * src/common.h (update_parent_directory): New prototype.
5910         * src/create.c (dump_file): Call update_parent_directory.
5911         * src/incremen.c (struct directory.mtime): New member.
5912         (note_directory): Take additional arguments. All callers updated.
5913         (scan_directory): Updated to use more metadata. In particular,
5914         this allows to correctly detect renamed files.
5915         (read_directory_file,write_directory_file)
5916         (write_directory_file_entry): Support new directory file format.
5917         * tests/listed01.at: Sleep 1 sec before creating second file.
5918         * tests/listed02.at: Never skip the test. It should work on any
5919         filesystem.
5920
5921         * doc/snapshot.texi: New file
5922         * doc/tar.texi: Update.
5923         * doc/Makefile.am: Update.
5924
5925 2005-11-04  Paul Eggert  <eggert@cs.ucla.edu>
5926
5927         * src/extract.c (set_stat): Rewrite to avoid bug in Forte
5928         Developer 7 C 5.4 Patch 111708-09 (2004-02-19).
5929
5930 2005-11-04  Sergey Poznyakoff  <gray@gnu.org.ua>
5931
5932         * bootstrap: Fix quoting in help output.
5933         (update_po): Use backward-compatible wget option --cache instead
5934         of deprecated -C to accomodate for wget 1.10.
5935         Changes proposed by Eric Blake
5936         * THANKS: Add Eric Blake
5937
5938 2005-11-02  Paul Eggert  <eggert@cs.ucla.edu>
5939
5940         * doc/tar.texi: Consistently put two spaces after sentences,
5941         and put commas after "i.e." and "e.g.".  This is the usual GNU
5942         style in manuals.
5943
5944         * lib/.cvsignore: Add creat-safer.c, fcntl--.h, fcntl-safer.h,
5945         open-safer.c, openat-die.c, verify.h, to accommodate recent gnulib
5946         changes.
5947
5948 2005-10-27  Sergey Poznyakoff  <gray@gnu.org.ua>
5949
5950         * src/compare.c (diff_dumpdir): Pass a valid device number to
5951         get_directory_contents.
5952
5953         * THANKS: Add John Thomas McDole
5954
5955         * bootstrap: If file `.bootstrap' exists in the cwd and is
5956         readable, prepend its contents to the command line
5957
5958 2005-10-21  Sergey Poznyakoff  <gray@gnu.org.ua>
5959
5960         * tests/link01.at: Skip test if ln fails (suppose the OS does
5961         not support hard links).
5962
5963 2005-10-04  Sergey Poznyakoff  <gray@gnu.org.ua>
5964
5965         * src/tar.c (decode_options): Report error if -A or -r is used
5966         together with compression option.
5967
5968 2005-09-29  Sergey Poznyakoff  <gray@gnu.org.ua>
5969
5970         * doc/tar.texi: Use @option and @kbd consistently.
5971         Document new options.
5972
5973 2005-09-28  Sergey Poznyakoff  <gray@gnu.org.ua>
5974
5975         * NEWS: Updated
5976         * src/common.h (show_stored_names_option): New variable
5977         * src/list.c (print_header): If show_stored_names_option is given,
5978         list member names as stored in the archive. Patch proposed by Erik
5979         Cumps <erik.cumps@icos.be>
5980         * src/tar.c: Implement --show-stored-names option
5981
5982         * src/common.h (test_label_option): New variable;
5983         * src/list.c (print_header): Special handling if test_label_option
5984         is set.
5985         * src/names.c (all_names_found): If test_label_option is set
5986         return true.
5987         * src/tar.c: New option --test-label tests the archive volume
5988         label. The option proposed by Wouter Verhelst <wouter@nixsys.be>
5989
5990 2005-09-21  Paul Eggert  <eggert@cs.ucla.edu>
5991
5992         * tests/Makefile.am (clean-local): Don't attempt to run
5993         $(TESTSUITE) if it doesn't exist.  Problem reported by
5994         Eric Blake.
5995
5996 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
5997
5998         Don't filter time stamps through the resolution supported
5999         by struct stat; keep them to full nanosecond resolution.
6000         This affects behavior only on older hosts or file systems
6001         that have lower-resolution time stamps.
6002         * src/common.h (OLDER_STAT_TIME): Parenthesize arg.
6003         (OLDER_TAR_STAT_TIME): New macro.
6004         (code_timespec): New function.
6005         (BILLION, LOG10_BILLION, TIMESPEC_STRSIZE_BOUND): New constants.
6006         * src/compare.c (diff_file): Use full time stamp resolution.
6007         * src/create.c (start_header, dump_file0): Likewise.
6008         (start_header, dump_file0): Adjust to new structure layout.
6009         (dump_regular_finish): Simplify by using timespec_cmp.
6010         * src/extract.c (struct delayed_set_stat): Don't store stat info
6011         that we don't need, to save space.  All uses changed.
6012         (struct delayed_set_stat, struct delayed_link, file_newer_p):
6013         (create_placeholder_file, extract_link, apply_delayed_links):
6014         Use full time stamp resolution.
6015         (check_time): Use code_timespec rather than rolling our own code.
6016         (set_stat, delay_set_stat): Arg now points to tar_stat_info to
6017         avoid losing time information.  All callers changed.
6018         * src/list.c (read_and, decode_header, print_heaeder):
6019         Use full time stamp resolution.
6020         * src/misc.c (code_timespec): New function.
6021         * src/tar.h (struct tar_stat_info): Record atime, mtime, ctime
6022         separately, for benefit of hosts with lower resolution.
6023         * src/update.c (update_archive): Use full time stamp resolution.
6024         * src/xheader.c (code_time): Use new code_timespec function
6025         to simplify code.
6026         (atime_coder, atime_decoder, ctime_coder, ctime_decoder):
6027         (mtime_coder, mtime_decoder): Use full time stamp resolution.
6028
6029         Report time stamps to full resolution in environment.
6030         Report memory allocation failures rather than ignoring them.
6031         * src/system.c (time_to_env): New function.
6032         (oct_to_env, str_to_env, chr_to_env): Report memory allocation failures.
6033         (stat_to_env): Report full resolution in time stamps.
6034
6035 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
6036
6037         Merge changes from gnulib for file system sub-second time stamps.
6038         * configure.ac: Remove checks for struct stat.st_spare1, struct
6039         stat.st_atim.tv_nsec, struct stat.st_atimespec.tv_nsec, struct
6040         stat.st_atimensec, as gnulib now does this for us.
6041         Similarly for LIB_CLOCK_GETTIME.
6042         * gnulib.modules: Add stat-time.
6043         * lib/.cvsignore: Add stat-time.h.
6044         * src/common.h: Include stat-time.h.
6045         (timespec_lt): Remove.  All callers changed to use timespec_cmp.
6046         (get_stat_atime, get_stat_ctime, get_stat_mtime):
6047         (set_stat_atime, set_stat_ctime, set_stat_mtime):
6048         Remove; now defined by stat-time.h.
6049
6050 2005-09-14  Sergey Poznyakoff  <gray@gnu.org.ua>
6051
6052         * src/incremen.c (list_dumpdir): New function. Used to dump
6053         contents of GNUTYPE_DUMPDIR blocks.
6054         * src/common.h (list_dumpdir): Likewise.
6055         * src/list.c (list_archive): Use list_dumpdir() to display
6056         GNUTYPE_DUMPDIR blocks. Do that only if two or more -v options are
6057         given.
6058
6059 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
6060
6061         * lib/.cvsignore: Adjust to current gnulib and modules used.
6062         Add getdelim.c, getdelim.h, mbchar.c, mbchar.h, mbuiter.h, memchr.c,
6063         pipe-safer.c, size_max.h, strdup.c, strdup.h, strnlen.h, strnlen1.c,
6064         strnlen1.h, unistd--.h.
6065         Remove getndelim2.c, getndelim2.h, pathmax.h, sysexits.h, xstrdup.c.
6066
6067         Treat fishy-looking hard links like fishy-looking symlinks.
6068         * src/extract.c (struct delayed_set_stat): Rename after_symlinks
6069         member to after_links.  All uses changed.
6070         (struct delayed_link): Renamed from struct delayed_symlink.
6071         All uses changed.  New member is_symlink.
6072         (delayed_link_head): Renamed from delayed_symlink_head.  All uses
6073         changed.
6074         (create_placeholder_file): New function, taken from extract_symlink.
6075         (extract_link): Create placeholders for fishy-looking hard links.
6076         (extract_symlink): Move code into create_placeholder_file.
6077         (apply_delayed_links): Renamed from apply_delayed_symlinks.
6078         All uses changed.  Create both hard links and symlinks.
6079
6080 2005-09-03  Paul Eggert  <eggert@cs.ucla.edu>
6081
6082         * README-alpha: Modernize description of software required for
6083         developers.
6084
6085 2005-09-03  Sergey Poznyakoff  <gray@gnu.org.ua>
6086
6087         * gnulib.modules: Add strdup
6088         * src/incremen.c (purge_directory): Do not dereference symbolic
6089         links. Bug reported by Ralph Corderoy <ralph@inputplus.co.uk> and
6090         David Brown <davidb@davidb.org>
6091         * tests/incr01.at: New test.
6092         * tests/Makefile.am: Add incr01.at
6093         * tests/testsuite.at: Likewise
6094         * THANKS: Updated
6095
6096 2005-08-17  Sergey Poznyakoff  <gray@gnu.org.ua>
6097
6098         * src/incremen.c (read_directory_file): Use strtoumax to read
6099         snapshot file contents.
6100         (write_directory_file_entry): Use umaxtostr().
6101
6102 2005-07-31  Sergey Poznyakoff  <gray@gnu.org.ua>
6103
6104         * src/create.c (file_dumpable_p,dump_file0): Fix handling of
6105         sparse files to /dev/null with --totals option.
6106         * tests/update.at: Remove dependency on file order.
6107
6108 2005-07-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6109
6110         * doc/tar.texi: Fix typo.
6111
6112 2005-07-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6113
6114         * tests/pipe.at: Pipe the output from `tar xfv' through sort.
6115
6116 2005-06-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6117
6118         * src/sparse.c (tar_sparse_init): Fill structure with zeros. Call
6119         sparse_select_optab(). All callers updated.
6120         (sparse_member_p, sparse_fixup_header): Use tar_sparse_init().
6121
6122 2005-06-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6123
6124         * src/sparse.c (pax_sparse_member_p): Checking member size
6125         vs. file size is not reliable enough. Use sparse_map_avail.
6126
6127         * tests/star/gtarfail.at: Adapt to the new output format
6128         * tests/star/gtarfail2.at: Likewise
6129         * tests/star/multi-fail.at: Likewise
6130         * tests/star/pax-big-10g.at: Likewise
6131         * tests/star/ustar-big-2g.at: Likewise
6132         * tests/star/ustar-big-8g.at: Likewise
6133
6134         * tests/sparse03.at: New test.
6135         * tests/Makefile.am: Add sparse03.at
6136         * tests/testsuite.at: Likewise
6137
6138         * src/xheader.c (size_decoder): Do not set archive_file_size.
6139
6140         Fix bugs introduced yesterday:
6141
6142         * src/sparse.c (tar_sparse_init):  Initialize
6143         dimped_size to 0.
6144         (sparse_scan_file): Initialize archive_file_size to 0. The
6145         variable keeps size of the file *as stored in the archive*, not
6146         the size reported by stat.
6147
6148 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
6149
6150         A sweep of the sparse code prompted by a bug report by Jim Meyering.
6151         * src/sparse.c: Include <inttostr.h>.
6152         (struct tar_sparse_file): offset and dumped_size are off_t, not
6153         size_t.  optab is now const *.
6154         (dump_zeros): Return bool success flag, not off_t.
6155         All callers changed.
6156         Use a constant-zero buffer rather than clearing a buffer each time.
6157         Don't mess up if write fails.
6158         (dump_zeros, check_sparse_region):
6159         Don't assume off_t is no wider than size_t.
6160         (tar_sparse_init): Don't bother clearing a field that is already clear.
6161         (zero_block_p): First arg is const *, not *.
6162         (clear_block, SPARSES_INIT_COUNT): Remove.
6163         (sparse_add_map): First arg is now struct start_stat_info *, not
6164         struct tar_sparse_file *.  All callers changed.
6165         Use x2nrealloc to check for size_t overflow.
6166         (parse_scan_file): Cache commonly-used parts of file.
6167         Use an auto buffer, not a static one.
6168         Don't bother clearing the buffer; not needed.
6169         Don't bother clearing items that are already clear.
6170         (oldgnu_optab, star_optab, pax_optab): Now const.
6171         (sparse_dump_region): Don't bother clearing the buffer before
6172         reading into it; just clear the parts that aren't read into.
6173         (sparse_dump_file): Clear the whole local variable 'file'.
6174         (diff_buffer): Remove; now a local var.
6175         (check_sparse_region): Don't bother clearing buffer before
6176         reading into it.  Don't assume off_t is promoted to long.
6177         (oldgnu_get_sparse_info, star_get_sparse_info):
6178         Use an auto status, not static.
6179         * src/tar.h (struct tar_stat_info): had_trailing_slash is
6180         now bool, not int.
6181         * src/xheader.c (sparse_offset_coder, sparse_numbytes_coder):
6182         Rewrite to avoid cast.
6183         (sparse_offset_decoder, sparse_numbytes_decoder):
6184         Diagnose excess entries rather than crashing.
6185
6186 2005-06-22  Jim Meyering  <jim@meyering.net>
6187
6188         * src/common.h (timespec_lt): Add a return type: bool.
6189
6190 2005-06-21  Paul Eggert  <eggert@cs.ucla.edu>
6191
6192         Further improvements inspired by Jim Meyering's fixes.
6193
6194         * NEWS: Better support for full-resolution time stamps.
6195         The -v option now prints time stamps only to 1-minute resolution.
6196         * gnulib.modules: Add utimens.
6197         * lib/.cvsignore: Add imaxtostr.c, inttostr.c, inttostr.h,
6198         offtostr.c, umaxtostr.c, utimens.c, utimens.h.  Remove paxconvert.c.
6199         * lib/Makefile.tmpl (libtar_a_SOURCES): Remove paxconvert.c.
6200         * lib/paxconvert.c: Remove; superseded by umaxtostr.c.
6201         * po/POTFILES.in: Remove lib/paxconvert.c.  Add lib/xalloc-die.c,
6202         lib/obstack.c.
6203         * src/buffer.c (set_start_time, compute_duration, start_time):
6204         Use gettime rather than rolling our own code.
6205         * src/common.h (OLDGNU_NAME_FIELD_SIZE, MAXOCTAL11, MAXOCTAL7): Remove.
6206         (newer_ctime_option): Remove.
6207         (timespec_lt): New function.
6208         (OLDER_STAT_TIME): Use it.
6209         (string_to_chars): First arg is char const *, not char *.
6210         (tartime): Time arg is now struct timespec.  New bool arg.
6211         All callers changed.
6212         (code_ns_fraction): New decl.
6213         (sys_stat_nanoseconds): Remove decl.
6214         (get_stat_atime, get_stat_ctime, get_stat_mtime): New functions.
6215         (set_stat_atime, set_stat_ctime, set_stat_mtime): New functions.
6216         * src/compare.c: Include utimens.h rather than rolling our own.
6217         (diff_dir, diff_file, diff_link, diff_symlink, diff_special):
6218         Prototype.
6219         (diff_dumpdir, diff_multivol): Prototype.
6220         (diff_file): Support higher-resolution time stamps.
6221         * src/create.c: Include utimens.h rather than rolling our own.
6222         (MAX_OCTAL_VAL): New macro.
6223         (tar_copy_str, string_to_chars): Don't bother to zero-fill;
6224         the destination is already zeroed.
6225         (string_to_chars): First arg is char const *.
6226         (start_private_header): Use MINOR_TO_CHARS, not MAJOR_TO_CHARS,
6227         for minor device number.
6228         (write_header_name, dump_hard_link, dump_file0):
6229         Simplify test for old GNU format.
6230         (start_header): Put in placeholders for uid, etc., even when
6231         using extended headers, for benefit of older "tar" implementations.
6232         Don't assume uintmax_t is wider than 32 bits.
6233         Output extended header for mtime if needed.
6234         (dump_regular_finish, dump_file0):
6235         Support extended time stamp resolution.
6236         * src/extract.c: Include utimens.h rather than rolling our own.
6237         (check_time): Support extended time stamp resolution.
6238         * src/list.c: Include <inttostr.h>.
6239         (tartime): Use umaxtostr rather than stringify_uintmax_t_backwards.
6240         * src/xheader.c: Include <inttostr.h>.
6241         Do not include <xstrtol.h>.
6242         (strtoimax) [!HAVE_DECL_STRTOIMAX && !defined strtoimax]: New decl.
6243         (strtoumax) [!HAVE_DECL_STRTOUMAX && !defined strtoumax]: New decl.
6244         (BILLION, LOG10_BILLION): New constants.
6245         (to_decimal): Remove; superseded by inttostr.  All callers changed
6246         to use umaxtostr.
6247         (xheader_format_name): Don't assume pids and uintmax_t values
6248         fit in 63 bytes (!) when printed.
6249         (decode_record): Don't bother to check for ERANGE; an out of range
6250         value must be treater than len_max anyway.
6251         If the length is out of range, output it in the diagnostic.
6252         (format_uintmax): Remove; all callers changed to use umaxtostr.
6253         (xheader_print): Don't assume sizes can be printed in 99 bytes (!).
6254         (out_of_range_header): New function.
6255         (decode_time): Use it.
6256         (code_time): Accept struct timespec, not time_t and unsigned long.
6257         All callers changed.  Size sbuf properly, and remove unnecessary check.
6258         Don't assume time stamps can fit in 199 bytes.
6259         Handle negative time stamps.  Handle fractional time stamps
6260         more consistently.  Don't output unnecessary trailing zeros.
6261         (decode_time): Yield struct timespec, not time_t and unsigned long.
6262         All callers changed.
6263         Handle negative time stamps.  Truncate towards minus infinity
6264         consistently.  Improve overflow checks, and output a better
6265         diagnostic on overflow.
6266         (code_num): Don't assume uintmax_t can be printed in 99 bytes (!).
6267         (decode_num): New function, for better diagnostics.
6268         (atime_coder, atime_decoder, gid_decoder, ctime_coder):
6269         (ctime_decoder, mtime_coder, mtime_decoder, size_decoder):
6270         (uid_decoder, sparse_size_decoder, sparse_numblocks_decoder):
6271         (sparse_offset_decoder, sparse_numbytes_decoder):
6272         Use decode_num, etc., instead of xstrtoumax, etc.
6273
6274 2005-06-21  Jim Meyering  <jim@meyering.net>
6275
6276         Carefully crafted invalid headers can cause buffer overrun.
6277         Invalid header fields go undiagnosed.
6278         Some valid time strings are ignored.
6279
6280         * src/xheader.c (sparse_numblocks_decoder): Remove unchecked use
6281         of `calloc'.  Use xcalloc instead.
6282         (decode_time, gid_decoder, size_decoder, uid_decoder):
6283         (sparse_size_decoder, sparse_offset_decoder, sparse_numblocks_decoder):
6284         Ensure that the result of calling xstrtoumax is no larger than
6285         the maximum value for the target type.  Upon any failure, exit with
6286         a diagnostic.
6287         (sparse_numblocks_decoder): Avoid buffer overrun/heap corruption:
6288         use x2nrealloc, rather than `n *= 2' and xrealloc(p, n,....
6289         (decode_time): Rewrite to accept time strings like
6290         1119018481.000000000.  Before, such strings were always ignored.
6291
6292 2005-06-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6293
6294         * src/create.c (dump_file0): Check for is_avoided_name()
6295         first. Fixes bug reported by Martin Lohmeier
6296         <martin@mein-horde.de>
6297         * tests/update.at: New file
6298         * tests/Makefile.am (TESTSUITE_AT): Add update.at
6299         * tests/testsuite.at: Likewise
6300
6301 2005-06-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6302
6303         * configure.ac (AC_STRUCT_ST_BLKSIZE)
6304         (AC_STRUCT_ST_BLOCKS): Removed. Handled by system.m4.
6305
6306 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
6307
6308         * src/names.c (excluded_name): excluded_filename ->
6309         excluded_file_name, because the name was changed in gnulib.
6310
6311 2005-05-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6312
6313         * src/tar.c (read_name_from_file,update_argv): Automatically
6314         detect nul-terminated list files.
6315         * NEWS: Updated
6316
6317 2005-05-27  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6318
6319         * scripts/backup.sh.in: Bugfixes.
6320
6321 2005-05-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6322
6323         * scripts/backup.in: Minor fixes
6324         * scripts/backup.sh.in (mt_begin,mt_rewind)
6325         (mt_offline,mt_status): Use $MT to invoke mt
6326         (init_common): Set --rsh-command option for mt if TAPE_FILE is a
6327         remote archive.
6328         * doc/tar.texi: Document new backup scripts behavior
6329
6330 2005-05-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6331
6332         * lib/.cvsignore: Updated
6333         * lib/Makefile.tmpl: Add new paxutils files
6334         * po/POTFILES.in: Likewise
6335         * src/buffer.c: Update invocations of safer_name_suffix()
6336         * src/create.c: Likewise
6337         * src/extract.c: Likewise
6338         * src/xheader.c: Likewise
6339         * src/common.h: Include paxlib.h instead of paxerror.h
6340         (safer_name_suffix,removed_prefixes_p): Removed. The functions are
6341         imported from paxutils
6342         * src/names.c (hash_string_hasher,hash_string_compare)
6343         (hash_string_insert,hash_string_lookup,removed_prefixes_p)
6344         (safer_name_suffix): Moved to paxutils
6345
6346 2005-05-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6347
6348         * bootstrap (copy_files): Accept optional third argument: a prefix
6349         to be appended to destination file names.
6350         Import paxutils/paxlib files.
6351         * configure.ac: Remove checking for LIB_SETSOCKOPT, it is handled
6352         by paxutils.
6353         * lib/Makefile.tmpl (libtar_a_SOURCES): Add paxerror.c paxexit.c
6354         paxconvert.c
6355         * po/POTFILES.in: Likewise.
6356         * src/common.h: Remove defines and declarations imported from
6357         paxutils
6358         * src/misc.c: Likewise
6359         * src/list.c (stringify_uintmax_t_backwards): Moved to paxutils
6360
6361 2005-05-17  Paul Eggert  <eggert@cs.ucla.edu>
6362
6363         * src/misc.c (remove_any_file): Fix typo in previous change.
6364
6365 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
6366
6367         Port to Solaris 10's treatment of unlinking directories.
6368         * gnulib-modules: Add unlinkdir.
6369         * lib/.cvsignore: Add unlinkdir.h, unlinkdir.c.
6370         * src/common.h (we_are_root): Remove extern decl; it's now static.
6371         * src/extract.c (we_are_root): Now static.
6372         * src/misc.c: Include <unlinkdir.h>.
6373         (remove_any_file): Use cannot_unlink_dir () rather than we_are_root.
6374
6375         * ChangeLog, ChangeLog.1, Makefile.am, NEWS, PORTS, README,
6376         README-alpha, TODO, bootstrap, configure.ac, doc/Makefile.am,
6377         doc/convtexi.pl, doc/fdl.texi, doc/gendocs_template,
6378         lib/Makefile.tmpl, lib/prepargs.c, lib/waitpid.c, po/POTFILES.in,
6379         scripts/Makefile.am, scripts/backup-specs, scripts/backup.in,
6380         scripts/backup.sh.in, scripts/restore.in, src/Makefile.am,
6381         src/arith.h, src/buffer.c, src/common.h, src/compare.c,
6382         src/create.c, src/delete.c, src/extract.c, src/incremen.c,
6383         src/list.c, src/mangle.c, src/misc.c, src/names.c, src/sparse.c,
6384         src/system.c, src/tar.c, src/tar.h, src/update.c, src/utf8.c,
6385         src/xheader.c, tests/Makefile.am, tests/append.at,
6386         tests/append01.at, tests/comprec.at, tests/delete01.at,
6387         tests/delete02.at, tests/delete03.at, tests/delete04.at,
6388         tests/delete05.at, tests/extrac01.at, tests/extrac02.at,
6389         tests/extrac03.at, tests/extrac04.at, tests/extrac05.at,
6390         tests/gzip.at, tests/ignfail.at, tests/incremental.at,
6391         tests/link01.at, tests/listed01.at, tests/listed02.at,
6392         tests/long01.at, tests/longv7.at, tests/multiv01.at,
6393         tests/multiv02.at, tests/multiv03.at, tests/multiv04.at,
6394         tests/old.at, tests/options.at, tests/options02.at, tests/pipe.at,
6395         tests/recurse.at, tests/same-order01.at, tests/same-order02.at,
6396         tests/shortrec.at, tests/sparse01.at, tests/sparse02.at,
6397         tests/testsuite.at, tests/truncate.at, tests/version.at,
6398         tests/volume.at, tests/star/gtarfail.at, tests/star/gtarfail2.at,
6399         tests/star/multi-fail.at, tests/star/pax-big-10g.at,
6400         tests/star/quicktest.sh, tests/star/ustar-big-2g.at,
6401         tests/star/ustar-big-8g.at:
6402         Update FSF postal mail address.
6403
6404 2005-05-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6405
6406         * NEWS: Updated
6407         * THANKS: Updated
6408         * bootstrap: Install files from paxutils/doc
6409         * doc/Makefile.am (tar_TEXINFOS): Add genfile.texi
6410         * doc/tar.texi (Genfile): New appendix
6411         * src/compare.c (diff_file): diff_handle was not initialized
6412         * src/create.c (dump_regular_file): Correctly pad archive members
6413         that shrunk during archiving. Repored by Frank Heckenbach.
6414         * src/extract.c (file_newer_p): Return false if file does not
6415         exist
6416         (prepare_to_extract): Correct warning wording.
6417         * tests/truncate.at: New test case
6418         * tests/Makefile.am: Add truncate.at
6419         * tests/testsuite.at: Likewise.
6420
6421         * doc/.cvsignore: Updated
6422         * lib/.cvsignore: Updated
6423         * tests/.cvsignore: Updated
6424
6425 2005-05-02  Paul Eggert  <eggert@cs.ucla.edu>
6426
6427         * tests/multivol04.at: Tell awk to read from /dev/null.
6428
6429         Adjust to recent gnulib changes.
6430         * lib/.cvsignore: Add dup-safer.c, fd-safer.c, unistd-safer.h.
6431         * src/common.h (initial_umask): New var.
6432         * src/create.c (start_ueader): Use it, and adjust to new modechange
6433         API.
6434         (hash_link): unsigned -> size_t parameters and result.
6435         * src/incremen.c (hash_directory): Likewise.
6436         * src/names.c (hash_string_hasher): Likewise.
6437         * src/tar.c (parse_opt): Set it, and adjust to new modechange API.
6438
6439 2005-04-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6440
6441         * tests/Makefile.am: Add shortrec.at.
6442
6443 2005-04-18  Paul Eggert  <eggert@cs.ucla.edu>
6444
6445         * src/buffer.c (reading_from_pipe): Remove.  All uses removed.
6446         (short_read): Don't warn about short reads; they're normal.
6447         * tests/shortrec.at: New file.
6448         * tests/testsuite.at: Include it.
6449
6450         * bootstrap (gnulib_modules): Don't create a file modlist.tmp, as
6451         it is sometimes left behind as a garbage file (maybe due to the
6452         multiple traps?).
6453
6454 2005-04-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6455
6456         * src/list.c: Handle Solaris 'X' type flag
6457         * src/tar.h (SOLARIS_XHDTYPE): New define
6458
6459 2005-04-06  Sergey Poznyakoff  <gray@mirddin.farlep.net>
6460
6461         * src/tar.c: Minor fixes to text messages. Proposed by Benno
6462         Schulenberg.
6463         * src/extract.c: Likewise
6464         (extract_file): Assign orig_file_name
6465         to save_name uniformly over the program. This fixes matching
6466         directory names at the start of an archive volume.
6467         * src/buffer.c (flush_write): Warn when the name of the archive
6468         straddling volume boundary is longer than 100 characters. Earlier
6469         behavior was to issue a fatal error.
6470         (struct zip_magic): Reverted part of changes from 2005-04-04.
6471         They make the maintenance too costly. Removing `unsigned'
6472         qualifier from `magic' member should be enough.
6473         * src/compare.c (diff_init): Read directory file if in listed
6474         incremental. This prevents spurious 'Contents differ' diagnostics.
6475         (diff_archive): Minor fixes to text messages
6476         (diff_file,diff_dumpdir,diff_multivol): Assign orig_file_name
6477         to save_name uniformly over the program. This fixes matching
6478         directory names at the start of an archive volume.
6479         * src/create.c: Assign orig_file_name
6480         to save_name uniformly over the program. This fixes matching
6481         directory names at the start of an archive volume.
6482         * src/list.c: Likewise
6483
6484         * tests/multiv03.at: Modified to match the new behavior
6485         * tests/multiv04.at: New file. Test splittind directory members between
6486         the archive volumes.
6487         * tests/Makefile.am: Add multiv04.at
6488         * tests/testsuite.at: Likewise.
6489
6490 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
6491
6492         * configure.ac (AC_CONFIG_AUX_DIR): Rename from config to build-aux,
6493         for reasons discussed in the thread beginning at
6494         <http://lists.gnu.org/archive/html/bug-gnulib/2005-03/msg00119.html>.
6495         * .cvsignore: Remove config; add build-aux.
6496
6497         * src/buffer.c (struct zip_magic): Use char arrays, not pointers.
6498         The unsigned char * pointer ran afoul of pedantic C compilers, and
6499         we didn't need pointers anyway.  Put the size field before the
6500         data to avoid unnecessary padding.  All uses changed.
6501         (magic) Make it const, since it doesn't change.  All uses changed.
6502
6503 2005-04-02  Paul Eggert  <eggert@cs.ucla.edu>
6504
6505         * src/xheader.c (decode_record): Don't dump core when given
6506         a corrupted extended header.  Problem reported by Jim Meyering.
6507         Also, check for other ways that the header might be invalid,
6508         e.g., missing newline at end.  Do not allow keys with nulls.
6509         Allow blanks before and after length, as POSIX requires.
6510         Do not allow leading "-" in length.  Check for length overflow.
6511         (xheader_decode, xheader_decode_global): Let decode_record
6512         check for exhaustion of record.
6513         (xheader_read): Null-terminate the extended record;
6514         decode_record relies on this.
6515
6516 2005-03-21  Paul Eggert  <eggert@cs.ucla.edu>
6517
6518         * bootstrap (TP_URL): Change from
6519         <http://www2.iro.umontreal.ca/~gnutra/po/maint/tar/> to
6520         <http://www.iro.umontreal.ca/translation/maint/tar/> to avoid
6521         some redirection glitches.
6522         Use "trap - 0" rather than "trap 0" to fix a POSIX-conformance bug.
6523         * doc/.cvsignore: Change "tar.info" to "tar.info*".  Sort.
6524         * lib/.cvsignore: Add intprops.h (new gnulib file).
6525
6526 2005-03-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6527
6528         * src/list.c (print_header): Print UID/GID in case of
6529         empty user/group name. This could occur when dumping
6530         files belonging to non-existing users and when listing
6531         broken archives.
6532         Reported by Igor Lautar.
6533
6534         * src/create.c: Correctly parse empty uname/gname
6535         * src/sparse.c (sparse_scan_file): Bugfix. offset had
6536         incorrect type.
6537
6538         * scripts/backup.in: Use `head -n 1'. Provide missing
6539         argument to ${MT_STATUS}. Proposed by Jan Merka.
6540         * scripts/backup.sh.in: Likewise. Fixed typo in
6541         MT_OFFLINE assignment.
6542         * scripts/restore.in (restore_fs): Use root_fs
6543
6544 2005-02-15  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6545
6546         * src/create.c: Replace strdup with xstrdup
6547         * src/names.c: Likewise
6548         * src/tar.c: Likewise
6549
6550         * tests/append01.at: Added reference to bug-tar archive
6551         * tests/listed02.at: Use -print with find.
6552
6553 2005-02-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6554
6555         * THANKS: Added Tim Adye. Fixed UTF.
6556         * src/list.c (read_header): Removed assignment to
6557         oldgnu_header.isextended. It was breaking append mode.
6558
6559         * tests/append01.at: New test.
6560         * tests/Makefile.am: Added append01.at
6561         * tests/testsuite.at: Likewise
6562
6563 2005-02-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6564
6565         * gnulib.modules: New file. List of required gnulib
6566         modules.
6567         * bootstrap: Merge list of required modules from
6568         paxutils with that from tar proper.
6569         * src/tar.c: Various fixes in help and diagnostic messages.
6570
6571 2005-02-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6572
6573         * src/common.h (EXTRACT_OVER_PIPE): New macro
6574         * src/compare.c: Code clean up.
6575         * src/extract.c (extract_archive): Do not check for
6576         EXTRACT_OVER_PIPE, decode_options() does this.
6577         * src/misc.c (exec_error,fork_error,dup2_error)
6578         (pipe_error): Removed unneeded functions.
6579         * src/system.c (sys_exec_command): Use xclose, xpipe,
6580         xfork, xdup2 and exec_fatal.
6581         * src/tar.c (options): Improved sorting. Document --backup=off.
6582         (decode_options): Clear backup_option if necessary.
6583
6584 2005-02-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6585
6586         Initial implementation of --to-command option proposed
6587         by Hansjoerg Lipp.
6588
6589         * bootstrap: Get setenv module from gnulib
6590         * src/buffer.c: Do not use 8-bit chars in comments
6591         * src/common.h (to_command_option)
6592         (ignore_command_error_option): New globals
6593         (sys_exec_command,sys_wait_command): New commands
6594         * src/extract.c (extract_file): Handle to_command_option
6595         Fix error recovery: decrease `size' by `written', not
6596         by `count', otherwise tar misses the next header
6597         Do not diagnose write error if to_command_option
6598         is set, since the command may have exited prematurely.
6599         It would be better to check for sigpipe, though.
6600         (prepare_to_extract): Handle to_command_option
6601         * src/misc.c (exec_error, fork_error, dup_error)
6602         (pipe_error): New functions
6603         * src/system.c (sys_exec_command)
6604         (sys_wait_command): New functions
6605         * src/tar.c: Handle new options --to-command,
6606         --ignore-command-error
6607         * THANKS: Added Hansjoerg Lipp
6608
6609 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
6610
6611         * src/list.c (from_header): New arg OCTAL_ONLY, normally false.
6612         All uses changed.  Fix typo that sometimes suppressed all "Archive
6613         contains obsolescent base-64 headers" warnings, not just the first
6614         one.
6615         (tar_checksum): Accept only octal checksums, since they aren't
6616         supposed to overflow into weird formats.
6617
6618         Adjust to gnulib changes.
6619         * lib/.cvsignore: Add chdir-long.c, chdir-long.h, memrchr.c,
6620         memrchr.h, openat.c, openat.h.  Remove pathmax.h (added by
6621         mistake, perhaps?), sysexit.h (my typo), xstrdup.c (gnulib removed
6622         this file).  Sort entries.
6623
6624 2005-02-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6625
6626         * src/extract.c: Further rewrite.
6627         * src/buffer.c: Removed unused variables.
6628         * src/list.c: Likewise
6629         * src/tar.c (update_argv): Changed type to void
6630
6631         * src/common.h (OLDGNU_NAME_FIELD_SIZE): New constant
6632         * src/create.c (start_private_header,write_header_name)
6633         (dump_hard_link): Restore compatibility with 1.13.25
6634         * src/extract.c (extract_archive): Rewritten
6635         * src/list.c: Add translators' comments
6636         * src/tar.c (options) Minor spelling fix
6637         * tests/star/quicktest.sh: Determine path to the tar executable.
6638
6639 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6640
6641         * po/POTFILES.in: Added tests/genfile.c
6642         * src/buffer.c (short_read): Use ngettext()
6643         (new_volume): use quote().
6644         * src/create.c: Use quote()
6645         * src/extract.c: Likewise
6646         * src/xheader.c: Likewise
6647         * src/misc.c: Add comments to translators
6648
6649         * tests/same-order01.at: sort ls output
6650         * tests/sparse01.at (RE_CHECK): Added missing space
6651
6652         * tests/sparse02.at: Test extracting sparse files over a pipe.
6653         * tests/Makefile.am: Added sparse02.at
6654         * tests/testsuite.at: Likewise
6655         * tests/listed02.at: Skip the test on filesystems that do not
6656         update ctime of a file when renaming it. To be reverted when
6657         the new incremental mode is ready.
6658         * tests/sparse01.at: Extract and compare sparse file
6659
6660 2005-02-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6661
6662         * src/sparse.c: Extract sparse files even if the output
6663         fd is not seekable.
6664
6665 2005-02-01  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6666
6667         * bootstrap: Add a comment to lib/Makefile.am saying that this
6668         is an autogenerated file.
6669         Exit with code 1 if any of autotools fails.
6670         * lib/Makefile.tmpl: Insert Emacs magic to the first line.
6671         * tests/Makefile.am: Add append.at
6672
6673         * m4/.cvsignore: Ignore all *.m4 files
6674
6675 2005-01-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6676
6677         Rewritten handling of -T (--files-from) option. Now it
6678         inserts the file names immediately into argv array which allows
6679         for:
6680         1) any valid tar options (including another -T) to be used in the file
6681         2) any number of -T options to be given in command line
6682
6683         * configure.ac: Raised version number to 1.15.2
6684         * src/common.h: Include obstack.h
6685         (files_from_option): Removed
6686         (unquote_option): New variable
6687         (stat_fatal): New function
6688         (name_close): Removed function.
6689         * src/incremen.c: Remove inclusion of obstack.h
6690         * src/xheader.c: Likewise.
6691         * src/misc.c (stat_fatal): New function
6692         * src/names.c (name_file): Removed variable.
6693         (read_name_from_file): Removed function. All callers changed.
6694         (name_close): Removed function. All callers changed.
6695         * src/tar.c: New options --unquote (--no-unquote) and
6696         --add-file
6697         (add_file_id,read_name_from_file,update_argv): New functions
6698         (parse_opt): Rewritten handling of -T option. Handle hidden
6699         --HANG option for debugging purposes.
6700         (decode_options): Init unquote_option to true. Init argv_stk.
6701         Remove unneeded references to files_from_option
6702
6703         * doc/tar.texi: Document new options.
6704         Moved rendition macros and option value definitions into
6705         separate files
6706         * doc/rendition.texi: New file
6707         * doc/value.texi: New file
6708         * doc/Makefile.am: Updated
6709
6710 2005-01-13  Paul Eggert  <eggert@cs.ucla.edu>
6711
6712         * tests/testsuite.at (RE_CHECK): Use "join - file", not
6713         "join file -", to work around a bug in Solaris 8 join.
6714         Problem reported by Tomohiro Suzuki.
6715
6716 2005-01-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6717
6718         * src/list.c (read_header): Fixed calculation of the
6719         size for GNU long name/link. Tar was reading one block
6720         more if name_size was divisible by 512. Thanks Josef
6721         Bauer.
6722         * tests/long01.at: New file. Test listing of GNU long names
6723         divisible by 512.
6724         * tests/pipe.at: Sort tar output.
6725         * tests/Makefile.am: Added long01.at
6726         * tests/testsuite.at: Likewise.
6727         * THANKS: Added Josef Bauer
6728         * lib/.cvsignore: Updated
6729         * m4/.cvsignore: Updated
6730         * NEWS: Updated
6731
6732 2005-01-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6733
6734         * directory: Updated for 1.15.1
6735         * doc/Makefile.am: Use gendocs.sh to generate web documentation
6736         * doc/gendocs_template: Template file for gendocs.sh
6737         * doc/tar.texi: Updated docs for --[no-]same-permissions
6738         * src/tar.c: Reworded docstrings for --[no-]same-permissions
6739
6740 2005-01-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6741
6742         * bootstrap: Create m4/paxutils.m4
6743         * configure.ac: Call tar_PAXUTILS
6744         * tests/options02.at: Test that tar correctly handles non-option
6745         arguments interspersed with options.
6746         * tests/Makefile.am: Add options02.at
6747         * tests/testsuite.at: Likewise
6748         * tests/listed02.at: Do not create useless directory
6749
6750 2005-01-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6751
6752         * src/tar.c (parse_opt): Bugfix: Use ARGP_KEY_ARG. Thanks
6753         Mike Frysinger <vapier@gentoo.org> for reporting.
6754
6755 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
6756
6757         * lib/Makefile.tmpl (localedir.h): Omit needless quotes and a
6758         needless sed command.  Problem reported by Paul Jarc.
6759
6760 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
6761
6762         Accommodate latest gnulib.
6763         * doc/.cvsignore: Add getdate.texi.
6764         * bootstrap: Do not treat alloca-opt specially; this is no
6765         longer needed (and breaks builds) with latest gnulib.
6766
6767 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6768
6769         * src/tar.c (main): Reverted recent changes (#ifdef).
6770
6771 2004-12-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6772
6773         * configure.ac: Raise version number to 1.15.1
6774         Check for locale.h
6775         * NEWS: Entry for 1.15.1
6776         * src/buffer.c: Bugfix. Changes introduced 2004-11-26
6777         broke extraction from stdin.
6778         * src/list.c (from_header, tar_checksum): Changed declaration.
6779         All callers updated.
6780         * src/common.h: Likewise
6781         * src/tar.c (main): Protect invocation of setlocale by
6782         ifdef.
6783
6784         * tests/comprec.at: New test
6785         * tests/pipe.at: New test
6786         * tests/Makefile.am (comprec.at,pipe.at): New tests
6787         * tests/testsuite.at: Likewise
6788         * tests/gzip.at: Use AT_GZIP_PREREQ
6789         * tests/star/pax-big-10g.at: Likewise
6790         * tests/star/ustar-big-2g.at: Likewise
6791         * tests/star/ustar-big-8g.at: Likewise
6792
6793         * tests/extrac04.at: Discard stderr from sort, on some
6794         systems it spits out lots of irrelevant info.
6795         * tests/listed02.at: Likewise
6796
6797         * doc/index.html.in: Rewritten in xhtml to follow recent
6798         GNU site standards.
6799         * THANKS: Updated
6800
6801 2004-12-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6802
6803         Released version 1.15. Sources up to this point are
6804         tagged release_1_15.
6805
6806         * configure.ac: Raised version number to 1.15
6807         * NEWS: Likewise
6808         * directory: Updated
6809         * bootstrap (update_po): Give -r to wget. Always remove index.html
6810         Ignore alloca-opt module (it duplicates alloca)
6811
6812         * tests/Makefile.am: Distribute star/quicktest.sh
6813         * tests/star/README: Document quicktest.sh
6814         * tests/star/qucktest.sh: Removed.
6815         * tests/star/quicktest.sh: New file.
6816
6817 2004-12-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6818
6819         * NEWS: Updated
6820         * doc/tar.texi: Document auto-detection of compressed archive
6821         formats.
6822         * src/tar.c (decode_options): Ignore --seek if used with --delete.
6823         Delete.c is based on the assumption that the archive is being
6824         actually read, not lseeked.
6825
6826         * tests/delete05.at: New file
6827         * tests/extrac02.at: Fixed typo in AT_SETUP
6828         * tests/Makefile.am: Added delete05.at
6829         * tests/testsuite.at: Likewise.
6830
6831 2004-12-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6832
6833         * src/delete.c (delete_archive_members): Bugfix: when
6834         attempting to delete an nonexistent member, the last
6835         blocking_factor blocks were zeroed.
6836
6837 2004-12-14  Paul Eggert  <eggert@cs.ucla.edu>
6838
6839         * TODO: Mention sub-second resolution, lutimes, lchmod.
6840
6841 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
6842
6843         Adjust to recent gnulib changes.
6844         * doc/getdate.texi: Remove, since bootstrap gets it from gnulib now.
6845         * .cvsignore: Add rmt, rmt/*, rmt/*/*.
6846         * lib/.cvsignore: Add allocsa.c, allocsa.h, allocsa.valgrind,
6847         charset.alias, config.charset, getcwd.c, getcwd.h, localcharset.c,
6848         localcharset.h, ref-add.sed, ref-add.sin, ref-del.sed,
6849         ref-del.sin, setenv.c, setenv.h, unsetenv.c.  Remove pathmax.h,
6850         xstrdup.c.
6851         * m4/.cvsignore: Add allocsa.m4, eealloc.m4, getcwd-path-max.m4,
6852         localcharset.m4, realloc.m4, setenv.m4.  Remove malloc.m4,
6853         pathmax.m4, realloc.m4.
6854
6855 2004-11-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6856
6857         * configure.ac: Raised version number to 1.14.91
6858         * scripts/tarcat: New file
6859         * scripts/Makefile.am: Added tarcat
6860         * src/buffer.c (hit_eof): Changed type to boolean
6861         (read_full_records,reading_from_pipe): New variables
6862         (check_compressed_archive,open_compressed_archive): New functions
6863         (open_archive): Autodetect compressed archives and act accordingly.
6864         Set reading_from_pipe. This fixes controversial set of changes
6865         introduced 2004-05-11,2004-03-22.
6866         * src/list.c (tar_checksum): New function
6867         (read_header): Use tar_checksum().
6868         * src/common.h (tar_checksum): New function
6869
6870         * tests/star/README: Updated
6871         * NEWS: Updated
6872         * PORTS: Updated
6873
6874 2004-11-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6875
6876         * src/tar.c (decode_options): Fixed -o semantics. Thanks
6877         Jean Delvare <khali@linux-fr.org>
6878
6879 2004-10-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6880
6881         * bootstrap: Add localcharset
6882         * lib/Makefile.tmpl: Initialize SUFFIXES and CLEANFILES since the
6883         makefile snippet from localcharset uses '+=' on them.
6884         * src/Makefile.am (LDADD): Add LIBICONV
6885         * src/list.c (decode_header): Set uname/gname to NULL if their
6886         header counterparts are empty
6887         * src/tar.c (options): Use OPTION_NO_TRANS
6888         * src/utf8.c: Use locale_charset() from gnulib
6889
6890         * tests/star/README: Updated
6891
6892         * NEWS: Updated
6893         * TODO: Minor fix
6894
6895 2004-10-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6896
6897         * THANKS: Added Bryan Ford
6898         * doc/Makefile.am (.text): Fixed rule
6899         * po/POTFILES.in: Added argp-help.c
6900
6901 2004-10-04  Bryan Ford  <baford@mit.edu>
6902
6903         * src/tar.c: New option --exclude-caches, to exclude
6904         cache directories automatically on archive creation.
6905         Cache directories are directories containing a
6906         standardized tag file, as specified at:
6907                 http://www.brynosaurus.com/cachedir/spec.html
6908         * src/common.h: New variable exclude_caches_option.
6909         * src/create.c: New function check_cache_directory(),
6910         called from dump_dir0() if exclude_caches_option is set,
6911         to check for a cache directory tag and exclude the directory
6912         if such a tag is found.
6913         * doc/tar.texi: Updated accordingly.
6914
6915 2004-09-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6916
6917         * doc/tar.texi: Minor fix
6918         * src/tar.c (options): Minor fix
6919
6920 2004-09-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6921
6922         * TODO: Updated
6923         * lib/Makefile.tmpl: Added 'rtapelib.o: localedir.h' dependency
6924         * src/common.h: Comment WANT_DIRECTORY_REMOVE_OPTION.
6925         * src/extract.c: Normalized use of remove_any_file().
6926         * src/misc.c: Likewise.
6927         * src/tar.c (parse_opt): Emit warning if -l option is used.
6928         (show_default_settings): REMOTE_SHELL may be undefined
6929
6930 2004-09-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6931
6932         Test suite rewritten in autotest.
6933
6934         * configure.ac: Updated for autotest
6935         * src/tar.c (argp_program_version): Modified.
6936         * tests/Makefile.am: Rewritten for autotest.
6937
6938         * tests/.cvsignore: Updated
6939         * tests/append.at: New file
6940         * tests/atlocal.in: New file
6941         * tests/delete01.at: New file
6942         * tests/delete02.at: New file
6943         * tests/delete03.at: New file
6944         * tests/delete04.at: New file
6945         * tests/extrac01.at: New file
6946         * tests/extrac02.at: New file
6947         * tests/extrac03.at: New file
6948         * tests/extrac04.at: New file
6949         * tests/extrac05.at: New file
6950         * tests/gzip.at: New file
6951         * tests/ignfail.at: New file
6952         * tests/incremental.at: New file
6953         * tests/link01.at: New file
6954         * tests/listed01.at: New file
6955         * tests/listed02.at: New file
6956         * tests/longv7.at: New file
6957         * tests/multiv01.at: New file
6958         * tests/multiv02.at: New file
6959         * tests/multiv03.at: New file
6960         * tests/old.at: New file
6961         * tests/options.at: New file
6962         * tests/recurse.at: New file
6963         * tests/same-order01.at: New file
6964         * tests/same-order02.at: New file
6965         * tests/sparse01.at: New file
6966         * tests/testsuite.at: New file
6967         * tests/version.at: New file
6968         * tests/volume.at: New file
6969         * tests/star/gtarfail.at: New file
6970         * tests/star/gtarfail2.at: New file
6971         * tests/star/multi-fail.at: New file
6972         * tests/star/pax-big-10g.at: New file
6973         * tests/star/ustar-big-2g.at: New file
6974         * tests/star/ustar-big-8g.at: New file
6975
6976         * tests/preset.in: Removed
6977         * tests/before: Removed
6978         * tests/after: Removed
6979         * tests/version.sh: Removed.
6980         * tests/append.sh: Removed.
6981         * tests/delete01.sh: Removed.
6982         * tests/delete02.sh: Removed.
6983         * tests/delete03.sh: Removed.
6984         * tests/delete04.sh: Removed.
6985         * tests/extrac01.sh: Removed.
6986         * tests/extrac02.sh: Removed.
6987         * tests/extrac03.sh: Removed.
6988         * tests/extrac04.sh: Removed.
6989         * tests/extrac05.sh: Removed.
6990         * tests/gzip.sh: Removed.
6991         * tests/incremen.sh: Removed.
6992         * tests/ignfail.sh: Removed.
6993         * tests/link01.sh: Removed.
6994         * tests/listed01.sh: Removed.
6995         * tests/listed02.sh: Removed.
6996         * tests/longv7.sh: Removed.
6997         * tests/multiv01.sh: Removed.
6998         * tests/multiv02.sh: Removed.
6999         * tests/multiv03.sh: Removed.
7000         * tests/old.sh: Removed.
7001         * tests/options.sh: Removed.
7002         * tests/same-order01.sh: Removed.
7003         * tests/same-order02.sh: Removed.
7004         * tests/volume.sh: Removed.
7005         * tests/recurse.sh: Removed.
7006         * tests/sparse01.sh: Removed.
7007         * tests/star/gtarfail.sh: Removed.
7008         * tests/star/gtarfail2.sh: Removed.
7009         * tests/star/multi-fail.sh: Removed.
7010         * tests/star/ustar-big-2g.sh: Removed.
7011         * tests/star/ustar-big-8g.sh: Removed.
7012         * tests/star/pax-big-10g.sh: Removed.
7013
7014 2004-09-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7015
7016         * bootstrap: Install genfile.c from paxutils
7017         * tests/genfile.c: Removed. Integrated into
7018         paxutils.
7019         * tests/mksparse.c: Removed. Integrated into
7020         (paxutils) genfile.c
7021         * tests/Makefile.am: Removed mksparse
7022         * tests/sparse01.sh: Use genfile instead of mksparse
7023
7024 2004-09-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7025
7026         Started merging with cpio into paxutils. Sources before
7027         this point are tagged alpha-1_14_90
7028
7029         * Makefile.am: Updated for use with paxutils
7030         * README-alpha: Likewise
7031         * bootstrap: Likewise
7032         * configure.ac: Likewise
7033         * lib/Makefile.tmpl: Likewise
7034         * po/POTFILES.in: Likewise
7035         * src/Makefile.am: Likewise
7036         * src/buffer.c: Likewise
7037         * src/common.h: Likewise
7038         * src/compare.c: Likewise
7039         * src/create.c: Likewise
7040         * src/delete.c: Likewise
7041         * src/extract.c: Likewise
7042         * src/incremen.c: Likewise
7043         * src/list.c: Likewise
7044         * src/mangle.c: Likewise
7045         * src/misc.c: Likewise
7046         * src/names.c: Likewise
7047         * src/sparse.c: Likewise
7048         * src/system.c: Likewise
7049         * src/tar.c: Likewise
7050         * src/update.c: Likewise
7051         * src/utf8.c: Likewise
7052         * src/xheader.c: Likewise
7053
7054         * src/system.h: Removed
7055         * src/rmt.c: Removed
7056         * src/rmt.h: Removed
7057         * src/rtapelib.c: Removed
7058
7059 2004-09-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7060
7061         * tests/listed02.sh: Do not depend on any particular ordering
7062         of output.
7063
7064 2004-09-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7065
7066         * doc/tar.texi: Document the use of -C option in
7067         file lists. Document --seek option.
7068         * configure.ac: New option --with-rmt. New configuration variable
7069         DEFAULT_RMT_DIR. Removed DEFAULT_RMT_COMMAND.
7070         * src/Makefile.am: Install rmt into rmtdir
7071         * src/tar.c (usage): Minor fix.
7072         * NEWS: Updated.
7073         * README: Updated.
7074
7075 2004-09-01  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7076
7077         * configure.ac: Raised version number to 1.14.90
7078         * src/common.h (is_individual_file): New prototype
7079         * src/create.c (dump_file0): Fix bug introduced
7080         2004-02-21.
7081         * src/names.c (register_individual_file)
7082         (is_individual_file): New functions.
7083         * tests/listed01.sh: Use genfile instead of dd.
7084         * tests/listed02.sh: New file.
7085         * tests/Makefile.am: Added listed02.sh
7086
7087         * NEWS: Updated
7088
7089 2004-08-31  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7090
7091         * src/sparse.c (sparse_add_map): Fixed improper initializations
7092         of sparse_map_size. We assume that whatever number it contains
7093         describes adequately the current size of sparse_map. The only
7094         number we need to reset is sparse_map_avail.
7095         * src/compare.c (verify_volume): Call set_next_block_after
7096         if read_header returns HEADER_FAILURE
7097         Destroy and reinitialize content of current_stat_info and
7098         extended_header after each iteration (bug reported by
7099         John L. Males <jlmales@yahoo.com>).
7100         Issue a warning if the created archive contains some members
7101         whose file names were stripped off their leading prefixes.
7102         This is a temporary fix of the issue reported by Bdale Garbee
7103         <bdale@gag.com> (Refs: Debian bug 230064, Message-Id
7104         <87n07kyzhi.fsf@rover.gag.com>, Sun, 15 Feb 2004 11:22:17 -0700)
7105
7106         * src/names.c (removed_prefixes_p): New function.
7107
7108         * src/buffer.c: When computing write rate do not take
7109         into account the time needed to verify the archive(s).
7110         The bug reported by John L. Males <jlmales@yahoo.com>
7111         (set_start_time,compute_duration): New functions.
7112         (print_total_written): Use the result of compute_duration().
7113         (close_archive): Call compute_duration.
7114         * src/common.h (set_start_time, removed_prefixes_p): New prototypes.
7115         * src/list.c (decode_header): Fixed initialization
7116         of stat_info->is_sparse
7117         * src/tar.c (main): Call set_start_time().
7118
7119         * src/misc.c (unquote_string): Unquote '\a' and '\v'.
7120         Reported by Helmut Waitzmann <helmut.waitzmann@web.de>.
7121
7122         * NEWS: Updated
7123         * THANKS: Updated
7124
7125 2004-08-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7126
7127         * src/tar.c: Fix copy-n-paste errors in the license
7128
7129 2004-08-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7130
7131         * scripts/backup.in: Renamed LIBPATH to LIBDIR.
7132         Use ROOT_FS with -C option. Do not send mail
7133         if ADMINISTRATOR is set to NONE.
7134         * scripts/backup.sh.in (test_root): Append / to
7135         ROOT_FS if it does not already end in it.
7136         * scripts/restore.in: Renamed LIBPATH to LIBDIR.
7137         New option -a (--all). Do not start restore unless
7138         -a or patterns are given.
7139         (restore_fs,restore_files): Fixed use of --listed option.
7140         * doc/tar.texi: Updated
7141         * NEWS: Updated
7142
7143 2004-08-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7144
7145         * src/tar.c (find_argp_option): Fixed typo
7146
7147 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
7148
7149         Merge argp, getopt, xalloc changes from gnulib.
7150         * bootstrap (gnulib_modules): Add xalloc-die.
7151         Remove code to test for patches; we don't have patches now.
7152         Set LC_ALL=C so that file names sort consistently.
7153         Prefer the gnulib copies of gettext.m4, glibc21.m4,
7154         lib-ld.m4, lib-prefix.m4, po.m4 too.
7155
7156         * patches/getopt.diff: Remove; gnulib now works unpatched.
7157         * configure.ac (_getopt_long_only_r): Remove check.
7158         gl_ARGP now does this for us.
7159         * lib/.cvsignore: Add fnmatch.h, getopt_.h, sysexit.h,
7160         xalloc-die.c.
7161         * src/extract.c: Adjust to changes to gnulib xalloc module.
7162         (extr_init): Remove assignment to xalloc_fail_func; no longer needed.
7163         (xalloc_die): New function.
7164
7165 2004-08-10  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7166
7167         * NEWS: Updated
7168
7169         * src/buffer.c (flush_write): Limit filenames
7170         of the members that straddle multivolume archive
7171         boundary to 100 characters.
7172         (flush_read): Use strncmp when comparing multivolume member
7173         names.
7174         * tests/multiv03.sh: New file
7175         * tests/Makefile.am: Added multiv03.sh
7176
7177 2004-08-09  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7178
7179         * src/list.c (read_and): Call decode_header before
7180         calling skip_member()
7181         (skip_member): Use is_sparse field to determine if the
7182         member is a sparse file.
7183
7184         * tests/Makefile.am: Added extrac05.sh
7185         * tests/extrac05.sh: New file
7186         * tests/append.sh: Rearranged leading comments. Added explicit
7187         references to report messages wherever available.
7188         * tests/delete01.sh: Likewise
7189         * tests/delete02.sh: Likewise
7190         * tests/delete03.sh: Likewise
7191         * tests/delete04.sh: Likewise
7192         * tests/extrac01.sh: Likewise
7193         * tests/extrac02.sh: Likewise
7194         * tests/extrac03.sh: Likewise
7195         * tests/extrac04.sh: Likewise
7196         * tests/gzip.sh: Likewise
7197         * tests/ignfail.sh: Likewise
7198         * tests/incremen.sh: Likewise
7199         * tests/link01.sh: Likewise
7200         * tests/listed01.sh: Likewise
7201         * tests/longv7.sh: Likewise
7202         * tests/multiv01.sh: Likewise
7203         * tests/multiv02.sh: Likewise
7204         * tests/old.sh: Likewise
7205         * tests/options.sh: Likewise
7206         * tests/recurse.sh: Likewise
7207         * tests/same-order01.sh: Likewise
7208         * tests/same-order02.sh: Likewise
7209         * tests/sparse01.sh: Likewise
7210         * tests/version.sh: Likewise
7211         * tests/volume.sh: Likewise
7212
7213 2004-08-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7214
7215         * bootstrap: Extended --update-po option to take an
7216         optional argument specifying the po file to update.
7217         * src/create.c: Improved compatibility with 1.13.25
7218         * tests/link01.sh: New file.
7219         * tests/Makefile.am: Added link01.sh
7220
7221 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
7222
7223         Merge from gnulib.
7224
7225         * patches/argp.diff: Remove; no longer needed.
7226
7227         * lib/.cvsignore: Add stat-macros.h.
7228         Remove addext.c, malloc.c, realloc.c.
7229
7230         * src/extract.c: Include <getcwd.h>.
7231         (extract_archive): Rewrite with new macro IS_ABSOLUTE_FILE_NAME.
7232         * src/extract.c (make_directories):
7233         FILESYSTEM_PREFIX_LEN -> FILE_SYSTEM_PREFIX_LEN.
7234         * src/misc.c (must_be_dot_or_slash): Likewise.
7235         * src/names.c (excluded_name, safer_name_suffix, stripped_prefix_len):
7236         Likewise.
7237         * src/tar.c (parse_opt): Likewise.
7238         * src/incremen.c (purge_directory): Fix format buffer typos in warning
7239         strings.
7240         * src/tar.c (options): Add missing initializers to pacify gcc.
7241         (decode_options): Remove unused var.
7242
7243 2004-08-02  Paul Eggert  <eggert@cs.ucla.edu>
7244
7245         * bootstrap (gnulib_modules): Add getpagesize.
7246         * configure.ac (valloc): Remove check; valloc no longer used.
7247         * lib/.cvsignore: Add getpagesize.h.
7248         * m4/.cvsignore: Add getpagesize.m4.
7249         * src/buffer.c (record_buffer): New var.
7250         (open_archive): Don't use valloc; on older or buggy hosts, you can't
7251         free the result.  Use page_aligned_alloc instead.
7252         * src/compare.c (diff_init): Likewise.
7253         * src/buffer.c (open_archive): Record the pointer to be freed
7254         into record_buffer.
7255         (close_archive): Free record_buffer.
7256         * src/common.h (page_aligned_alloc): New decl.
7257         * src/misc.c (quote_n, quote): Remove these redundant functions.
7258         (ptr_align): New function, from coreutils/src/system.h.
7259         (page_aligned_alloc): New function.
7260         * src/system.h (valloc): Remove.
7261
7262 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
7263
7264         * src/extract.c (extract_archive): Do not report an error
7265         when hard-linking X to X when X exists.  Problem reported by
7266         Toby Peterson.
7267         * lib/.cvsignore: Add fchown-stub.c.
7268
7269 2004-06-29  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7270
7271         * NEWS: Updated
7272         * src/common.h (root_device): New global.
7273         (gnu_restore): Renamed to purge_directory().
7274         * src/extract.c (extr_init): Save the device number
7275         of the root device.
7276         (extract_archive): Renamed gnu_restore() to purge_directory().
7277         * src/incremen.c (gnu_restore): Renamed to purge_directory().
7278         Do not attempt to purge the directory if it is on a different
7279         device and one_file_system_option is set.
7280
7281 2004-06-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7282
7283         * doc/tar.texi: The actual default for exclude patterns
7284         is --no-anchored. Fixed.
7285         * src/tar.c (options): Likewise.
7286         Thanks "Felix Natter" <felix.natter@ldc.de> for noticing.
7287
7288 2004-06-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7289
7290         * doc/tar.texi: Fixed several inconsistencies.
7291         * src/tar.c: Fixed docstring for --checkpoint option.
7292
7293 2004-05-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7294
7295         * src/buffer.c (seek_archive): New function
7296         * src/common.h (seek_archive): New function
7297         (seekable_archive): New global.
7298         * src/list.c (skip_file): Use seek_archive() if
7299         possible.
7300         * src/tar.c (struct fmttab): Accept 'pax' as alias
7301         for 'posix'
7302         (options): New option -n (--seek).
7303         * src/update.c: Determine type of the archive before
7304         appending to it.
7305
7306         * TODO: Updated.
7307
7308 2004-05-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7309
7310         * bootstrap: New option --update-po
7311         * src/tar.c: New option -H (short alias to --format)
7312         * doc/tar.texi: Document -H option
7313         * src/names.c (safer_name_suffix): Fixed bug introduced
7314         2004-05-11.
7315
7316 2004-05-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7317
7318         * bootstrap: Apply patches from patch subdirectory
7319         * patches: New dir
7320         * patches/argp.diff: New file
7321         * patches/getopt.diff: New file
7322         * configure.ac: Check for _getopt_long_only_r and
7323         force using included version of getopt if the function
7324         is not available.
7325         * src/tar.c: Use argp for command line parsing.
7326         * src/system.h: Minor formatting fix
7327         * m4/.cvsignore: Updated
7328         * lib/.cvsignore: Updated
7329         * doc/tar.texi: Minor fix.
7330         * src/extract.c: Fix improper use of 'path' term
7331         * src/incremen.c: Likewise
7332         * src/list.c: Likewise
7333         * src/misc.c: Likewise
7334         * src/names.c: Likewise
7335         * src/rmt.h: Likewise
7336         * src/rtapelib.c: Likewise
7337         * src/update.c: Likewise
7338         * src/xheader.c: Likewise
7339         * tests/star/README: Minor fix
7340
7341 2004-05-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7342
7343         * configure.ac: Raised version number to 1.14.1
7344         * src/tar.c: Renamed --strip-path to --strip-components
7345         Changed improper use of _() to ngettext().
7346         * src/extract.c: Renamed strip_path_option to strip_components_option
7347         * src/common.h: Likewise.
7348         * NEWS: Updated.
7349         * doc/tar.texi: Updated
7350
7351 2004-05-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7352
7353         * src/system.c (sys_child_open_for_uncompress): Do not
7354         set read_full_records_option: the compressed archive is
7355         likely not to contain integer number of records. Should
7356         the user wish to use reblocking, he may always give tar
7357         -B option. This is a minor improvement over the change
7358         dated 2004-03-22.
7359         * src/buffer.c (open_archive): Removed assignment to
7360         read_full_records_option.
7361
7362         * src/names.c (safer_name_suffix): (safer_name_suffix): Use "%s"
7363         as the format argument, rather than a possibly-translated variable
7364         string. Patch provided by Jim Meyering  <jim@meyering.net>
7365         * src/tar.c (decode_options): Fixed typo in the comment.
7366         * tests/star/README: Minor correction
7367
7368 2004-05-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7369
7370         * directory: New file. GNU directory entry for tar.
7371         * doc/Makefile.am: Rewritten. Added rules for generating
7372         documentation for the project's website.
7373         * doc/.cvsignore: Updated
7374         * doc/index.html.in: New file.
7375
7376 2004-05-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7377
7378         * configure.ac: Raised version number to 1.14
7379         * NEWS: Updated.
7380         * tests/after: Added copyleft statement
7381         * tests/before: Added copyleft statement
7382         * tests/preset.in: Added copyleft statement
7383
7384         Tar 1.14 is released. Sources up to this point are tagged
7385         release_1_14
7386
7387 2004-05-10  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7388
7389         * configure.ac: Fixed prerequisite headers for sys/buf.h
7390         (needed on FreeBSD)
7391         * src/system.h: Likewise.
7392         * tests/after (compare): Fixed argument quoting under eval
7393         * tests/before: Quote TAR_ARCHIVE_FORMATS
7394
7395 2004-05-10  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7396
7397         * NEWS: Updated
7398         * README: Updated
7399         * PORTS: Updated
7400         * configure.ac: Call gl_AC_TYPE_INTMAX_T. Document
7401         DEFAULT_.* variables. Use DEFAULT_RMT_COMMAND to set
7402         the pathname of the rmt utility.
7403         New option --enable-backup-scripts.
7404         * doc/tar.texi: Updated
7405         * scripts/Makefile.am: Install the scripts only if requested
7406         by the configure.
7407         * scripts/backup.in: Fixed --version output.
7408         Fixed initialization of the listing files and printing
7409         the time of the last previous level dump.
7410         * scripts/restore.in: Fixed --version output.
7411         * src/Makefile.am (localedir.h rule): Generate correct
7412         DEFAULT_RMT_COMMAND variable.
7413         * src/common.h (rmt_command_option): New variable.
7414         * src/list.c (read_and): Print block number before
7415         issuing 'Skipping to next header' diagnostics, if
7416         requested by block_number_option.
7417         * src/rtapelib.c: Use rmt_command_option instead of
7418         hardcoded "/etc/rmt".
7419         * src/tar.c: New option --rmt-command.
7420         (decode_options): Handle --rmt-command. Initialize
7421         rmt_command_option to DEFAULT_RMT_COMMAND.
7422
7423 2004-05-09  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7424
7425         * doc/tar.texi: Further update.
7426
7427 2004-05-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7428
7429         * configure.ac: Minor fix
7430         * scripts/Makefile.am: Updated
7431         * scripts/backup-specs: Updated
7432         * scripts/backup.in: Minor fixes
7433         * scripts/backup.sh: Removed
7434         * scripts/backup.sh.in: New file. Source for backup.sh
7435         * scripts/restore.in: New file
7436         * scripts/.cvsignore: Updated
7437         * scripts/WARNING: Removed
7438         * doc/tar.texi: Updated
7439         * NEWS: Updated
7440
7441 2004-05-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7442
7443         * src/names.c (name_gather): Bugfix: Honor single -C with
7444         --same-order.
7445         * tests/same-order01.sh: New file
7446         * tests/same-order02.sh: New file
7447         * tests/Makefile.am: Updated
7448
7449         * tests/append.sh: Added copyleft header
7450         * tests/delete01.sh: Likewise
7451         * tests/delete02.sh: Likewise
7452         * tests/delete04.sh: Likewise
7453         * tests/extrac01.sh: Likewise
7454         * tests/extrac02.sh: Likewise
7455         * tests/extrac03.sh: Likewise
7456         * tests/extrac04.sh: Likewise
7457         * tests/gzip.sh: Likewise
7458         * tests/ignfail.sh: Likewise
7459         * tests/incremen.sh: Likewise
7460         * tests/multiv01.sh: Likewise
7461         * tests/old.sh: Likewise
7462         * tests/options.sh: Likewise
7463         * tests/recurse.sh: Likewise
7464         * tests/version.sh: Likewise
7465         * tests/volume.sh: Likewise
7466         * tests/star/gtarfail.sh: Likewise
7467         * tests/star/gtarfail2.sh: Likewise
7468         * tests/star/multi-fail.sh: Likewise
7469         * tests/star/pax-big-10g.sh: Likewise
7470         * tests/star/qucktest.sh: Likewise
7471         * tests/star/ustar-big-2g.sh: Likewise
7472         * tests/star/ustar-big-8g.sh: Likewise
7473
7474         * doc/.cvsignore: Updated
7475
7476 2004-05-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7477
7478         * configure.ac: Check whether date accepts +format argument
7479         (for backup scripts).
7480         * scripts/level-0: Removed
7481         * scripts/level-1: Removed
7482         * scripts/weekly.new: Removed
7483         * scripts/dump-remind: Removed
7484         * scripts/backup.in: New file
7485         * scripts/backup.sh: New file
7486         * scripts/dump-remind.in: New file
7487         * scripts/backup-specs: Updated
7488         * scripts/Makefile.am: Updated for new directory contents.
7489         * scripts/.cvsignore: Updated
7490
7491 2004-05-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7492
7493         * TODO: Updated
7494         * doc/tar.texi: Updated
7495         * src/tar.c: --utc implies -vv
7496
7497 2004-04-28  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7498
7499         * src/utf8.c: Make sure ICONV_CONST is defined. AM_ICONV
7500         does not define it if it fails to find iconv.h.
7501
7502 2004-04-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7503
7504         * bootstrap: Use gnulib-tool to generate lib/Makefile.am
7505         and parts of configure.ac
7506         * configure.ac: Invoke tar_GNULIB to configure gnulib stuff.
7507         * lib/Makefile.am: Removed
7508         * lib/Makefile.tmpl: New file.
7509         * lib/.cvsignore: Updated
7510         * m4/.cvsignore: Updated
7511         * src/xheader.c: Include stpcpy.h
7512
7513         * src/create.c: Produce an error, not warning, if the
7514         filename is too long.
7515         * tests/longv7.sh: Synchronized with the recent changes.
7516
7517 2004-04-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7518
7519         * configure.ac: Fixed test for iconv_t
7520         * src/rmt.h: Bugfix by Jürgen Weigert
7521         * THANKS: Add Jürgen Weigert
7522         * tests/star/README: Fixed typo
7523
7524 2004-04-04  Paul Eggert  <eggert@twinsun.com>
7525
7526         Merge getdate documentation changes from coreutils.
7527
7528         * doc/getdate.texi: Update from coreutils CVS.
7529         * doc/tar.texi: Fix getdate menu to match getdate.texi's.
7530
7531         Merge recent gnulib changes, and remove some lint.
7532
7533         Improve support for nanosecond-resolution time stamps.
7534         * bootstrap: Add gettime, timespec modules.
7535         * configure.ac (gl_GETTIME, gl_TIMESPEC): Add.
7536         * lib/.cvsignore (getopt_int.h, gettime.c, gettimeofday.c,
7537         timespec.h): Add.
7538         * lib/Makefile.am (libtar_a_SOURCES): Add gettime.c, timespec.h.
7539         * m4/.cvsignore: Add clock_time.m4, gettime.m4, gettimeofday.m4,
7540         st_mtim.m4, timespec.m4.  Remove malloc.m4, realloc.m4.
7541         * src/common.h (newer_mtime_option): Now a struct timespec, not
7542         time_t.  All uses changed.
7543         (NEWER_OPTION_INITIALIZED, OLDER_STAT_MTIME): New macros.
7544         * src/create.c (dump_file0): Use OLDER_STAT_TIME to compare times.
7545         * src/incremen.c (scan_path): Likewise.
7546         * src/list.c (read_and): Likewise.
7547         * src/list.c (read_and): Use NEWER_OPTION_INITIALIZED to decide
7548         whether newer_mtime_option is initialized.
7549         * src/tar.c (decode_options): Likewise.
7550         * src/tar.c (decode_options): Adjust to new signature for get_date.
7551
7552         * src/buffer.c (short_read, flush_read): Use size_t, not ssize_t, for
7553         result of safe_read, full_write, and similar functions.
7554         Detect safe_read error by comparing to SAFE_READ_ERROR;
7555         detect full_write error by comparing to 0.
7556         All uses changed.
7557         * src/common.h (write_error_details, sys_write_archive_buffer):
7558         Likewise.
7559         * src/misc.c (write_error_details): Likewise.
7560         * src/rmt.c (main): Likewise.
7561         * src/rmt.h (rmt_read__, rmt_write__): Likewise.
7562         * src/rtapelib.c (rmt_read__, rmt_write__, rmt_ioctl__): Likewise.
7563         * src/sparse.c (sparse_scan_file, sparse_dump_region,
7564         check_sparse_region, check_data_region): Likewise.
7565         * src/system.c (sys_write_archive_buffer, sys_drain_input_pipe,
7566         sys_child_open_for_compress, sys_child_open_for_uncompress): Likewise.
7567         * src/update.c (append_file): Likewise.
7568
7569         * src/buffer.c (clear_read_error_count): Use explicit (void)
7570         to indicate a function with no arguments.
7571         * src/create.c (check_links): Likewise.
7572         * src/system.c (sys_get_archive_stat, sys_save_archive_dev_ino,
7573         sys_detect_dev_null_output, sys_drain_input_pipe, sys_spawn_shell,
7574         sys_reset_uid_gid, sys_get_archive_stat, sys_save_archive_dev_ino,
7575         sys_detect_dev_null_output, sys_drain_input_pipe, sys_spawn_shell):
7576         Likewise.
7577         * src/utf8.c (get_input_charset): Likewise.
7578         * src/xheader.c (xheader_ghdr_name, xheader_write_global,
7579         xheader_decode_global, extended_header_init): Likewise.
7580         * tests/mksparse.c (usage): Likewise.
7581
7582         * src/buffer.c (new_volume): Rename local variables to avoid
7583         shadowing warnings.
7584         * src/common.h (file_dumpable_p, sys_stat_nanoseconds,
7585         sparse_file_p, sparse_member_p, sparse_fixup_header,
7586         sparse_dump_file, sparce_extract_file, sparse_skip_file,
7587         sparse_diff_file): Likewise.
7588         * src/compare.c (diff_archive): Likewise.
7589         * src/create.c (file_dumpable_p, dump_regular_file, dump_dir0,
7590         dump_dir, dump_hard_link, file_count_links, dump_file0, dump_file):
7591         Likewise.
7592         * src/extract.c (repair_delayed_set_stat): Likewise.
7593         * src/misc.c (maybe_backup_file, add_hierarchy_to_namelist):
7594         Likewise.
7595         * src/sparse.c (struct tar_sparse_optab, tar_sparse_dump_region,
7596         tar_sparse_extract_region, sparse_dump_region, sparse_extract_region,
7597         sparse_dump_file, sparse_file_p, sparse_member_p,
7598         sparse_fixup_header, sparse_extract_file, sparse_skip_file,
7599         check_data_region, sparse_diff_file): Likewise.
7600         * src/system.c (sys_stat_nanoseconds): Likewise.
7601         * src/xheader.c (xheader_format_name): Likewise.
7602
7603         * src/common.h (enum old_files): Remove comma before }; not portable.
7604
7605         * src/common.h (read_fatal_details): Add __attribute__ ((noreturn)).
7606         * src/rmt.c (usage): Likewise.
7607         * src/xheader.c (xheader_set_single_keyword): Likewise.
7608         * tests/genfile.c (usage): Likewise.
7609         * tests/mksparse.c (die, usage): Likewise.  Also add printf attribute
7610         to die.
7611
7612         * src/common.h (gname_to_gid, uname_to_uid): Add const to avoid
7613         some gcc warnings.
7614         * src/names.c (uname_to_uid, gname_to_gid): Likewise.
7615         * src/utf8.c (struct langtab.lang, struct langtab.terr, struct
7616         langtab.charset, charset_lookup): Likewise.
7617
7618         * src/common.h (name_init): Remove unused args.  All callers changed.
7619         * src/names.c (name_init): Likewise.
7620
7621         * src/common.h (usage, xheader_write, xheader_write_global,
7622         sys_reset_uid_gid): New decls.
7623
7624         * src/compare.c (report_difference, process_noop): Add
7625         __attribute__ ((unused)) for unused attributes.
7626         * src/sparse.c (oldgnu_sparse_member_p, star_sparse_member_p):
7627         Likewise.
7628         * src/xheader.c (dummy_coder, dummy_decoder, atime_coder,
7629         gid_coder, gname_coder, linkpath_coder, ctime_coder, mtime_coder,
7630         path_coder, size_coder, uid_coder, uname_coder,
7631         sparse_numblocks_coder): Likewise.
7632
7633         * src/create.c (dump_regular_finish, dump_dir0, dump_dir,
7634         dump_file0): Now static.
7635         * src/utf8.c (charset_lookup): Likewise.
7636         * src/xheader.c (xheader_protected_pattern_p,
7637         xheader_protected_keyword_p, xheader_set_single_keyword,
7638         xheader_keyword_deleted_p, xheader_keyword_override_p,
7639         xheader_list_append, xheader_list_destroy, xheader_set_keyword_equal):
7640         Likewise.
7641         * tests/genfile.c (usage): Likewise.
7642         * tests/mksparse.c (die, mkhole, mksparse, usage, xlat_suffix):
7643         Likewise.
7644
7645         * src/create.c (hash_link): Rewrite to avoid cast.
7646
7647         * src/extract.c (file_newer_p): Use parameter, not global var.
7648         * src/misc.c (write_error_details): Likewise.
7649
7650         * src/extract.c (prepare_to_extract): Remove directory arg; not
7651         used.  All callers changed.
7652
7653         * src/misc.c (close_fatal): Remove; not used.
7654         * src/system.c (sys_utimes): Likewise.
7655
7656         * src/rmt.c (get_string): Avoid buffer overrun (off by 1 error).
7657
7658         * src/rmt.c (main): Update copyright date to 2004.
7659         * src/tar.c (decode_options): Likewise.
7660
7661         * src/rtapelib.c (get_status_string): Don't lose errno when
7662         skipping the error messages.
7663         (get_status): Report an error if atol returns a negative number.
7664
7665         * src/utf8.c (struct langtab, langtab, charset_lookup,
7666         get_input_charset) [!defined HAVE_LIBCONV]: Omit unused
7667         definitions.
7668         (iconv_open, iconv, iconv_close) [!defined HAVE_LIBCONV]:
7669         Use macros, not definitions, to avoid type clashes with system
7670         headers.
7671         (charset_lookup): Local var is now auto, not static.
7672         (utf8_convert): Use ICONV_CONST instead of const, to avoid
7673         type clashes.
7674
7675         * src/utf8.c (langtab): Initialize all elements of struct, to
7676         avoid gcc warning.
7677         * src/xheader.c (xhdr_tab): Likewise.
7678
7679         * src/xheader.c: Include fnmatch.h, since we use fnmatch.
7680
7681         * tests/mksparse.c (mkhole): Fix typo: bool was assigned to off_t.
7682
7683 2004-04-04  Sergey Poznyakoff  <gray@Noldor.runasimi.org>
7684
7685         * NEWS: Updated
7686         * configure.ac: Raised version number to 1.13.94
7687         * src/system.h: Protect inclusion of <sys/time.h>
7688         by ifdef.
7689         Declare time() if HAVE_DECL_TIME is 0
7690         * tests/.cvsignore: Added mksparse
7691
7692         * tests/sparse01.sh: New file
7693         * tests/multiv02.sh: New file
7694         * tests/Makefile.am: Add sparse01.sh and multiv02.sh
7695         * tests/longv7.sh: Added missing call to 'after'
7696
7697         * src/common.h: Added missing prototypes
7698         * src/compare.c (diff_archive): Use is_sparse member
7699         instead of GNUTYPE_SPARSE.
7700         * src/create.c: Removed unused variables
7701         * src/extract.c (extract_archive): Use sparse_member_p instead
7702         of GNUTYPE_SPARSE.
7703         Removed unused variables
7704         * src/list.c (decode_header): Use sparse_fixup_header to correct
7705         the st_size value.
7706         (print_header): Do not rely on GNUTYPE_SPARSE type.
7707         Use st->stat.st_size to print real file size.
7708         (skip_member): Assign stat_info.file_name to save_name. This fixes
7709         bug reported by Mads Martin Joergensen <mmj@suse.de>
7710         Use sparse_skip_file() to skip sparse members.
7711         * src/rtapelib.c: include "common.h"
7712         * src/sparse.c (struct tar_sparse_optab.sparse_member_p)
7713         (struct tar_sparse_optab.fixup_header): New member
7714         (tar_sparse_member_p): New function.
7715         (tar_sparse_init): Return true if decode_header is not provided
7716         (tar_sparse_fixup_header)
7717         (sparse_member_p,sparse_fixup_header)
7718         (sparse_skip_file)
7719         (oldgnu_sparse_member_p,oldgnu_fixup_header,star_sparse_member_p)
7720         (star_fixup_header, pax_sparse_member_p): New function
7721         (pax_decode_header): Remove
7722         * src/system.h: Include <sys/time.h> and <utime.h> when available
7723         * src/tar.c (usage): Prototype moved to common.h
7724         * src/tar.h (struct tar_stat_info.is_sparse): New member
7725         * src/utf8.c (utf8_convert): Changed prototype
7726         (get_input_charset): Removed unused variable
7727         * src/xheader.c: include <fnmatch.h>
7728         (size_decoder): Assign to both st->archive_file_size and
7729         st->stat.st_size.
7730         (st->stat.st_size): Assign to st->stat.st_size
7731         (sparse_numbytes_decoder): Removed unused variable
7732         * src/.cvsignore: Added .gdbinit
7733         * THANKS: Added Mads Martin Joergensen
7734
7735 2004-03-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7736
7737         * src/create.c (write_long_name): Do not allow more than
7738         NAME_FIELD_SIZE-1 characters in a file name for V7 format
7739         archives.
7740         * tests/longv7.sh: New file.
7741         * tests/Makefile.am: Add longv7.sh
7742
7743 2004-03-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7744
7745         * src/buffer.c (open_archive): Clear read_full_records_option
7746         if reading from a pipe.
7747         (short_read): Display warning about the deduced record size
7748         if version > 1
7749         * tests/star/pax-big-10g.sh: Updated to match the above changes.
7750         * tests/star/ustar-big-2g.sh: Likewise.
7751         * tests/star/ustar-big-8g.sh: Likewise.
7752
7753         * configure.ac: Added gl_FUNC_STRTOULL
7754         * src/create.c (start_header): Check for GNU_FORMAT
7755         if incremental_option is set.
7756         * src/xheader.c (to_decimal): New function.
7757         (xheader_format_name): Use to_decimal() instead of snprintf.
7758         * tests/listed01.sh: Use genfile instead of dd
7759         * tests/multiv01.sh: Likewise.
7760
7761 2004-03-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7762
7763         * src/list.c (read_and): Stop processing the archive after
7764         encountering a single zero record. Many old archives contain
7765         arbitrary garbage after it.
7766         The warning is issued anyway.
7767
7768 2004-03-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7769
7770         * src/rtapelib.c (rmt_lseek__,rmt_ioctl__): Bugfix. The
7771         conversion buffer was not null terminated. Fix provided
7772         by Leland Lucius <llucius@tiny.net>
7773         * THANKS: Added Leland Lucius
7774         * src/utf8.c (utf8_convert): Indentation fix.
7775
7776 2004-02-29  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7777
7778         * src/buffer.c (flush_read): Bugfix: the
7779         condition at line 714 included
7780
7781               || (status > 0 && !read_full_records_option)
7782
7783         which is grossly wrong, since even if new_volume() below succeeds,
7784         the subsequent call to rmtread will overwrite the chunk of data
7785         already read in the buffer and thus spoil everything.
7786         * src/system.c (sys_child_open_for_uncompress): Minor stylistic
7787         fix.
7788         * tests/star/multi-fail.sh: New test.
7789         * tests/Makefile.am: Added multi-fail.sh
7790         * tests/star/README: Updated
7791
7792 2004-02-29  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7793
7794         * NEWS: Updated
7795         * configure.ac: Removed spurious AC_CHECK_LIB(iconv)
7796         * src/common.h (utc_option): new global
7797         (enum old_files.KEEP_NEWER_FILES): New element
7798         * src/extract.c: Handle --keep-newer-files option
7799         * src/list.c (tartime): Print UTC if --utc was given.
7800         * src/tar.c: New options: --utc and keep-newer-files
7801
7802         * tests/Makefile.am: Added new tests
7803         * tests/after: Rewritten
7804         * tests/before: Rewritten
7805         * tests/preset.in: Rewritten
7806         * tests/delete03.sh: Accommodate for the new testsuite logic
7807         * tests/gzip.sh: Likewise
7808         * tests/incremen.sh: Likewise
7809         * tests/listed01.sh: Likewise
7810         * tests/multiv01.sh: Likewise
7811         * tests/old.sh: Likewise
7812         * tests/options.sh: Likewise
7813         * tests/version.sh: Likewise
7814         * tests/volume.sh: Likewise
7815
7816         * tests/star: New directory
7817         * tests/star/README: New file
7818         * tests/star/gtarfail.sh: New file
7819         * tests/star/gtarfail2.sh: New file
7820         * tests/star/pax-big-10g.sh: New file
7821         * tests/star/qucktest.sh: New file
7822         * tests/star/ustar-big-2g.sh: New file
7823         * tests/star/ustar-big-8g.sh: New file
7824
7825 2004-02-26  Paul Eggert  <eggert@twinsun.com>
7826
7827         * doc/tar.texi (dircategory Individual utilities): Append period,
7828         as suggested by Karl Berry.
7829
7830 2004-02-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7831
7832         * src/list.c (decode_header): Call xheader_decode before
7833         the assignment to current_stat_info.archive_file_size.
7834
7835 2004-02-23  Paul Eggert  <eggert@twinsun.com>
7836
7837         * configure.ac: Invoke AM_ICONV, to define ICONV_CONST if needed.
7838
7839 2004-02-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7840
7841         1.13.93 released.
7842
7843         * NEWS: Updated
7844         * tests/before: Move testing of the prerequisite archive formats
7845         to the separate function 'prereq'. Do not expect any arguments
7846         * tests/delete03.sh: Use prereq() instead of passing arguments
7847         to 'before'.
7848         * tests/incremen.sh: Likewise.
7849         * tests/listed01.sh: Likewise.
7850         * tests/multiv01.sh: Likewise.
7851
7852 2004-02-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7853
7854         Added UTF-8 support. Finished global extended header
7855         support.
7856
7857         * NEWS: Minor fix
7858         * configure.ac: Detect libiconv
7859         * src/utf8.c: New file. Conversions to and from utf-8.
7860         * src/Makefile.am: Added utf8.c
7861         * src/create.c (write_header_name) In pax format, use
7862         "path" keyword if the file name is not ASCII
7863         (start_header): Likewise for uname and gname.
7864         * src/list.c: Decode encountered global headers.
7865         * src/xheader.c: Use keywords from the global
7866         headers.
7867         Correctly handle UTF-8 conversions.
7868         (xheader_list_destroy): New function.
7869         (xheader_set_single_keyword,xheader_set_keyword_equal): Added
7870         missing gettext markers
7871         (decode_record): Rewritten using caller-provided handler and
7872         data closure.
7873         * tests/listed01.sh: Give credit to Andreas Schuldei.
7874
7875 2004-02-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7876
7877         * src/create.c (dump_file0): The conditional at line
7878         1296 prevented incremental backups on individual files
7879         from working, as reported by Andreas Schuldei
7880         <andreas@schuldei.org>.
7881
7882         This is due to the condition
7883
7884           (0 < top_level || !incremental_option)
7885
7886         Removing it makes incremental backups work for individual
7887         files as well as for directories. On the other hand, it does
7888         not affect other functionality, as shown by the reasoning below:
7889
7890         To begin with, the two parts of this condition are mutually
7891         superfluous, because
7892
7893           1) when top_level < 0, incremental_option == 1
7894           so the condition yields false
7895           2) when top_level >= 0, incremental_option == 0
7896           so the condition yields true.
7897
7898         In other words, it is completely equivalent to
7899
7900               (!incremental_option)
7901
7902         Now, let's consider the effect of its removal. There are two cases:
7903
7904         1) when incremental_option==1
7905         This means incremental backup in progress. In this case dump_file
7906         is invoked only for directories or for files marked with 'Y' by
7907         get_directory_contents. The latter are those that did not meet the
7908         condition in incremen.c:242, which is exactly the same condition
7909         as this at create.c:1296. So, for these files the check
7910         (!incremental_option) is useless, since the rest of the
7911         conditional will yield false anyway. On the other hand, if
7912         dump_file is invoked on a directory, the conditional will yield
7913         false due to !S_ISDIR assertion, so these will be processed as usual.
7914
7915         Thus, for this case the extra condition (!incremental_option) is
7916         irrelevant, and its removal won't alter the behavior of tar,
7917         *except* that it will enable incremental backups on individual
7918         files, which is the wanted effect.
7919
7920         2) when incremental_option==0
7921         In this case the condition yields true and its removal does not
7922         affect the functionality.
7923
7924         * THANKS: Updated
7925         * configure.ac: Raised patchlevel to 93
7926         * src/incremen.c: Minor stylistic fixes.
7927         * tests/listed01.sh: New test. Check listed incremental
7928         backups on individual files.
7929         * tests/Makefile.am: Added listed01.sh
7930
7931 2004-02-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7932
7933         * src/common.h (simple_finish_header,start_private_header): New
7934         declarations
7935         (xheader_ghdr_name): Changed declaration
7936         * src/create.c (start_private_header): Removed static qualifier.
7937         (write_extended): Removed superfluous last argument. Use
7938         xheader_write()
7939         (simple_finish_header): New function.
7940         (finish_header): Use simple_finish_header() to break recursive
7941         dependency between this function and write_extended().
7942         * src/tar.c (assert_format): Do not bail out if several
7943         --format arguments are given. This is a common case when
7944         TAR_OPTIONS are used.
7945         (decode_options): New option --show-defaults displays the
7946         compiled-in defaults.
7947         Use POSIX format if no --format option was given and
7948         --pax-option was specified.
7949         Do not allow to use --pax-option unless the archive format is
7950         set to POSIX (or reading subcommand is requested).
7951
7952         * src/update.c (update_archive): Write global extended header if
7953         constructed.
7954         * src/xheader.c (xheader_format_name): Bugfix.
7955         (xheader_xhdr_name): Changed the default extended header name
7956         to '%d/PaxHeaders.%p/%f', as POSIX requires.
7957         (xheader_ghdr_name): Removed unused argument.
7958         (xheader_write,xheader_write_global): New function.
7959         (xheader_decode): Modified to honor overrides whatever
7960         the current archive format is.
7961
7962         * src/delete.c (delete_archive_members): Call xheader_decode
7963         unconditionally.
7964         * src/list.c (decode_header): Likewise.
7965         * src/incremen.c (sort_obstack): Fixed typo in the comment
7966
7967         * doc/tar.texi: Document new default for extended
7968         header names.
7969
7970         * tests/before: Accept an optional list of allowed archive
7971         formats. Exit with the status 77 if the current archive
7972         format does not match any of them.
7973         * tests/delete03.sh: Require gnu, oldgnu or posix format
7974         * tests/incremen.sh: Require gnu or oldgnu format
7975         * tests/multiv01.sh: Likewise
7976
7977 2004-02-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7978
7979         * doc/tar.texi (Option Summary): Documented --pax-option
7980         * src/tar.c: Likewise.
7981         * NEWS: Likewise.
7982         * src/create.c (to_chars): Added a comment.
7983         * src/tar.h: Comment to GNU_FORMAT
7984
7985 2004-02-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7986
7987         * README: Updated
7988         * configure.ac: Added stpcpy
7989         * bootstrap: Likewise
7990         * lib/Makefile.am: Likewise
7991         * src/common.h (xheader_xhdr_name,xheader_ghdr_name): New
7992         functions
7993         * src/create.c (write_extended): Call xheader_xhdr_name
7994         instead of using hardcoded "././@PaxHeader" name.
7995         * src/tar.c: New option --pax-option (equivalent to -o option
7996         of pax).
7997         * src/xheader.c: Implement pax -o option. Fixed misleading
7998         heading comment (introduced 2003-09-02).
7999         * src/incremen.c: Minor fixes
8000         * m4/.cvsignore: Updated
8001
8002 2004-02-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8003
8004         * src/incremen.c: Removed accumulator stuff in favor of obstack.
8005         (get_directory_contents): Split into two functions
8006         * src/update.c: Minor changes
8007         * doc/tar.texi: Fixed typo
8008
8009 2004-02-15  Paul Eggert  <eggert@twinsun.com>
8010
8011         Fix Debian bug 230872, originally reported by Jeff King in
8012         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=230872>.
8013
8014         * doc/tar.texi (posix compliance): Remove.  The whole section
8015         was a misunderstanding of what POSIXLY_CORRECT is supposed to
8016         mean.  The GNU Coding Standards says that POSIXLY_CORRECT
8017         is for disabling extensions that are incompatible with POSIX:
8018         it is not for disabling compatible extensions.  All references
8019         to this section removed.
8020         (posix): This format is created only if the posix format is
8021         specified; it is no longer created if gnu format is specified
8022         and POSIXLY_CORRECT is set.
8023         * src/tar.c (decode_options): Ignore POSIXLY_CORRECT.
8024         POSIX does not specify the behavior of tar, so we should
8025         not worry about POSIXLY_CORRECT here.
8026
8027 2004-01-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8028
8029         * Makefile.am: Removed m4
8030         * configure.ac: Require automake-1.8/autoconf-2.59. Removed
8031         m4/Makefile.
8032         * README-alpha: Updated
8033         * bootstrap: Updated TP URL, improved help output. Default
8034         to :ext:anoncvs and set CVS_RSH, unless already set.
8035         * m4/Makefile.am: Removed
8036
8037 2004-01-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8038
8039         * bootstrap: Bugfix by Marco Gerards <metgerards@student.han.nl>:
8040         Use $option instead of $1 so all options will be parsed.
8041
8042 2004-01-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8043
8044         Started rewriting buffer.c ...
8045
8046         * bootstrap: New option --no-po
8047         * src/buffer.c (new_volume,check_label_pattern): Changed return type.
8048         (time_to_start_writing): Changed data type
8049         (file_to_switch_to): Removed. Variable never assigned to.
8050         (open_archive) Moved option compatibility checks to tar.c
8051         Other minor changes.
8052         * src/common.h (maybe_backup_file): Changed return type
8053         * src/misc.c: Likewise.
8054         * src/create.c: Updated invocations of safer_name_suffix
8055         * src/extract.c: Likewise
8056         * src/delete.c: Updated assignment to write_archive_to_stdout
8057         * src/tar.c (decode_options): More option compatibility checks
8058         (moved from buffer.c)
8059         * src/update.c (time_to_start_writing): Changed data type.
8060         * tests/recurse.sh: New test case.
8061         * tests/mksparse.c: New file.
8062         * tests/Makefile.am: Added recurse.sh and mksparse.c
8063
8064 2004-01-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8065
8066         * src/sparse.c (sparse_diff_file): Bugfix. Thanks
8067         Martin Simmons for the patch.
8068         * src/create.c (dump_dir0): Bugfix. Thanks Piotr Czerwinski
8069         <pius@pld-linux.org> for the patch.
8070
8071 2003-12-26  Paul Eggert  <eggert@twinsun.com>
8072
8073         Synchronize with Gettext 0.13.1, Automake 1.8, Autoconf 2.59,
8074         and translation website.
8075
8076         * bootstrap: Don't bother skipping codeset.m4, glibc21.m4,
8077         intdiv0.m4, inttypes_h.m4, inttypes.m4, inttypes-pri.m4,
8078         isc-posix.m4, and lcmessage.m4 from gnulib.  This list of files is
8079         a bit obsolete anyway, now that gettext 0.13.1 is out.  Also, the
8080         files are replaced by autoreconf.  Also, there seems to be a bug
8081         in gettext/autoconf/automake if we try to omit these files after
8082         autoreconf has replaced them, even though the gettext manual says
8083         they're optional.  So give up and just include them for now, even
8084         though they make 'configure' longer and slower.
8085
8086         Change translation URL from
8087         <http://www.iro.umontreal.ca/contrib/po/maint/tar/> to
8088         <http://www2.iro.umontreal.ca/~gnutra/po/maint/tar/> to
8089         accommodate translator website revamp.
8090
8091         Fail if autoreconf fails.
8092
8093         * m4/.cvsignore: Add intmax.m4, longdouble.m4, printf-posix.m4,
8094         signed.m4, size_max.m4, wchar_t.m4, wint_t.m4, xsize.m4, to
8095         ignore files now supplied by gettext 0.13.1.
8096
8097 2003-12-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8098
8099         Synchronized with the backup repository on Mirddin
8100
8101 2003-12-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8102
8103         * configure.ac: Check for varios members of struct stat
8104         that may represent file modification times with a subsecond
8105         precision.
8106         Check for utimes (for future use)
8107         * src/buffer.c (short_read): Issue a warning on short reads.
8108         * src/common.h (sys_stat_nanoseconds): New function
8109         * src/create.c (dump_file0): Use sys_stat_nanoseconds().
8110         * src/list.c (read_and): Treat only two successive zero
8111         filled blocks as an EOF indicator. Issue a warning if
8112         a single one is encountered.
8113         * src/system.c (sys_stat_nanoseconds): New function
8114         * src/tar.h (tar_stat_info.atime_nsec,mtime_nsec,ctime_nsec): New
8115         members.
8116         * src/xheader.c (code_time,decode_time): Support for subsecond
8117         precision.
8118         (atime_coder,atime_decoder,ctime_coder,ctime_decoder)
8119         (mtime_coder,mtime_decoder): Update invocations of code_time and
8120         decode_time.
8121         (gid_decoder,size_decoder,uid_decoder,sparse_size_decoder)
8122         (sparse_numblocks_decoder,sparse_offset_decoder)
8123         (sparse_numbytes_decoder): Updated
8124
8125 2003-12-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8126
8127         * src/names.c (safer_name_suffix): Reverted change made
8128         2003-11-14. Reason: Discussion with Paul Eggert and
8129         Jean-Louis Martineau. See also ChangeLog entry from
8130         1999-08-14.
8131         * tests/delete03.sh: Likewise.
8132         * tests/extrac04.sh: Likewise.
8133         * tests/multiv01.sh: Likewise.
8134
8135 2003-12-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8136
8137         * src/incremen.c (write_directory_file): Use sys_truncate
8138         * src/list.c (print_header): Use archive_file_size member
8139         when printing real file size.
8140         * src/sparse.c (sparse_scan_file): Correctly handle files with
8141         a hole at the end.
8142         (sparse_dump_region,sparse_extract_region): Allow for zero size
8143         trailing blocks
8144
8145 2003-12-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8146
8147         * configure.ac: Raised version number to 1.13.92
8148         * src/list.c (decode_header): Discern between pax and ustar
8149         formats
8150         Initialize current_stat_info.archive_file_size.
8151
8152         NOTE: Modifications from this date on are temporarily
8153         stored on local CVS on mirddin. This repository will
8154         be synchronized with Savannah as soon as the latter
8155         becomes operational again.
8156
8157 2003-12-01  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8158
8159         * TODO: Updated
8160         * src/sparse.c: Initial implementation of GNU/pax sparse
8161         file format.
8162         * src/common.h (xheader_store): Changed prototype.
8163         * src/create.c: Update calls to xheader_store
8164         * src/extract.c (extract_archive): Check reported size vs.
8165         archive file size to determine if we have to do with a
8166         sparse file.
8167         * src/tar.c (usage): Cleaned up the sample argument to --newer
8168         option.
8169         (decode_options): Allow --sparse for POSIX_FORMAT archives.
8170         * src/xheader.c (struct xhdr_tab.coder; all coder function): Added
8171         extra argument
8172         Implemented GNU.sparse.* keywords.
8173
8174 2003-11-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8175
8176         * configure.ac: Check for setlocale. Thanks Bruno Haible for
8177         reporting.
8178
8179 2003-11-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8180
8181         * src/create.c (write_gnu_long_link): Use oldgnu
8182         magic with @LongLink blocks.
8183
8184 2003-11-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8185
8186         * src/tar.h: Support for star sparse format.
8187         * src/sparse.c: Likewise.
8188
8189 2003-11-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8190
8191         * src/sparse.c (sparse_diff_file): New function
8192         * src/common.h (sys_compare_uid,sys_compare_gid): New functions
8193         (sys_compare_uid_gid): Removed.
8194         (sys_compare_links,report_difference): Changed prototype
8195         (sparse_diff_file): New function
8196         * src/system.c (sys_compare_uid,sys_compare_gid): New functions
8197         (sys_compare_uid_gid): Removed.
8198         (sys_compare_links): Changed declaration
8199         * src/compare.c (diff_archive): Use sparse_diff_file.
8200
8201 2003-11-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8202
8203         Rewritten sparse file handling.
8204
8205         * src/sparse.c: New file. Provides a universal framework
8206         for various methods for sparse files handling.
8207         * src/Makefile.am: Added sparse.c
8208         * src/common.h (struct sp_array,sparsearray,sp_array_size)
8209         (init_sparsearray,fill_in_sparse_array): Removed
8210         (enum dump_status): New data type
8211         (pad_archive,close_diag,open_diag,read_diag_details)
8212         (readlink_diag,savedir_diag,seek_diag_details,stat_diag): New
8213         functions.
8214         (sparse_file_p,sparse_dump_file,sparse_extract_file): New
8215         functions.
8216         (print_header): Changed prototype declaration.
8217         * src/tar.h (struct sp_array): Declaration from common.h
8218         (struct tar_stat_info): New members archive_file_size,
8219         sparse_map_avail,sparse_map.
8220         * src/create.c: Major rewrite.
8221         * src/extract.c: Use new sparse file interface.
8222         * src/compare.c (diff_sparse_files): Temporary placeholder.
8223
8224         * src/buffer.c: Minor changes
8225         * src/tar.c: Likewise.
8226         * src/list.c: Likewise.
8227         * src/misc.c (close_diag,open_diag,read_diag_details)
8228         (readlink_diag,savedir_diag,seek_diag_details,stat_diag): New
8229         diagnostics functions.
8230         * src/incremen.c: Use new diagnostics functions.
8231         * src/names.c: Likewise.
8232
8233 2003-11-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8234
8235         * configure.ac: Fixed check for setsockopt
8236
8237         * src/create.c: Do not zero-terminate name field if
8238         the name is exactly 100 characters long.
8239         (write_ustar_long_name): Fixed cheking for unsplittable
8240         names.
8241
8242 2003-11-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8243
8244         * src/create.c (start_header): Removed debugging hook
8245         (dump_file): Fixed handling of linkname field.
8246         * src/names.c (safer_name_suffix): If the input
8247         file name ends with a slash, output one should do so
8248         as well.
8249         * doc/tar.texi: Documented --format=ustar
8250
8251 2003-11-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8252
8253         * src/tar.h (archive_format): USTAR_FORMAT: New type.
8254         * src/create.c: Added POSIX.1-1988 support.
8255         * src/names.c (safer_name_suffix): Skip leading ./
8256         * src/tar.c: New option --format=ustar forces
8257         POSIX.1-1988 archive format.
8258         * tests/delete03.sh: Updated.
8259         * tests/extrac04.sh: Updated.
8260         * tests/multiv01.sh: Updated.
8261
8262 2003-11-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8263
8264         * src/list.c (read_and): Initialize current_stat_info
8265         and extended_header at the start of the loop.
8266         * src/names.c (all_names_found): Check if the argument
8267         contains valid filename. Fixes coredump on `not_a_tar_file'
8268         * src/xheader.c (atime_decoder,gid_decoder,ctime_decoder)
8269         (mtime_decoder,size_decoder,uid_decoder): Use xstrtoumax.
8270         Fixes `pax-big-10g' bug.
8271
8272 2003-11-12  Paul Eggert  <eggert@twinsun.com>
8273
8274         Fix some C compatibility bugs reported by Joerg Schilling.
8275
8276         * src/common.h (stripped_prefix_len): Fix misspelling
8277         "stripped_path_len" in declaration.
8278         * src/rmt.c (main): Use "return FOO;" rather than
8279         "exit (FOO);"; we no longer have to worry about
8280         pre-ANSI hosts that mishandled returned values from "main".
8281         * src/tar.c (main): Likewise.  This avoids warnings on some
8282         compilers.
8283         * src/system.c: Include signal.h, for 'kill'.
8284         * src/system.h (DEV_BSIZE): Remove.
8285         (DEFAULT_ST_BLKSIZE): New macro.
8286         (ST_BLKSIZE): Use it, instead of DEV_BSIZE.
8287         * src/tar.c (enum): Remove comma just before }.
8288
8289 2003-11-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8290
8291         * src/list.c (decode_header): Initialize st_atime and
8292         st_ctime.
8293
8294 2003-11-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8295
8296         * configure.ac (tar_save_LIBS): Bugfix. Thanks Adrian
8297         Bunk <bunk@fs.tum.de> for reporting.
8298         * doc/tar.texi: Fixed spelling. Thanks Martin Buchholz
8299         <martin@xemacs.org> for spotting.
8300
8301 2003-11-04  Paul Eggert  <eggert@twinsun.com>
8302
8303         * src/xheader.c (xhdr_tab): Make it extern, not static, as C89 and
8304         C99 require this.
8305
8306 2003-10-26  Paul Eggert  <eggert@twinsun.com>
8307
8308         * src/system.c (sys_spawn_shell): Cast trailing null to (char *).
8309         Bug reported by Christian Weisgerber.
8310
8311 2003-10-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8312
8313         * AUTHORS: Updated
8314         * NEWS: Updated
8315         * src/tar.c (decode_options): Removed superfluous archive format
8316         check
8317         * doc/tar.texi: Documented new features.
8318
8319 2003-10-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8320
8321         * NEWS: Updated
8322         * THANKS: Added Wojciech Polak
8323         * configure.ac: Added checks for missing functions. Raised
8324         version number to indicate alpha release.
8325         * lib/Makefile.am: Added missing headers
8326         * lib/waitpid.c: Added missing includes.
8327         * src/extract.c: Likewise.
8328         * src/names.c: Removed spurious includes.
8329         * src/xheader.c: Likewise.
8330         * src/system.h [MSDOS]: Fixed spelling of EACCES. Added
8331         macro overriding broken mkdir prototypes.
8332
8333 2003-10-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8334
8335         * configure.ac: Check for dev_t and ino_t.
8336         * m4/Makefile.am: Added missing files.
8337         * src/system.c: New file.
8338         * src/Makefile.am: Added system.c
8339         * src/common.h: Prototypes for functions from system.c
8340         * src/system.h (SET_BINARY_MODE, ERRNO_IS_EACCESS): New defines
8341         * src/buffer.c: Moved system dependencies to system.c
8342         * src/compare.c: Likewise.
8343         * src/create.c: Likewise.
8344         * src/delete.c: Likewise.
8345         * src/extract.c: Likewise.
8346         * src/rtapelib.c: Likewise.
8347
8348 2003-10-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8349
8350         Implemented --occurrence option.
8351
8352         * NEWS: Updated.
8353         * src/tar.c: New option --occurrence.
8354         * src/common.h (occurrence_option): New global
8355         (struct name): Changed `found' member to `uintmax_t
8356         found_count'.
8357         (names_done): Removed
8358         (all_names_found): Changed prototype.
8359         (ISFOUND,WASFOUND): New macros
8360         * src/delete.c (delete_archive_members): Honor --occurrence
8361         option.
8362         * src/list.c (read_and): Likewise.
8363         * src/names.c: Count number of occurrences of each name in the
8364         archive.
8365         (name_match): Honor --occurrence option.
8366         (names_done): Removed
8367         (all_names_found,names_notfound): Rewritten.
8368
8369 2003-10-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8370
8371         * src/tar.c: Removed extra precaution regarding
8372         subcommand_option == CAT_SUBCOMMAND
8373         * lib/Makefile.am: Updated
8374
8375 2003-10-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8376
8377         * src/common.h (names_done): New function.
8378         * src/names.c: Likewise.
8379         * src/list.c (read_and): Use all_names_found() as `while'
8380         condition.
8381         * src/tar.c: New option --first-copy
8382         * NEWS: Updated
8383
8384 2003-09-24  Paul Eggert  <eggert@twinsun.com>
8385
8386         * src/rmt.c (main): Don't translate Copyright string; international
8387         law says the word "Copyright" should be in English.
8388         * src/tar.c (decode_options): Likewise.
8389
8390 2003-09-22  Paul Eggert  <eggert@twinsun.com>
8391
8392         * doc/tar.texi (extracting untrusted archives): New section.
8393
8394         * src/common.h (stripped_path_len): Renamed from cut_path_elements.
8395         Return size_t, not pointer, so that we don't have to worry about
8396         violating the C standard by converting char const * to char *.
8397         All callers changed.
8398         * src/names.c (stripped_path_len): Likewise.  Strip file system
8399         prefix, too.  Count adjacent slashes as if they were one slash;
8400         that is the POSIX standard.
8401
8402 2003-09-17  Paul Eggert  <eggert@twinsun.com>
8403
8404         * README-alpha: Document maintainer tool assumptions a bit.  GNU
8405         'sed' is no longer required.  For GNU m4 1.4, suggest the patch in
8406         Debian bug 211447.  Fix minor misspellings/whitespace nits.
8407
8408         * configure.ac (AC_AIX, AC_MINIX): Remove; subsumed by
8409         gl_USE_SYSTEM_EXTENSIONS.
8410
8411         * lib/.cvsignore: Add exit.h, time_r.c, time_r.h.
8412         * m4/.cvsignore: Add restrict.m4, time_r.m4.
8413
8414 2003-09-17  Paul Eggert  <eggert@twinsun.com>
8415
8416         * bootstrap: Don't use "for option; do";
8417         Solaris 8 /bin/sh doesn't like that.
8418
8419 2003-09-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8420
8421         * README-alpha: Updated
8422         * bootstrap: Updated
8423
8424 2003-09-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8425
8426         * README-alpha: Updated
8427         * bootstrap: Updated
8428         * po/POTFILES.in: Added src/xheader.c
8429         * src/common.h (cut_path_elements): Added proto.
8430
8431 2003-09-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8432
8433         * src/buffer.c: Use ngettext where appropriate.
8434         * src/compare.c: Likewise.
8435         * src/create.c: Likewise.
8436         * src/misc.c: Likewise.
8437         * src/tar.c: Likewise.
8438         * src/update.c: Likewise.
8439
8440 2003-09-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8441
8442         * .cvsignore: Added *.shar.gz
8443         * NEWS: Updated
8444         * TODO: Updated
8445         * src/common.h (strip_path_elements): New variable.
8446         * src/extract.c (extract_archive): Implemented --strip-path
8447         * src/names.c (cut_path_elements): New function.
8448         * src/tar.c: New option --strip-path=NUM.
8449         (decode_options) Assign boolean values to bool variables.
8450
8451 2003-09-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8452
8453         * src/delete.c: Fixed deletion from the POSIX archives.
8454         * src/list.c (read_header): Minor change.
8455         * src/tar.c (main): Do not check for volume_label_option
8456         if subcommand_option is not CREATE_SUBCOMMAND.
8457         * src/xheader.c (xheader_decode): Store the header as
8458         well (for eventual delete).
8459
8460         * tests/incremen.sh: Explicitly request GNU format. This will
8461         disappear when GNU extended header keywords are working.
8462         * tests/multiv01.sh: Likewise
8463         * tests/volume.sh: Likewise
8464
8465 2003-09-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8466
8467         * src/create.c: Support for "linkpath" extended keyword.
8468         * src/xheader.c (decode_record): Reversed the return
8469         condition.
8470
8471 2003-09-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8472
8473         * configure.ac: Allow to redefine the default output format.
8474         * src/tar.c: Use DEFAULT_ARCHIVE_FORMAT macro
8475         (archive_format_string): New function.
8476         (usage): Updated help output.
8477         * README: Updated.
8478         * NEWS: Updated.
8479         * TODO: Updated.
8480
8481 2003-09-02  Paul Eggert  <eggert@twinsun.com>
8482
8483         * src/common.h (destroy_stat, xheader_decode, xheader_store,
8484         xheader_read, xheader_finish, xheader_destroy): Add decls;
8485         C99 requires this.
8486
8487         * src/create.c (write_extended): Remove unused local 'bufsize'.
8488
8489         * src/delete.c (delete_archive_members): Handle case of
8490         HEADER_SUCCESS_EXTENDED followed by HEADER_FAILURE.
8491         * src/list.c (read_and): Abort if HEADER_SUCCESS_EXTENDED
8492         occurs, as it's not possible.
8493         * src/update.c (update_archive): Likewise.
8494
8495         Use "const" when possible in new code.
8496         * src/tar.c (struct fmttab.name): Now char const *.  All uses changed.
8497         (fmttab): Now const.  All uses changed.
8498         * src/xheader.c (struct xhdr_tab.keyword): Now pointer to const.
8499         (struct xhdr_tab.coder, struct xhdr_tab.decoder, locate_handler,
8500         decode_record, xheader_store, xheader_print, code_string, code_time,
8501         code_num, dummy_coder, dummy_decoder, atime_coder, atime_decoder,
8502         gid_coder, gid_decoder, gname_coder, gname_decoder, linkpath_coder,
8503         linkpath_decoder, ctime_coder, ctime_decoder, mtime_coder,
8504         mtime_decoder, path_coder, path_decoder, size_coder, size_decoder,
8505         uid_coder, uid_decoder, uname_coder, uname_decoder):
8506         Use pointers to const when possible.
8507         (xhdr_tab): Now const.
8508
8509         * src/tar.c (fmttab): Avoid GCC warning by not eliding initializers.
8510         (set_archive_format): Report an error if no format name matches,
8511         instead of returning an undefined value.
8512
8513         * src/xheader.c (struct xhdr_tab.decoder, dummy_decoder,
8514         atime_decoder, gid_decoder, gname_decoder, linkpath_decoder,
8515         ctime_decoder, mtime_decoder, path_decoder, size_decoder,
8516         uid_decoder, uname_decoder): Remove unused keyword arg.
8517         All uses changed.
8518
8519         * src/tar.c (set_archive_format): Now static.
8520         * src/xheader.c (xhdr_tab, format_uintmax): Now static.
8521
8522         * src/xheader.c (dummy_coder, dummy_decoder, atime_coder,
8523         atime_decoder, gid_coder, gid_decoder, gname_coder, gname_decoder,
8524         linkpath_coder, linkpath_decoder, mtime_coder, mtime_decoder,
8525         ctime_coder, ctime_decoder, path_coder, path_decoder, size_coder,
8526         size_decoder, uid_coder, uid_decoder, uname_coder, uname_decoder):
8527         Remove forward decls; no longer needed.
8528         (xhdr_tab): Move to end, so that the forward decls aren't needed.
8529         Add a forward declaration.
8530
8531         Use 'bool' in new code, when appropriate.
8532         * src/xheader.c (decode_record): Return bool, not int.
8533         * src/common.h (read_header): Since it accepts bool, change
8534         all callers to use false and true rather than 0 and 1.
8535
8536         * src/xheader.c (decode_record): Fix misspelling in diagnostic
8537         "extended headed" -> "extended header".
8538
8539         GNU coding style fixes.
8540         * src/xheader.c (decode_record, xheader_decode):
8541         Do not use decls like "char *p, *q;".
8542
8543         Minor style fixes.
8544         (xheader_store): Avoid parentheses around object operand of sizeof.
8545
8546 2003-09-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8547
8548         * src/create.c (start_header): Store long file names
8549         in "path" keyword of an extended header if in POSIX
8550         mode.
8551         (finish_header): print header before calling write_extended().
8552         * src/list.c (list_archive): Always decode the header. This
8553         is necessary so the extended header is processed and the correct
8554         filename is printed no matter what the state of verbose_option.
8555         * src/xheader.c (xhdr_tab): Reserved GNU keywords (commented out
8556         for the time being).
8557
8558 2003-09-01  Paul Eggert  <eggert@twinsun.com>
8559
8560         Update from gnulib, and correct fnmatch to fnmatch-gnu.
8561         * bootstrap (gnulib_modules): Change fnmatch to fnmatch-gnu.
8562         Sort.
8563         * configure.ac (gl_USE_SYSTEM_EXTENSIONS): Use this instead
8564         of AC_GNU_SOURCE.
8565         * lib/.cvsignore: Add alloca.h, stdbool.h.  Sort.  Append newline.
8566         * lib/Makefile.am (lib_OBJECTS): New macro, for convenience when
8567         copying rules from gnulib module descriptions.
8568         (BUILT_SOURCES, EXTRA_DIST, all-local, alloca.h):
8569         Update from gnulib modules alloca, fnmatch, getline, stdbool.
8570         * m4/.cvsignore: Add utimes-null.m4.  Sort.
8571
8572 2003-09-01  Sergey Poznyakoff
8573
8574         Added initial support for creating POSIX headers.
8575
8576         * src/common.h (MAXOCTAL11,MAXOCTAL7): New defines
8577         (string_to_chars): New functions
8578         (struct xheader): Changed structure
8579         (gid_to_gname,gname_to_gid,uid_to_uname,uname_to_uid): Changed
8580         prototypes.
8581         * src/create.c (string_to_chars): New function.
8582         (write_extended): New function
8583         (start_header): Create extended POSIX headers if necessary.
8584         (finish_header): Likewise.
8585         * src/list.c (print_header): Take user/group from
8586         current_stat_info.
8587         * src/names.c (gid_to_gname,gname_to_gid)
8588         (uid_to_uname,uname_to_uid): Changed prototypes.
8589         * src/tar.c: New option --format.
8590         * src/tar.h (OLDGNU_COMPATIBILITY): Removed
8591         (struct extra_header): Removed unused structure.
8592         (union block.extra_header): Removed unused member.
8593         * src/xheader.c: Implemented coder functions.
8594         * bootstrap: Added obstack.
8595         * lib/.cvsignore: Likewise.
8596         * configure.ac: Added 'gl_OBSTACK'
8597         * m4/Makefile.am: Added new files.
8598         * m4/.cvsignore: Likewise.
8599         * TODO: Minor formatting change
8600
8601 2003-08-31  Sergey Poznyakoff
8602
8603         Added initial support for POSIX extended and STAR headers
8604         (only for listing/extracting).
8605
8606         * src/xheader.c: New file.
8607         * src/Makefile.am: Added xheader.c
8608         * src/tar.h (struct star_header): New datatype
8609         (XHDTYPE,XGLTYPE): New defines
8610         (enum archive_format:STAR_FORMAT): New member
8611         (struct tar_stat_info): New datatype.
8612         (union block.star_header): New member.
8613         * src/common.h (orig_file_name,current_file_name)
8614         (current_trailing_slash,current_link_name): Removed variables.
8615         (current_stat_info): New variable
8616         (current_stat): Removed
8617         (extended_header): New variable
8618         (decode_header): Changed prototype.
8619         * src/list.c (decode_header): Added initial support for POSIX extended
8620         and STAR headers.
8621         (skip_member): Check oldgnu_header only if current_format is set
8622         to OLDGNU_FORMAT.
8623         * src/buffer.c: Use current_stat_info
8624         * src/compare.c: Likewise.
8625         * src/create.c: Likewise.
8626         * src/delete.c: Likewise.
8627         * src/incremen.c: Likewise.
8628         * src/mangle.c: Likewise.
8629         * src/update.c: Likewise.
8630         * src/extract.c: Likewise.
8631         (make_directories): Improved check for the existence of the directory
8632         * src/tar.c (destroy_stat): New function.
8633
8634 2003-08-29  Paul Eggert  <eggert@twinsun.com>
8635
8636         * NEWS, bootstrap: Drop en_GB locale; it was more trouble than it
8637         was worth (e.g., different users in en_GB disagree about -ize
8638         versus -ise).
8639         * po/en_GB.po: Remove.
8640
8641 2003-07-28  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8642
8643         * TODO: Updated
8644         * NEWS: Updated
8645         * src/tar.c: Removed support for the obsolete command line
8646         options.
8647         * doc/tar.texi: Removed references to the obsolete command
8648         line options.
8649
8650 2003-07-27  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8651
8652         * TODO: Updated
8653         * NEWS: Updated
8654         * doc/tar.texi: Updated
8655         * src/common.h (check_links_option): New variable
8656         (orig_file_name): New variable
8657         (check_links): New proto.
8658         * src/create.c (struct link.nlink): New member
8659         (link_table): Static for the module.
8660         (dump_file): Update `link' member when adding new links
8661         to the link_table.
8662         (check_links): New function.
8663         * src/list.c (print_header): Use orig_file_name.
8664         * src/tar.c: New option --check-links. Changed semantics of
8665         -o to comply to UNIX98 when extracting and to its previous
8666         semantics otherwise.
8667         (main): Call check_links if --check-links. was given.
8668
8669 2003-07-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8670
8671         * src/list.c (print_header): Revised
8672         * NEWS: Started the entry for 1.13.26
8673         * doc/Makefile.am (tar.dvi): Fixed TEXINPUTS value.
8674
8675 2003-07-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8676
8677         * .cvsignore: Added to the repository.
8678         * doc/.cvsignore: Likewise.
8679         * lib/.cvsignore: Likewise.
8680         * m4/.cvsignore: Likewise.
8681         * po/.cvsignore: Likewise.
8682         * scripts/.cvsignore: Likewise.
8683         * src/.cvsignore: Likewise.
8684         * tests/.cvsignore: Likewise.
8685
8686         * lib/Makefile.am: Added exitfail.[hc]
8687         * src/misc.c (chdir_do): Fixed call to restore_cwd
8688         * src/buffer.c (flush_read): Fixed behavior on short
8689         reads right after opening the new archive (multiv01.sh test).
8690         (new_volume): Special handling for "-".
8691         * src/list.c (print_header): Print trailing slash if
8692         current_trailing_slash was set (extrac03.sh,extrac04.sh tests).
8693         * tests/multiv01.sh: Minor changes.
8694         * m4/Makefile.am: Added missing files.
8695
8696 2003-07-05  Paul Eggert  <eggert@twinsun.com>
8697
8698         Finish the checkin begin yesterday.
8699
8700         * NEWS: Document the user-visible changes installed in the last
8701         two days.
8702
8703         * TODO: New file (actually, resurrected; but with new contents).
8704
8705         * src/list.c (read_and): Give full type for procedure arg.
8706         (read_header): Strip trailing slashes, setting current_trailing_slash.
8707         (tartime): Avoid int overflow when printing year (!).
8708         (print_header): New arg specifying block ordinal.  All uses changed.
8709         Print link as 'h' type.  Give labels for long links and names.
8710
8711         * src/misc.c (contains_dot_dot): Moved to names.c
8712         (must_be_dot_or_slash): New function.
8713         (safer_rmdir): Use it.
8714         (remove_any_file): Now takes enum as option, not boolean.
8715         Check for (Linux) EISDIR as well as (POSIX) EPERM when attempting
8716         to unlink a directory.
8717         (deref_stat): Accept bool, not int.
8718
8719         * src/names.c (namelist_match): Allow partial matches only if
8720         recursive.
8721         (hash_string_hasher): Renamed from hash_avoided_name.
8722         (hash_string_compare): Renamed from compare_avoided_anames.
8723         (hash_string_insert, hash_string_lookup): New functions.
8724         (add_avoided_name, is_avoided_name): Use them.
8725         (safer_name_suffix): New function.
8726         (contains_dot_dot): Moved here from misc.c.  Now returns bool, not int.
8727
8728         * src/rmt.c: Don't include print-copyr.h.
8729         (prepare_input_buffer): New arg FD.
8730         Do not read more than INT_MAX bytes at once,
8731         since it breaks on some brain damaged Tru64 hosts.
8732         Divide size by two
8733         when retrying instead of subtracting 1024; for speed.
8734         (main): Use gettext to translate (C), not print_copyright.
8735
8736         * src/system.h: Include <alloca.h> and <stdbool.h> unconditionally,
8737         now that gnulib handles this.
8738         Include <stddef.h> and <limits.h> unconditionally, now that we assume
8739         C89 or better.
8740         Assume that offsetof is defined in stddef.h.
8741         Do not include <sys/param.h>.
8742         (realloc, lseek): Do not declare.
8743         (HAVE_DECL_VALLOC): Renamed from HAVE_VALLOC.
8744         (CHAR_BIT, CHAR_MAX, UCHAR_MAX, LONG_MAX): Remove
8745         declarations, since we now assume C89 or better.
8746         (PARAMS): Remove, as we now assume C89.  All uses changed.
8747         (bindtextdomain, textdomain): Include <gettext.h> to define.
8748         Include <unlocked-io.h>.
8749         (valloc): Define if not defined, and if valloc is not declared.
8750         (xstrdup): Remove decl.
8751
8752         * src/tar.c: Do not include <print-copyr.h>.
8753         Include <getdate.h>.
8754         (get_date): Remove decl.
8755         (ATIME_PRESERVE_OPTION, CHECKPOINT_OPTION, FORCE_LOCAL_OPTION,
8756         IGNORE_FAILED_READ_OPTION, INDEX_FILE_OPTION, NO_OVERWRITE_DIR_OPTION,
8757         NUMERIC_OWNER_OPTION, RECURSIVE_UNLINK_OPTION, REMOVE_FILES_OPTION,
8758         SHOW_OMITTED_DIRS_OPTION, TOTALS_OPTION): New constants.
8759         (long_options, decode_options): Use them.
8760         (OVERWRITE_DIR_OPTION): Remove.
8761         (long_options): New options --index-file, --no-overwrite-dir.
8762         Remove --overwrite-dir option.
8763         (usage): Use PACKAGE_BUGREPORT.
8764         (decode_options): Terminate new argv properly.
8765         Use PACKAGE_NAME, PACKAGE_VERSION.
8766         If verbose, report how we grokked any textual date option.
8767         (main): Add support for index-file.
8768
8769         * tests/Makefile.am: Convert to UTF-8.
8770         (AUTOMAKE_OPTIONS): Remove.
8771         (TESTS): Add delete04.sh, multiv01.sh, options.sh.
8772         (INCLUDES): Remove ../intl.
8773         (LDADD): Don't link libtar.a twice.
8774
8775         * tests/genfile.c: Convert to UTF-8.
8776         Don't include <print-copyr.h>.
8777         (DEFAULT_PATTERN): Renamed from DEFAULT.
8778         (ZEROS_PATTERN): Renamed from ZEROS.
8779         (main): Use gettext to translate (C), not print_copyright.
8780
8781 2003-07-04  Paul Eggert  <eggert@twinsun.com>
8782
8783         Revamp to meet current standards of autoconf, automake,
8784         gettext, and gnulib, and incorporate new translations.
8785
8786         * config/config.guess, config/config.sub, config/depcomp,
8787         config/install-sh, config/mdate-sh, config/missing,
8788         config/mkinstalldirs, config/texinfo.texi:
8789         Moved here from parent directory, or from doc.
8790         * config.hin: Renamed from config.h.in.
8791         * config/config.rpath: New file.
8792
8793         * intl: Remove this subdirectory.
8794
8795         * lib/fnmatch_.h: Renamed from lib/fnmatch.hin.
8796
8797         * lib/getstr.c, lib/getstr.h, lib/msleep.c, lib/print-copyr.c,
8798         lib/print-copyr.h, lib/readutmp.c, lib/rename.c, lib/stpcpy.c,
8799         lib/strstr.c, lib/strtoimax.c, lib/strtoll.c, lib/strtoull.c,
8800         lib/strtoumax.c, lib/unicodeio.c, lib/unicodeio.h,
8801         lib/xstrtoimax.c, m4/c-bs-a.m4, m4/ccstdc.m4, m4/check-decl.m4,
8802         m4/decl.m4, m4/jm-mktime.m4, m4/prereq.m4, m4/xstrtoimax.m4,
8803         stamp-h.in: Remove.
8804
8805         * lib/alloca_.h, lib/fnmatch_loop.c, lib/gettext.h, lib/pathmax.h,
8806         lib/safe-write.c, lib/safe-write.h, lib/stdbool_.h, lib/strcase.h,
8807         lib/stripslash.c, lib/unlocked-io.h, lib/xgetcwd.h, m4/alloca.m4,
8808         m4/backupfile.m4, m4/bison.m4, m4/chown.m4, m4/dirname.m4,
8809         m4/dos.m4, m4/exclude.m4, m4/fileblocks.m4, m4/ftruncate.m4,
8810         m4/getdate.m4, m4/getopt.m4, m4/hash.m4, m4/human.m4,
8811         m4/intdiv0.m4, m4/intmax_t.m4, m4/inttypes-pri.m4,
8812         m4/inttypes_h.m4, m4/isc-posix.m4, m4/lchown.m4, m4/lib-ld.m4,
8813         m4/lib-link.m4, m4/lib-prefix.m4, m4/memset.m4, m4/mktime.m4,
8814         m4/modechange.m4, m4/nls.m4, m4/onceonly.m4, m4/pathmax.m4,
8815         m4/po.m4, m4/quote.m4, m4/quotearg.m4, m4/rmdir.m4,
8816         m4/safe-read.m4, m4/safe-write.m4, m4/save-cwd.m4, m4/savedir.m4,
8817         m4/ssize_t.m4, m4/stdbool.m4, m4/stdint_h.m4, m4/strcase.m4,
8818         m4/strtoimax.m4, m4/strtol.m4, m4/strtoll.m4, m4/strtoul.m4,
8819         m4/strtoull.m4, m4/strtoumax.m4, m4/tm_gmtoff.m4, m4/uintmax_t.m4,
8820         m4/unlocked-io.m4, m4/xalloc.m4, m4/xgetcwd.m4, m4/xstrtol.m4,
8821         po/LINGUAS, po/Makevars, po/Rules-quot, po/boldquot.sed,
8822         po/en@boldquot.header, po/en@quot.header, po/en_GB.po,
8823         po/insert-header.sin, po/remove-potcdate.sin, po/stamp-po: New files.
8824
8825         * ABOUT-NLS, INSTALL, lib/addext.c, lib/alloca.c, lib/argmatch.c,
8826         lib/argmatch.h, lib/backupfile.c, lib/backupfile.h, lib/dirname.c,
8827         lib/dirname.h, lib/error.c, lib/exclude.c, lib/exclude.h,
8828         lib/fnmatch.h, lib/full-write.c, lib/full-write.h, lib/getdate.h,
8829         lib/getdate.y, lib/getline.c, lib/getline.h, lib/getopt.c,
8830         lib/getopt.h, lib/getopt1.c, lib/hash.c, lib/hash.h, lib/human.c,
8831         lib/human.h, lib/lchown.c, lib/malloc.c, lib/mktime.c,
8832         lib/modechange.c, lib/modechange.h, lib/quote.c, lib/quote.h,
8833         lib/quotearg.c, lib/quotearg.h, lib/realloc.c, lib/safe-read.c,
8834         lib/safe-read.h, lib/save-cwd.c, lib/save-cwd.h, lib/savedir.c,
8835         lib/savedir.h, lib/strcasecmp.c, lib/utime.c, lib/xalloc.h,
8836         lib/xgetcwd.c, lib/xmalloc.c, lib/xstrdup.c, lib/xstrtol.c,
8837         lib/xstrtol.h, lib/xstrtoumax.c, m4/codeset.m4, m4/d-ino.m4,
8838         m4/error.m4, m4/fnmatch.m4, m4/getcwd.m4, m4/getline.m4, m4/gettext.m4,
8839         m4/glibc21.m4, m4/iconv.m4, m4/inttypes.m4, m4/lcmessage.m4,
8840         m4/longlong.m4, m4/malloc.m4, m4/mbrtowc.m4, m4/mbstate_t.m4,
8841         m4/progtest.m4, m4/realloc.m4, m4/strerror_r.m4, m4/ulonglong.m4,
8842         m4/utimbuf.m4, m4/utime.m4, m4/utimes.m4, m4/xstrtoumax.m4,
8843         po/Makefile.in.in:
8844         Upgrade to latest version from external source.  The file "bootstrap"
8845         now grabs these automatically, so we needn't keep track of them
8846         in this change long any longer.
8847
8848         * Makefile.am (AUTOMAKE_OPTIONS): Remove.  Now done by configure.ac.
8849         (SUBDIRS): Remove intl.
8850         * PORTS: Update for star, Macintosh.
8851         * README, README-alpha: Suggest Autoconf 2.57, Automake 1.7.5,
8852         Bison 1.875, gettext 0.12.1.
8853         * THANKS: Add Bernhard Rosenkraenzer, Solar Designer.
8854         * configure.ac (AC_INIT, AM_INIT_AUTOMAKE): Convert to modern form.
8855         (AC_CONFIG_AUX_DIR): New.
8856         (AC_CONFIG_HEADERS): Rename config.h.in to config.hin, to be more
8857         like coreutils.
8858         (AC_PREREQ): Bump from 2.52 to 2.57.
8859         (AC_GNU_SOURCE): New.
8860         (AC_PROG_GCC_TRADITIONAL, AM_C_PROTOTYPES, AC_C_CONST): Remove;
8861         we no longer support K&R C.
8862         (YACC): Remove.
8863         (AC_CHECK_HEADERS): Remove limits.h, poll.h, stdbool.h, stropts.h,
8864         sys/ioccom.h, sys/param.h, sys/time.h, sys/timeb.h, wchar.h, wctype.h.
8865         (AC_MBSTATE_T): Remove.
8866         (HAVE_UTIME_H, HAVE_DECL_FREE, HAVE_DECL_GETGRGID, HAVE_DECL_GETPWUID,
8867         HAVE_DECL_GETENV, HAVE_DECL_MALLOC, HAVE_DECL_STRTOUL,
8868         HAVE_DECL_STRTOULL, HAVE_MKNOD): Remove our special code.
8869         (AM_STDBOOL_H): Add.
8870         (AC_HEADER_TIME, AC_STRUCT_TIMEZONE,
8871         jm_CHECK_TYPE_STRUCT_DIRENT_D_INO): Remove.
8872         (AC_CHECK_TYPE): Remove ssize_t.
8873         (gt_TYPE_SSIZE_T): Add.
8874         (jm_AC_PREREQ_XSTRTOUMAX, jm_PREREQ_ADDEXT, jm_PREREQ_ERROR,
8875         jm_PREREQ_HUMAN, jm_PREREQ_QUOTEARG, jm_PREREQ_XGETCWD,
8876         AC_FUNC_ALLOCA, AC_FUNC_CLOSEDIR_VOID, AC_FUNC_STRERROR_R,
8877         AC_FUNC_FNMATCH, AC_FUNC_VPRINTF, AM_FUNC_GETLINE, jm_FUNC_MALLOC,
8878         jm_FUNC_MKTIME, jm_FUNC_REALLOC):
8879         Remove.  Switch to gnulib macros like gl_BACKUPFILE instead.
8880         (tar_LDADD): Rename to LIB_CLOCK_GETTIME.  All uses changed.
8881         (rmt_LDADD): Rename to LIB_SETSOCKOPT.  All uses changed.
8882         (AC_CHECK_FUNCS): Remove fchdir, ftime, getcwd, isascii, nap,
8883         napms, poll, select, strstr, usleep.
8884         (AC_REPLACE_FUNCS): Remove ftruncate, lchown, memset, rename,
8885         rmdir, strcasecmp, strncasecmp, strtol, strtoul.
8886         (AM_GNU_GETTEXT): Use external and need-ngettext options.
8887         (AM_GNU_GETTEXT_VERSION): New.
8888         (AC_OUTPUT): Remove intl/Makefile.
8889
8890         * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
8891         ($(srcdir)/tar.info, tar.dvi): Remove obsolete warnings.
8892         * doc/fdl.texi: Update to current GNU version.
8893         * doc/gettext.texi: Update to current coreutils version,
8894         plus a copyright notice.
8895         * doc/tar.texi: Switch to new method for doing copyright notices.
8896         Use @acronym instead of @sc where appropriate.
8897         Remove empty examples.  Give a few more examples.
8898
8899         * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
8900         (EXTRA_DIST, libtar_a_SOURCES): Switch to gnulib, so that they
8901         are built up in pieces with +=.
8902         (noinst_HEADERS, INCLUDES): Remove.
8903         (BUILT_SOURCES, MAINTAINERCLEANFILES, MOSTLYCLEANFILES): New.
8904         (libtar_a_LIBADD): Use $ rather than @.
8905         (all-local, alloca.h, fnmatch.h, stdbool.h): New rules, from gnulib.
8906
8907         * m4/Makefile.am (EXTRA_DIST): Add alloca.m4, backupfile.m4,
8908         bison.m4, chown.m4, dirname.m4, dos.m4, exclude.m4, fileblocks.m4,
8909         ftruncate.m4, getdate.m4, getopt.m4, hash.m4, human.m4,
8910         intdiv0.m4, intmax_t.m4, inttypes_h.m4, inttypes-pri.m4,
8911         isc-posix.m4, lcown.m4, lib-ld.m4, lib-link.m4, lib-prefix.m4,
8912         memset.m4, mktime.m4, modechange.m4, nls.m4, onceonly.m4,
8913         pathmax.m4, po.m4, quotearg.m4, quote.m4, rmdir.m4, safe-read.m4,
8914         safe-write.m4, save-cwd.m4, savedir.m4, ssize_t.m4, stdbool.m4,
8915         stdint_h.m4, strcase.m4, strtoimax.m4, strtoll.m4, strtol.m4,
8916         strtoull.m4, strtoul.m4, strtoumax.m4, tm_gmtoff.m4, uintmax_t.m4,
8917         unlocked-io.m4, xalloc.m4, xgetcwd.m4, xstrtol.m4.
8918         Remove c-bs-a.m4, ccstdc.m4, check-decl.m4, decl.m4, jm-mktime.m4,
8919         prereq.m4, xstrtoimax.m4.
8920
8921         * po/POTFILES.in: Remove tests/genfile.c; it doesn't need to
8922         be translated, since it's not a user-visible tool.
8923
8924         * scripts/Makefile.am (AUTOMAKE_OPTIONS): Remove.
8925
8926         * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
8927         (INCLUDES): Remove ../intl.  Put top-srcdir before ., for
8928         consistency with coreutils.
8929         (LDADD): Link LIBINTL after libtar.a, since
8930         it's now external and should stand by itself.
8931
8932         * src/buffer.c (print_total_written): Adjust to new human.h
8933         interface.
8934         (child_open_for_compress): Do not increase size to BLOCKSIZE.
8935         (open_archive): Open index file name.
8936         Strip trailing slahes from file names.
8937         (flush_write): Set size to 0 if not saving names.
8938         (flush_write, flush_read): Use safer_name_suffix rather than
8939         inline code.
8940
8941         * src/common.h: Include <quote.h>.
8942         (absolute_names_option, atime_preserve_option, backup_option,
8943         block_number_option, checkpoint_option, dereference_option,
8944         force_local_option, ignore_failed_read_option, ignore_zeros_option,
8945         incremental_option, interactive_option, multi_volume_option,
8946         numeric_owner_option, one_file_system_option, recursive_unlink_option,
8947         read_full_records_option, remove_files_option, same_order_option,
8948         show_omitted_dirs_option, sparse_option, starting_file_option,
8949         to_stdout_option, totals_option, touch_option, verify_option,
8950         dev_null_output, now_verifying, we_are_root): Now bool, not int.
8951         (current_trailing_slash, index_file_name, recent_long_name_blocks,
8952         recent_long_link_blocks): New vars.
8953         (NO_OVERWRITE_DIR_OLD_FILES): New constant.
8954         (OVERWRITE_OLD_DIRS): Remove.
8955         (enum remove_option): New enum.
8956         (remove_any_file): Use it as option arg, not int.
8957         (is_avoided_name, contains_dot_dot): Return bool, not int.
8958         (safer_name_suffix): New decl.
8959
8960         * src/compare.c (now_verifying): Now bool, not int.
8961         (fill_in_sparse_array): Move to extract.c.  Now returns bool;
8962         all callers changed to test for failure.
8963         (diff_sparse_files): Take size from current_stat, not from param.
8964         (diff_archive): Do not count trailing slashes in archives.
8965         (verify_volume): Test for header failure after loop, not before.
8966
8967         * src/create.c (relativize): Remove; replaced by safer_name_suffix.
8968         All callers changed.
8969         (start_header): Clear devmajor and devminor fields, too.
8970         (finish_header): New arg block_ordinal.
8971         (init_sparsearray): Now extern.  Set sp_array_size to
8972         SPARSES_IN_OLDGNU_HEADER if it is zero.
8973         (dump_file): Keep link table as a hash.
8974         Do not count "file changed as we read it" as a failure.
8975
8976         * src/delete.c (recent_long_name_blocks, recent_long_link_blocks):
8977         Move extern decl to common.h.
8978
8979         * src/extract.c (we_are_root): Now bool, not int.
8980         (check_time): Warn about implausibly old time stamps.
8981         (set_stat): Use utimbuf, not stat_info.
8982         (prepare_to_extract): New arg DIRECTORY.
8983         (fill_in_sparse_array): Moved here from compare.c.
8984         (extract_sparse_file): Now returns off_t, giving size left.
8985         Truncate file at end.
8986         (extract_archive): Use safer_name_suffix rather than rolling our own.
8987         Use fill_in_sparse_array rather than rolling our own.
8988         Strip trailing slashes more effectively.
8989         Check for unsafe names.
8990
8991         * src/incremen.c (struct directory): nfs and found are now of type
8992         bool, not int.
8993         (gnu_restore): Now takes directory name as argument, not offset
8994         of directory name in a global.  All uses changed.
8995         (CURRENT_FILE_NAME): Remove.
8996
8997         New tests.
8998         * tests/delete04.sh, tests/multiv01.sh, tests/options.sh: New
8999         files.
9000
9001 2002-09-30  Paul Eggert  <eggert@twinsun.com>
9002
9003         * src/rmt.c (prepare_input_buffer): Renamed form
9004         prepare_record_buffer.  All uses changed.  Do not assume that
9005         size_t is the same width as int.
9006
9007 2002-03-29  Paul Eggert  <eggert@twinsun.com>
9008
9009         * src/incremen.c (get_directory_contents):
9010         If ignore_failed_read_option, only warn about
9011         get_directory_contents failures.  Fix suggested by
9012         Mark Costlow.
9013
9014 2002-01-31  Mark W. Eichin  <eichin@thok.org>
9015
9016         * src/buffer.c (child_open_for_compress): Don't try to read
9017         past the end of the buffer.
9018
9019 2001-10-11  Jim Meyering  <meyering@lucent.com>
9020
9021         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
9022         and quote_n (1, ... to avoid clobbering a buffer.
9023
9024 2001-09-26  Paul Eggert  <eggert@twinsun.com>
9025
9026         * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 1.13.25.
9027
9028         * src/buffer.c (flush_read): Don't diagnose partial blocks before
9029         end of file; just ignore them silently.
9030
9031         * src/list.c (read_header): Don't keep around extended name
9032         and link info indefinitely; keep it only for the next file.
9033         This fixes a bug introduced in 1.13.24, and removes the need
9034         for some static variables.  Set recent_long_name and
9035         recent_long_link to zero if there were no long links; this
9036         avoids a violation of ANSI C rules for pointers in delete.c.
9037         * THANKS: Add Christian Laubscher.
9038
9039 2001-09-26  Jim Meyering  <meyering@lucent.com>
9040
9041         * doc/tar.texi (Remote Tape Server): is know -> is known
9042
9043 2001-09-25  Paul Eggert  <eggert@twinsun.com>
9044
9045         * lib/unicodeio.c (EILSEQ): Include <iconv.h> first, since
9046         <iconv.h> may define EILSEQ (e.g. libiconv).  Define a
9047         replacement EILSEQ to be ENOENT, not EINVAL, since callers may
9048         want to distinguish EINVAL and EILSEQ.
9049
9050 2001-09-24  Christophe Kalt  <Christophe.Kalt@kbcfp.com>
9051
9052         * src/extract.c (maybe_recoverable):
9053         Treat OVERWRITE_OLD_DIRS like DEFAULT_OLD_FILES.
9054
9055 2001-09-22  Paul Eggert  <eggert@twinsun.com>
9056
9057         * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 1.13.24.
9058
9059         * ABOUT-NLS, intl/*: Update to gettext-0.10.40, replacing LGPL
9060         with GPL.
9061
9062         * INSTALL, mkinstalldirs: Update to autoconf 2.52 version.
9063         * PORTS: Add copyright notice, 'star' reference.
9064         * README-alpha: Add copyright notice, autoconf 2.52 patch.
9065         * THANKS: Add Christophe Kalt.
9066         * config.sub: Upgrade to 2001-09-14 version.
9067
9068         * configure.ac (ALL_LINGUAS): Add ko.
9069         * po/ko.po: Resurrected file.
9070
9071         * doc/convtexi.pl: Add coding advice for Emacs.
9072
9073         * doc/getdate.texi: Add copyright notice.
9074
9075         * doc/mdate-sh: Upgrade to automake 1.5 version.
9076
9077         * doc/tar.texi (extracting files): Mention --to-stdout.
9078         (Option Summary, Dealing with Old Files): New option --overwrite-dir.
9079         (Overwrite Old Files): Likewise.
9080
9081         * lib/Makefile.am (noinst_HEADERS):
9082         Remove copysym.h.  Add print-copyr.h, unicodeio.h.
9083         (libtar_a_SOURCES): Remove copysym.c, Add print-copyr.c, unicodeio.c.
9084
9085         * lib/copysym.c, lib/copysym.h: Remove.
9086         * lib/print-copyr.c, lib/print-copyr.h, lib/unicodeio.c,
9087         lib/unicodeio.h: New files.
9088
9089         * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
9090         lib/mktime.c, lib/strtoll.c: Switch from LGPL to GPL.
9091
9092         * lib/quotearg.c (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
9093         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
9094
9095         * m4/Makefile.am (EXTRA_DIST): Remove isc-posix.m4.
9096         * m4/isc-posix.m4: Remove.
9097
9098         * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit.
9099
9100         * po/POTFILES.in: Add copyright notice.
9101
9102         * src/Makefile.am (LDADD): Like libtar.a before @INTLLIBS@ as
9103         well as after.
9104         * tests/Makefile.am (LDADD): Likewise.
9105
9106         * src/buffer.c (write_archive_buffer, close_archive):
9107         If an archive is a socket, treat it like a FIFO.
9108         (records_read, records_written): New vars.
9109         (write_archive_to_stdout): Now bool, not int.
9110         (open_archive, flush_write, flush_read): Keep records_read and
9111         records_written up to date.
9112
9113         * src/common.h (enum old_files): New value OVERWRITE_OLD_DIRS.
9114         (write_archive_to_stdout): Now bool, not int.
9115         (enum read_header): New value HEADER_SUCCESS_EXTENDED.
9116         (read_header): Now takes bool arg.  Existing callers modified
9117         to pass 0, unless otherwise specified.
9118
9119         * src/delete.c (records_read): Remove; now a global.
9120         (acting_as_filter): Now bool, not int.
9121         (recent_long_name, recent_long_link, recent_long_name_blocks,
9122         recent_long_link_blocks, records_read, records_written): New decls.
9123         (records_skipped): New var.
9124         (move_archive): Don't divide by zero if arg is 0.
9125         Use the above vars to compute how far to move.
9126         (write_recent_blocks): New function.
9127         (delete_archive_member): Pass 1 to read_header, so that it doesn't
9128         read more than 1 block.  Handle resulting HEADER_SUCCESS_EXTENDED code.
9129         Keep track of how many records have been skipped.
9130         Let the buffer code count records.
9131         When copying a header, copy any extended headers that came before it.
9132
9133         * src/extract.c (extract_archive): When marking a directory to be
9134         updated after symlinks, stat all directories after it in the
9135         delayed-set-stat list too, since they will be checked after
9136         symlinks.  Add support for --overwrite-dir.
9137
9138         * src/list.c (recent_long_name, recent_long_link,
9139         recent_long_name_blocks, recent_long_link_blocks): New vars.
9140         (read_and): Pass 0 to read_header.
9141         (read_header): New arg RAW_EXTENDED_HEADERS.  Store away extended
9142         headers into new vars.  Null-terminate incoming symbolic links.
9143
9144         * src/rmt.c: Include print-copyr.h, not copysym.h.
9145         (main): Use print_copyright, not copyright_symbol.
9146         * src/tar.c (decode_options): Likewise.
9147         (OVERWRITE_DIR_OPTION): New constant.
9148         (long_options, usage, decode_options): Add --overwrite-dir.
9149
9150         * src/tar.h: Put copyright notice into documentation.
9151
9152         * tests/Makefile.am (TESTS): Add delete03.sh.
9153         * tests/delete03.sh: New file.
9154
9155         * tests/genfile.c: Include print-copyr.h, not copysym.h.
9156         (main): Use print_copyright, not copyright_symbol.
9157         Include <argmatch.h>.
9158         (pattern_strings): Remove.
9159         (pattern_args, pattern_types): New constants.
9160         (main): Use XARGMATCH, not argmatch.
9161
9162 2001-09-20  Jim Meyering  <meyering@lucent.com>
9163
9164         * lib/xstrtol.c (strtoimax): Guard declaration with
9165         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
9166         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
9167         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
9168         (strtoumax): Likewise, for completeness (it wasn't necessary).
9169         * m4/xstrtoimax.m4 (jm_AC_PREREQ_XSTRTOIMAX):
9170         Check for declaration of strtoimax.
9171         * m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX):
9172         Check for declaration of strtoumax.
9173
9174 2001-09-16  Paul Eggert  <eggert@twinsun.com>
9175
9176         * fnmatch.m4 (jm_FUNC_FNMATCH): Fix typo in previous patch: yes -> no.
9177
9178 2001-09-14  Paul Eggert  <eggert@twinsun.com>
9179
9180         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.23.
9181
9182         * README-alpha: Describe automake patch.
9183
9184         * configure.ac (LIBOBJS):
9185         Remove automake 1.4 workaround, as we're using 1.5 now.
9186         (USE_INCLUDED_LIBINTL): New AC_DEFINE.
9187
9188         * lib/copysym.c: Include stddef.h, for size_t.
9189         Include langinfo.h if needed.
9190         Use locale_charset only if USE_INCLUDED_LIBINTL;
9191         if not, use nl_langinfo (CODESET) if available.
9192
9193 2001-09-13  Paul Eggert  <eggert@twinsun.com>
9194
9195         * config.guess, config.sub: Sync with canonical versions.
9196
9197         * configure.ac (jm_PREREQ_XGETCWD): Add.
9198
9199         * lib/Makefile.am (noinst_HEADERS): Add copysym.h.
9200         (libtar_a_SOURCES): Add copysym.c.
9201         * copysym.c, copysym.h: New files.
9202
9203         * lib/error.c: Sync with fileutils version.
9204
9205         * m4/Makefile.am (EXTRA_DIST): Add getcwd.m4; remove uintmax_t.m4.
9206         * m4/getcwd.m4: New file.
9207         * m4/uintmax_t.m4: Remove.
9208
9209         * m4/gettext.m4 (AM_WITH_NLS):
9210         Fix bug with calculating version of Bison 1.29.
9211         Reported by Karl Berry.
9212
9213         * src/Makefile.am (datadir): Remove.
9214
9215         * src/rmt.c: Include copysym.h.
9216         (main): Use copyright_symbol to translate copyright notice,
9217         instead of gettext.
9218         * src/tar.c: Likewise.
9219         * tests/genfile.c: Likewise.
9220
9221         * src/system.h (MB_LEN_MAX): New symbol.
9222
9223 2001-09-11  Paul Eggert  <eggert@twinsun.com>
9224
9225         * src/extract.c (struct delayed_set_stat): New member
9226         'after_symlinks'.
9227         (delay_set_stat): Initialize it to 0.
9228         (set_mode): New arg current_stat_info.  Use it (if nonnull) to avoid
9229         taking an extra stat ourselves.  All callers changed.
9230         (set_stat): Likewise.
9231         (apply_nonancestor_delayed_set_stat): New arg 'after_symlinks'.
9232         If false, stop when encountering a struct whose 'after_symlinks'
9233         member is true.  Otherwise, go through all structures but check
9234         them more carefully.  All callers changed.
9235         (extract_archive): When extracting a deferred symlink, if its parent
9236         directory's status needs fixing, then mark the directory as needing
9237         to be fixed after symlinks.
9238         (extract_finish): Fix status of ordinary directories, then apply
9239         delayed symlinks, then fix the status of directories that are
9240         ancestors of delayed symlinks.
9241
9242         * src/rtapelib.c (rexec):
9243         Remove declaration; it ran afoul of prototypes on Crays.
9244         Reported by Wendy Palm of Cray.
9245
9246 2001-09-06  Paul Eggert  <eggert@twinsun.com>
9247
9248         * lib/strtoimax.c (HAVE_LONG_LONG):
9249         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
9250         (strtoimax): Use sizeof (long), not
9251         sizeof strtol (ptr, endptr, base),
9252         to work around bug in IBM C compiler.
9253
9254 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9255
9256         * lib/xgetcwd.c: Include "xalloc.h".
9257         (xgetcwd): Do not return NULL when memory is exhausted; instead,
9258         report an error and exit.
9259
9260         * m4/prereq.m4 (jm_PREREQ_XREADLINK): New macro.
9261         (jm_PREREQ): Use it.
9262
9263 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9264
9265         * m4/prereq.m4 (jm_PREREQ): Add jm_PREREQ_XGETCWD.
9266         (jm_PREREQ_XGETCWD): New macro.
9267
9268         * lib/exclude.c (fnmatch_no_wildcards):
9269         Fix typo that caused us to do case-folding
9270         search even when that was not desired.  This occurred only in the
9271         no-wildcard case.
9272
9273         * lib/xgetcwd.c: Include pathmax.h if not HAVE_GETCWD.
9274         Do not include xalloc.h.
9275         (INITIAL_BUFFER_SIZE): New symbol.
9276         Do not use xmalloc / xrealloc, since the caller is responsible for
9277         handling errors.  Preserve errno around `free' during failure.
9278         Do not overrun buffer when using getwd.
9279
9280         * lib/xgetcwd.c (xgetcwd):
9281         Use HAVE_GETCWD_NULL, not defined __GLIBC__ && __GLIBC__ >= 2,
9282         to decide whether to use getcwd (NULL, 0).
9283
9284 2001-09-02  Paul Eggert  <eggert@twinsun.com>
9285
9286         * lib/xgetcwd.c: Fix typo in local var; from Jim Meyering.
9287
9288 2001-09-01  Jim Meyering  <meyering@lucent.com>
9289
9290         * exclude.c: Use `""', not `<>' to #include non-system header files.
9291         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9292         and strncasecmp as r-values.  Unixware didn't have declarations.
9293
9294 2001-08-31  Jim Meyering  <meyering@lucent.com>
9295
9296         * lib/xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9297         Use an initial, malloc'd, buffer of length 128 rather than
9298         a statically allocated one of length 1024.
9299
9300 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9301
9302         * lib/utime.c: Include full-write.h.
9303         * lib/xstrtol.c (strtoimax): New decl.
9304
9305 2001-08-29  Paul Eggert  <eggert@twinsun.com>
9306
9307         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.22.
9308
9309         * src/create.c (dump_file): Relativize link names before dumping.
9310         This fixes a bug reported by Jose Pedro Oliveira.
9311
9312         * src/create.c (dump_file): Use offsetof when computing sizes for
9313         struct hack; this avoids wasted space in some cases.
9314         * src/incremen.c (note_directory, find_directory): Likewise.
9315         * src/names.c (name_gather, addname): Likewise.
9316
9317         * src/extract.c (extract_archive): Use strcpy, not memcpy,
9318         for consistency with other code that does similar things.
9319         * src/names.c (name_gather): Likewise.
9320
9321         * src/names.c (read_name_from_file, name_next, name_gather,
9322         add_hierarchy_to_namelist): Avoid quadratic behavior when
9323         reallocating buffers.  Check for buffer size overflow.
9324         (addname): Avoid unnecessary clearing of memory.
9325
9326 2001-08-29  "Jan D."  <Jan.Djarv@mbox200.swipnet.se>
9327
9328         * src/extract.c (delay_set_stat): Fix off-by-one error in file
9329         name size allocation that caused core dumps.
9330
9331 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9332
9333         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.21.
9334
9335         * configure.ac (GNU_SOURCE): Define to 1, not /**/.
9336         (major_t, minor_t, ssize_t): Use new-style AC_CHECK_TYPE.
9337         (daddr_t): Remove; no longer used.
9338         (jm_PREREQ_HUMAN): Add.
9339
9340         * acconfig.h: Remove; no longer needed.
9341
9342         * config.guess, config.sub:
9343         New files, from automake 1.5.  Gettext 0.10.39 needs them.
9344         * depcomp, missing, mkinstalldirs: Upgrade to automake 1.5.
9345
9346         * Makefile.am (AUTOMAKE_OPTIONS): Add dist-bzip2.
9347         (SUBDIRS): Put intl before lib, as gettext requires.
9348
9349         * ABOUT-NLS: Upgrade to gettext 0.10.39.
9350         * intl: Upgrade entire directory to gettext 0.10.39.
9351         * m4/codeset.m4, m4/glibc21.m4, m4/iconv.m4:
9352         New files, from gettext 0.10.39.
9353         * m4/gettext.m4, m4/isc-posix.m4, m4/lcmessage.m4, m4/progtest.m4,
9354         Upgrade to gettext 0.10.39,
9355         * po/Makefile.in.in: Likewise, except fix a typo in its copying
9356         permissions.
9357         * po/cat-id-tbl.c, po/stamp-cat-id:
9358         Remove; no longer used by gettext 0.10.39.
9359         * po/ChangeLog: New file.
9360
9361         * doc/Makefile.am (EXTRA_DIST): Add freemanuals.texi.
9362         $(srcdir)/tar.texi: Likewise.
9363         * doc/freemanuals.texi: New file.
9364         * doc/tar.texi (Free Software Needs Free Documentation): New appendix.
9365         `fileds' -> `fields'
9366         * doc/texinfo.tex: Upgrade to version 2001-07-25.07.
9367
9368         * lib/Makefile.am (EXTRA_DIST): Add strtoll.c, strtoimax.c.
9369         (noinst_HEADERS): Add quote.h.
9370         (libtar_a_SOURCES): Add quote.c, xstrtoimax.c.
9371
9372         * lib/exclude.c: Fix typo in '#include <stdint.h>' directive.
9373
9374         * lib/full-write.c, lib/savedir.c: Comment fix.
9375
9376         * lib/pathmax.h: Remove.
9377
9378         * lib/quote.c, lib/quote.h: New files.
9379
9380         * lib/xgetcwd.c: Don't include pathmax.h.
9381         Include stdlib.h and unistd.h if available.
9382         Include xalloc.h.
9383         (xmalloc, xstrdup, free): Remove decls.
9384         (xgetcwd): Don't assume sizes fit in unsigned.
9385         Check for overflow when computing sizes.
9386         Simplify reallocation code.
9387
9388         * lib/xmalloc.c: Quote failure tests.
9389
9390         * lib/strtoumax.c, lib/xstrtoimax.c: New files.
9391
9392         * lib/strtoimax.c: Renamed from strtouxmax.c.  Make it more
9393         similar to strtol.c.
9394         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.
9395         (verify): New macro.
9396         (strtoumax, uintmax_t, strtoull, strtol): Remove.
9397         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
9398         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
9399         changed to signed values.  Check sizes at compile-time, not
9400         run-time.  Prefer strtol to strtoll if both work.
9401         (main): Remove.
9402
9403         * lib/xstrtol.h (xstrtoimax): New decl.
9404
9405         * m4/Makefile.am (EXTRA_DIST):
9406         Add codeset.m4, glibc21.m4, iconv.m4, inttypes.m4,
9407         longlong.m4, xstrtoimax.m4.
9408
9409         * m4/inttypes.m4 (jm_AC_HEADER_INTTYPES_H):
9410         Remove; now done by autoconf.
9411         (jm_AC_TYPE_INTMAX_T, jm_AC_TYPE_UINTMAX_T): Replace with
9412         Use AC_CHECK_TYPE instead of merely looking for the header.
9413
9414         * m4/uintmax_t.m4: Use shorter comment.
9415
9416         * m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX):
9417         Quote first arg of AC_DEFUN.
9418         Require jm_AC_TYPE_INTMAX_T and jm_AC_TYPE_LONG_LONG since they
9419         is needed to parse the include file.
9420         Simplify logic behind the args to AC_REPLACE.
9421
9422         * src/Makefile.am (OMIT_DEPENDENCIES): Remove.
9423
9424         * src/ansi2knr.1, src/ansi2knr.c: Remove; wasn't being used.
9425
9426         * src/rmt.c (main):
9427         Use "Copyright %d" to simplify the translator's job in the future.
9428         Advise translator about circle-C.
9429         * src/tar.c: (decode_options): Likewise.
9430         * tests/genfile.c (main): Likewise.
9431
9432 2001-08-28  Jim Meyering  <meyering@lucent.com>
9433
9434         * lib/argmatch.c: Include "quote.h".
9435         (argmatch_invalid): Quote the context.
9436
9437         * lib/dirname.c (dir_name): Fix typo on PC platforms.
9438
9439         * lib/backupfile.c, lib/basename.c, lib/dirname.c, lib/strtoul.c:
9440         Use single-quote for local .h files.
9441
9442         * lib/error.h (__attribute__): Don't depend on __STRICT_ANSI__.
9443
9444         * lib/getopt.c, lib/getopt.h, lib/getopt1.c: Upgrade to recent
9445         glibc versions.
9446
9447         * lib/getdate.y (get_date): Initialize tm_isdst to -1 before
9448         invoking mktime the last time.
9449
9450         * lib/pathmax.h: Use #if rather than #ifdef for HAVE_UNISTD_H.
9451
9452         * lib/rename.c: Major rewrite by Volker Borchert to use system
9453         rename function, but to work around problems with trailing
9454         slashes.
9455
9456         * lib/strtoll.c: New file, from glibc.
9457         * lib/strtoul.c: Update from glibc.
9458
9459         * lib/strtouxmax.c: Renamed from lib/strtoumax.c.
9460         Add support for signed numbers, too.
9461         (strtoul, strtoull): Do not declare if STRTOUXMAX_UNSIGNED
9462         is not defined.
9463         (strtol, strtoll): Declare as needed, if STRTOUXMAX_UNSIGNED is
9464         not defined.
9465         (strtoumax, uintmax_t, strtoull, strtoul): New macros.
9466         (main): Use generic names in debugging output.
9467         * lib/strtoimax.c: Plus add the following changes of my own:
9468         (main): Use accurate names in debugging output.
9469
9470         * lib/xgetcwd.c (xgetcwd): Use getcwd if glibc 2 or later.
9471         Don't use PATH_MAX.
9472
9473         * m4/c-bs-a.m4, m4/check-decl.m4, m4/d-ino.m4, m4/error.m4,
9474         m4/getline.m4, m4/jm-mktime.m4, m4/malloc.m4, m4/mbrtowc.m4,
9475         m4/mbstate_t.m4, m4/realloc.m4, m4/uintmax_t.m4, m4/utimbuf.m4,
9476         m4/utime.m4, m4/utimes.m4:
9477         Quote the first argument in each use of AC_DEFUN.
9478
9479         * m4/getline.m4: Don't use string.h.
9480
9481         * m4/inttypes.m4, m4/longlong.m4, m4/xstrtoimax.m4: New files.
9482
9483         * m4/mbrtowc.m4 (jm_FUNC_MBRTOWC): @%:@ -> #.
9484
9485 2001-08-27  Paul Eggert  <eggert@twinsun.com>
9486
9487         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.20.
9488
9489         The biggest change is the new --exclude semantics and options.
9490         The basic idea was suggested by Gerhard Poul; thanks!
9491
9492         * NEWS: Describe new --exclude semantics and options, and bug fixes.
9493         * README: ignfail.sh fails on some NFS hosts.
9494         * NEWS, README, lib/xstrtol.h: Add copyright notice.
9495
9496         * Makefile.am (ACLOCAL_AMFLAGS): Add -I m4.
9497         (M4DIR, ACINCLUDE_INPUTS, $(srcdir)/acinclude.m4):
9498         Remove; the automake bug has been fixed.
9499         * acinclude.m4: Remove.
9500
9501         * configure.ac: Renamed from configure.in.
9502         (AC_PREREQ): Bump from 2.13 to 2.52.
9503         (ALL_LINGUAS): Add id, tr.  Remove ko, as po/ko.po (dated
9504         1997-05-30) has an encoding error.
9505         (jm_AC_HEADER_INTTYPES_H): Remove; now done by autoconf.
9506         (AC_FUNC_FNMATCH): Use AC_CONFIG_LINKS, not AC_LINK_FILES.
9507
9508         * doc/fdl.texi: Update to current GNU version.
9509
9510         * doc/tar.texi: Put leading '*' in direntry.
9511         Accommodate new gfdl sectioning.
9512         New option --recursion (the default) that is the inverse of
9513         --no-recursion.
9514
9515         New options --anchored, --ignore-case, --wildcards,
9516         --wildcards-match-slash, and their negations (e.g., --no-anchored).
9517         Along with --recursion and --no-recursion, these control how exclude
9518         patterns are interpreted.  The default interpretation of exclude
9519         patterns is now --no-anchored --no-ignore-case --recursion
9520         --wildcards --wildcards-match-slash.
9521
9522         * lib/Makefile.am (OMIT_DEPENDENCIES): Remove.
9523
9524         * lib/exclude.c (bool): Declare, perhaps by including stdbool.h.
9525         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
9526         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
9527         Include if available.
9528         (<xalloc.h>): Include
9529         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
9530         (verify): New macro.  Use it to verify that EXCLUDE macros do not
9531         collide with FNM macros.
9532         (struct patopts): New struct.
9533         (struct exclude): Use it, as exclude patterns now come with options.
9534         (new_exclude): Support above changes.
9535         (new_exclude, add_exclude_file):
9536         Initial size must now be a power of two to simplify overflow checking.
9537         (free_exclude, fnmatch_no_wildcards): New function.
9538         (excluded_filename): No longer requires options arg, as the options
9539         are determined by add_exclude.  Now returns bool, not int.
9540         (excluded_filename, add_exclude):
9541         Add support for the fancy new exclusion options.
9542         (add_exclude, add_exclude_file): Now takes int options arg.
9543         Check for arithmetic overflow when computing sizes.
9544         (add_exclude_file): xrealloc might modify errno, so don't
9545         realloc until after errno might be used.
9546
9547         * lib/exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
9548         New macros.
9549         (free_exclude): New decl.
9550         (add_exclude, add_exclude_file): Now takes int options arg.
9551         (excluded_filename): No longer requires options arg, as the options
9552         are determined by add_exclude.  Now returns bool, not int.
9553
9554         * lib/prepargs.c: Include <string.h>; required for C99 since
9555         we use strlen.
9556
9557         * lib/quotearg.c:
9558         BSD/OS 4.1 wchar.h requires FILE and struct tm to be declared.
9559
9560         * lib/xstrtol.h (_DECLARE_XSTRTOL): Improve quality of
9561         diagnostic for LONGINT_INVALID_SUFFIX_CHAR.
9562
9563         * m4/Makefile.am (EXTRA_DIST): Add check-decl.m4, mbrtowc.m4.
9564         Remove inttypes_h.m4, largefile.m4, mktime.m4.
9565
9566         * m4/inttypes_h.m4, m4/largefile.m4, m4/mktime.m4: Remove;
9567         subsumed by Autoconf 2.50.
9568
9569         * m4/error.m4: Upgrade to serial 2.
9570
9571         * m4/fnmatch.m4 (jm_FUNC_FNMATCH): Upgrade to serial 4, but
9572         remove test for GNU C library.  It's not correct, as some
9573         older glibcs are buggy.
9574
9575         * m4/getline.m4, m4/malloc.m4: Upgrade to serial 4.
9576
9577         * m4/prereq.m4: Upgrade to serial 20, but then:
9578         (jm_PREREQ): Add jm_PREREQ_EXCLUDE.
9579         (jm_PREREQ_EXCLUDE): New macro.
9580         (jm_PREREQ_HUMAN): Remove jm_AC_HEADER_INTTYPES_H, as it is subsumed
9581         by autoconf 2.5x.
9582
9583         * m4/realloc.m4: Upgrade to serial 4.
9584
9585         * m4/strerror_r.m4: Revert to serial 1002.
9586
9587         * m4/uintmax_t.m4: Upgrade to autoconf 2.5x.
9588
9589         * m4/utimes.m4: Upgrade to latest version (still "serial 3").
9590
9591         * m4/xstrtoumax.m4: Upgrade to serial 3, but then:
9592         (jm_AC_PREREQ_XSTRTOUMAX): Remove jm_AC_HEADER_INTTYPES_H, as
9593         it is now subsumed by autoconf.  Add inttypes.h.
9594
9595         * po/cs.po, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
9596         po/it.po, po/pl.po, po/sl.po, po/sv.po: Sync with translation project.
9597
9598         * src/buffer.c (new_volume): Stop if the script exits with an error.
9599
9600         * src/common.h (excluded_with_slash, excluded_without_slash):
9601         Remove, replacing by:
9602         (excluded): New decl.
9603         (link_error): New decl.
9604         (excluded_name): Now returns bool.
9605
9606         * src/extract.c:
9607         (struct delayed_symlinks, extract_archive, apply_delayed_symlinks):
9608         Support hard links to symbolic links.
9609
9610         (struct delayed_symlink): Remove 'names' member, replacing it with
9611         'sources' and 'target' member.  All uses changed.
9612
9613         (struct string_list): New type.
9614
9615         (delayed_set_stat, extract_archive): Use offsetof when computing sizes
9616         for struct hack; this avoids wasted space in some cases.
9617
9618         (extract_archive): Fix test for absolute pathnames and/or "..".
9619         Use link_error to report errors for links.
9620         Remove redundant trailing '/' at "really_dir", for all uses, not
9621         just before invoking mkdir.
9622         If overwriting old files, do not worry so much about existing
9623         directories.
9624         Fix mode computation in the case where the directory exists.
9625
9626         (apply_delayed_symlinks): If we can't make a hard link to a symbolic
9627         link, make a copy of the symbolic link.
9628
9629         * src/incremen.c (get_directory_contents):
9630         If ignore_failed_read_option, only warn about
9631         stat failures.
9632
9633         * src/list.c (from_header): Do not issue a diagnostic if TYPE is zero.
9634         However, check for error even for '-' or '+' case.
9635
9636         (print_header): Try parsing uids and gids as unsigned integers first,
9637         and as a uid_t or gid_t only if that fails.  This adds support for
9638         listing positive uids and gids that are greater than UID_MAX and
9639         GID_MAX.
9640
9641         * src/misc.c (link_error): New function.
9642
9643         * src/names.c (collect_and_sort_names):
9644         If ignore_failed_read_option, only warn about
9645         stat errors.
9646
9647         (excluded_name): Now returns bool.  Simplify, as the fancy
9648         features are now all in excluded_filename.
9649
9650         * src/rtapelib.c (base_name): Remove decl, as system.h now
9651         declares it.
9652
9653         * src/system.h: Include stddef.h if available.
9654         (offsetof): Declare if stddef.h doesn't.
9655
9656         Include <dirname.h>.
9657         (FILESYSTEM_PREFIX_LEN, ISSLASH): Remove; now defined by dirname.h.
9658
9659         * src/tar.c (ANCHORED_OPTION, IGNORE_CASE_OPTION,
9660         NO_ANCHORED_OPTION, NO_IGNORE_CASE_OPTION, NO_WILDCARDS_OPTION,
9661         NO_WILDCARDS_MATCH_SLASH_OPTION, WILDCARDS_OPTION,
9662         WILDCARDS_MATCH_SLASH_OPTION):
9663         New enum values.
9664
9665         (long_options, usage, decode_options): Add support for --anchored,
9666         --ignore-case, --no-anchored, --no-ignore-case, --no-wildcards,
9667         --no-wildcards-match-slash, --recursion, --wildcards,
9668         --wildcards-match-slash.
9669
9670         (decode_options): Implement the new way of interpreting exclude
9671         patterns.
9672
9673         (usage): --newer-mtime takes a DATE operand.  DATE may be a file name.
9674
9675         (OPTION_STRING, decode_options): Add -I, -y.  Currently these options
9676         just print error messages suggesting alternatives.
9677
9678         (add_filtered_exclude): Remove.
9679
9680         * tests/Makefile.am (TESTS): Alphabetize, except put version.sh first.
9681
9682         * tests/extrac04.sh (out): Remove
9683         directory/subdirectory/file1, as the new semantics for
9684         --exclude exclude it.
9685
9686         * tests/genfile.c (main): Don't use non-ASCII char in msgid.
9687
9688 2001-08-12  Paul Eggert  <eggert@twinsun.com>
9689
9690         * lib/addext.c (<errno.h>): Include.
9691         (errno): Declare if not defined.
9692         (addext): Work correctly on the Hurd, where pathconf returns -1 and
9693         leaves errno alone, because there is no limit.  Also, work even if
9694         size_t is narrower than long.
9695
9696 2001-07-08  Paul Eggert  <eggert@twinsun.com>
9697
9698         * lib/alloca.c (alloca): Arg is of type size_t, not unsigned.
9699
9700 2001-05-10  Paul Eggert  <eggert@twinsun.com>
9701
9702         * lib/addext.c (ISSLASH, base_name): Remove decls; now in dirname.h.
9703         Include <backupfile.h> and <dirname.h> after size_t is defined.
9704         (addext): Use base_len to trim redundant trailing slashes instead of
9705         doing it ourselves.
9706
9707         * lib/backupfile.c (ISSLASH, base_name):
9708         Remove decls; now in dirname.h.
9709         Include <argmatch.h>, <backupfile.h>, <dirname.h> after size_t
9710         is defined.
9711         (find_backup_file_name): Rename locals to avoid new functions.
9712         Use base_len instead of rolling it ourselves.
9713         Work even if dirlen is 0.
9714         Use a dir of '.' if given the empty string.
9715
9716         * lib/basename.c:
9717         Do not include <stdio.h>, <assert.h>; no longer needed.
9718         (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Remove; now in dirname.h.
9719         Include <string.h>, <dirname.h>.
9720         (base_name): Allow file names ending in slashes, other than names
9721         that are all slashes.  In this case, return the basename followed
9722         by the slashes.
9723
9724         * lib/dirname.c: Include <string.h> instead of <stdlib.h>.
9725         (FILESYSTEM_PREFIX_LEN, ISSLASH): Remove; now in dirname.h.
9726         (dir_len): Renamed from dirlen.
9727         All callers changed.
9728
9729         * lib/dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
9730         New macros.
9731         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
9732
9733 2001-02-16  Paul Eggert  <eggert@twinsun.com>
9734
9735         * lib/quotearg.c (mbrtowc, mbrtowc, mbsinit):
9736         Do not declare or define if HAVE_MBRTOWC,
9737         since the test for HAVE_MBRTOWC now requires proper declarations.
9738
9739         * lib/alloca.c (malloc): Undef before defining.
9740
9741 2001-02-13  Paul Eggert  <eggert@twinsun.com>
9742
9743         * src/compare.c (read_and_process): Use off_t for size.
9744         From Maciej W. Rozycki.
9745
9746 2001-01-26  Paul Eggert  <eggert@twinsun.com>
9747
9748         * lib/quotearg.c: Include stddef.h.  From Jim Meyering.
9749
9750 2001-01-12  Paul Eggert  <eggert@twinsun.com>
9751
9752         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.19.
9753
9754         * lib/savedir.h (savedir): Remove size arg.
9755
9756         * doc/tar.texi: Add @setchapternewpage odd.
9757         Remove -I as an alias for -T, for now.
9758         Add @dircategory.
9759         Update copyright.  Remove "Published by".
9760         Dates beginning with / or . are taken to be file names.
9761
9762         * src/tar.c (<time.h>): Do not include;
9763         (time): Do not declare.
9764         (usage): Remove -I as an alias for -T.
9765         (OPTION_STRING): Remove -I.
9766         (decode_options): Dates that look like an absolute path name,
9767         or that start with '.', are presumed to be file names whose
9768         dates are taken.
9769         Remove 'I' as an aliase for 'T'.
9770         Update copyright.
9771
9772         * src/extract.c (<time.h>): Do not include; system.h now does this.
9773         (make_directories): Skip filesystem prefixes.
9774         Don't assume '/' is the only separator.
9775         (extract_sparse_file): Use new full_write semantics.
9776         On write error, return instead of invoking skip_file.
9777         Do not free sparsearray; caller does this now.
9778         (apply_nonancestor_delayed_set_stat): Do not assume '/' is the only
9779         separator.
9780         (extract_archive): Don't assume file name lengths fit in int.
9781         Report what got stripped from member name; it might be more than '/'.
9782         Use new full_write semantics.
9783         Do not pass redundant trailing "/" to mkdir, as POSIX does not allow
9784         mkdir to ignore it.
9785         Do not report mkdir error if old_files_option == KEEP_OLD_FILES.
9786
9787         * src/buffer.c (<time.h>): Do not include; system.h now does this.
9788         (time): Remove decl; likewise.
9789         (child_open_for_uncompress): Use new full_write semantics.
9790         (flush_write): Use ISSLASH instead of testing for '/'.
9791         (flush_read): Likewise.
9792
9793         * src/rmt.h (_remdev): Look for / anywhere in Path.
9794
9795         * src/misc.c (contains_dot_dot): Skip filesystem prefix.
9796         Don't assume '/' is the only separator.
9797         (safer_rmdir): Don't assume '/' is the only separator.
9798
9799         * src/compare.c (diff_archive): Don't assume '/' is the only separator.
9800
9801         * lib/dirname.h (dirlen): New decl.
9802
9803         * src/incremen.c (get_directory_contents):
9804         Remove path_size arg; all callers changed.
9805         Don't assume '/' is the only directory separator.
9806         (gnu_restore): Work even if file name length doesn't fit in int.
9807
9808         * lib/addext.c (ISSLASH): New macro.
9809         (addext): Trim any redundant trailing slashes.
9810
9811         * src/names.c (name_next):
9812         Don't assume '/' is the only directory separator.
9813         (namelist_match): Likewise.
9814         (add_hierarchy_to_namelist): Remove dirsize arg.
9815         Do not assume '/' is the only directory separator.
9816         (new_name): Likewise.
9817
9818         * lib/Makefile.am (noinst_HEADERS): Add dirname.h, full-write.h.
9819         (libtar_a_SOURCES): Add dirname.c.
9820
9821         * src/create.c (relativize):
9822         New function, with much of old start_header's guts.
9823         Handle filesystem prefixes.
9824         (start_header): Use this new function.
9825         (init_sparsearray): Don't bother to zero out the new array;
9826         it's not needed.
9827         (deal_with_sparse): Fix array allocation bug.
9828         (create_archive): Don't assume '/' is the only separator.
9829         (dump_file): Likewise.
9830         Don't worry about leading / in symlink targets.
9831
9832         * lib/savedir.c (savedir):
9833         Remove size arg; it wasn't portable.  All callers changed.
9834
9835         * lib/utime.c (utime_null): Adjust to new full_write convention.
9836
9837         * configure.in (YACC): Avoid portability problem with Ultrix sh.
9838
9839         * lib/backupfile.c: Include <dirname.h>.
9840         (ISSLASH): New macro.
9841         (find_backup_file_name): Use dirlen to calculate directory lengths.
9842         (max_backup_version): Strip redundant trailing slashes.
9843
9844         * src/common.h: Include <full-write.h>.
9845         (get_directory_contents): No longer has size arg.
9846         (gnu_restore): Arg is size_t, not int.
9847
9848         * src/system.h: Include <time.h>.
9849         (time): Declare if not defined.
9850
9851         * lib/full-write.c: Include full-write.h, not safe-read.h.
9852         full_write returns size_t, with short writes meaning failure.
9853         All callers changed.
9854
9855         * src/rtapelib.c: Include full-write.h.
9856
9857         * src/rmt.c: Include full-write.h.
9858         (main): Update copyright.
9859
9860         * doc/getdate.texi: Mention that only English is supported.
9861         Show how to use "date" so that the output is acceptable to getdate.
9862         Mention Z as an abbreviation for UTC.
9863
9864         * lib/full-write.h: New file.
9865
9866         * src/list.c: system.h now does time.h stuff.
9867
9868         * lib/dirname.c:
9869         Use HAVE_STDLIB_H, not STDC_HEADERS, to decide whether to include
9870         stdlib.h.
9871         Do not include string.h, strings.h, or assert.h; no longer needed.
9872         (strrchr, memrchr, malloc): Remove decls; no longer needed.
9873         Include <xalloc.h>.
9874         (base_name): New decl.
9875         (BACKSLASH_IS_PATH_SEPARATOR): Remove.
9876         (dir_name_r): Remove.
9877         (dirlen): New function.
9878         (dir_name): Use dirlen instead of dir_name_r.
9879         (<string.h>, <strings.h>): Include only if test program.
9880         (main): Use "return 0", not "exit (0)".
9881
9882 2000-12-08  Paul Eggert  <eggert@twinsun.com>
9883
9884         * lib/dirname.h: New file.
9885
9886 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
9887
9888         * lib/fnmatch.c: Do not comment out all the code if we are using
9889         the GNU C library, because in some cases we are replacing buggy
9890         code in the GNU C library itself.
9891
9892 2000-10-30  Paul Eggert  <eggert@twinsun.com>
9893
9894         * lib/fnmatch.c (FOLD): Do not assume that characters are unsigned.
9895
9896 2000-10-29  Paul Eggert  <eggert@twinsun.com>
9897
9898         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.18.
9899
9900         * src/tar.c: Include <fnmatch.h>, for FNM_LEADING_DIR.
9901
9902 2000-10-28  Paul Eggert  <eggert@twinsun.com>
9903
9904         * doc/tar.texi: --no-recursion now applies to extraction, too.
9905         * src/create.c (dump_file): no_recurse_option -> ! recursion_option
9906         * src/names.c (namelist_match, excluded_name):
9907         Do not match subfiles of a directory
9908         if --no-recursion is specified.
9909         * src/tar.c (NO_RECURSE_OPTION): Remove.
9910         (long_options): Have getopt set the --no-recursion flag.
9911         (decode_options): Initialize recursion_option to FNM_LEADING_DIR.
9912         Remove case for NO_RECURSE_OPTION.
9913         * src/common.h (recursion_option):
9914         Renamed from no_recurse_option, with sense
9915         negated, and with FNM_LEADING_DIR being the nonzero value.
9916
9917         * names.c (namelist_match): New function.
9918         (name_match, name_scan): Use it to eliminate duplicate code.
9919         (names_notfound): Remove special case for Amiga.
9920
9921 2000-10-27  Paul Eggert  <eggert@twinsun.com>
9922
9923         * src/misc.c (read_error_details, read_warn_details,
9924         read_fatal_details): Don't assume size_t is unsigned long.
9925
9926         * src/buffer.c (flush_read): If read_full_records_option, try to
9927         fill the input buffer, as --delete -f - needs this.
9928
9929 2000-10-24  Paul Eggert  <eggert@twinsun.com>
9930
9931         * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Port to autoconf 2.13.
9932
9933         * src/buffer.c (check_label_pattern):
9934         Make sure header name is a string before
9935         passing it to fnmatch.
9936         (init_volume_number): Check for global_volno overflow.
9937         (new_volume): Check for global_volno overflow.
9938
9939         * src/tar.c (decode_options):
9940         Check that volume label is not too long to overflow
9941         name in tar header block.
9942
9943         * Makefile.am (EXTRA_DIST): Remove rebox.el.
9944
9945         * configure.in (HAVE_DECL_STRERROR_R): Remove our handwritten code.
9946         (AC_FUNC_STRERROR_R): Use this instead.
9947
9948 2000-10-23  Paul Eggert  <eggert@twinsun.com>
9949
9950         * src/extract.c: Include <time.h>, since we invoke "time".
9951
9952         * lib/prepargs.c (prepend_default_options):
9953         Don't use NULL, for portability.
9954
9955         * m4/fnmatch.m4: Add "working" to message.
9956
9957         * src/names.c: (_GNU_SOURCE): Remove; autoconf now does this.
9958         Include <hash.h>.
9959         (getpwuid, getgrgid): Declare only if system headers don't.
9960         (gid_to_gname): Don't invoke setgrent.
9961         (namelist): Now static, not global.
9962         (nametail): New var.  All uses of namelast changed to use
9963         nametail, with one extra level of indirection.
9964         (name_gather): Use memcpy instead of strncpy + assignment of NUL.
9965         (name_match): Set nametail too, when setting namelist to null.
9966         (add_hierarchy_to_namelist): Change type of dir arg from char * to
9967         struct name *, so that we don't have to look up the name again
9968         here.  Get change_dir from dir rather than as a separate arg.  Add
9969         dirsize arg, and pass it along to get_directory_contents.  Remove
9970         unnecessary check of directory type.
9971         (new_name): Do not append a slash if PATH already ends in one.
9972         (avoided_names, struct avoided_name): Remove.
9973         (avoided_name_table): New var, replacing avoided_names.
9974         (hash_avoided_name, compare_avoided_names): New function.
9975         (add_avoided_name, is_avoided_name): Use hash table rather than
9976         linked list.
9977
9978         * src/buffer.c (_GNU_SOURCE): Remove; autoconf now does this.
9979         (child_open_for_compress, child_open_for_uncompress,
9980         close_archive): Propagate any failure of the compression process
9981         back to "tar".
9982         (open_archive, flush_write, flush_read, close_archive): Do not
9983         allocate an array of size PATH_MAX, as PATH_MAX might be (size_t)
9984         -1.  Instead, allocate an array with the size that's needed.
9985         (open_archive): Don't bother checking S_ISCHR of /dev/null.
9986         (backspace_output): Don't try to backspace past start of archive.
9987         (close_archive): Remove special case for DELETE_SUBCOMMAND.
9988
9989         * acconfig.h (_GNU_SOURCE, DEFAULT_ARCHIVE, DEFAULT_BLOCKING,
9990         DENSITY_LETTER, DEVICE_PREFIX, EMUL_OPEN3, HAVE_GETGRGID,
9991         HAVE_GETPWUID, HAVE_MKNOD, HAVE_RTAPELIB, HAVE_ST_FSTYPE_STRING,
9992         HAVE_UNION_WAIT, HAVE_UTIME_H, HAVE_VALLOC, MTIO_CHECK_FIELD, PACKAGE,
9993         PROTOTYPES, REMOTE_SHELL, STD_INC_PATH, VERSION, WITH_CATALOGS,
9994         WITH_DMALLOC, WITH_REGEX):
9995         Remove; now generated automatically.
9996
9997         * configure.in (_GNU_SOURCE): Define to empty, not 1, for
9998         compatibility for glibc fragments.
9999         (_GNU_SOURCE, HAVE_UTIME_H, MTIO_CHECK_FIELD,
10000         HAVE_ST_FSTYPE_STRING, HAVE_MKNOD, REMOTE_SHELL, DENSITY_LETTER,
10001         DEVICE_PREFIX, DEFAULT_ARCHIVE, DEFAULT_BLOCKING): Add comment so
10002         that we needn't put an entry into acconfig.h.
10003         (ALL_LINGUAS): Add da.
10004         (AC_C_BACKSLASH_A): Remove; jm_PREREQ_QUOTEARG now does this.
10005         (AC_CHECK_HEADERS): Add stdbool.h (for hash.h users), wctype.h
10006         (for strtol.c).
10007         (AC_MBSTATE_T): Add.
10008         (RMT): Append $(EXEEXT).
10009         (HAVE_GETGRGID, HAVE_GETPWUID, pe_AC_TYPE_SIGNED_CHAR): Remove.
10010         (HAVE_DECL_FREE, HAVE_DECL_GETGRGID, HAVE_DECL_GETPWUID,
10011         HAVE_DECL_GETENV, HAVE_DECL_MALLOC, HAVE_DECL_STRTOUL,
10012         HAVE_DECL_STRTOULL, HAVE_DECL_STRERROR_R): New macros.
10013         (jm_PREREQ_ADDEXT, jm_PREREQ_ERROR, jm_PREREQ_QUOTEARG): Add.
10014         (AC_REPLACE_FUNCS): Remove execlp; no longer needed.
10015         (AC_CHECK_FUNCS): Add clock_gettime; AC_SEARCH_LIBS wasn't enough.
10016         Remove mbrtowc; jm_PREREQ_QUOTEARG now does this.
10017         (EMUL_OPEN3): Remove; no longer needed.
10018         (DENSITY_LETTER, DEVICE_PREFIX): Simplify m4 quoting.
10019
10020         * m4/fnmatch.m4 (AC_FUNC_FNMATCH): Detect d*/*1 vs d/s/1 bug.
10021
10022         * src/common.h: Do not include basename.h.
10023         * src/rtapelib.c (base_name): Do not include basename.h;
10024         declare base_name instead.
10025
10026         * lib/basename.h, lib/execlp.c, lib/getpagesize.h, lib/mkdir.c:
10027         Remove these files.
10028         * lib/getstr.c, lib/getstr.h, lib/hash.h, lib/hash.h, lib/prepargs.c,
10029         lib/prepargs.h, lib/savedir.c, lib/savedir.h: New files.
10030         * lib/Makefile.am (EXTRA_DIST, noinst_HEADERS, libtar_a_SOURCES):
10031         Adjust to the above changes.
10032
10033         * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove ../src/ansi2knr.
10034
10035         * src/open3.c: Remove.
10036
10037         * src/Makefile.am (AUTOMAKE_OPTIONS): Remove ansi2knr.
10038         (tar_SOURCES): Remove open3.c.
10039         (INCLUDES): Remove -I.., as automake does that.
10040         (OMIT_DEPENDENCIES): ../lib/fnmatch.h -> fnmatch.h.  Add localedir.h.
10041
10042         The following changes are to put LOCALEDIR into localedir.h instead
10043         of passing it on the command line.
10044         (DEFS): Remove.
10045         (DISTCLEANFILES): New macro.
10046         (localedir.h): New rule.
10047         (rmt.o tar.o): Now depend on localedir.h.
10048
10049         * tests/delete02.sh, tests/extrac04.sh: New files.
10050
10051         * tests/Makefile.am (AUTOMAKE_OPTIONS): Remove ansi2knr.
10052         (TESTS): Add extrac04.sh, and restore delete02.sh.
10053         (DEFS): Remove; LOCALEDIR is now done via localedir.h.
10054         (INCLUDES): Remove -I.. as automake does this now.
10055
10056         * src/rtapelib.c (rexec): Don't declare unless using it.
10057         (do_command): Simplify signal-handling code slightly.
10058
10059         * src/delete.c (blocks_needed): Remove.  All uses changed to use
10060         blocking_factor - new_blocks.
10061         (acting_as_filter): New var.
10062         (write_record, delete_archive_members): Use acting_as_filter
10063         rather than archive == STDIN_FILENO to detect whether we're acting
10064         as a filter, as open can return STDIN_FILENO in some cases.
10065         (delete_archive_members): Ignore zero blocks if
10066         ignore_zeros_option is nonzero.  Fix bug that messed up last
10067         output block: write_eot can't be used here, as it gets confused
10068         when the input is at end of file.
10069
10070         * src/compare.c (diff_archive): Do not impose an arbitrary limit on
10071         symbolic link contents length.  Pass directory size to
10072         get_directory_contents.
10073
10074         * m4/decl.m4, m4/error.m4, m4/mbstate_t.m4, m4/prereq.m4,
10075         m4/strerror_r.m4: New files.
10076         * m4/signedchar.m4: Remove this file.
10077         * Makefile.am (ACINCLUDE_INPUTS): Adjust to above changes.
10078         * m4/Makefile.am (EXTRA_DIST): Likewise.
10079
10080         * Makefile.am (DISTCLEANFILES): Add intl/libintl.h.
10081
10082         * po/da.po: New translation file.
10083
10084         * src/mangle.c (extract_mangle):
10085         Fix diagnostic with wrong number of %s'es.
10086
10087         * lib/fnmatch.c (fnmatch):
10088         Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
10089         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
10090
10091         * lib/full-write.c (full_write): Some buggy drivers return 0 when you
10092         fall off a device's end.  Detect this.
10093
10094         * src/system.h (IN_CTYPE_DOMAIN): Renamed from CTYPE_DOMAIN.  All
10095         uses changed.
10096         (open): Remove macro; we no longer support EMUL_OPEN3.  Do not
10097         include <pathmax.h> and directory include files like <dirent.h>;
10098         no longer used.  Include <savedir.h> instead.
10099         (closedir, signed_char): remove macro; no longer used.
10100         (bool, false, true): Include <stdbool.h> if you have the include
10101         file, otherwise define.
10102
10103         * src/misc.c:
10104         (is_dot_or_dotdot, closedir_error, closedir_warn, opendir_error,
10105         opendir_warn, readdir_error): Remove; no longer needed.
10106         (safer_rmdir): Strip leading ./ (or .// or ./// or ././ or etc.)
10107         before deciding whether we're trying to remove ".".
10108         (remove_any_file): Try unlink first if we are not root.  Use
10109         savedir when recursively removing directories, to avoid exhausting
10110         file descriptors.
10111         (savedir_error, savedir_warn, symlink_error): New functions.
10112
10113         * src/list.c: (read_and): Do not invoke
10114         apply_nonancestor_delayed_set_stat; DO_SOMETHING is now
10115         responsible for that.  Do not invoke apply_delayed_set_stat; our
10116         caller is now responsible for that.
10117         (read_header): Use signed char instead of signed_char.  Prevent
10118         later references to current_header from mistakenly treating it as
10119         an old GNU header.
10120         (from_header): Quote invalid base-64 strings in diagnostics.
10121         (time_from_header): Do not warn about future timestamps in
10122         archive; check_time now does that.
10123         (print_header): Quote unknown file types.
10124         (skip_member): New function, replacing skip_extended_headers and
10125         now skipping the whole member instead of just the extended
10126         headers.  All callers changed.  This makes the code handle
10127         extended headers uniformly, and fixes some bugs.
10128
10129         * src/update.c (update_archive): Use skip_member.
10130
10131         * src/extract.c (we_are_root): Now global.
10132         (struct delayed_symlink): New type.
10133         (delayed_symlink_head): New var.
10134         (extr_init, fatal_exit): Invoke extract_finish on fatal errors,
10135         not apply_delayed_set_stat.
10136         (set_mode, set_stat): Pointer args are now const pointers.
10137         (check_time): New function.
10138         (set_stat): Warn if setting a file's timestamp to be the future.
10139         (make_directories): Do not save and restore errno.
10140         (maybe_recoverable): Set errno to ENOENT if we cannot make missing
10141         intermediate directories.
10142         (extract_archive): Invoke apply_nonancestor_delayed_set_stat here,
10143         not in caller.  Extract potentially dangerous symbolic links more
10144         carefully, deferring their creation until the end, and using a
10145         regular file placeholder in the meantime.  Do not remove trailing
10146         / and /. from file names.  Do not bother checking for ".." when
10147         checking whether a directory loops back on itself, as loopbacks
10148         can occur with symlinks too.  Also, in that case, do not bother
10149         saving and restoring errno; just set it to EEXIST.
10150         (apply_nonancestor_delayed_set_stat): A prefix is a potential
10151         ancestor if it ends in slash too (as well as ending in a char just
10152         before slash).
10153         (apply_delayed_set_stat): Remove.
10154         (apply_delayed_symlinks, extract_finish): New functions.
10155
10156         * doc/fdl.texi: New file.
10157         * doc/Makefile.am (EXTRA_DIST): Add fdl.texi.
10158         ($(srcdir)/tar.info): Add fdl.texi.  Invoke makeinfo with --no-split.
10159         * doc/tar.texi: Add Free Documentation License.  New section
10160         "Overwrite Old Files", and revamp that section to make it easier to
10161         follow.  "tar" -> "GNU tar" where appropriate.  Migrate getdate
10162         documentation into getdate.texi.  Fix several minor typos.  Describe
10163         TAR_OPTIONS.  Describe incompatibility between incremental backups and
10164         --atime-preserve.  Describe incompatibility between --verify and other
10165         options.  Mention that tar normally removes symbolic links rather than
10166         following them, when extracting a file of the same name.
10167
10168         * THANKS: Add gpoul.  Change skip's address.
10169
10170         * po/POTFILES.in: Add lib/human.c.
10171
10172         * src/common.h (namelist, namelast): Remove decls.
10173         (we_are_root, extract_finish, skip_member, savedir_error,
10174         savedir_warn, symlink_error, gnu_list_name): New decls.
10175         (apply_delayed_set_stat, apply_nonancestor_delayed_set_stat,
10176         skip_extended_headers, is_dot_or_dotdot, closedir_error,
10177         closedir_warn, opendir_error, opendir_warn, readdir_error,
10178         readdir_warn): Remove decls.
10179         (get_directory_contents): New off_t arg.
10180         (addname): Now returns struct name *.
10181
10182         * src/tar.h, tests/genfile.c: Fix comments.
10183
10184         * src/create.c: Include hash.h.
10185         (gnu_list_name): Remove decl.
10186         (struct link): Remove "next" member.
10187         (linklist): Remove.
10188         (start_header): Say "leading `FOO'" rather than "`FOO' prefix" for
10189         consistency with other diagnostics.
10190         (deal_with_sparse): Check for I/O error when closing the file.
10191         (create_archive): Do not allocate an array of size PATH_MAX, as
10192         PATH_MAX might be (size_t) -1.  Instead, allocate an array with
10193         the size that's needed.
10194         (hash_link, compare_links): New functions.
10195         (dump_file): Do not exhaust open file descriptors when descending
10196         deeply into a directory, by using savedir rather than
10197         opendir/readdir.  Do not zero-fill the name buffer unnecessarily.
10198         Hash the set of links already created, instead of using a linked
10199         list.  Fix some bugs in outputting sparse files which caused the
10200         sparse tables to be incorrect.  When a file unexpectedly shrinks,
10201         output zeros rather than garbage.  Do not allocate an array of
10202         size PATH_MAX, as PATH_MAX might be (size_t) -1.  Instead,
10203         allocate an array with the size that's needed.
10204
10205         * src/incremen.c: Include hash.h.
10206         (struct directory): Remove "next", "dir_text".  Change "name" to
10207         be char[1] with struct hack, not const char *.  Add "found".
10208         (directory_list): Remove.  Replaced by directory_table.
10209         (directory_table): New var.
10210         (nfs_string): Renamed from nfs.
10211         (hash_directory, compare_directories): New functions.
10212         (note_directory): Now returns struct directory *.  First arg is
10213         now const pointer.  struct stat arg is now dev_t, ino_t, nfs.
10214         Remove text arg.  New "found" arg, basically corresponding to the
10215         old text arg not being null.  All callers changed.
10216         (note_directory, find_directory): Use hash table rather than
10217         linked list.
10218         (get_directory_contents): New arg "device".  Use savedir to do the
10219         hard work.  Save the nfs-ness of stat_data, since it might change
10220         under us.  Use note_directory instead of find_directory to save
10221         some work.  When adding an "A" record, do it with
10222         add_to_accumulator instead of cheating with strcat.
10223         (read_directory_file): Use "+" flag before device to indicate
10224         whether it was NFS.  Fix typo in checking for strtoul error.
10225         (write_directory_file_entry): New function.
10226         (write_directory_file): Use it, and use the hash routines to
10227         traverse the directory table.
10228         (gnu_restore): Use savedir rather than opendir/readdir.
10229
10230         * src/tar.c: Include localedir.h, prepargs.h.
10231         (long_options): Now static.
10232         (long_options, usage, decode_options): -j is now short for
10233         --bzip2, and -I is now an alias for -T.
10234         (decode_options, main): argv is not const pointer now.
10235         (decode_options): Invoke prepend_default_options to support
10236         TAR_OPTIONS.  In diagnostic, mention the string that was the
10237         invalid blocking factor, tape length, group, owner, or record
10238         size.  --delete is no longer incompatible with -f -, undoing
10239         2000-01-07 change.
10240         (main): Invoke extract_finish at end of extraction.
10241
10242         * src/rmt.c: Include localedir.h.
10243         (main): Update copyright date to 2000.
10244
10245         * doc/getdate.texi: New file, taken from fileutils 4.0.27, with the
10246         following changes: Use @sc where appropriate.  Document the ranges of
10247         supported times more precisely.  Add Eggert to getdate authors.
10248         Document old Latin 12m/12pm tradition.  Remove list of alphabetic time
10249         zone names, as it wasn't correct and people shouldn't be relying on it
10250         anyway.  Relative items also account for non-DST adjustments.  Fix
10251         some misspellings.
10252
10253         * lib/prepargs.c, lib/prepargs.h, tests/extrac04.sh: New file.
10254
10255         * tests/ignfail.sh: opendir -> savedir in diagnostics.
10256
10257         * tests/preset.in: Set LANGUAGE to the empty string, for some
10258         brain damaged host.
10259
10260 2000-10-20  Paul Eggert  <eggert@twinsun.com>
10261
10262         * m4/fnmatch.m4: Mention the GNU C library.
10263
10264 2000-10-19  Paul Eggert  <eggert@twinsun.com>
10265
10266         * m4/fnmatch.m4: Add a couple more test cases to catch bugs in
10267         glibc 2.1.95.
10268
10269 2000-10-17  Paul Eggert  <eggert@twinsun.com>
10270
10271         * lib/human.c (<limits.h>): Do not include; human.h does it if needed.
10272         (CHAR_BIT): Remove.
10273
10274         * lib/human.h (<limits.h>): Include if HAVE_LIMITS_H.
10275         (CHAR_BIT): Define if not defined.
10276
10277 2000-09-09  Paul Eggert  <eggert@twinsun.com>
10278
10279         * lib/quotearg.c: From fileutils: rename ISASCII to IN_CTYPE_DOMAIN.
10280
10281 2000-08-07  Paul Eggert  <eggert@twinsun.com>
10282
10283         * lib/xmalloc.c: Memory exhausted -> memory exhausted
10284
10285         * lib/xalloc.h (xalloc_msg_memory_exhausted):
10286         change to array from char *.
10287
10288 2000-08-06  Paul Eggert  <eggert@twinsun.com>
10289
10290         * m4/mbstate_t.m4: Define mbstate_t to be int, not char, for
10291         compatibility with glibc 2.1.3 strftime.c.
10292
10293 2000-07-31  Paul Eggert  <eggert@twinsun.com>
10294
10295         * lib/quotearg.c (quotearg_n_options):
10296         Don't make the initial slot vector a constant,
10297         since it might get modified.
10298
10299         * lib/quotearg.c: Add support for more than one preallocated slot.
10300
10301 2000-07-30  Paul Eggert  <eggert@twinsun.com>
10302
10303         * lib/quotearg.c (quotearg_n_options):
10304         Preallocate a slot 0 buffer, so that the caller
10305         can always quote one small component of a "memory exhausted" message
10306         in slot 0.
10307
10308 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10309
10310         * lib/quotearg.c:
10311         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX), so that
10312         mbstate_t is always defined.
10313
10314         Do not inspect MB_LEN_MAX, since it's incorrectly defined to be 1 in
10315         some GCC installations, and this configuration error is likely to be
10316         common.
10317
10318 2000-07-22  Paul Eggert  <eggert@twinsun.com>
10319
10320         * lib/quotearg.c:
10321         When the system forces us to redefine mbstate_t, shadow its mbsinit
10322         function.  From Bruno Haible.
10323
10324 2000-07-14  Paul Eggert  <eggert@twinsun.com>
10325
10326         * lib/xmalloc.c: Simplify exhausted message.
10327
10328         * lib/quotearg.h: Update copyright date; from Jim Meyering.
10329
10330 2000-07-13  Paul Eggert  <eggert@twinsun.com>
10331
10332         * lib/quotearg.h (enum quoting style):
10333         New constant clocale_quoting_style.
10334
10335         * lib/quotearg.c:
10336         (quoting_style_args, quoting_style_vals, quotearg_buffer_restyled):
10337         Add support for clocale_quoting_style, undoing previous change to
10338         locale_quoting_style.
10339
10340 2000-07-10  Paul Eggert  <eggert@twinsun.com>
10341
10342         * lib/quotearg.c:
10343         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX,
10344         since otherwise we don't need it.
10345         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
10346         since we don't do multibytes in that case.
10347         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
10348         invoke multibyte primitives.
10349
10350         * m4/mbstate_t.m4 (AC_MBSTATE_T):
10351         Renamed from AC_MBSTATE_T_OBJECT.  All uses changed.
10352         Change from a two-part test, which defines both HAVE_MBSTATE_T_OBJECT
10353         and mbstate_t, to a single-part test that simply defines mbstate_t.
10354
10355         * lib/quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
10356         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
10357         to decide whether to define the BeOS workaround macro;
10358         this adjusts to the change to AC_MBSTATE_T.
10359
10360         * m4/strerror_r.m4: New file.
10361
10362 2000-07-05  Paul Eggert  <eggert@twinsun.com>
10363
10364         * lib/quotearg.c: Use double-quote to quote.
10365
10366         * lib/quotearg.c (N_): New macro.
10367         (gettext_default): New function.
10368         (quotearg_buffer_restyled): Use gettext_default ("{LEFT QUOTATION MARK}",
10369         "\"") for left quote, and gettext_default ("{RIGHT QUOTATION MARK}", "\"")
10370         for right quote.
10371
10372         * lib/quotearg.c (struct quoting_options):
10373         Simplify quote_these_too dimension.
10374         From Bruno Haible  <haible@clisp.cons.org>.
10375
10376         * m4/mbstate_t.m4 (AC_MBSTATE_T_OBJECT):
10377         Test for mbstate_t only if the test
10378         for an object-type mbstate_t fails.
10379
10380         * lib/quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
10381
10382 2000-07-03  Paul Eggert  <eggert@twinsun.com>
10383
10384         * m4/mbstate_t.m4 (AC_MBSTATE_T_OBJECT): Port to autoconf 2.13.
10385         Add AC_CHECK_HEADERS(stdlib.h), since we use HAVE_STDLIB_H.
10386
10387         * lib/quotearg.c (mbrtowc):
10388         Assign to *pwc, and return 1 only if result is nonzero.
10389         (iswprint): Define to ISPRINT if we are substituting our own mbrtowc.
10390
10391 2000-07-02  Paul Eggert  <eggert@twinsun.com>
10392
10393         * lib/quotearg.c (mbstate_t):
10394         Do not define; it should be defined with AC_CHECK_TYPE.
10395
10396 2000-06-26  Paul Eggert  <eggert@twinsun.com>
10397
10398         * m4/mbstate_t.m4: Include stdio.h before wchar.h, to work around
10399         a bug in glibc 2.1.3.
10400
10401         * lib/xmalloc.c: Fix inaccurate comment for xrealloc.
10402
10403 2000-06-19  Paul Eggert  <eggert@twinsun.com>
10404
10405         * lib/quotearg.c (ISASCII): Add #undef and move definition to follow
10406         inclusion of wctype.h to work around solaris2.6 namespace pollution.
10407         (ISPRINT): Likewise.
10408         Reported by Tom Tromey.
10409
10410 2000-06-15  Paul Eggert  <eggert@twinsun.com>
10411
10412         * lib/human.c (adjust_value): New function.
10413         (human_readable_inexact): Apply rounding style even when printing
10414         approximate values.
10415
10416         * lib/human.c: Avoid shadowing warnings.
10417         From Jim Meyering.
10418
10419 2000-06-14  Paul Eggert  <eggert@twinsun.com>
10420
10421         * lib/human.c (human_readable_inexact): Allow an input block size
10422         that is not a multiple of the output block size, and vice versa.
10423
10424         * lib/getdate.y (get_date): Apply relative times after time zone
10425         indicator, not before.
10426
10427 2000-05-31  Paul Eggert  <eggert@twinsun.com>
10428
10429         * m4/largefile.m4: Rewrite so that we don't need to run getconf,
10430         and thus don't need AC_CANONICAL_HOST.
10431
10432         (AC_SYS_LARGEFILE_FLAGS, AC_SYS_LARGEFILE_SPACE_APPEND): Remove.
10433         (AC_SYS_LARGEFILE_TEST_INCLUDES): New macro.
10434         (AC_SYS_LARGEFILE_MACRO_VALUE): Change arguments from
10435         CODE-TO-SET-DEFAULT to VALUE, INCLUDES, FUNCTION-BODY.  All uses
10436         changed.  Instead of inspecting the output of getconf, try to
10437         compile the test program without and with the macro definition.
10438         (AC_SYS_LARGEFILE): Do not require AC_CANONICAL_HOST or check for
10439         getconf.  Instead, check for the needed flags by compiling test
10440         programs.
10441
10442         * configure.in (AC_CANONICAL_HOST): Remove; the largefile stuff no
10443         longer needs it.
10444         * config.guess, config.sub: Remove these files, for similar reasons.
10445
10446 2000-05-03  Paul Eggert  <eggert@twinsun.com>
10447
10448         * m4/largefile.m4 (AC_SYS_LARGEFILE): Define _XOPEN_SOURCE to be
10449         500, instead of _GNU_SOURCE to be 1, to work around glibc 2.1.3
10450         bug.  This avoids a clash when files like regex.c that define
10451         _GNU_SOURCE.
10452
10453 2000-05-02  Paul Eggert  <eggert@twinsun.com>
10454
10455         * m4/largefile.m4 (AC_SYS_LARGEFILE):
10456         Define _GNU_SOURCE if this is needed to make
10457         ftello visible (e.g. glibc 2.1.3).  Use compile-time test, rather than
10458         inspecting host and OS, to decide whether to define _LARGEFILE_SOURCE.
10459
10460         * lib/quotearg.c (mbrtowc, mbstat_t):
10461         Add definitions if !HAVE_MBSTATE_T_OBJECT.
10462         (<wctype.h>): Include if HAVE_WCTYPE_H.
10463         (iswprint): Define to 1 if we lack it
10464
10465 2000-04-18  Paul Eggert  <eggert@twinsun.com>
10466
10467         * m4/mbstate_t.m4: New file.
10468
10469 2000-04-17  Bruno Haible  <haible@clisp.cons.org>
10470
10471         * tests/ignfail.sh: Test for uid 0 along with user "root".
10472
10473 2000-04-05  Paul Eggert  <eggert@twinsun.com>
10474
10475         * m4/largefile.m4 (AC_SYS_LARGEFILE_FLAGS):
10476         Don't use -n32 on IRIX if the installer said
10477         otherwise.
10478
10479 2000-02-28  Paul Eggert  <eggert@twinsun.com>
10480
10481         * lib/quotearg.c (ALERT_CHAR): New macro.
10482         (quotearg_buffer_restyled): Use it.
10483
10484 2000-02-23  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
10485
10486         * src/list.c (tartime): Fix off-by-one error when copying year if
10487         OLD_CTIME.
10488
10489 2000-02-18  Paul Eggert  <eggert@twinsun.com>
10490
10491         * lib/getdate.y: Handle two-digit years with leading zeros correctly.
10492         (textint): New typedef.
10493         (parser_control): Changed from struct parser_control to typedef
10494         (for consistency).  Member year changed from int to textint.  All
10495         uses changed.
10496         (YYSTYPE): Removed; replaced by %union with int and textint
10497         members.
10498         (tID): Removed; not used.
10499         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE,
10500         tMERIDIAN, tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER,
10501         tUNUMBER, tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
10502         (tSNUMBER, tUNUMBER): Now of type <textintval>.
10503         (date, number, to_year): Use width of number in digits, not its
10504         value, to determine whether it's a 2-digit year, or a 2-digit
10505         time.
10506         (yylex): Store number of digits of numeric tokens.  Return '?' for
10507         unknown identifiers, rather than (unused) tID.
10508
10509 2000-01-16  Paul Eggert  <eggert@twinsun.com>
10510
10511         * lib/quotearg.c (quotearg_buffer_restyled):
10512         Do not quote alert, backslash, formfeed,
10513         and vertical tab unnecessarily in shell quoting style.
10514
10515 2000-01-15  Paul Eggert  <eggert@twinsun.com>
10516
10517         * m4/c-bs-a.m4:
10518         Change quoting to be compatible with future autoconf versions.
10519
10520 2000-01-11  Paul Eggert  <eggert@twinsun.com>
10521
10522         * lib/exclude.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Remove unused macros.
10523
10524 2000-01-07  Paul Eggert  <eggert@twinsun.com>
10525
10526         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.17.
10527
10528         Fix bug with fnmatch.h dependency, as follows:
10529         * src/Makefile.am (OMIT_DEPENDENCIES): New macro.
10530         * lib/Makefile.am (OMIT_DEPENDENCIES): New macro.
10531
10532         * src/common.h (apply_nonancestor_delayed_set_stat):
10533         Renamed from apply_delayed_set_stat.
10534         (apply_delayed_set_stat, decode_mode, chmod_error_details,
10535         chown_error_details, close_warn, closedir_warn, mkdir_error,
10536         read_error_details, read_fatal_details, read_warn_details,
10537         seek_error_details, seek_warn_details, utime_error,
10538         write_error_details, write_fatal_details): New decls.
10539
10540         Make diagnostic messages more regular.
10541         * src/create.c (dump_file): Quote file names with colons if possible.
10542         * src/compare.c (diff_archive): Likewise.
10543         * src/extract.c (repair_delayed_set_stat, extract_archive): Likewise.
10544         * src/incremen.c (get_directory_contents, gnu_restore): Likewise.
10545         * src/mangle.c (extract_mangle): Likewise.
10546         * src/misc.c (call_arg_error, call_arg_fatal, call_arg_warn):
10547         Likewise.
10548         * src/buffer.c (archive_write_error, flush_archive, close_archive,
10549         new_volume, xclose):
10550         Use error message functions to report errors consistently.
10551         * src/compare.c (diff_sparse_files, diff_archive): Likewise.
10552         * src/create.c (finish_sparse_file, dump_file): Likewise.
10553         * src/extract.c (set_mode, set_stat, extract_sparse_file,
10554         extract_archive): Likewise.
10555         * src/list.c (list_archive): Likewise.
10556         * src/update.c (append_file): Likewise.
10557         * src/compare.c (diff_init, diff_sparse_files):
10558         Use xalloc_die to report memory exhaustion.
10559         * src/incremen.c (gnu_restore): Likewise.
10560         * src/list.c (read_header): Likewise.
10561         * src/mangle.c (extract_mangle): Likewise.
10562         * src/misc.c (maybe_backup_file): Likewise.
10563         * src/tar.c (decode_options): Likewise.
10564         * src/compare.c (read_and_process, fill_in_sparse_array,
10565         diff_sparse_files):
10566         Use consistent terminology for unexpected-EOF message.
10567         * src/extract.c (extract_sparse_file, extract_archive): Likewise.
10568         * src/list.c (list_archive, read_header, skip_file,
10569         skip_extended_headers): Likewise.
10570         * src/buffer.c (archive_write_error): Add noreturn attribute to decl.
10571         (xdup2): Regularize messages with rest of tar.
10572
10573         * src/buffer.c (flush_read): Don't read past EOF.
10574
10575         * src/extract.c (extr_init):
10576         If we run out of memory, invoke apply_delayed_set_stat.
10577         (prepare_to_extract): Don't complain if we can't remove ".".
10578         (apply_delayed_set_stat): New function.
10579         (apply_nonancestor_delayed_set_stat):
10580         Renamed from apply_delayed_set_stat.  All uses changed.
10581         Don't remove head if it doesn't apply.
10582
10583         * src/create.c (find_new_file_size):
10584         Return size instead of storing through pointer.
10585         All callers changed.
10586         (deal_with_sparse): Don't keep reading after read errors.
10587         (finish_sparse_file): Just abort if there is an internal error.
10588         (dump_file): Fix typo: stat_warn and stat_error were interchanged.
10589         Don't restore access times on directories during incremental dumps
10590         until after dealing with the directory.
10591         If ignoring failed reads, count closedir, read, and unknown
10592         file errors as warnings, not errors.
10593         Fix buffer overrun problem when dumping sparse files.
10594
10595         * src/list.c (read_and):
10596         Invoke apply_nonancestor_delayed_set_stat on file names
10597         after handling them.
10598         (decode_mode): Remove; moved to misc.c.
10599
10600         * src/misc.c (safer_rmdir): New function.
10601         (remove_any_file): Use it to avoid problems with rmdir(".").
10602         (maybe_backup_file): Regularize diagnostics.
10603         (undo_backup_file): Likewise.
10604         (decode_mode): Moved here from list.c.
10605         (chmod_error_details, chown_error_details, close_fatal,
10606         close_warn, closedir_warn, mkdir_error, read_error_details,
10607         read_warn_details, read_fatal_details, seek_error_details,
10608         seek_warn_details, utime_error, write_error_details,
10609         write_fatal_details): New functions.
10610
10611         * src/delete.c (save_record): Remove static variable (now local).
10612         (move_archive): Don't position before start of archive.
10613         (write_record): Abort if count is zero at inopportune time.
10614         Plug memory leak.
10615
10616         * src/tar.c (decode_options): --delete and -f - are now
10617         incompatible, since we didn't have time to fix their bugs.
10618
10619         * tests/Makefile.am (TESTS): Remove delete02.sh.
10620         * tests/ignfail.sh: Adjust to new quoting scheme again.
10621
10622 2000-01-06  Paul Eggert  <eggert@twinsun.com>
10623
10624         * lib/getdate.y: Sync tm_diff with the GNU C Library.
10625         (TM_YEAR_BASE): Renamed from TM_YEAR_ORIGIN.  All uses changed.
10626         (tm_diff): Renamed from difftm.  All uses changed.
10627         Replace body with that taken from GNU C Library 2.1.3pre1.
10628         (get_date): Prefer tm_gmtoff to tm_diff if available.
10629
10630 1999-12-29  "Melissa O'Neill"  <oneill@cs.sfu.ca>
10631
10632         * tests/incremen.sh: Invoke stat on newly created file so that its
10633         ctime is updated on Nextstep.
10634
10635 1999-12-21  Machael Stone  <mstone@cs.loyola.edu>
10636
10637         * lib/getdate.y (get_date):
10638         Fix typo when checking for time_t overflow in time zone calculations.
10639
10640 1999-12-13  Paul Eggert  <eggert@twinsun.com>
10641
10642         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.16.
10643
10644         * README-alpha: New file.
10645         * README: New sections for gzip and bzip2, Solaris.
10646         Remove mention of BACKLOG.
10647
10648         * configure.in (AC_C_BACKSLASH_A): Add.
10649         (AC_CHECK_HEADERS): Add wchar.h.
10650         (AC_CHECK_FUNCS): Add mbrtowc.
10651         (AC_FUNC_CLOSEDIR_VOID): Add.
10652
10653         * tests/Makefile.am (TESTS): Add delete02.sh.
10654         (POSTPONED_TESTS): Remove.
10655         (EXTRA_DIST): Remove $(POSTPONED_TESTS).
10656
10657         * tests/preset.in:
10658         Set LC_ALL rather than LANGUAGE, LANG, and LC_MESSAGES.
10659
10660         * tests/ignfail.sh (err): Adjust to new quoting scheme.
10661
10662         * tests/delete02.sh: Fix typo: need to list archive2, not archive.
10663
10664         * tests/extrac03.sh: Use -P option, so that .. doesn't get diagnosed.
10665
10666         * src/tar.c ("quotearg.h"): New include.
10667         (usage): Now has __attribute__ ((noreturn)).
10668         (confirm): Report errno if we can't open tty.
10669         (confirm, decode_options):
10670         Quote arbitrary strings in diagnostics.
10671         (OVERWRITE_OPTION): New constant.
10672         (long_options, usage, decode_options): New --overwrite option.
10673         (decode_options): --keep-old-files, --overwrite, and --unlink-first
10674         are now mutually exclusive.
10675         Don't assume that gettext preserves errno.
10676         (main): Set default quoting style to escape_quoting_style.
10677
10678         * src/update.c (<quotearg.h>): New include.
10679         (append_file):
10680         Don't assume that gettext preserves errno.
10681         Quote arbitrary strings in diagnostics.
10682         Check for close error.
10683
10684         * src/names.c (<quotearg.h>): New include.
10685         (name_init, name_next, name_close, names_notfound,
10686         collect_and_sort_names): Don't assume that gettext preserves
10687         errno.  Quote arbitrary strings in diagnostics.
10688         (excluded_name): Fix typo that caused empty patterns to be
10689         mishandled.
10690
10691         * src/misc.c (<quotearg.h>): New include.
10692         (quote_copy_string): Quote only newline and backslash; the output is no
10693         longer meant for humans, and is locale-independent.
10694         (contains_dot_dot): New function.
10695         (remove_any_file): Don't use lstat; just rmdir the file and then use
10696         unlink if the rmdir fails because the file isn't a directory.
10697         Check for readdir and closedir errors.
10698         (maybe_backup_file): Report "stat" for stat errors.
10699         (maybe_backup_file, chdir_do):
10700         Quote arbitrary strings in diagnostics.
10701         (maybe_backup_file, undo_last_backup):
10702         Don't assume that gettext preserves errno.
10703         (call_arg_error, call_arg_fatal, call_arg_warn,
10704         chdir_fatal, close_error, closedir_error, exec_fatal, mkfifo_error,
10705         mknod_error, open_error, open_fatal, open_warn, opendir_error,
10706         opendir_warn, read_error, read_fatal, readdir_error, readdir_warn,
10707         readlink_error, readlink_warn, seek_error, seek_warn, stat_error,
10708         stat_warn, truncate_error, truncate_warn, unlink_error, waitpid_error,
10709         write_error, write_fatal, xfork, xpipe, quote_n, quote): New functions.
10710
10711         * src/system.h (__attribute__): New macro.
10712         (O_NDELAY, O_NONBLOCK, O_APPEND): Remove.
10713         (S_ISDOOR): New macro.
10714         (closedir): New macro, if CLOSEDIR_VOID.
10715
10716         * src/rmt.c, src/rtapelib.c (decode_oflag):
10717         O_APPEND might not be defined.
10718
10719         * src/list.c: (read_and, list_archive):
10720         Quote arbitrary strings in diagnostics.
10721         (from_header): Use locale_quoting_style to quote diagnostics.
10722         (print_header, print_for_mkdir): Quote with quotearg, not quote_copy_string.
10723
10724         * src/rmt.h (REM_BIAS): Increase from 128 to (1 << 30).
10725
10726         * src/Makefile.am: Use ## for copyright comments.
10727
10728         * src/extract.c (<quotearg.h>): New include.
10729         (enum permstatus): New enum.
10730         (struct delayed_set_stat): file_name is now at end of buffer, to avoid
10731         two mallocs.  New members file_name_len, invert_permissions, permstatus.
10732         (extr_init): Remove hack that silently adjusted newdir_umask.
10733         (set_mode, set_stat): New args invert_permissions, permstatus, typeflag.
10734         Use these args to decide whether and how to set modes.
10735         (set_mode, set_stat, prepare_to_extract, extract_sparse_file, extract_archive):
10736         Don't assume that gettext preserves errno.
10737         (set_stat): Remove arg symlink_flag; subsumed by typeflag.
10738         (delay_set_stat, repair_delayed_set_stat): New functions.
10739         (make_directories): Avoid mkdir where last part of path is "..".
10740         Create a struct delayed_set_stat for each directory made.
10741         (prepare_to_extract): Renamed from unlink_destination, and
10742         return 0 immediately if to_stdout_option; all callers changed.
10743         (maybe_recoverable): New parameter interdir_made.
10744         Add support for --overwrite.
10745         (extract_sparse_file, extract_archive):
10746         Quote arbitrary strings in diagnostics.
10747         (extract_archive): By default, warn about ".." in member names, and skip them.
10748         Don't open files with O_NONBLOCK or O_APPEND.
10749         Open with O_TRUNC only if --overwrite; otherwise, use O_EXCL to avoid
10750         overwriting them.  Pass only rwxrwxrwx permissions to `open' and `mkdir',
10751         minus the current umask.  Keep track of intermediate directories made,
10752         to avoid looping when making x/../x when x doesn't exist; the
10753         earlier code solved this in a different way that didn't fit well
10754         into the new scheme.  Don't extract permissions onto existing
10755         directories unless --overwrite is given.  Do not add -wx------
10756         permissions to new directories permanently; just do it temporarily.
10757         Remove no-longer-needed hack with MSDOS and directory time stamps.
10758         (apply_delayed_set_stat): New argument specifies which directories to
10759         fix statuses of.  Do not wait until the end of extraction to fix
10760         statuses; instead, fix a directory's status once we exit that directory.
10761         This requires less memory and does the right thing in some cases
10762         where the old method didn't.
10763         (fatal_exit): New function.
10764
10765         * src/incremen.c (<quotearg.h>): New include.
10766         (get_directory_contents, gnu_restore):
10767         Check for readdir and closedir errors.
10768         (get_directory_contents, read_directory_file, gnu_restore):
10769         Quote arbitrary strings in diagnostics.
10770         (get_directory_contents, read_directory_file, write_directory_file):
10771         Don't assume that gettext preserves errno.
10772
10773         * src/create.c (<quotearg.h>): New include.
10774         (start_header): Use `member names' to refer to archive member names, not
10775         `archive names'.  Warn about `..' in member names.
10776         (finish_sparse_file, dump_file):
10777         Quote arbitrary strings in diagnostics.
10778         (finish_sparse_file, dump_file):
10779         Don't assume that gettext preserves errno.
10780         (dump_file): Don't use `access' to determine whether a directory is readable;
10781         this isn't reliable if tar is setuid.  Use `opendir' instead.
10782         Check for readdir and closedir failures.
10783         Don't dump sockets as if they were fifos; just warn and skip.
10784
10785         * src/delete.c (move_archive):
10786         Don't report fatal error merely because sizes don't fit
10787         into struct mtop values; fall back on lseek instead.
10788         Say `Cannot' uniformly, instead of `Could not' sometimes and `Cannot' others.
10789         Say `reposition' instead of `re-position'.
10790         (delete_archive_members):
10791         Set archive to STDOUT_FILENO before outputting trailing buffer.
10792
10793         * src/compare.c (<quotearg.h>): New include.
10794         (diff_init): Use `Cannot' uniformly, instead of `Could not' sometimes
10795         and `Cannot' others.
10796         (report_difference, diff_archive):
10797         Quote arbitrary strings in diagnostics.
10798         (process_rawdata, diff_sparse_files, get_stat_data, diff_archive, seek_warn):
10799         Don't assume that gettext preserves errno.
10800         (diff_archive): Don't open regular files with O_NONBLOCK.
10801         Preserve access times of files if --atime.
10802
10803         * src/common.h (FATAL_ERROR): Use new fatal_exit function to exit.
10804         (FATAL_ERROR, USAGE): Don't return 0.
10805         (enum old files): New enum.
10806         (old_files_option): New variable, replacing keep_old_files_option and
10807         unlink_first_option.
10808         (apply_delayed_set_stat): Now takes char const * param.
10809         (fatal_exit, contains_dot_dot, chdir_fatal, close_error,
10810         closedir_error, exec_fatal, mkfifo_error, mknod_error, open_error,
10811         open_fatal, open_warn, opendir_error, opendir_warn, read_error,
10812         read_fatal, readdir_error, readdir_warn, readlink_error,
10813         readlink_warn, seek_error, seek_warn, stat_error, stat_warn,
10814         truncate_error, truncate_warn, unlink_error, waitpid_error,
10815         write_error, write_fatal, xfork, xpipe, quote, quote_n): New decls.
10816
10817         * src/buffer.c:
10818         (xclose, xdup2, child_open_for_compress, child_open_for_uncompress,
10819         archive_write_error, archive_read_error, flush_archive, close_archive,
10820         init_volume_number, new_volume):
10821         Don't assume that gettext preserves errno.
10822
10823         (xdup2): Don't report errno if dup returns an unexpected nonnegative value.
10824         (open_archive): Reject multivolume verify attempts a bit earlier.
10825         Rename local variable `access', in case it's defined by system header.
10826
10827         (open_archive, backspace_output): Use `Cannot' uniformly, instead of
10828         `Could not' sometimes and `Cannot' others.
10829
10830         (open_archive, flush_read, flush_archive, close_archive, new_volume):
10831         Quote arbitrary strings in diagnostics.
10832
10833         (read_error): Set archive to STDOUT_FILENO temporarily when writing
10834         archive buffer.
10835
10836         (init_volume_number): Check for input and output errors in volno_file.
10837
10838         (new_volume): Use new fatal_exit function to exit, and new xfork
10839         function to fork.
10840
10841         * m4/Makefile.am (EXTRA_DIST): Add c-bs-a.m4.
10842
10843         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/c-bs-a.m4.
10844
10845         * doc/tar.texi: Add --overwrite.
10846         --absolute-names rejects ".." in names.
10847
10848         * lib/quotearg.c: Add support for multibyte characters.
10849         (ISGRAPH): Remove.
10850         (ISPRINT): New macro.
10851         (<wchar.h>): Include if HAVE_MBRTOWC && HAVE_WCHAR_H.
10852         (isprint, mbrtowc, mbsinit, mbstate_t): New macros,
10853         defined if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
10854         (quotearg_buffer_restyled): New function, with most of the old
10855         quotearg_buffer's contents.
10856         Major rewrite to support multibyte characters.
10857         (quotearg_buffer): Now just calls quotearg_buffer_restyled.
10858
10859         * m4/c-bs-a.m4: New file.
10860
10861         * lib/Makefile.am: Use ## for copyright notice.
10862
10863         * scripts/Makefile.am: Use ## on copyright notice.
10864
10865         * doc/Makefile.am:
10866         ($(srcdir)/tar.info, tar.dvi): We now use texinfo 4.0.
10867
10868 1999-12-05  Paul Eggert  <eggert@twinsun.com>
10869
10870         * doc/ChangeLog, lib/ChangeLog, scripts/ChangeLog,
10871         src/ChangeLog, tests/ChangeLog: Remove these files.
10872         * ChangeLog.1: New file, incorporating the above files, plus old
10873         ChangeLog entries.
10874         * Makefile.am (EXTRA_DIST): Add ChangeLog.1.
10875
10876 1999-12-05  Dale Worley  <worley@ariadne.com>
10877
10878         * src/compare.c (<utime.h>, struct utimbuf): Add.
10879         (diff_archive): Restore access times if --atime.
10880         * doc/tar.texi: Explain that --atime also preserves modification time.
10881
10882 1999-12-04  Gerhard Poul  <gpoul@gnu.org>
10883
10884         * ABOUT-NLS: Update to latest version from ftp.gnu.org.
10885         * BACKLOG, TODO: Remove.
10886         * Makefile.am (all-local, BABYL, dist-zoo, id, ID): Remove.
10887         * README: Bring up to date.
10888
10889 1999-12-03  Paul Eggert  <eggert@twinsun.com>
10890
10891         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.15.
10892
10893         * src/compare.c (diff_archive):
10894         Do not set errno to EPIPE; we no longer use perror.
10895
10896         * src/create.c (dump_file):
10897         If a parent directory said that a file should be there but it is
10898         absent, diagnose it as being removed in the meantime.
10899         Do not pass meaningless errno to ERROR when reporting that the
10900         file changed as we read it.
10901         Report that a file changed if its ctime changes; this is more
10902         sensitive than mtime+size, and more accurate.
10903
10904         * src/incremen.c (enum children): New type.
10905         (struct directory): Change old char allnew member to new enum children
10906         children member.
10907         All uses changed.
10908         (get_directory_contents): When doing an incremental dump that does
10909         not cross filesystem boundaries, dump the mount points, even though
10910         they are in a different filesystem.  This is for convenience when
10911         restoring, and for consistency with non-incremental dumps.
10912         This requires a 3-way flag for keeping track of which children we want,
10913         so we use enum children rather than boolean.
10914
10915         * src/open3.c (modes): Remove.
10916         (open3): Remove unportable assumptions about flag encodings.
10917         Use `stat' instead of `access' for testing file existence,
10918         to avoid problems with setuid programs.
10919
10920         * src/names.c (name_next): If file names are given both in the
10921         command line (e.g. via -C) and in a file (via -T), do not
10922         ignore the command-line names.
10923
10924         * m4/uintmax_t.m4: Backport to autoconf 2.13.
10925
10926         * doc/tar.texi: Clarify getdate authorship.
10927
10928 1999-11-23  Paul Eggert  <eggert@twinsun.com>
10929
10930         * lib/Makefile.am (DISTCLEANFILES): New macro.
10931
10932         * configure.in (tar_fnmatch_hin):
10933         Remove; it runs afoul of a bug in autoconf 2.13.
10934         Instead, always link fnmatch.h to some file, even if it's a throwaway.
10935
10936 1999-11-19  Paul Eggert  <eggert@twinsun.com>
10937
10938         * m4/largefile.m4: Update serial.
10939
10940 1999-11-18  Paul Eggert  <eggert@twinsun.com>
10941
10942         * m4/largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Work around a bug in
10943         the QNX shell, which doesn't propagate exit status of failed
10944         commands inside shell assignments.
10945
10946 1999-11-07  Paul Eggert  <eggert@twinsun.com>
10947
10948         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.14.
10949
10950         * configure.in (AC_PREREQ): Bump to 2.13.
10951         (ALL_LINGUAS): Add pt_BR, ja.
10952         (AC_FUNC_FNMATCH): Remove lib/funmatch.h before invoking, not after.
10953         (tar_cv_path_RSH): Prefer a non-symlink rsh to a symlink one,
10954         for AIX crossbuilds.
10955
10956         * doc/tar.texi: New node create options for --ignore-failed-read.
10957         Remove unused version control symbols.
10958         Modernize texinfo usage.
10959
10960         * src/tar.c (usage): Add examples.
10961
10962         * m4/fnmatch.m4 (AC_FUNC_FNMATCH):
10963         Include fnmatch.h when testing fnmatch.
10964
10965         * src/common.h (collect_and_sort_names): New decl.
10966
10967         * src/list.c (from_header):
10968         Handle 32-bit two's complement negative time stamps
10969         even if the leading octal digit is 2 or 3.
10970
10971         * src/extract.c (set_stat): Remove duplicate code.
10972
10973         * src/create.c (to_chars): Remove trailing newline from warning.
10974         (dump_file): Ignore doors.
10975         (finish_header): Report block numbers with origin 0, not origin 1.
10976
10977         * src/rmt.c: Include getopt.h.
10978         (long_opts): New constant.
10979         (usage): New function.
10980         (main): Implement --help and --version.
10981         Output usage message if arguments are bad.
10982
10983 1999-10-10  Paul Eggert  <eggert@twinsun.com>
10984
10985         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.13.
10986
10987         * README: Remove --with-dmalloc.
10988         Add --disable-largefile.
10989         Remove old NeXT dirent problems, or AIX valloc problems.
10990         Remove old union wait advice, and old %lld advice.
10991         Remove advice about FreeBSD 2.1.7, ISC 4.1mu, Ultrix `make'.
10992
10993         * doc/tar.texi: Clarify documentation for portable file names.
10994
10995         * configure.in (AM_WITH_DMALLOC): Remove.
10996         (ALL_LINGUAS): Add ja.
10997
10998         * src/tar.c (decode_options):
10999         Invalid dates are now treated as (time_t) -1.
11000         Redo version message to conform to GNU standards.
11001
11002         * src/create.c (dump_file):
11003         Fix typo: last two args to dump_file were interchanged.
11004         * src/update.c (update_archive): Likewise.
11005
11006         * src/common.h (tartime): New decl.
11007
11008         * src/list.c (tartime): Now extern.
11009         (read_and): Invalid headers cause errors, not warnings.
11010
11011 1999-10-03  Paul Eggert  <eggert@twinsun.com>
11012
11013         * lib/getdate.y (__attribute__):
11014         Don't use if GCC claims to be before 2.8; this is
11015         needed for OPENStep 4.2 cc.  Also, don't use if strict ANSI.
11016
11017 1999-09-25  Paul Eggert  <eggert@twinsun.com>
11018
11019         * lib/fnmatch.c, lib/fnmatch.hin: Merge changes from latest glibc.
11020         * lib/getopt.c, lib/getopt.h, lib/getopt1.c: Likewise.
11021
11022         * tests/incremen.sh: Add yet another sleep.
11023
11024 1999-09-24  Paul Eggert  <eggert@twinsun.com>
11025
11026         * NEWS: A read error now causes a nonzero exit status.
11027
11028         * src/create.c (to_chars): Fix base-256 output.
11029
11030         * src/buffer.c (write_error):
11031         Read error is an error, not just a warning.
11032
11033 1999-09-24  Paul Eggert  <eggert@twinsun.com>
11034
11035         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.12.
11036
11037         * src/tar.c (<time.h>): Include.
11038         (time): Declare if not defined.
11039         (confirm): Don't read past EOF.
11040         (long_options, usage): Add --no-same-owner, --no-same-permissions.
11041         (main): Use clock_gettime if available.
11042
11043         * tests/Makefile.am (TESTS): Add incremen.sh
11044         (INCLUDES): Add -I../lib, for fnmatch.h.
11045
11046         * src/update.c (update_archive):
11047         Remove call to name_expand; had no effect.
11048         Use chdir_do to change into directory.
11049         Use deref_stat instead of stat.
11050         Use add_avoided_name to mark names to be avoided; the old method of
11051         setting a bit with the name caused all descendants of that name to
11052         be avoided, in some circumstances.
11053
11054         * tests/incremen.sh: Remove unnecessary sleeps.
11055
11056         * src/names.c (name_next): Go back to using plain chdir.
11057         (name_gather): Use chdir_arg to keep track of arguments to chdir.
11058         (addname): Likewise.
11059         (name_match): Use chdir_do to act on chdir args.
11060         (merge_sort): Moved here from incremen.c.
11061         (compare_names, add_hierarchy_to_namelist, collect_and_sort_names):
11062         Likewise.
11063         (name_expand): Remove.
11064         (name_from_list): Skip fake names.
11065         Use chdir_do to act on chdir args.
11066         (struct avoided_name): New struct.
11067         (avoided_names): New var.
11068         (add_avoided_name, is_avoided_name): New functions.
11069
11070         * src/system.h (stat, lstat): Define in terms of statx on
11071         STX_HIDDEN && !_LARGE_FILES /* AIX */ hosts.
11072         (UCHAR_MAX): New macro.
11073         (TYPE_MAXIMUM): Cast to arg type, for types narrow than int.
11074
11075         * m4/largefile.m4: Work around GCC 2.95.1 bug with HP-UX 10.20.
11076
11077         * src/incremen.c (<time.h>): Remove include; no longer used.
11078         (time): Remove decl.
11079         (time_now): Remove.
11080         (get_directory_contents): Use deref_stat.
11081         Consider a subdirectory to be all new only if
11082         listed_incremental_option or if it its timestamp is newer than the
11083         cutoff.
11084         (add_hierarchy_to_namelist, merge_sort): Move to names.c.
11085         (read_directory_file): Now extern.  Do not set time_now.
11086         (write_directory_file): Renamed from write_dir_file.
11087         Use start_time instead of time_now.
11088         (compare_names, collect_and_sort_names): Move to names.c.
11089
11090         * src/mangle.c (<time.h>): Remove; not used.
11091         (time): Do not declare.
11092
11093         * src/misc.c (chdir_from_initial_wd): Remove.
11094         (deref_stat): New function.
11095         (struct wd): New struct.
11096         (wd, wds, wd_alloc): New variables.
11097         (chdir_arg, chdir_do): New function.
11098
11099         * src/compare.c (get_stat_data): Use deref_stat.
11100
11101         * src/common.h (name_expand): Remove.
11102
11103         * src/list.c (time): Declare if not defined.
11104         (base_64_digits): Moved here from create.c.
11105         (base64_map): Use UCHAR_MAX for size, not less-clear (unsigned char)
11106         -1.
11107         (read_and): Don't get time from header unless we need it now;
11108         as getting time can cause duplicate diagnostics if bogus.
11109         Remove "Hmm, " from diagnostic.
11110         Use "Skipping to next header" uniformly.
11111         (from_header): Renamed from from_chars.  All uses changed.
11112         Allow different forms for unportable 2's complement numbers.
11113         Don't check for extended forms when parsing checksums.
11114         Parse base-256 output.
11115         (gid_from_header): Renamed from gid_from_chars.  All uses changed.
11116         (major_from_header): Renamed from major_from_chars.  All uses changed.
11117         (minor_from_header): Renamed from minor_from_chars.  All uses changed.
11118         (mode_from_header): Renamed from mode_from_chars.  All uses changed.
11119         (off_from_header): Renamed from off_from_chars.  All uses changed.
11120         (size_from_header): Renamed from size_from_chars.  All uses changed.
11121         (time_from_header): Renamed from time_from_chars.  All uses changed.
11122         Warn about future timestamps.
11123         (uid_from_header): Renamed from uid_from_chars.  All uses changed.
11124         (uintmax_from_header): Renamed from uintmax_from_chars.
11125         All uses changed.
11126         (tartime): New function, incorporating isotime.
11127         (isotime): Delete.
11128         (print_header): Use tartime.
11129
11130         * src/create.c (to_chars): Fix typo in decl.
11131         Don't assign through char const *.
11132         Rename name_expand back to collect_and_sort_names.
11133
11134         * src/extract.c (<time.h>): No need to include.
11135         (time): No need to declare.
11136         (now): Remove variable.
11137         (extr_init): Don't initialize `now'.
11138         Increment same_permissions_option and same_owner_option if we_are_root
11139         is nonzero; this supports the new --no-same-owner option.
11140         (set_stat): Use start_time instead of `now'.
11141
11142         * src/create.c (struct link): Remove unused linkcount member.
11143         (base_64_digits): Move to list.c.
11144         (base_8_digits): Remove.
11145         (to_octal): New function, with some of old contents of to_base.
11146         (to_base): Remove.
11147         (to_base256): New function.
11148         (to_chars): Use base 256, not base 64, for huge values.
11149         (mode_to_chars): Don't use two's complement in GNU format or POSIX
11150         format.
11151         (dump_file): Interchange last two arguments. If TOP_LEVEL is negative,
11152         it means we have an incremental dump where we don't know whether this
11153         is a top-level call.
11154         Use deref_stat instead of statx / stat / lstat.
11155         Cast result of alloca.
11156         Check for dates if 0 < top_level, not if listed_incremental_option.
11157         Move multiple-link check after directory check.
11158         Do not dump avoided names.
11159         Dump hard links to symbolic names as links, not as separate
11160         symbolic links.
11161         start_header cannot return a null pointer, so don't test for it.
11162         Likewise for find_next_block.
11163
11164         * src/buffer.c, src/common.h (<human.h>): Include.
11165         (read_error): Read error is an error, not just a warning.
11166         (print_total_written): Also print human-readable byte count, and
11167         bytes/s.
11168         (open_archive, flush_write): Use start_time, not current time.
11169         (flush_read): Report about garbage bytes ignored at end of archive,
11170         but act on non-garbage bytes (instead of ignoring them).
11171         (new_volume): Use WARN for warnings.
11172
11173         * doc/Makefile.am:
11174         ($(srcdir)/tar.info): Add -I$(srcdir) so that subdir builds work.
11175
11176         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/fnmatch.m4.
11177
11178         * m4/Makefile.am (EXTRA_DIST): Add fnmatch.m4.
11179
11180         * lib/Makefile.am (noinst_HEADERS):
11181         Rename fnmatch.h to fnmatch.hin; add human.h.
11182         (libtar_a_SOURCES): Add human.c, xstrtoul.c.
11183         (INCLUDES): Remove -I.. -I$(srcdir) -- automake adds this for us.
11184
11185         * src/Makefile.am (rmt_LDADD, tar_LDADD): New macros.
11186
11187         * lib/fnmatch.c (strchrnul):
11188         Define to __strchrnul if _LIBC, to our own replacement otherwise.
11189         Do not define if !_LIBC and if it already exists.
11190         (internal_fnmatch): Use it.
11191
11192         * configure.in (tar_LDADD): New variable, used only when linking tar.
11193         (rmt_LDADD): Similarly, for rmt.
11194         (AC_FUNC_FNMATCH): Link fnnmatch.hin to fnmatch.h if we're using our
11195         fnmatch.c; otherwise, use the system fnmatch.h.
11196
11197         * doc/tar.texi: Add --no-same-owner, --no-same-permissions.
11198         Modernize sample backup script.
11199
11200         * THANKS: Martin Goik's email address has changed.
11201
11202         * m4/fnmatch.m4: New file.
11203
11204 1999-09-03  Paul Eggert  <eggert@twinsun.com>
11205
11206         * lib/lchown.h (ENOSYS): Don't use ENOMSG; it's not in NeXTStep3.3.
11207         Use EINVAL instead.
11208
11209 1999-08-29  Paul Eggert  <eggert@twinsun.com>
11210
11211         * lib/getdate.y (get_date):
11212         Rename outermost local `probe' to `quarter'.
11213         Rename latter local `tm' to probe_tm.
11214         From: Jim Meyering <meyering@ascend.com>
11215         Message-ID: <uryn1vafyyc.fsf@ixi.eng.ascend.com>
11216
11217 1999-08-28  Paul Eggert  <eggert@twinsun.com>
11218
11219         * lib/getdate.y (PC): New macro; use it when possible.
11220         (number): Handle `Nov 11 1996' example correctly.
11221         See Risks Digest 20.55 (1999-08-27)
11222         http://catless.ncl.ac.uk/Risks/20.55.html#subj18
11223
11224 1999-08-23  Paul Eggert  <eggert@twinsun.com>
11225
11226         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.11.
11227
11228         Remove minor cases of lint from many source files: this includes
11229         unnecessary casts, uses of NULL, etc.
11230
11231         * configure.in (AC_PROG_YACC): Remove.
11232         (YACC): Always use bison.
11233         (AC_STRUCT_TIMEZONE): Add.
11234         (AC_REPLACE_FUNCS): Add strcasecmp, strncasecmp.
11235
11236         * doc/tar.texi: --bzip2 is now -I.  Remove obsolete time zone info.
11237         Fix spelling.
11238
11239         * lib/Makefile.am (EXTRA_DIST): Add strcasecmp.c, strncasecmp.c.
11240         ($(srcdir)/getdate.c): Rename y.tab.c to getdate.c only if successful.
11241
11242         * lib/strcasecmp.c, lib/strncasecmp.c: New files.
11243
11244         * src/common.h (merge_sort): Remove decl; no longer exported.
11245
11246         * src/system.h (voidstar): Remove.
11247         (memcpy, memcmp): Cast args.
11248         ("xalloc.h"): Add include.
11249         (xmalloc, xrealloc): Remove decl.
11250
11251         * src/mangle.c (time): Do not declare if defined.
11252         (first_mangle, mangled_num): Remove.
11253
11254         * src/list.c (from_chars): Report out-of-range values more precisely.
11255         (off_from_chars): Do not allow negative offsets.
11256         (uid_from_chars): Allow negative uids.
11257
11258         * src/create.c (linklist): Now static.
11259         (to_chars): Fix wording of message to match from_chars.
11260
11261         * src/misc.c (merge_sort): Move to incremen.c.
11262         * src/incremen.c (merge_sort): Move here from misc.c; now static.
11263         It's too painful to make it both generic and portable.
11264         (read_directory_file): "timestamp" -> "time stamp" in messages.
11265
11266         * src/tar.c (long_options, usage, main): -y is now -I (for --bzip).
11267         (usage): Fix misspelling.
11268         (OPTION_STRING): -y is now -I.
11269         (decode_options): Use -1, not EOF, for getopt_long result.
11270         Fix typo when invoking xstrtoumax: look for LONGINT_OK, not LONG_MAX.
11271         Handle operands after any "--" argument.
11272         (main): Report any output errors.
11273
11274         * src/rmt.c (main): status is ssize_t, not long.
11275
11276         * src/names.c (name_gather): Handle trailing -C option correctly.
11277         (addname): use memcpy, not strncpy, to copy a string of known length.
11278         (name_match): Handle trailing -C option correctly.
11279         Propagate -C option to following files.
11280         (name_match, name_scan): Remove redundant matching code.
11281
11282         * src/buffer.c (open_archive): Use American spelling in diagnostic.
11283
11284         * lib/getdate.y: Major rewrite.  Add copyright notice.
11285         (<stdio.h>): Include only if testing.
11286         (ISUPPER): Remove.
11287         (ISLOWER): New macro.
11288         (<string.h>): Include if HAVE_STRING_H, not USG.
11289         (bcopy): Remove.
11290         (yymaxdepth, ..., yycheck): Don't bother to redefine, since we assume
11291         bison.
11292         (EPOCH_YEAR): Renamed from EPOCH.
11293         (table): Renamed from TABLE.
11294         (meridian): Now an anonymous enum.
11295         (struct parser_control): New type.
11296         (YYLEX_PARAM, YYPARSE_PARAM, YYSTYPE): New macros.
11297         (yyInput, ..., yyRelYear): Migrated into struct parser_control.
11298         (%pure_parser): Added, so that the parser is pure.
11299         (%union): Removed; the type is now just plain int.
11300         All %type directives removed.
11301         (tLOCAL_ZONE): New %token.
11302         (month_day_table): Renamed from MonthDayTable.
11303         (gmtime, localtime, mktime, time): Declare only if not defined.
11304         (meridian_table): New table.
11305         (dst_table): New table.
11306         (units_table): renamed from UnitsTable.
11307         (relative_time_table): Renamed from OtherTable.
11308         (time_zone_table): Renamed from TimezoneTable.  Modernized.
11309         (military_table): Renamed from MilitaryTable.
11310         (to_hour): Renamed from ToHour.
11311         (to_year): Renamed from ToYear.
11312         (lookup_zone): New function.
11313         (LookupWord): Renamed from lookup_word.  Use lookup_zone for time
11314         zones.
11315         (yylex): Now reentrant.  All callers changed.
11316         (get_date): Add support for local time zone abbreviations.
11317         Make it reentrant.
11318
11319 1999-08-20  Paul Eggert  <eggert@twinsun.com>
11320
11321         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.10.
11322
11323         * src/create.c (to_chars): Generate GNU base-64 representation
11324         if we are generating an old or new GNU format tar file for a
11325         number that can't be represented with the POSIX format.
11326
11327         * configure.in (AC_CHECK_FUNCS): Add fchdir.
11328         (AM_FUNC_GETLINE): Add.
11329         (LIBOBJS): Add getline.o to workaround comment.
11330         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/getline.m4.
11331         * m4/Makefile.am (EXTRA_DIST): Add getline.m4.
11332         * lib/Makefile.am (noinst_HEADERS): Add getline.h, save-cwd.h.
11333         (libtar_a_SOURCES): Add save-cwd.c, xgetcwd.c.
11334         * lib/getline.c, lib/getline.h, lib/save-cwd.c,
11335         lib/save-cwd.h, m4/getline.m4: New files.
11336
11337         * src/misc.c (<save-cwd.h>): Include.
11338         (chdir_from_initial_wd): New function.
11339
11340         * src/names.c (name_next): Use chdir_from_initial_wd, not chdir.
11341         (name_gather): Handle `-C x -C y' correctly.
11342         Do not rely on addname to handle -C.
11343         (addname): New CHANGE_DIR parameter.  All callers changed.
11344         Remove ugly calls to getcwd; no longer needed.
11345         (name_match, name_from_list): Use chdir_from_initial_wd, not chdir.
11346
11347         * src/incremen.c (listed_incremental_stream): New var.
11348         (read_directory_file): Remove arbitrary limits on file name length.
11349         Do not attempt to get the working directory; we can bypass this
11350         on fchdir hosts.  Open the listed_incremental_option file for both
11351         read and write instead of opening it twice.  Check for I/O errors
11352         when doing I/O to this file.  Check for invalid data in the file,
11353         and report line numbers of invalid data.
11354         (write_dir_file): Likewise.
11355         (collect_and_sort_names): Use chdir_from_initial_wd, not chdir.
11356         Do not invoke write_dir_file; that's our caller's responsibility.
11357
11358         * src/list.c (max): New macro.
11359         (isotime): Now takes time_t, not time_t *.  Report the decimal values
11360         of times that can't be broken down.
11361         (print_header): Don't assume that major and minor device numbers can
11362         fit into uintmax_t.
11363
11364         * src/common.h (struct name): change_dir is now char const *.
11365         (write_directory_file): Remove unused decl.
11366         (STRINGIFY_BIGINT): Assume b always points to UINTMAX_STRSIZE_BOUND
11367         chars; the old `sizeof (b)' broke when b was a pointer not an array.
11368         (chdir_from_initial_wd): New decl.
11369         (addname): New 2nd arg.
11370
11371         * THANKS: Torsten Lull -> Catrin Urbanneck
11372
11373 1999-08-18  Paul Eggert  <eggert@twinsun.com>
11374
11375         * configure.in (HAVE_GETHOSTENT, HAVE_SETSOCKOPT):
11376         Don't depend on ac_cv_func variables.
11377         From Albert Chin-A-Young <china@thewrittenword.com>.
11378
11379 1999-08-18  Paul Eggert  <eggert@twinsun.com>
11380
11381         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.9
11382
11383         * m4/signedchar.m4: New file.
11384         * configure.in (pe_AC_TYPE_SIGNED_CHAR): Add.
11385         * src/system.h (signed_char): New macro.
11386         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/signedchar.m4.
11387         * m4/Makefile.am (EXTRA_DIST): Add signedchar.m4.
11388
11389         * src/create.c (write_eot): Write at least two zero blocks.
11390
11391         * src/extract.c (extract_archive): Fix sparse array bug:
11392         we did not find end of array correctly.
11393
11394         * src/compare.c: (fill_in_sparse_array, diff_sparse_files):
11395         Don't assume find_next_block yields nonnull.
11396         * src/extract.c (extract_sparse_file, extract_archive): Likewise.
11397         * src/list.c (skip_extended_headers): Likewise.
11398
11399         * src/list.c (read_and, list_archive): Simplify code.
11400         (read_header): Fix computation of signed checksums on machines where
11401         char is unsigned.
11402         Do not consider a block to be zero unless all its bytes are zero,
11403         even the checksum bytes.  Do not attempt to parse the checksum of
11404         a zero block.  Fix memory leak with long names and links.
11405         (from_chars): Accommodate a buggy tar that outputs leading NUL
11406         if the previous field overflows.
11407
11408         * src/misc.c (quote_copy_string): Generate \177 for '\177', not
11409         \?, for portability to non-ASCII hosts.
11410
11411 1999-08-16  Paul Eggert  <eggert@twinsun.com>
11412
11413         * configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.8.
11414
11415         * src/extract.c (make_directories): Do not chown intermediate
11416         directories, even if we are root.
11417
11418         * src/list.c (read_header): Fix bugs when interpreting
11419         POSIX-compliant headers that do not contain null bytes in the
11420         header or link names.
11421
11422 1999-08-14  Paul Eggert  <eggert@twinsun.com>
11423
11424         * configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.7.
11425
11426         * configure.in (AC_CHECK_HEADERS): Remove sys/wait.h.
11427         (AC_HEADER_SYS_WAIT): Add.
11428         (AC_REPLACE_FUNCS): Add waitpid.
11429         (tar_cv_header_union_wait, HAVE_UNION_WAIT): Remove.
11430         * lib/waitpid.c: New file.
11431         * lib/Makefile.am (EXTRA_DIST): Add waitpid.c.
11432         * src/system.h (WCOREDUMP): Remove; no longer used.
11433         (WIFSTOPPED): Likewise.
11434         (WEXITSTATUS, WIFSIGNALED): Default to Solaris 7 versions.
11435         * src/buffer.c (child_open_for_compress): Undo previous change.
11436         (close_archive): Use waitpid, POSIX-style, instead of old BSD style.
11437         (new_volume): Likewise.
11438
11439         * src/buffer.c, src/extract.c, src/incremen.c (time):
11440         Don't declare if defined.
11441         * src/extract.c (extr_init): Remove unneeded cast around 0 arg to time.
11442         * src/incremen.c (read_directory_file):
11443         Invoke `time' the same way everyone else does.
11444         Check validity of --listed-incremental file contents a bit better.
11445         Do not worry about --after-date-option; tar.c now checks this.
11446         * src/list.c (isotime): Report ??? if localtime returns null.
11447         Don't assume years fit into four digits.
11448         Don't append trailing newline.
11449         (print_header): Report ??? if localtime returns null;
11450         Don't assume years fit into four digits.
11451
11452         * src/compare.c (diff_archive): Do not fall back on absolute name
11453         when --absolute-names is not specified.
11454
11455         * src/create.c (start_header):
11456         Include text of ignored filesystem prefix in warning.
11457         (create_archive): Check for excluded names when doing incremental
11458         pass through directory.
11459         (dump_file): Do not dump old files explicitly given on command line
11460         when using --listed-incremental.  Do not strip ./ prefix from names.
11461
11462         * src/tar.c: -g now implies after_date_option = 1.
11463         -g and -N are now incompatible options.
11464
11465         * doc/tar.texi: Explain --exclude better.  Don't strip leading `./'.
11466
11467 1999-08-11  Jeff Dairiki  <dairiki@dairiki.org>
11468
11469         * src/list.c (read_header): Don't parse OLDGNU_FORMAT
11470         incremental headers as POSIX prefixes.
11471
11472 1999-08-11  Paul Eggert  <eggert@twinsun.com>
11473
11474         * NEWS, configure.in: Version 1.13.6.
11475
11476         * configure.in (ALL_LINGUAS): Add pt_BR.
11477         * po/pt_BR.po: New file.
11478
11479         * doc/Makefile.am ($(srcdir)/tar.info, $(srcdir)/header.texi):
11480         Renamed from tar.info and header.texi; adjust actions so that
11481         they work in other directories.
11482
11483         * doc/tar.texi: Add -y and --bzip2.
11484         Patterns containing / now exclude only file names whose prefix match.
11485
11486         * lib/exclude.h (excluded_filename): New option parameter.
11487         (add_exclude_file): New ADD_FUNC parameter.
11488         (excluded_pathname): Remove decl.
11489         * lib/exclude.c (_GNU_SOURCE):
11490         Remove; no longer needed since we don't use FNM_ macros.
11491         (excluded_filename): Renamed from excluded_filename_opts.
11492         (excluded_filename, excluded_pathname): Remove.
11493         (add_exclude_file): New ADD_FUNC parameter.
11494
11495         * po/POTFILES.in: Add lib/quotearg.c.
11496
11497         * src/buffer.c (_GNU_SOURCE): Define.
11498         (<fnmatch.h>): Include unconditionally.
11499         (child_open_for_compress): Dup after closing, to avoid possible file
11500         descriptor exhaustion.
11501         (flush_write): Use FILESYSTEM_PREFIX_LEN instead of MSDOS ifdef.
11502         (flush_read): Likewise.
11503
11504         * src/common.h (LG_8, LG_64): New macros.
11505         (excluded_with_slash, excluded_without_slash): New vars.
11506         (excluded): Remove.
11507         (base_64_digits): New decl.
11508         (gid_to_chars, major_to_chars, minor_to_chars, mode_to_chars,
11509         off_to_chars, size_to_chars, time_to_chars, uid_to_chars,
11510         uintmax_to_chars,
11511         GID_TO_CHARS, MAJOR_TO_CHARS, MINOR_TO_CHARS, MODE_TO_CHARS,
11512         OFF_TO_CHARS, SIZE_TO_CHARS, TIME_TO_CHARS, UID_TO_CHARS,
11513         UINTMAX_TO_CHARS):
11514         Renamed from gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct,
11515         off_to_oct, size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct,
11516         GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT, MODE_TO_OCT, OFF_TO_OCT,
11517         SIZE_TO_OCT, TIME_TO_OCT, UID_TO_OCT, UINTMAX_TO_OCT,
11518         respectively.  All definitions and uses changed.
11519         (excluded_name): New decl.
11520
11521         * src/compare.c (diff_archive):
11522         Open files with O_NONBLOCK instead of O_NDELAY.
11523
11524         * src/create.c (base_64_digits): New constant.
11525         (base_8_digits): New macro.
11526         (MAX_VAL_WITH_DIGITS): New macro.
11527         (to_base): First half of old to_oct.  Support base 64 too.
11528         (to_chars): Other half of old to_oct, for 64-bit support.
11529         (GID_NOBODY, UID_NOBODY): Don't define if the headers don't.
11530         (gid_substitute, uid_substitute): Look up names dynamically if
11531         GID_NOBODY and UID_NOBODY aren't defined; use -2 if all else fails.
11532         (mode_to_chars): Renamed from mode_to_oct.
11533         Support negative values in all the _to_chars functions.
11534         (start_header): Use FILESYSTEM_PREFIX_LEN instead of MSDOS ifdef.
11535         Abort if archive format is DEFAULT_FORMAT when it shouldn't be.
11536         (dump_file): Inspect entire pathname, not just new file name
11537         component, when deciding whether to exclude it.
11538
11539         * src/extract.c (extract_archive):
11540         Open files with O_NONBLOCK instead of O_NDELAY.
11541
11542         * src/incremen.c (get_directory_contents):
11543         Inspect entire pathname, not just new file name
11544         component, when deciding whether to exclude it.
11545
11546         * src/list.c (<fnmatch.h>): Do not include.
11547         (from_chars): Renamed from from_oct.  New parameter specifying
11548         the negative of the minimum allowed value.  Support negative
11549         and base-64 values.
11550         (base64_map): New var.
11551         (base64_init): New function.
11552         (print_header): Output numeric uids and gids if numeric_owner_option.
11553
11554         * src/misc.c (quote_copy_string): Use LG_8 instead of constants.
11555
11556         * src/names.c (_GNU_SOURCE): Define.
11557         (<fnmatch.h>): Include unconditionally.
11558         (excluded_name): New function, taking over duties of excluded_pathname.
11559         All uses changed.
11560
11561         * src/rmt.c (decode_oflag): New function.
11562         (main): Use it to support symbolic open flags.
11563
11564         * src/rtapelib.c (encode_oflag): New function.
11565         (rmt_open__): Do not allow newlines in the path.
11566         Propagate errno correctly.
11567         Decode symbolic open flags, if present.
11568
11569         * src/system.h (FILESYSTEM_PREFIX_LEN, ISSLASH, O_ACCMODE, O_NONBLOCK):
11570         New macros.
11571
11572         * src/tar.c: (long_options, usage, OPTION_STRING, decode_options):
11573         New -y or --bzip2 option.
11574         (add_filtered_exclude): New function.
11575         (decode_options): Put excluded patterns with / into
11576         excluded_with_slash, and without / into excluded_without_slash.
11577         Compare newer_mtime_option to its new initial value
11578         TYPE_MINIMUM (time_t) when deciding whether more than one
11579         threshold date was specified.
11580
11581 1999-07-20  Paul Eggert  <eggert@twinsun.com>
11582
11583         * NEWS, configure.in: Version 1.13.5.
11584
11585         * src/common.h (FATAL_ERROR): Invoke apply_delayed_set_stat
11586         before exiting.
11587         * src/buffer.c (new_volume): Likewise.
11588         * src/incremen.c (read_directory_file): Likewise.
11589         * src/tar.c (decode_options):
11590         ERROR ((TAREXIT_FAILURE, ... -> FATAL_ERROR ((0,
11591         for consistency.
11592
11593         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.4.
11594         * configure.in (AC_CHECK_FUNCS): Add lstat, readlink, symlink.
11595
11596         * src/system.h (lstat): Define only if !HAVE_LSTAT && !defined lstat.
11597         (S_ISMPB, S_ISMPC, S_ISNWK): Remove unused macros.
11598         (S_ISBLK, S_ISCHR, S_ISCTG, S_ISFIFO, S_ISLNK, S_ISSOCK):
11599         Define to 0 if the corresponding S_IF* macro is not defined.
11600         (mkfifo): Do not define if already defined, or if S_IFIFO
11601         is not defined.
11602
11603         * src/compare.c (diff_archive): Use HAVE_READLINK, not
11604         S_ISLNK, to determine whether to invoke readlink.
11605         * src/create.c (dump_file): Likewise.
11606
11607         * src/extract.c (set_mode):
11608         Do not chmod unless we are root or the -p option was given;
11609         this matches historical practice.
11610         (unlink_destination): New function, which checks for unlink failures.
11611         (maybe_recoverable): Stay quiet if -U.
11612         (extract_archive): Use O_EXCL if unlink_first_option.
11613         Report unlink failures.
11614         Use HAVE_SYMLINK, not S_ISLNK, to determine whether symlink exists.
11615         Use HAVE_MKFIFO || defined mkfifo, not S_ISFIFO, to determine whether
11616         mkfifo exists.
11617
11618         * src/incremen.c (get_directory_contents): Depend on
11619         S_ISHIDDEN, not AIX, to determine whether to invoke S_ISHIDDEN.
11620
11621         * src/list.c: Remove S_IS* ifdefs.
11622         * src/misc.c (maybe_backup_file): Likewise.
11623
11624         * src/misc.c (maybe_backup_file):
11625         "Virtual memory exhausted" -> "Memory exhausted",
11626         to conform to the other places this message is issued.
11627
11628         * src/mangle.c (extract_mangle):
11629         Replace #ifdef S_ISLNK with #ifdef HAVE_SYMLINK.
11630
11631         * src/rtapelib.c (rmt_open__):
11632         Remove typo that caused us to omit the first char
11633         of the basename.
11634
11635 1999-07-16  Paul Eggert  <eggert@twinsun.com>
11636
11637         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.13.3.
11638
11639         * doc/tar.texi: A path name is excluded if any of its file name
11640         components matches an excluded pattern, even if the path name was
11641         specified on the command line.
11642         * src/create.c (create_archive): Likewise.
11643         * src/list.c (read_and): Likewise.
11644         * src/update.c (update_archive): Likewise.
11645         * lib/exclude.h (excluded_pathname): New decl.
11646         * lib/exclude.c (_GNU_SOURCE): Define.
11647         (FILESYSTEM_PREFIX_LEN, ISSLASH): New macros.
11648         (excluded_filename_opts): New function.
11649         (excluded_pathname): New function.
11650
11651         * lib/Makefile.am (EXTRA_DIST):
11652         xstrtol.c moved here from libtar_a_SOURCES.
11653         (libtar_a_SOURCES): Move xstrtol.c to EXTRA_DIST.
11654         Remove xstrtoul.c; no longer needed.
11655         * lib/xstrtol.c: Remove.
11656
11657         * src/tar.c (decode_options):
11658         Set newer_time_option to TYPE_MINIMUM, so that
11659         negative timestamps are handled correctly.
11660         Replace invocations of xstrtol and xstrtoul with xstrtoumax, for
11661         uniformity (and so that we don't need to have the other fns).
11662         (main): Remove call to init_total_written; no longer needed.
11663
11664         * configure.in (AC_CHECK_SIZEOF): Remove no-longer-needed
11665         checks for unsigned long and long long.
11666         * src/arith.c: Remove.
11667         * src/Makefile.am (tar_SOURCES): Remove arith.c.
11668         * po/POTFILES.in: Remove src/arith.c.
11669         * src/arith.h: Use double, to simplify configuration gotchas.
11670         (tarlong): Now double.
11671         (TARLONG_FORMAT): New macro.
11672         (BITS_PER_BYTE, BITS_PER_TARLONG, SUPERDIGIT, BITS_PER_SUPERDIGIT,
11673         LONGS_PER_TARLONG, SIZEOF_TARLONG, struct tarlong,
11674         zerop_tarlong_helper, lessp_tarlong_helper, clear_tarlong_helper,
11675         add_to_tarlong_helper, mult_tarlong_helper, print_tarlong_helper,
11676         zerop_tarlong, lessp_tarlong, clear_tarlong, add_to_tarlong,
11677         mult_tarlong, print_tarlong): Remove.  All callers replaced with
11678         arithmetic ops.
11679
11680         * src/common.h (init_total_written): Remove decl.
11681
11682         * src/buffer.c (total_written):
11683         Remove; replaced with prev_written + bytes_written.
11684         (prev_written): New var.
11685         (init_total_written): Remove.
11686         (print_total_written): Use TARLONG_FORMAT instead of print_tarlong.
11687
11688         * m4/ulonglong.m4 (jm_AC_TYPE_UNSIGNED_LONG_LONG):
11689         Make sure that we can shift, multiply
11690         and divide unsigned long long values; Ultrix cc can't do it.
11691
11692         * lib/modechange.c (mode_compile): Use uintmax_t, not unsigned long.
11693         Check for any unknown bits, not just unknown bits left of the leftmost
11694         known bit.
11695
11696         * lib/quotearg.c (quotearg_buffer):
11697         Don't quote spaces if C quoting style.
11698         * src/list.c (from_oct):
11699         Use C quoting style for error; omit trailing NULs.
11700
11701 1999-07-14  Paul Eggert  <eggert@twinsun.com>
11702
11703         * configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.2.
11704
11705         * m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX): Check whether
11706         <inttypes.h> defines strtoumax as a macro (and not as a function).
11707         HP-UX 10.20 does this.
11708
11709         * src/tar.c (usage): tar-bugs@gnu.org -> bug-tar@gnu.org
11710         * PORTS, README, TODO, doc/tar.texi: Likewise.
11711
11712 1999-07-12  Paul Eggert  <eggert@twinsun.com>
11713
11714         * configure.in (AM_INIT_AUTOMAKE): Version 1.13.1.
11715         (LIBOBJS): Add mktime.o to automake 1.4 bug workaround.
11716
11717         * src/list.c (decode_header):
11718         Do not assume that S_IFBLK and S_IFCHR are defined.
11719
11720         * src/create.c (start_header): Do not assume S_IFMT is defined.
11721         (dump_file): Remove unnecessary check for screwy apollo lossage.
11722         Do not assume S_IFBLK and S_IFCHR are defined.
11723
11724         * src/extract.c (extract_archive):
11725         Test whether S_IFCHR and S_IFBLK are nonzero,
11726         not whether they are defined, for consistency with other tests.
11727
11728         * src/buffer.c (is_regular_file):
11729         Don't succeed on files that we can't access due to
11730         permissions problems.
11731         (open_archive): Fix wording on fatal error message.
11732         Don't bother to stat /dev/null if the archive is not a character
11733         special device.
11734
11735         * src/compare.c (process_rawdata, diff_sparse_files, diff_archive):
11736         Report an error, not a warning, for I/O errors.
11737         (process_rawdata, process_dumpdir, diff_sparse_files):
11738         Change ungrammatical "Data differs" to "Contents differ".
11739         (get_stat_data): Find hidden files on AIX.
11740         Accept file name as argument; all uses changed.
11741         (get_stat_data, diff_archive): Use system error message for
11742         nonexistent files rather than rolling our own.
11743         (diff_archive): Unknown file types are errors, not warnings.
11744         Normalize spelling of message to "File type differs".
11745         Use get_stat_data to get link status, for consistency.
11746         Do not inspect st_rdev for fifos.
11747         Do not assume st_mode values contain only file types and mode bits.
11748         Check for mode changes and device number changes separately.
11749
11750         * src/update.c (append_file):
11751         Open the file before statting it, to avoid a race.
11752         Complain about file shrinkage only when we reach EOF.
11753
11754 1999-07-08  Paul Eggert  <eggert@twinsun.com>
11755
11756         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13 released.
11757
11758         * configure.in (AC_EXEEXT): Add.
11759
11760         * lib/Makefile.am (noinst_HEADERS):
11761         Add basename.h, exclude.h.  Remove full-write.h.
11762         (libtar_a_SOURCES): Add exclude.c.
11763
11764         * lib/basename.h, lib/exclude.c, lib/exclude.h, lib/safe-read.h:
11765         New files.
11766         * lib/full-write.c: Include safe-read.h instead of full-write.h.
11767         * lib/safe-read.h (safe_read): New decl.
11768         * src/rmt.c: Include safe-read.h.
11769         * src/rtapelib.c: Include basename.h, save-read.h.
11770         (rmt_open__): Use base_name to compute base name.
11771
11772         * src/common.h:
11773         Include basename.h, exclude.h; don't include full-write.h.
11774         (exclude_option): Remove decl.
11775         (excluded): New decl.
11776         (add_exclude, add_exclude_file, check_exclude): Remove decls.
11777
11778         * src/list.c (read_and):
11779         Use excluded_filename instead of check_exclude.
11780         Check base name of incoming file name, not entire file name, when
11781         deciding whether to exclude it.
11782
11783         * src/create.c (finish_sparse_file):
11784         Use excluded_filename instead of check_exclude.
11785         Don't bother to stat excluded file names.
11786         * src/incremen.c (get_directory_contents): Likewise.
11787
11788         * src/names.c (exclude_pool, exclude_pool_size,
11789         allocated_exclude_pool_size, simple_exclude_array,
11790         simple_excludes, allocated_simple_excludes,
11791         pattern_exclude_array, pattern_excludes,
11792         allocated_pattern_excludes, add_exclude, add_exclude_file,
11793         check_exclude):
11794         Remove; now done in ../lib/exclude.c.
11795
11796         * src/tar.c (decode_options): Initialize `excluded'.
11797         Use new add_exclude_file and add_exclude functions.
11798
11799 1999-07-05  Paul Eggert  <eggert@twinsun.com>
11800
11801         * m4/gettext.m4: Use changequote rather than [[ ]].
11802
11803         * lib/safe-read.c: Renamed from lib/full-read.c.
11804         (safe_read): Renamed from full_read.  All uses changed.
11805         * lib/safe-read.h, lib/full-write.h: New files.
11806         * lib/Makefile.am (noinst_HEADERS): Add full-write.h, safe-read.h.
11807         (libtar_a_SOURCES): Rename full-read.c to safe-read.c.
11808         * lib/full-write.c: Include full-write.h.
11809         * src/common.h: Include full-write.h, safe-read.h.
11810         * src/system.h: (full_read, full_write): Remove decls.
11811
11812         * src/Makefile.am (datadir): New var; needed for Solaris gettext.
11813
11814         * src/system.h (bindtextdomain, textdomain): undef before
11815         defining, to avoid preprocessor warnings with --disable-nls
11816         on hosts whose locale.h includes libintl.h.
11817
11818         * lib/xstrtol.c (__strtol): Remove decl; it doesn't work if __strtol
11819         expands to a macro, which occurs in HP-UX 10.20 with strtoumax.
11820         (strtol, strtoul): New decls (for pre-ANSI hosts), to replace
11821         the above decl.
11822
11823 1999-07-02  Paul Eggert  <eggert@twinsun.com>
11824
11825         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/mktime.m4.
11826         * m4/mktime.m4: New file.
11827         * m4/Makefile.am.in, m4/README: Remove these files.
11828         * m4/Makefile.am (EXTRA_DIST): Add mktime.m4;
11829         remove README, Makefile.am.in.
11830         (Makefile.am): Remove rule; it didn't work in BSD/OS 4.0.
11831         * m4/jm-mktime.m4 (jm_FUNC_MKTIME): Invoke AC_FUNC_MKTIME,
11832         not AM_FUNC_MKTIME.
11833
11834         * src/tar.c: Include signal.h.
11835         (SIGCHLD): Define to SIGCLD if SIGCLD is defined but SIGCHLD is not.
11836         (main): Ensure SIGCHLD is not ignored.
11837
11838         (BACKUP_OPTION, DELETE_OPTION, EXCLUDE_OPTION, GROUP_OPTION,
11839         MODE_OPTION, NEWER_MTIME_OPTION, NO_RECURSE_OPTION, NULL_OPTION,
11840         OWNER_OPTION, POSIX_OPTION, PRESERVE_OPTION, RECORD_SIZE_OPTION,
11841         RSH_COMMAND_OPTION, SUFFIX_OPTION, USE_COMPRESS_PROGRAM_OPTION,
11842         VOLNO_FILE_OPTION, OBSOLETE_ABSOLUTE_NAMES,
11843         OBSOLETE_BLOCK_COMPRESS, OBSOLETE_BLOCKING_FACTOR,
11844         OBSOLETE_BLOCK_NUMBER, OBSOLETE_READ_FULL_RECORDS, OBSOLETE_TOUCH,
11845         OBSOLETE_VERSION_CONTROL): Make sure they can't be valid chars, so
11846         they don't overlap with char codes.  Use an enum instead of a lot
11847         of #defines.
11848
11849         * src/system.h (ISASCII): Remove.
11850         (CTYPE_DOMAIN, ISDIGIT, ISODIGIT, ISPRINT, ISSPACE, S_ISUID,
11851         S_ISGID, S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP,
11852         S_IROTH, S_IWOTH, S_IXOTH, MODE_WXUSR, MODE_R, MODE_RW,
11853         MODE_RWX, MODE_ALL, SEEK_SET, SEEK_CUR, SEEK_END, CHAR_MAX,
11854         LONG_MAX): New macros.
11855
11856         * src/incremen.c (ISDIGIT, ISSPACE): Remove; now in system.h.
11857         (read_directory_file): Cast ISSPACE arg to unsigned char.
11858         * src/misc.c (ISPRINT): Remove; now in system.h.
11859         (remove_any_file): Add brackets to pacify gcc -Wall.
11860         * src/list.c: Don't include <ctype.h>; system.h already does this.
11861         (ISODIGIT, ISSPACE): Remove; now in system.h.
11862         (decode_header): No need to AND mode with 07777; MODE_FROM_OCT
11863         does this now.
11864         (from_oct): Cast ISSPACE arg to unsigned char.
11865
11866         * src/create.c (mode_to_oct): Translate modes from internal to
11867         external form.
11868         * src/list.c (mode_from_oct): Translate modes from external to
11869         internal form.  Do not complain about unrecognized mode bits.
11870         * src/common.h (TSUID, TSGID, TSVTX, TUREAD, TUWRITE, TUEXEC,
11871         TGREAD, TGWRITE, TGEXEC, TOREAD, TOWRITE, TOEXEC): Remove undefs.
11872
11873         * src/extract.c: (extr_init, make_directories, extract_archive):
11874         Do not assume mode bits have traditional Unix values.
11875         * src/list.c (decode_mode): Likewise.
11876         * src/create.c (start_header, dump_file): Likewise.
11877         * src/buffer.c (child_open_for_compress,
11878         child_open_for_uncompress, open_archive, (close_archive): Likewise.
11879         * src/compare.c (diff_archive): Likewise.
11880
11881         * src/extract.c (set_mode): Use %04 not %0.4 format.
11882         (extract_sparse_file): Do not use data_block uninitialized.
11883         Check for lseek failures.
11884
11885         * src/rtapelib.c (rmt_lseek__):
11886         Convert lseek whence values to portable integers on the wire.
11887         * src/rmt.c (main): Likewise.  Check for whence values out of range.
11888
11889         * src/create.c (finish_sparse_file): Use lseek whence macros
11890         instead of integers.
11891         * src/buffer.c (backspace_output): Likewise.
11892         * src/compare.c (diff_archive, verify_volume): Likewise.
11893         * src/delete.c (move_archive): Likewise.
11894         * src/extract.c (extract_sparse_file): Likewise.
11895
11896         * src/create.c (dump_file): Do not invoke finish_sparse_file
11897         on a negative file descriptor.
11898
11899         * src/buffer.c: Add braces to pacify gcc -Wall.
11900
11901         * src/compare.c (diff_sparse_files): Report lseek errors.
11902
11903         * configure.in (ALL_LINGUAS): Add cs, es, ru.
11904
11905         * PORTS, TODO: gnu.ai.mit.edu -> gnu.org
11906
11907         * src/arith.c, src/buffer.c (new_volume): Don't put ^G in
11908         message to be internationalized; \a doesn't work with msgfmt.
11909
11910         * src/tar.c (long_options, main, usage, OPTION_STRING):
11911         Remove -E or --ending-file.
11912         * src/list.c (read_and): Likewise.
11913         * src/common.h (ending_file_option): Likewise.
11914         * src/buffer.c (close_archive): Likewise.
11915
11916         * tests/after: Don't run two commands together in a pipeline,
11917         as some old shells mishandle pipeline exit status.
11918
11919 1999-06-28  Paul Eggert  <eggert@twinsun.com>
11920
11921         * configure.in (AM_INIT_AUTOMAKE): version 1.12.64015.
11922         * NEWS: Describe changes since 1.12.
11923         * README: Update bug reporting address; move paxutils ref to NEWS.
11924
11925         Handle EINTR correctly.
11926         * lib/Makefile.am (libtar_a_SOURCES): Add full-read.c, full-write.c.
11927         * lib/full-read.c, lib/full-write.c: New files.
11928         * src/buffer.c (child_open_for_compress, child_open_for_uncompress):
11929         Prefer full_read to read and full_write to write.
11930         * src/compare.c (process_rawdata, diff_sparse_files): Likewise.
11931         * src/create.c (deal_with_sparse, finish_sparse_file, dump_file):
11932         Likewise.
11933         * src/extract.c (extract_sparse_file): Likewise.
11934         * src/rmt.c (get_string, main, report_error_message,
11935         report_numbered_error): Likewise.
11936         * src/rmt.h (rmtread, rmtwrite): Likewise.
11937         * src/rtapelib.c (do_command, get_status_string, rmt_read__,
11938         rmt_write__, rmt_ioctl__): Likewise.
11939         * src/update.c (append_file): Likewise.
11940         * src/system.h (full_read, full_write): New decls.
11941
11942         * po/POTFILES.in: Add lib/argmatch.c, lib/error.c lib/getopt.c,
11943         lib/xmalloc.c, src/arith.c, src/misc.c.
11944
11945         * src/system.h (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO):
11946         New macros.  All uses of STDIN and STDOUT changed.
11947         * src/rmt.c (prepare_record_buffer, main): Use STDIN_FILENO
11948         instead of 0 and STDOUT_FILENO instead of 1.
11949         * src/rtapelib.c (_rmt_rexec): Use STDIN_FILENO and STDOUT_FILENO
11950         instead of fileno (stdin) and fileno (stdout) or 0 and 1.
11951
11952         * src/rmt.c (private_strerror): Avoid const.  Translate results.
11953
11954         * tests/Makefile.am (TESTS): Remove incremen.sh; it doesn't work
11955         in the presence of NFS clock skew.
11956
11957 1999-06-25  Paul Eggert  <eggert@twinsun.com>
11958
11959         * configure.in (AM_INIT_AUTOMAKE): version 1.12.64014.
11960
11961         * src/buffer.c (write_archive_buffer): New function.
11962         (child_open_for_compress, flush_write, flush_read): Use it to write
11963         buffers.
11964         (open_archive): Report error if fstat of archive fails.
11965         Improve efficiency of check for /dev/null.
11966         Also, fix some corner cases with remote archives and /dev/null checking.
11967         (close_archive): Test for input fifo only if not remote.
11968         Truncate output archive only if it's not remote.
11969
11970         * src/misc.c (remove_any_file):
11971         Don't terminate if you see . or ..; just skip them.
11972
11973 1999-06-18  Paul Eggert  <eggert@twinsun.com>
11974
11975         * configure.in (AM_INIT_AUTOMAKE): version 1.12.64013.
11976
11977         Output sizes using a format that's more compatible with
11978         traditional tar (and with GNU Emacs).
11979         * src/common.h (GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT,
11980         MODE_TO_OCT, SIZE_TO_OCT, UID_TO_OCT, UINTMAX_TO_OCT):
11981         Don't subtract 1 from size.
11982         * src/create.c (to_oct): Prepend leading zeros, not spaces.
11983         Output a trailing NUL unless the value won't fit without it.
11984         (finish_header): No need to append NUL to chksum, now that
11985         to_oct is doing it.
11986
11987 1999-06-16  Paul Eggert  <eggert@twinsun.com>
11988
11989         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64012.
11990
11991         * src/Makefile.am (LDADD): Link libtar.a after @INTLLIBS@, since
11992         @INTLLIBS@ might invoke rpl_realloc.
11993
11994         * src/tar.c (backup_type): Remove decl; backupfile.h now has it.
11995         (intconv): Remove; use xstrto* fns instead.
11996         ("xstrtol.h"): Include.
11997         (check_decimal): Remove.
11998         (long_options, usage, OPTION_STRING, decode_options):
11999         Remove -y, --bzip2, --unbzip2.
12000         (decode_options): Use xget_version instead of get_version.
12001         Check for overflow with -b and -L and RECORD_SIZE_OPTION.
12002         Replace invocations of check_decimal  with xstrtoumax.
12003
12004         * tests/preset.in (echo_n, echo_c): Remove.
12005
12006         * tests/after: Don't rely on $echo_c and $echo_n.
12007
12008         * lib/addext.c, lib/dirname.c, lib/lchown.c, lib/lchown.h,
12009         lib/malloc.c, lib/mktime.c, lib/realloc.c, lib/strtol.c, lib/strtoul.c,
12010         lib/strtoull.c, lib/strtoumax.c, lib/utime.c, lib/xstrtol.c,
12011         lib/xstrtol.h, lib/xstrtoul.c, lib/xstrtoumax.c,
12012         m4/Makefile.am.in, m4/README, m4/ccstdc.m4, m4/d-ino.m4,
12013         m4/gettext.m4, m4/inttypes_h.m4, m4/isc-posix.m4,
12014         m4/jm-mktime.m4, m4/largefile.m4, m4/lcmessage.m4,
12015         m4/malloc.m4, m4/progtest.m4, m4/realloc.m4, m4/uintmax_t.m4,
12016         m4/ulonglong.m4, m4/utimbuf.m4, m4/utime.m4, m4/utimes.m4,
12017         m4/xstrtoumax.m4: New files.
12018
12019         * configure.in(fp_PROG_ECHO): Remove; no longer needed.
12020         (AC_SYS_LARGEFILE): Renamed from AC_LFS.
12021         (jm_AC_HEADER_INTTYPES_H): Replaces inline code.
12022         (jm_STRUCT_DIRENT_D_INO, jm_AC_TYPE_UINTMAX_T, jm_AC_PREREQ_XSTRTOUMAX): Add.
12023         (AC_CHECK_FUNCS): Remove lchown.
12024         (AC_REPLACE_FUNCS): Remove basename, dirname.
12025         Add lchown, strtol, strtoul.
12026         (jm_FUNC_MKTIME): Add.
12027         (LIBOBJS): Replace .o with $U.o, so that the .o files in LIBOBJS
12028         are also built via the ANSI2KNR-filtering rules.
12029         Use a no-op line to work around bug in automake 1.4 with malloc and
12030         realloc.
12031         (AC_OUTPUT): Add m4/Makefile.
12032
12033         * lib/Makefile.am (EXTRA_DIST):
12034         Add lchown.c, malloc.c, mktime.c, realloc.c,
12035         strtol.c, strtoul.c, strtoull.c, strtoumax.c, utime.c.
12036         (noinst_HEADERS): Add lchown.h, modechange.h, xstrtol.h.
12037         (libtar_a_SOURCES): Add addext.c, basename.c, xstrtol.c,
12038         xstrtoul.c, xstrtoumax.c.  Remove getversion.c.
12039         ($(srcdir)/getdate.c:): Remove `expect conflicts' line.
12040
12041         * src/system.h (uintmax_t): Don't declare; configure now does this.
12042
12043         * src/common.h (backup_type): New decl.
12044         * src/common.h, src/misc.c, src/tar.c:
12045         Move include of backupfile.h to common.h.
12046
12047         * src/misc.c (maybe_backup_file):
12048         Pass backup_type to find_backup_file_name.
12049
12050         * src/list.c (print_header): Change sizes of uform and gform from 11 to
12051         UINTMAX_STRSIZE_BOUND.
12052
12053         * doc/tar.texi: Remove --bzip2.
12054         Fix @xref typos reported by latest makeinfo.
12055
12056         * Makefile.am (ACLOCAL_AMFLAGS): New macro.
12057         (SUBDIRS): Add m4.
12058         (M4DIR, ACINCLUDE_INPUTS): New macros.
12059         ($(srcdir)/acinclude.m4): New rule.
12060
12061         * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT,
12062         HAVE_INTTYPES_H, HAVE_LC_MESSAGES, HAVE_STPCPY): Remve #undefs;
12063         now generated automatically by autoconf.
12064
12065 1999-05-15  Paul Eggert  <eggert@twinsun.com>
12066
12067         * doc/tar.texi: Remove -y.
12068
12069 1999-04-09  Paul Eggert  <eggert@twinsun.com>
12070
12071         * src/system.h (INT_STRLEN_BOUND): Fix off-by-factor-of-10 typo
12072         (we were allocating too much storage).
12073         (uintmax_t): Don't declare; configure now does this.
12074
12075         * ABOUT-NLS: Update to gettext 0.10.35 edition.
12076
12077 1999-03-22  Paul Eggert  <eggert@twinsun.com>
12078
12079         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64010
12080
12081         * acinclude.m4 (AC_LFS_FLAGS):
12082         Don't use -mabi=n32 with GCC on IRIX 6.2; it's the default.
12083         (AC_LFS): -n32, -o32, and -n64 are CPPFLAGS, not CFLAGS.
12084         (jm_FUNC_MALLOC, jm_FUNC_REALLOC): New macros.
12085
12086         * configure.in (jm_FUNC_MALLOC, jm_FUNC_REALLOC):
12087         New macros; needed for latest GNU xmalloc.c.
12088
12089         * Makefile.am (noinst_HEADERS): Add quotearg.h, xalloc.h.
12090         (libtar_a_SOURCES): Add quotearg.c.
12091         * list.c: Include <quotearg.h>.
12092         (from_oct): Add forward decl.
12093         (read_header): Return HEADER_FAILURE if we can't parse the checksum.
12094         (from_oct): Report an error only if TYPE is nonzero.
12095         Quote any funny characters in bad header.
12096
12097 1999-03-20  Paul Eggert  <eggert@twinsun.com>
12098
12099         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64009
12100
12101         * acinclude.m4 (AC_LFS_FLAGS): Add support for IRIX 6.2 and later.
12102         (AC_LFS_SPACE_APPEND): Assume $2 is quoted properly; all callers
12103         changed.
12104         (AC_LFS): Simplify AIX revision number test.
12105
12106 1999-03-17  Paul Eggert  <eggert@twinsun.com>
12107
12108         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64008
12109
12110         * configure.in (AC_VALIDATE_CACHED_SYSTEM_TUPLE):
12111         Remove; it doesn't work that well
12112         with AC_CANONICAL_HOST.
12113         (fp_WITH_INCLUDED_MALLOC): Remove; we'll just use the system malloc.
12114
12115         * Makefile.am (EXTRA_DIST): Remove AC-PATCHES, AM-PATCHES, BI-PATCHES.
12116
12117         * Makefile.am (EXTRA_DIST): Remove gmalloc.c.
12118
12119         * acinclude.m4 (fp_WITH_INCLUDED_MALLOC): Remove.
12120
12121         * tar.texi: Fix bug-report addr.
12122
12123         * README: Remove --with-included-malloc.
12124         Upgrade version numbers of build software.
12125
12126 1999-03-07  Paul Eggert  <eggert@twinsun.com>
12127
12128         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64007.
12129
12130         * acinclude.m4 (AM_WITH_NLS): Port to Solaris 2.5.1,
12131         where bindtextdomain and gettext require -lintl.
12132         (AC_LFS_FLAGS): Simplify so that it only gets the flags;
12133         `no' means it failed.
12134         (AC_LFS_SPACE_APPEND, AC_LFS_MACRO_VALUE): New macros.
12135         (AC_LFS): Use them.  Set _FILE_OFFSET_BITS, _LARGEFILE_SOURCE, and
12136         _LARGE_FILES from LFS_CFLAGS, so that in the normal case we don't need
12137         to add anything to the command line (it's all in config.h).
12138         Put any extra -D and -I options into CPPFLAGS, the rest into CFLAGS.
12139
12140 1999-03-01  Paul Eggert  <eggert@twinsun.com>
12141
12142         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64006.
12143
12144         * acinclude.m4 (AC_LFS_FLAGS): Port to AIX 4.2.
12145
12146         * src/list.c: (gid_from_oct, major_from_oct, minor_from_oct,
12147         mode_from_oct, off_from_oct, size_from_oct, time_from_oct,
12148         uid_from_oct, uintmax_from_oct): Use TYPE_MAXIMUM instead of macros
12149         like OFF_MAX, which are not reliable
12150         (e.g. OFF_MAX in AIX 4.2 is incorrect).
12151         * src/system.h (GID_MAX, MAJOR_MAX, MINOR_MAX, MODE_MAX, OFF_MAX,
12152         SIZE_MAX, TIME_MAX,UID_MAX, UINTMAX_MAX):  Remove; no longer used.
12153
12154         * src/incremen.c (get_directory_contents):
12155         Don't use statx if _LARGE_FILES; it doesn't work under AIX 4.2.
12156         Have statx depend on STX_HIDDEN, not AIX.
12157
12158         * src/create.c (to_oct):
12159         New parameter substitute, giving a substitute value to use
12160         when the original value is out of range.  Do not append a space to the
12161         output; modern tars don't.  When a value is out of range, specify the
12162         maximum value, not the number of bits.
12163         (GID_NOBODY, UID_NOBODY): New macros.
12164         (gid_to_oct, uid_to_oct): Use them as substitutes.
12165         (finish_header): Do not assume that UINTMAX_TO_OCT appends a space.
12166         (dump_file): Check whether the file changed as we read it.
12167
12168         * src/rmt.c (main): Remove suspicious AIX/386 code.
12169
12170 1999-02-19  Paul Eggert  <eggert@twinsun.com>
12171
12172         * intl/localealias.c (read_alias_file): Don't assume that memcpy
12173         returns a type compatible with char *; it doesn't on SunOS
12174         4.1.4 with Sun cc, since <string.h> doesn't declare memcpy.
12175
12176         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64005.
12177
12178         * src/tar.c (long_options, usage): Prefer --unbzip2 to --bunzip2.
12179         * doc/tar.texi: Add --bzip2, --unbzip2 options.
12180
12181         * configure.in (AC_CANONICAL_HOST, AC_VALIDATE_CACHED_SYSTEM_TUPLE):
12182         Add.
12183         (AC_LINK_FILES): Omit; AM_GNU_GETTEXT now does this.
12184         (AC_OUTPUT): Omit munging of po/Makefile; AM_GNU_GETTEXT now does this.
12185         * acinclude.m4 (AM_WITH_NLS):
12186         Update to latest gettext version (serial 5).
12187         (AC_LFS_FLAGS): New macro
12188         (AC_LFS): Use it.  Append to CFLAGS, LDFLAGS, LDLIBS instead of
12189         working only with unset variables.  Append to CFLAGS, not CPPFLAGS.
12190         Work properly in cross-compilation scenario, by checking for getconf
12191         with AC_CHECK_TOOL and by ditching uname in favor of
12192         AC_CANONICAL_HOST and $host_os.  Add --disable-lfs option.
12193
12194         * lib/getdate.y: Update to fileutils 4.0 getdate.y, with one patch:
12195         replace FORCE_ALLOCA_H with HAVE_ALLOCA_H.
12196         * lib/Makefile.am (AUTOMAKE_OPTIONS): Append ../src/ansi2knr,
12197         since getdate.y now uses ANSI code.
12198
12199         * config.guess, config.sub: New files; taken from automake 1.4.
12200
12201         * intl/Makefile.in, intl/VERSION, intl/bindtextdom.c,
12202         intl/cat-compat.c, intl/dcgettext.c, intl/dgettext.c,
12203         intl/explodename.c, intl/finddomain.c, intl/gettext.c,
12204         intl/gettext.h, intl/gettextP.h, intl/hash-string.h,
12205         intl/l10nflist.c, intl/libgettext.h, intl/loadinfo.h,
12206         intl/loadmsgcat.c, intl/localealias.c, intl/textdomain.c:
12207         Update to GNU gettext 0.10.35, with patches as per GCC snapshot 990109.
12208
12209 1999-02-01  Paul Eggert  <eggert@twinsun.com>
12210
12211         * src/tar.c: Update copyright.
12212
12213         * NEWS: 1.12.64004
12214
12215 1999-02-01  Paul Eggert  <eggert@twinsun.com>
12216
12217         * NEWS, configure.in: Version 1.12.64004
12218
12219         * configure.in (AC_LFS): Use this macro, instead of open-coding it.
12220
12221         * acinclude.m4 (AC_LFS, AM_PROG_CC_STDC): New macros.
12222
12223         * src/extract.c (extract_archive): Fix bug when extracting sparse
12224         files: they were trashing the tar file header.
12225
12226         * src/tar.c: (long_options, usage, OPTION_STRING, decode_options):
12227         Add -y or --bzip2 or --bunzip2 option.
12228
12229 1999-01-30  Paul Eggert  <eggert@twinsun.com>
12230
12231         * src/names.c (cached_no_such_uname, cached_no_such_gname,
12232         cached_no_such_uid, cached_no_such_gid): New vars.
12233         (uid_to_uname, gid_to_gname, uname_to_uid, gname_to_gid):
12234         Cache failures, too.
12235
12236         * src/tar.c (decode_options):
12237         Don't pass names longer than UNAME_FIELD_SIZE to
12238         uname_to_uid, as it messes up the cache.  Similarly for gname_to_uid.
12239
12240 1999-01-27  Paul Eggert  <eggert@twinsun.com>
12241
12242         * NEWS, configure.in: Version 1.12.64003
12243
12244         * src/buffer.c (backspace_output, close_archive):  Cast
12245         rmtlseek position arg to off_t, for benefit of K&R compilers
12246         with long long.
12247         * src/compare.c (verify_volume): Likewise.
12248
12249         * NEWS, configure.in: Version 1.12.64002
12250
12251         * src/create.c (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct,
12252         off_to_oct, size_to_oct, time_to_oct, uid_to_oct):
12253         Cast arg to uintmax_t for benefit of pre-ANSI compilers with long long.
12254         * src/list.c: (gid_from_oct, major_from_oct, minor_from_oct,
12255         mode_from_oct, off_from_oct, size_from_oct, time_from_oct,
12256         uid_from_oct): Likewise.
12257
12258 1999-01-25  Paul Eggert  <eggert@twinsun.com>
12259
12260         * incremen.sh: Fix timing bug in regression test.
12261
12262 1999-01-22  Paul Eggert  <eggert@twinsun.com>
12263
12264         * NEWS, configure.in: Update version
12265
12266         * Makefile.am (localedir): Change to $(datadir)/locale.
12267         (DEFS): New macro, defining LOCALEDIR.
12268         (tar.o, tar._o, rmt.o, rmt._o): Remove.
12269         (INCLUDES): Add -I..
12270
12271         * Makefile.am (localedir): Change to $(datadir)/locale.
12272
12273 1999-01-21  Paul Eggert  <eggert@twinsun.com>
12274
12275         * NEWS, README, configure.in: Unofficial version 1.12.64001.
12276
12277         * tests/Makefile.am (localedir): Change to $(datadir)/locale.
12278         * src/Makefile.am (localedir): Likewise.
12279         (DEFS): New macro, defining LOCALEDIR.
12280         (tar.o, tar._o, rmt.o, rmt._o): Remove.
12281         (INCLUDES): Add `-I..'.
12282
12283         * tests/incremen.sh: Fix timing bug.
12284
12285 1999-01-20  Paul Eggert  <eggert@twinsun.com>
12286
12287         * NEWS, README, configure.in: Unofficial version 1.12.64000.
12288         `lfs.7' changed to `64000' in version number
12289         to conform to gnits standards.
12290
12291         * COPYING, INSTALL, doc/texinfo.tex, install-sh, missing,
12292         mkinstalldirs, ansi2knr.c: Update to latest public versions.
12293
12294         Rebuild with automake 1.4 and autoconf 2.13, to work around some
12295         porting problems.
12296
12297 1998-12-07  Paul Eggert  <eggert@twinsun.com>
12298
12299         * NEWS, README, configure.in: Unofficial version 1.12.lfs.6.
12300
12301         * src/list.c (read_header):
12302         Accept file names as specified by POSIX.1-1996 section 10.1.1.
12303
12304 1998-11-30  Paul Eggert  <eggert@twinsun.com>
12305
12306         * configure.in: Quote the output of uname.
12307
12308         * src/extract.c (set_stat): chmod after chown even when not root;
12309         if we are using --same-owner this is needed e.g. on Solaris 2.5.1.
12310
12311 1998-11-15  Paul Eggert  <eggert@twinsun.com>
12312
12313         * NEWS, README, configure.in: Unofficial version 1.12.lfs.5.
12314
12315         * configure.in (ac_test_CPPFLAGS, ac_test_LDFLAGS, ac_test_LIBS,
12316         ac_getconfs, ac_result): Special case for HP-UX 10.20 or later.
12317
12318 1998-10-28  Paul Eggert  <eggert@twinsun.com>
12319
12320         * NEWS, README, configure.in: Unofficial version 1.12.lfs.4.
12321
12322         * src/system.h (voidstar): Use void * if __STDC__ is defined,
12323         not merely nonzero.
12324
12325         * src/rtapelib.c: Don't use rexec code unless compiled with WITH_REXEC.
12326         On many installations, rexec is disabled.
12327
12328 1998-08-07  Paul Eggert  <eggert@twinsun.com>
12329
12330         * NEWS, README, configure.in: Unofficial version 1.12.lfs.3.
12331
12332         * src/names.c (uid_to_uname, gid_to_gname): Don't used cached name
12333         for nameless users and groups.
12334
12335 1998-02-17  Paul Eggert  <eggert@twinsun.com>
12336
12337         * NEWS, README, configure.in: Unofficial version 1.12.lfs.2.
12338         * NEWS, README: Add explanation of why this isn't an official version.
12339
12340 1998-02-02  Paul Eggert  <eggert@twinsun.com>
12341
12342         * NEWS, README, configure.in: Unofficial version 1.12.lfs.1.
12343         This is an unofficial version.
12344
12345 1997-12-17  Paul Eggert  <eggert@twinsun.com>
12346
12347         * src/incremen.c (ST_DEV_MSB): New macro.
12348         (NFS_FILE_STAT): Use most significant bit of st_dev,
12349         even if it's unsigned.
12350
12351 1997-12-08  Paul Eggert  <eggert@twinsun.com>
12352
12353         * src/system.h (ST_NBLOCKS): Fix typo in definition.
12354
12355 1997-11-19  Paul Eggert  <eggert@twinsun.com>
12356
12357         * configure.in (HAVE_INTTYPES_H):
12358         Don't ignore cache variable if it's already set.
12359
12360 1997-11-10  Paul Eggert  <eggert@twinsun.com>
12361
12362         * src/rmt.c (main): Don't assume mt_count is of type daddr_t.
12363         * src/delete.c (records_read): Now off_t.
12364         (move_archive): Don't assume mt_count is of type daddr_t.
12365
12366 1997-10-30  Paul Eggert  <eggert@twinsun.com>
12367
12368         * configure.in (CPPFLAGS, LDFLAGS, LIBS):
12369         Set to appropriate values if large file support
12370         needs explicit enabling.
12371         (HAVE_INTTYPES_H, HAVE_ST_FSTYPE_STRING, daddr_t, major_t, minor_t,
12372         ssize_t):
12373         New macros to configure.
12374         (AC_TYPE_MODE_T, AC_TYPE_PID_T, AC_TYPE_OFF_T): Add.
12375
12376         * acconfig.h (daddr_t, HAVE_INTTYPES_H, HAVE_ST_FSTYPE_STRING,
12377         major_t, minor_t, ssize_t): New macros.
12378
12379         * src/arith.h (TARLONG_FORMAT):
12380         Fix typo: %uld -> %lu.  Use unsigned when long long
12381         (%lld -> %llu).
12382         (add_to_tarlong_helper, mult_tarlong_helper): 2nd arg is now unsigned long.
12383         (add_to_tarlong, mult_tarlong): Cast 2nd arg to unsigned long.
12384
12385         * src/arith.c (add_to_tarlong_helper, mult_tarlong_helper):
12386         2nd arg is now unsigned long.
12387
12388         * src/rmt.c (allocated_size): Now size_t, and now initialized to 0.
12389         (prepare_record_buffer): Arg is now size_t.
12390         Remove now-useless casts.
12391
12392         (main): Use `long' for status, so that it can store ssize_t.
12393         Use daddr_t, mode_t, size_t, off_t when appropriate.
12394         Convert daddr_t and off_t values ourselves, since they might be longer
12395         than long.  Convert other types using `long' primitives.
12396         When processing MTIOCTOP, do not try to pass resulting
12397         count back, since it won't work (it could be too large) and it's
12398         not expected anyway.
12399
12400         * src/update.c:
12401         (append_file) Use off_t, size_t, ssize_t when appropriate.  Remove
12402         now-useless casts.  Use unsigned long to print *_t types, except use
12403         STRINGIFY_BIGINT for off_t.
12404         (update_archive): Cast -1 to dev_t when necessary.
12405
12406         * src/tar.c (check_decimal):
12407         Now returns 1 if successful, 0 otherwise, and returns
12408         uintmax_t value into new arg.  Check for arithmetic overflow.
12409         (decode_options): Avoid overflow if record_size fits in size_t but not int.
12410         Check for overflow on user or group ids.
12411
12412         * src/compare.c (diff_init, process_rawdata, read_and_process,
12413         diff_sparse_files, diff_archive):
12414         Use off_t, pid_t, size_t, ssize_t when appropriate.
12415         Remove now-useless casts.  Use unsigned long to print *_t types,
12416         except use STRINGIFY_BIGINT for off_t.
12417
12418         (process_noop, process_rawdata, process_dumpdir, read_and_process):
12419         Size arg is now size_t.
12420
12421         (diff_sparse_files): Arg is now off_t.  Check for size_t overflow
12422         when allocating buffer.
12423
12424         * src/rtapelib.c:
12425         (do_command, rmt_open__, rmt_read__, rmt_lseek__, rmt_ioctl__):
12426         Use pid_t, size_t, ssize_t when appropriate.  Remove now-useless casts.
12427         Use unsigned long to print *_t types, except use STRINGIFY_BIGINT for
12428         off_t.
12429
12430         (get_status_string, get_status_off): New function.
12431         (get_status): Now returns long, so that it can store ssize_t.
12432         Invoke get_status_string to do the real work.
12433         (rmt_read__, rmt_write__): Now returns ssize_t. Size arg is now size_t.
12434         (rmt_lseek__): Now returns off_t, using new get_status_off function.
12435         (rmt_ioctl__): Convert mt_count by hand,
12436         since it might be longer than long.
12437
12438         * src/mangle.c (extract_mangle):
12439         Check for overflow when converting off_t to size_t.
12440         Use off_t, size_t when appropriate.  Remove now-useless casts.
12441
12442         * src/system.h (mode_t): Remove; now done by autoconf.
12443         (ST_NBLOCKS): Do not overflow if st_size is near maximum.
12444         Return number of ST_NBLOCKSIZE-byte blocks,
12445         not number of 512-byte blocks;
12446         this also helps to avoid overflow.
12447         (st_blocks): Declare if needed.
12448         (ST_NBLOCKSIZE): New macro.
12449         (<limits.h>, <inttypes.h>): Include if available.
12450         (CHAR_BIT): New macro.
12451         (uintmax_t): New typedef.
12452         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_STRLEN_BOUND,
12453         UINTMAX_STRSIZE_BOUND, GID_MAX, MAJOR_MAX, MINOR_MAX, MODE_MAX,
12454         OFF_MAX, SIZE_MAX, TIME_MAX, UID_MAX, UINTMAX_MAX): New macros.
12455
12456         * src/names.c (name_init):
12457         Fix typo in error message: FILE* was passed, but char*
12458         was wanted.
12459
12460         (read_name_from_file, name_gather, addname, name_match, name_scan,
12461         add_exclude): Use size_t when appropriate.  Remove now-useless casts.
12462
12463         (exclude_pool_size, allocated_exclude_pool_size): Now size_t.
12464
12465         * src/extract.c (newdir_umask, current_umask): Now mode_t.
12466         (extract_sparse_file): Args now use off_t.
12467
12468         (set_mode, set_stat, make_directories, extract_sparse_file,
12469         extract_archive): Use off_t, size_t, ssize_t when appropriate.  Remove
12470         now-useless casts.  Use unsigned long to print *_t types, except use
12471         STRINGIFY_BIGINT for off_t.
12472
12473         * src/misc.c (quote_copy_string):
12474         Use size_t when appropriate.  Remove now-useless casts.
12475
12476         * src/list.c (read_and, list_archive, read_header, decode_mode,
12477         print_header, print_for_mkdir):
12478         Use mode_t, off_t, size_t when appropriate.  Remove
12479         now-useless casts.  Use unsigned long to print *_t types, except use
12480         STRINGIFY_BIGINT for off_t.
12481
12482         (read_header): Check for overflow when converting header size.
12483
12484         (from_oct): Now static.  Now returns uintmax_t.  `where' arg is now
12485         const char *.  Size arg is now size_t.  Now takes new type and maxval
12486         args.  Compute result using uintmax_t, not long.  Report error if
12487         field does not contain octal number in range.
12488         (gid_from_oct, major_from_oct, minor_from_oct, mode_from_oct,
12489         off_from_oct, size_from_oct, time_from_oct, uid_from_oct,
12490         uintmax_from_oct): New functions.
12491
12492         (stringify_uintmax_t_backwards): New function.
12493
12494         (decode_mode, print_for_mkdir): Mode arg is now mode_t.
12495         (skip_file): Offset arg is now off_t.
12496
12497         * src/buffer.c (record_start_block, save_totsize, save_sizeleft,
12498         real_s_totsize, real_s_sizeleft, current_block_ordinal):
12499         Now off_t.
12500         (write_error): Arg is now ssize_t.
12501         (child_pid): Now pid_t.
12502         (available_space_after): Now size_t.
12503
12504         (child_open_for_compress, child_open_for_uncompress, flush_write,
12505         open_archive, flush_write, write_error, flush_read, close_archive):
12506         Use pid_t, ssize_t, size_t when appropriate.  Remove now-useless
12507         casts.  Use unsigned long to print *_t types, except use
12508         STRINGIFY_BIGINT for off_t.
12509
12510         * src/delete.c (records_read): Now daddr_t.
12511         (move_archive): Arg is now daddr_t.  Check for overflow when
12512         computing offset.
12513         (move_archive, delete_archive_members): Use daddr_t, off_t when
12514         appropriate.  Remove now-useless casts.
12515
12516         * src/rmt.h (rmt_read__, rmt_write__): Now returns ssize_t.
12517         (rmt_lseek): Now returns off_t.
12518
12519         * src/create.c (to_oct):
12520         Now static.  Value arg is now uintmax_t.  Accept new args
12521         giving name of type of octal field, for error messages.  Report an
12522         error if the value is too large to fit in the field.
12523         (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct, off_to_oct,
12524         size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct): New functions.
12525
12526         (write_eot, write_long, finish_header, deal_with_sparse,
12527         finish_sparse_file, dump_file): Use dev_t, off_t, ssize_t, size_t when
12528         appropriate.  Remove now-useless casts.  Use unsigned long to print
12529         *_t types, except use STRINGIFY_BIGINT for off_t.
12530
12531         (find_new_file_size): 1st arg is now off_t*.
12532         (finish_sparse_file): Args now use off_t, not long.
12533         Check for lseek error.
12534         (create_archive, dump_file): Cast -1 to dev_t when necessary.
12535         (dump_file): Device arg is now dev_t.
12536         Avoid overflow when testing whether file has holes
12537         by using the new ST_NBLOCKSIZE macro.
12538
12539         * src/incremen.c (struct accumulator, add_to_accumulator,
12540         get_directory_contents, add_hierarchy_to_namelist, gnu_restore):
12541         Use size_t for sizes.
12542         (struct directory, get_directory_contents, add_hierarchy_to_namelist):
12543         Use dev_t, ino_t for devices and inodes.
12544         (gnu_restore): Use off_t for file offsets.
12545         (struct directory): Use char for flags.  Add new flag `nfs'.
12546         (nfs): New constant
12547         (NFS_FILE_STAT): New macro.
12548         (note_directory): Accept struct stat * instead of
12549         device and inode number.  All callers changed.
12550         (note_directory, get_directory_contents):
12551         Use NFS_FILE_STAT to determine whether directory is an NFS directory.
12552         (write_dir_file): Cast time_t to unsigned long before printing as %lu.
12553
12554         * src/common.h (record_size, struct name, struct sp_array,
12555         available_space_after):
12556         Use size_t for sizes.
12557         (save_sizeleft, save_totsize, current_block_ordinal, skip_file):
12558         Use off_t for file offsets.
12559         (struct name): dir_contents is now const char *, not char *.
12560         (dump_file, get_directory_contents): Use dev_t for devices.
12561         (to_oct): Remove decl.
12562         (GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT, MODE_TO_OCT, SIZE_TO_OCT,
12563         UID_TO_OCT, UINTMAX_TO_OCT, OFF_TO_OCT, TIME_TO_OCT, STRINGIFY_BIGINT,
12564         GID_FROM_OCT, MAJOR_FROM_OCT, MINOR_FROM_OCT, MODE_FROM_OCT,
12565         OFF_FROM_OCT, SIZE_FROM_OCT, TIME_FROM_OCT, UID_FROM_OCT,
12566         UINTMAX_FROM_OCT): New macros.
12567         (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct, off_to_oct,
12568         size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct,
12569         stringify_uintmax_t_backwards, gid_from_oct, major_from_oct,
12570         minor_from_oct, mode_from_oct, off_from_oct, size_from_oct,
12571         time_from_oct, uid_from_oct, uintmax_from_oct): New decls.
12572         (print_for_mkdir): 2nd arg is now mode_t.
12573
12574         -----
12575
12576         See ChangeLog.1 for earlier changes.
12577
12578         -----
12579 \f
12580 Local Variables:
12581 mode: change-log
12582 version-control: never
12583 buffer-read-only: t
12584 End: