1828 Commits

Author SHA1 Message Date
Sergey Poznyakoff
983113b140 Version 1.24
* configure.ac, NEWS: Version 1.24
* bootstrap: Restore tar-specific code lost during last
sync from gnulib (241b72ffad).
* src/misc.c (chdir_do): Remove unused automatic variable.
2010-10-25 00:35:50 +03:00
Paul Eggert
9447e799ab tar: use more-accurate diagnostic when intermediate mkdir fails
Without this change, if tar tried to extract a file A/B/C, noticed
that A/B didn't exist, attempted to mkdir A/B, and the mkdir
failed, it did not diagnose the mkdir failure, but simply reported
the failure to open A/B/C.  This sometimes led to confusion
because it wasn't clear what tar was trying to do, in particular
that tar tried to mkdir A/B.  With this patch, tar issues two
diagnostics in this case: one for A/B and the other for A/B/C.
Problem reported by Hauke Laging in
<http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00020.html>.
* gnulib.modules: Remove faccessat.
* src/extract.c (make_directories): New arg INTERDIR_MADE.
Diagnose mkdir failure.  Return 0 on success, nonzero on failure,
as opposed to nonzero iff some directory was created.  All callers
changed.  Simplify the code when mkdir fails, by checking whether
the desired file exists unless errno==EEXIST: this is more robust.
* tests/extrac15.at: New test, to check this.
* tests/Makefile.am (TESTSUITE_AT): Add it.
* tests/testsuite.at: Include it.
2010-10-15 22:26:43 -07:00
Paul Eggert
502abd93bd tests: port to NFS file servers with clock skew
Several of the tests assumed that a newly created file cannot
have a time stamp dated in the future.  This assumption is not
true when files are served by a remote host whose clock is
slightly in advance of ours.  Fix the problems that I observed
when running "make check" a couple of times on such a server.

* tests/backup01.at: Use --warning=no-timestamp to suppress
clock-skew warnings.
* tests/chtype.at, tests/comprec.at, tests/exclude06.at:
* tests/extrac01.at, tests/extrac03.at, tests/extrac05.at:
* tests/extrac06.at, tests/extrac08.at, tests/extrac13.at:
* tests/extrac14.at, tests/incr01.at, tests/incr03.at, tests/link01.at:
* tests/multiv01.at, tests/multiv02.at, tests/multiv03.at:
* tests/pipe.at, tests/rename02.at, tests/rename03.at:
* tests/rename05.at, tests/same-order01.at, tests/same-order02.at:
* tests/sparse01.at:
Likewise.
2010-10-15 21:53:37 -07:00
Paul Eggert
241b72ffad gnulib: sync from latest gnulib, notably bootstrap and parse-datetime
* bootstrap: Sync from gnulib.
* doc/.gitignore: Rename getdate.texi to parse-datetime.texi.
* doc/Makefile.am (tar_TEXINFOS): Likewise.
* doc/tar.texi (Top): Adjust to renaming of getdate to parse-datetime.
* gnulib.modules: Likewise.  Also, remove ftruncate (now obsolete).
And add inttostr (we missed this dependency).
* src/tar.c: Include parse-datetime.h, not getdate.h.  All calls
to get_date replaced with parse_datetime.
2010-10-11 16:25:32 -07:00
Paul Eggert
c5c196310e tar: -x -C symlink fix
* src/misc.c (chdir_do): Don't use O_NOFOLLOW when opening the
argument to -C.  This is for consistency with "tar -c -C FOO", and
matches the new documentation.
* tests/extrac14.at: New file.
* tests/Makefile.am (TESTSUITE_AT): Add it.
* tests/testsuite.at: Include it.
2010-09-24 13:13:47 -07:00
Paul Eggert
14efeb9f95 tar: --dereference consistency
This closes another race condition, that occurs when overwriting a
symlink with a regular file.
* NEWS (--dereference consistency): New section.
* doc/tar.texi (Option Summary): Describe new --deference behavior.
(dereference): Likewise.  Remove discussion that I didn't follow,
even before --dereference was changed.
* src/common.h (deref_stat, set_file_atime): Adjust signatures.
* src/compare.c (diff_file, diff_multivol): Respect open_read_flags
instead of rolling our own flags.  This implements the new behavior
for --dereference.
(diff_file, diff_dumpdir): Likewise, for fstatat_flags.
* src/create.c: Adjust to set_file_atime signature change.
* src/extract.c (mark_after_links, file_newer_p, extract_dir):
Likewise.
* src/incremen.c (try_purge_directory): Likewise.
* src/misc.c (maybe_backup_file): Likewise.
* src/extract.c (file_newer_p): New arg STP.  All callers changed.
(maybe_recoverable): New arg REGULAR.  All callers changed.
Handle the case of overwriting a symlink with a regular file,
when --overwrite is specified but --dereference is not.
(open_output_file): Add O_CLOEXEC, O_NOCTTY, O_NONBLOCK for
consistency with file creation.  Add O_NOFOLLOW if
overwriting_old_files && ! dereference_option.
* src/incremen.c (update_parent_directory): Use fstat, not fstatat;
there's less to go wrong.
* src/misc.c (deref_stat): Remove DEREF arg.  All callers changed.
Instead, use fstatat_flags.
(set_file_atime): Remove ATFLAG arg.  All callers changed.
Instead, use fstatat_flags.
* src/names.c, src/update.c: Adjust to deref_stat signature change.
* src/tar.c (get_date_or_file): Use stat, not deref_stat, as this
is not a file to be archived.
* tests/Makefile.am (TESTSUITE_AT): Add extrac13.at.
* tests/extrac13.at: New file.
* tests/testsuite.at: Include it.
2010-09-23 19:41:47 -07:00
Paul Eggert
efe26f98ec tar: do not crash with --listed-incremental
Problem reported by Frantisek Hanzlik in
<https://bugzilla.redhat.com/635318> via Kamil Dudka in
<http://lists.gnu.org/archive/html/bug-tar/2010-09/msg00066.html>.
I don't understand this code either, but Sergey can take a look at
this patch, and perhaps install a better one, when he has the time.
* src/incremen.c (append_incremental_renames): Don't actually append
anything to DIR if DIR is null.
2010-09-20 11:35:04 -07:00
Paul Eggert
4bde4f39d0 tar: prefer openat-style functions
This change replaces traditional functions like 'open' with the
POSIX.1-2008 functions like 'openat'.  Mostly this is an internal
refactoring change, in preparation for further changes to close
some races.
* gnulib.modules: Add faccessat, linkat, mkfifoat, renameat, symlinkat.
Remove save-cwd.
* src/Makefile.am (tar_LDADD): Add $(LIB_EACCESS).
* tests/Makefile.am (LDADD): Likewise.
* src/common.h (chdir_fd): New extern var.
* src/compare.c (diff_file, diff_multivol): Use openat instead of open.
* src/create.c (create_archive, restore_parent_fd): Likewise.
* src/extract.c (create_placeholder_file): Likewise.
* src/names.c (collect_and_sort_names): Likewise.
* src/update.c (append_file): Likewise.
* src/compare.c (diff_symlink): Use readlinkat instead of readlink.
* src/compare.c (diff_file): Use chdir_fd instead of AT_FDCWD.
* src/create.c (subfile_open, dump_file0): Likewise.
* src/extract.c (fd_chmod, fd_chown, fd_stat, set_stat):
(repair_delayed_set_stat, apply_nonancestor_delayed_set_stat):
Likewise.
* src/extract.c (mark_after_links, file_newer_p, extract_dir):
(extract_link, apply_delayed_links):
Use fstatat rather than stat or lstat.
* src/misc.c (maybe_backup_file, deref_stat): Likewise.
* src/extract.c (make_directories): Use mkdirat rather than mkdir.
Use faccessat rather than access.  This fixes a minor permissions
bug when tar is running setuid (who would want to do that?!).
(open_output_file): Use openat rather than open.
In the process, this removes support for Masscomp's O_CTG files,
which aren't compatible with openat's signature.  Masscomp!  Wow!
That's a blast from the past.  As far as I know, that operating
system hasn't been supported for more than 20 years.
(extract_link, apply_delayed_links):
Use linkat rather than link.
(extract_symlink, apply_delayed_links):
Use symlinkat rather than symlink.
(extract_node): Use mknodat rather than mknod.
(extract_fifo): Use mkfifoat rather than mkfifo.
(apply_delayed_links): Use unlinkat rather than unlink or rmdir.
* src/misc.c (safer_rmdir, remove_any_file): Likewise.
* src/unlink.c (flush_deferred_unlinks): Likewise.
* src/extract.c (rename_directory): Use renameat rather than rename.
* src/misc.c (maybe_backup_file, undo_last_backup): Likewise.
* src/misc.c: Don't include <save-cwd.h>; no longer needed now
that we're using openat etc.
(struct wd): Add member fd.  Remove members err and fd.  All uses
changed.
(CHDIR_CACHE_SIZE): New constant.
(wdcache, wdcache_count, chdir_fd): New vars.
(chdir_do): Use openat rather than save_cwd.  Keep the cache up
to date.  This code won't scale well, but is good enough for now.
* src/update.c (update_archive): Use openat + fdopendir +
streamsavedir rather than savedir.

This file is a placeholder. It will be replaced with the actual ChangeLog
by make dist.  Run make ChangeLog if you wish to create it earlier.
2010-09-18 23:42:54 -07:00
Paul Eggert
fc5e44c99c tar: add utimens.h includes
* src/extract.c: Include <utimens.h>, needed for fdutimens prototype.
* src/misc.c: Likewise.
2010-09-18 00:40:16 -07:00
Paul Eggert
098ad10c71 tar: switch to gnulib fdutimensat module
* gnulib.modules: Add fdutimensat.
* src/common.h (fd_utimensat): Remove decl.
* src/extract.c (set_stat): Call fdutimensat, not fd_utimensat.
* src/misc.c (set_file_atime): Likewise.
(fd_utimensat): Remove.
2010-09-17 14:24:04 -07:00
Paul Eggert
6e08ab7694 tar: extract permissions for . last
* src/common.h (must_be_dot_or_slash): New decl.
* src/extract.c (mark_after_links): New function, taking code
that used to be in create_placeholder_file.
(create_placeholder_file): Use it.
(delay_set_stat): Always delay setting status for . and /.
* src/misc.c (must_be_dot_or_slash): Now extern.
* tests/extrac12.at: New file.
* tests/Makefile.am (TESTSUITE_AT): Add it.
* tests/testsuite.at: Likewise.
2010-09-17 12:28:25 -07:00
Paul Eggert
cecb7ac8e6 tar: don't check for getdtablesize; use AC_CHECK_FUNCS_ONCE
* configure.ac: Don't check for getdtablesize; no longer needed.
Use AC_CHECK_FUNCS_ONCE rather than AC_CHECK_FUNCS, for efficiency.
2010-09-17 10:48:03 -07:00
Paul Eggert
ea964cce81 tar: extract symlink attributes, close some symlink-related races
* NEWS: Describe symlink-extraction improvements.
* src/extract.c (enum permstatus): Remove.
(fchmod, fchown): Define dummy replacement macros if the system
does not supply them.
(implemented): New function.
(struct delayed_set_stat): Remove members invert_permissions,
permstatus.  They were too confusing, and tried to do too much
in too-little space.  Instead, add members current_mode,
current_mode_mask, interdir, atflag.  All users changed.
(struct delayed_link): Add members mode, atime, mtime, to support
platforms such as BSD where symlinks have these attributes.
All users changed.
(fd_chmod): Renamed from fdchmod.  New argument atflag.  Check for
operation not supported at run-time, not at configure-time.  Put
fd argument first.  All callers changed.
(fd_chown): Likewise, renaming from fdchown.
(fd_stat): Likewise, renaming from fdstat.
(set_mode): Remove args stat_info, cur_info, invert_permissions,
permstatus.  Add args mode, mode_mask, current_mode, current_mode_mask,
atflag.  All callers changed.  Close some races.  Use an easier-to
understand method for computing permissions.  Work around POSIX
incompatibility in Linux fchmodat.  Support extraction of symlink
modes, if the OS allows it.
(set_stat): Remove args cur_info, invert_permissions, permstatus.
Add args current_mode, current_mode_mask, interdir, atflag.
All callers changed.  Close some races.  Support extraction of
attributes on symlinks, if the OS allows it.
(delay_set_stat): Remove args invert_permissions, permstatus.
Add args current_mode, current_mode_mask, mode, atflag.
The ST arg can be null now, indicating that it's an intermediate
directory.  All callers changed.
(repair_delayed_set_stat, apply_nonancestor_delayed_set_stat):
Close some races.
(extract_dir): Also be paranoid if only --same-permissions, due
to semantics of setgid and setuid directories on some hosts.
This closes a race on those hosts.  Simplify calculation of
delay_set_stat arguments; the old code was truly strange and
probably wrong in some border cases.
(extract_dir, extract_file, extract_node, extract_fifo): Don't rely on
unspecified behavior in mode arg of open, mknod, etc.  Instead,
mask out those bits when creating the file, and add them later via
fchmod or chmodat.
(open_output_file): file_name is now const.  Add arg current_mode,
current_mode_mask.  All callers changed.  When overwriting old files,
refuse to overwrite something that is not a regular file, since
we're extracting a regular file.
(extract_file): Remove the FIXME comment.  Whatever the protection
issues were, they should be fixed now.  As a result of all the other
API changes, we now use fchmod etc. rather than chmod etc., closing
some races.
(create_placeholder_file, apply_delayed_links): Record desired
mode and times for symlinks, for OSes that support that.
2010-09-17 10:44:13 -07:00
Paul Eggert
e3fdb78d4b tar: tar -x without --incremental no longer sets atime again
* src/extract.c (set_stat): Use UTIME_OMIT rather than UTIME_NOW.
The UTIME_NOW was there only to emulate the previous behavior of
using the current time, and the previous behavior was there only
because before we started assuming POSIX.1-2008 there was no
portable way to get the effect of UTIME_NOW.
2010-09-16 11:02:26 -07:00
Paul Eggert
d945888643 tar: another --atime-preserve race fix
* src/common.h (set_file_atime): Add parentfd arg.
* src/compare.c (diff_file): Use it.
* src/create.c (dump_file0): Likewise.  This closes yet another
race condition with symbolic links.
* src/misc.c (set_file_atime): Add parentfd arg.
2010-09-16 10:47:07 -07:00
Paul Eggert
ecbcb7b6d7 tar: --atime-preserve fixes for races etc.
This patch fixes a race condition in the --atime-preserve=replace
option, which might cause tar to improperly follow a symbolic link.

It also drops the use of the _FIOSATIME ioctl of Solaris 2.x
and later, which loses resolution on time stamps.  Modern Solaris
systems support full-resolution time stamps in the kernel, and
it's not worth the hassle of testing this call, useful only in
no-longer-supported Solaris variants.

Also, it undoes a change I recently introduced to the --compare
option, which caused it to not follow symbolic links unless the
--dereference option was also used.  Quite possibly this change is
a good idea, but the old behavior was documented and the change
should not have been installed casually.

* configure.ac: Don't check for stropts.h and sys/filio.h.
* gnulib.modules: Add futimens, utimensat.  Remove futimens.
* src/common.h (fd_utimensat): New decl.
* src/compare.c (diff_file, diff_multivol):
Don't use open_read_flags: those are for --create only.
* src/create.c (dump_file0): Adjust to set_file_atime changes.
Pass fstatat_flags to set_file_atime, so that symbolic links are
not followed inadvertantly.
* src/extract.c: Don't include utimens.h.
(set_stat): Use fd_utimensat ant UTIME_NOW rather than fdutimens.
* src/misc.c: Don't include utimens.h, stropts.h, sys/filio.h.
(fd_utimensat): New function.
(set_file_atime): Use it.  New arg atflag, controlling symlink
handling.  All callers changed.
2010-09-16 10:17:04 -07:00
Paul Eggert
59146768ef * configure.ac: tar: close some race conditions when extracting
* configure.ac: Check for fchmod and fchown.  Don't check for utimes.
* src/extract.c (fdchmod, fdchown, fdstat): New functions.
(set_mode, set_stat): New arg FD.  All callers changed.
This avoids some race conditions between closing a regular file
and setting its metadata, and it's a bit faster.
2010-09-14 13:34:25 -07:00
Paul Eggert
0fb3020da0 tar: don't worry about fdopendir closing its argument
* NEWS: Don't mention dirfd; no longer needed.
* gnulib.modules: Remove dirfd.
* src/create.c (get_directory_entries): Remove the code dealing
with dirfd failures, as the new fdopendir replacement doesn't
close its argument so we don't need to call dirfd.  See
<http://lists.gnu.org/archive/html/bug-gnulib/2010-09/msg00208.html>
and gnulib commit 970c9038e4cca46e1b037ae0a6d574dfae6a7327.
2010-09-13 13:13:08 -07:00
Paul Eggert
d7db30d0e8 * NEWS: Fix wording typo in previous change.
Reported by Jim Meyering.
2010-09-13 00:22:53 -07:00
Paul Eggert
8da503cad6 tar: live within system-supplied limits on file descriptors
* NEWS: Note the change.  Mention dirfd and fdopendir.
* gnulib.modules: Add dirfd and fdopendir.  The code was already
using fdopendir; dirfd is a new need.
* src/common.h (open_searchdir_flags, get_directory_entries):
(subfile_open, restore_parent_fd, tar_stat_close): New decls.
(check_exclusion_tags): Adjust signature to match code change.
* src/create.c (IMPOSTOR_ERRNO): New constant.
(check_exclusion_tags): First arg is now a struct tar_stat_info
const *, not an fd.  All callers changed.
(dump_regular_file, dump_file0): A zero fd represents an unused
slot, so play it safe if the fd member is zero here.  A negative
fd represents the negation of an errno value, so play it safe and
do not assign -1 to fd merely because an open fails.
(open_failure_recover, get_directory_entries, restore_parent_fd):
(subfile_open): New functions.  These help to recover from file
descriptor exhaustion.
(dump_dir, dump_file0): Use them.
(dump_file0): Use tar_stat_close instead of rolling our own close.
* src/incremen.c (scan_directory): Use get_directory_entries,
subfile_open, etc., to recover from file descriptor exhaustion.
* src/names.c (add_hierarchy_to_namelist): Likewise.
(collect_and_sort_names): A negative fd represents the negation
of an errno value, so play it safe and do not assign -1 to fd.
* src/tar.c (decode_options): Set open_searchdir_flags.
Add O_CLOEXEC to all the open flags.
(tar_stat_close): New function, which knows how to deal with
new convention for directory streams and file descriptors.
Diagnose 'close' failures.
(tar_stat_destroy): Use it.
* src/tar.h (struct tar_stat_info): New member dirstream.
fd now has the negative of an errno value, not merely -1, if
the file could not be opened, so that failures to reopen directories
are better-diagnosed later.
* tests/Makefile.am (TESTSUITE_AT): Add extrac11.at.
* tests/testsuite.at: Likewise.
* tests/extrac11.at: New file.
2010-09-12 14:27:13 -07:00
Paul Eggert
c743301494 tar: improve documentation of reliability and security issues
* doc/tar.texi (Reliability and security, Reliability):
(Permissions problems, Data corruption and repair, Race conditions):
(Security, Privacy, Integrity, Live untrusted data):
(Security rules of thumb): New nodes.
2010-09-08 13:40:27 -07:00
Paul Eggert
de328a580a tar: more reliable directory traversal when creating archives
* NEWS: Document this.
* gnulib.modules: Add openat, readlinkat.
* src/common.h (open_read_flags, fstatat_flags): New global variables.
(cachedir_file_p, dump_file, check_exclusion_tags, scan_directory):
Adjust to new signatures, described below.
(name_fill_directory): Remove.
* src/compare.c (diff_file, diff_multivol): Use open_read_flags.
* src/create.c (struct exclusion_tag): Exclusion predicates now take
a file descriptor, not a file name.
(add_exclusion_tag): Likewise.  All uses changed.
(cachedir_file_p): Likewise.
(check_exclusion_tags): The directory is now a file descriptor,
not a file name.  All uses changed.  Use openat for better traversal.
(file_dumpable_p): Arg is now a struct stat, not a struct
tar_stat_info.  All uses changed.  Check the arg's file types too.
(dump_dir0, dump_dir, dump_file0, dump_file): Omit top_level and
parent_device args, since st->parent tells us that now.  All uses
changed.
(dump_dir): Likewise.  Also, omit fd arg for similar reasons.
Apply fdsavedir to a dup of the file descriptor, since we need a
file descriptor for openat etc. as well, and fdsavedir (perhaps
unwisely) consumes its file descriptor when successful.
Do not consume st->fd when successful; this simplifies the caller.
(create_archive): Allocate a file descriptor when retraversing
a directory, during incremental dumps.
(dump_file0): Use fstatat, openat, and readlinkat for better traversal.
When opening a file, use the result of fstat on the file descriptor
rather than the fstatat on the directory entry, to avoid some race
conditions.  No need to reopen the directory since we now no longer
close it.  Change "did we open the file?" test from 0 <= fd to
0 < fd since fd == 0 now represents uninitialized.
(dump_file): Now accepts struct tar_stat_info describing parent,
not parent_device.  Also, accept basename and fullname of entry.
All uses changed.
* src/incremen.c (update_parent_directory): Accept struct
tar_stat_info for parent, not name.  All callers changed.
Use fstatat for safer directory traversal.
(procdir): Accept struct tar_stat_info, not struct stat and
dev_t, for info about directory.  All callers changed.
(scan_directory): Accept struct tar_stat_info, not name,
device, and cmdline, for info about directory.  All callers
changed.  Do not consume the file descriptor, since caller
might need it.  Use fstatat and openat for safer directory
traversal; also, use fstat after opening to double-check.
(name_fill_directory): Remove.
* src/names.c (add_hierarchy_to_namelist): Accept struct
tar_stat_info instead of device and cmdline.  All callers changed.
When descending into a subdirectory, use openat and fstat for
safer directory traversal.
(collect_and_sort_names): Use open and fstat for safer directory
traversal.  Set up struct tar_stat_info for callee's new API.
* src/tar.c (decode_options): Initialize open_read_flags
and fstatat_flags.
(tar_stat_destroy): Close st->fd if it is positive (not zero!).
* src/tar.h (struct tar_stat_info): New members parent, fd.
* src/update.c (update_archive): Adjust to dump_file's API change.
* tests/filerem02.at: Ignore stderr since its contents now depend
on the file system implementation.
2010-09-06 13:39:21 -07:00
Paul Eggert
bad4b0006c tar: remove lint discovered by Sun C compiler
* src/common.h (WARN_ALL): Don't mask with 0xffffffff; on a 32-bit
host, 0xffffffff is of type 'unsigned int', which makes WARN_ALL
an unsigned int value that is too large to fit into an int, and
the C standard says that this has undefined behavior.  The mask is
not needed, so omit it.
2010-09-04 23:53:23 -07:00
Paul Eggert
e985feb292 tar: restore macros that are used in some cases
* src/tar.c (LOW_DENSITY_NUM, MID_DENSITY_NUM, HIGH_DENSITY_NUM):
Restore these macros, undoing the previous change to this file.
The macros are used after all, in some cases.  Sorry about that.
2010-09-04 00:09:30 -07:00
Paul Eggert
fbc54fa337 tar: remove unused macros
* src/create.c (UINTMAX_TO_CHARS): Remove; no longer used.
* src/tar.c (LOW_DENSITY_NUM, MID_DENSITY_NUM, HIGH_DENSITY_NUM):
Likewise.
* src/incremen.c (DIR_IS_NEW): Comment out; not used.
Mark this with a FIXME, since it looks like it should be used.
2010-09-02 20:46:25 -07:00
Sergey Poznyakoff
45a574151a Fix --remove-files in update/append mode.
* src/update.c (update_archive): Call finish_deferred_unlinks when
done.
2010-08-27 15:36:24 +03:00
Paul Eggert
0adf4027f5 tar: avoid assumptions about root access and chmod -w in test cases
* tests/extrac07.at, tests/extrac09.at, tests/listed03.at: Use
AT_UNPRIVILEGED_PREREQ, since this test requires non-root
privileges.
* tests/extrac07.at: Don't use "chmod -w", as POSIX says it's not
portable to start a chmod permissions-list with "-" as it may be
confused with an option.  Use "chmod a-w" instead.
2010-08-26 10:23:06 -07:00
Paul Eggert
fce1c1c8cb tar: fix bug with -C and delayed setting of metadata
* src/common.h (chdir_current): New decl.
* src/extract.c (struct delayed_set_stat, struct delayed_link):
New member change_dir.
(delay_set_stat, create_placeholder_file): Set it.
(apply_nonancestor_delayed_set_stat, apply_delayed_links): Use it.
(extract_link): Check that the links are all relative to the same
directory.
(extract_archive): Restore the current directory after
apply_nonancestor_delayed_set_stat has possibly changed it.
* src/misc.c (chdir_current): New external var; this used to
be the private static variable 'previous' inside chdir_dir.
All uses changed.
* tests/Makefile.am (TESTSUITE_AT): New test extrac10.at.
* tests/extrac10.at: New file.
* tests/testsuite.at: Include it.
2010-08-25 17:09:59 -07:00
Sergey Poznyakoff
372ac37d01 Don't apply file transformations to volume names.
* src/list.c (decode_header): Don't apply file transformations to volume names.
* tests/xform01.at: New testcase.
* tests/xform-h.at (xform): Rename macro to xformtest. Use pushdef/popdef.
* tests/Makefile.am, tests/testsuite.at: Add xform01.at
2010-08-25 10:54:45 +03:00
Paul Eggert
a9895fd20c tar: optimize -c --sparse when file is entirely sparse
* src/sparse.c (sparse_scan_file): If the file is entirely sparse,
that is, if ST_NBLOCKS is zero, don't bother scanning for nonzero
blocks.  Idea by Kit Westneat, communicated by Bernd Schubert in
<http://lists.gnu.org/archive/html/bug-tar/2010-08/msg00038.html>.
Also, omit unnecessary lseek at start of file.
2010-08-24 17:29:06 -07:00
Paul Eggert
a59c819beb tar: don't assume size of a sparse file chunk fits in size_t
* src/tar.h (struct sp_array): Change numbytes from size_t to off_t.
All uses changed.
* scripts/xsparse.c (struct sp_array): Likewise.
Include <stdint.h>, for SIZE_MAX.
(expand_sparse): Don't try to allocate a buffer bigger than
SIZE_MAX bytes.
* src/common.h (SIZE_TO_CHARS, size_to_chars, SIZE_FROM_HEADER):
(size_from_header): Remove decls.
* src/create.c (size_to_chars): Remove.
* src/list.c (size_from_header): Remove.
* src/sparse.c (sparse_extract_region, check_data_region):
(oldgnu_add_sparse, oldgnu_store_sparse_info, pax_decode_header):
Don't assume chunk sizes fit in size_t.
(oldgnu_add_sparse): Check for off_t overflow.
* src/xheader.c (sparse_numbytes_decoder, sparse_map_decoder):
Likewise.
2010-08-24 16:50:49 -07:00
Paul Eggert
57b11473b0 tar: use ctime, not mtime, when checking placeholders
* src/extract.c (struct delayed_link): Rename member mtime to ctime.
All uses changed to use ctime rather than mtime.
2010-08-24 15:44:25 -07:00
Paul Eggert
fbcadc9592 tar: add comment to link04.at test
* tests/link04.at: Add explanatory comment at head.
2010-08-24 08:18:37 -07:00
Paul Eggert
3b219f943e tar: fix 1.23 Solaris regression related to PRIV_SYS_LINKDIR
The idea was suggested by Petr Sumbera in the thread starting here:
http://lists.gnu.org/archive/html/bug-tar/2010-08/msg00000.html
* src/extract.c (set_mode): Save the errno of the chmod that
failed, for the benefit of chmod_error_details.  Do not bother
retrying chmod unless the mode suggests setuid is the issue.
(extract_archive): Remove redundant call to priv_set_remove_linkdir.
* src/system.c: Include priv-set.h.
(sys_spawn_shell, sys_child_open_for_compress):
(sys_child_open_for_uncompress, sys_exec_command):
(sys_exec_info_script, sys_exec_checkpoint_script):
Invoke priv_set_restore_linkdir before execv or execlp, so that
the subprocess has the same privileges that tar originally did.
2010-08-24 00:07:50 -07:00
Paul Eggert
37ddfb0b7e tar: handle files that occur multiple times but have link count 1
This patch was inspired by the following patch that addressed a
similar problem in GNU coreutils du:
http://git.savannah.gnu.org/gitweb/?p=coreutils.git;h=efe53cc72b599979ea292754ecfe8abf7c839d22
* src/common.h (name_count): New decl.
* src/create.c (trivial_link_count): New static var.
(create_archive): Initialize it.
(dump_hard_link, file_count_links): Use it, so that files with
link count 1 are handled correctly when they are found multiple times.
* src/names.c (allocated_entries): Renamed from allocated_names,
since the identifier's name was misleading.  All uses changed.
(entries): Renamed from names.  All uses changed.
(scanned): Renamed from name_index.  All uses changed.
(name_count): New var.
(name_add_name): Increment it.
* tests/link04.at: New file.
* tests/testsuite.at: Add it.
* tests/Makefile.am (TESTSUITE_AT): Likewise.
2010-08-23 19:13:12 -07:00
Paul Eggert
09f039050e tar: use nlink_t for link counts
* src/create.c (struct link): nlink is now of type nlink_t, not size_t.
2010-08-23 13:49:49 -07:00
Paul Eggert
34795cedb7 tar: don't export names that aren't used elsewhere
* src/common.h (file_dumpable_p, gid_to_chars, major_to_chars):
(minor_to_chars, mode_to_chars, uid_to_chars, uintmax_to_chars):
(string_to_chars, dumpdir_creat0, dumpdir_create, dumpdir_free):
(dumpdir_locate, dumpdir_next, dumpdir_first, gid_from_header):
(major_from_header, minor_from_header, mode_from_header):
(time_from_header, uid_from_header, quote_copy_string, request_stdin):
(xheader_init, transform_header_name):
Remove declarations; these are no longer exported from their modules.
(GID_TO_CHARS, MAJOR_TO_CHARS, MINOR_TO_CHARS, MODE_TO_CHARS):
(UID_TO_CHARS, UINTMAX_TO_CHARS, UNAME_TO_CHARS, GNAME_TO_CHARS):
Move to src/create.c, since no other module uses these.
(GID_FROM_HEADER, MAJOR_FROM_HEADER, MINOR_FROM_HEADER):
(MODE_FROM_HEADER, TIME_FROM_HEADER, UID_FROM_HEADER):
Move to src/extract.c, since no other module uses these.
(dumpdir_t, dumpdir_iter_t): Remove; no longer used.
* src/create.c (gid_to_chars, major_to_chars, minor_to_chars):
(mode_to_chars, uid_to_chars, uintmax_to_chars, string_to_chars):
(file_dumpable_p): Now static.
* src/incremen.c (dumpdir_create0, dumpdir_create, dumpdir_free):
(dumpdir_locate, dumpdir_next, dumpdir_first): Now static.
(scan_directory, write_directory_file_entry):
Use struct dumpdir_iter * rather than dumpdir_iter_t.
* src/list.c (gid_from_header, major_from_header, minor_from_header):
(mode_from_header, time_from_header, uid_from_header):
(transform_member_name): Now static.
* src/misc.c (quote_copy_string): #if 0 out, as it's not used
anywhere.
* src/system.c (wait_for_grandchild): Now static.
* src/tar.c (request_stdin): Now static.
* src/xheader.c (xheader_init): Now static.
2010-08-23 13:27:36 -07:00
Paul Eggert
9764a6b1d3 tar: fix misspelled identifier "set_comression_program_by_suffix"
* src/suffix.c (set_compression_program_by_suffix): Renamed from
set_comression_program_by_suffix.
* src/buffer.c, src/common.h, src/tar.c: All uses changed.
2010-08-23 11:37:19 -07:00
Paul Eggert
a1a15e3202 tar: change interdir_made from int to bool
* src/extract.c (maybe_recoverable, create_placeholder_file):
Change interdir_made from int * to bool *, since the flag has just
two values 0 and 1.  All uses changed.  This does not affect tar's
behavior.
2010-08-20 01:09:17 -07:00
Paul Eggert
0ab5e64ac0 tar: remove trailing white space from source files
* ChangeLog.1, ChangeLog.CVS, Makefile.am, NEWS, README:
* README-hacking, directory, doc/Makefile.am, doc/dumpdir.texi:
* doc/gendocs_template, doc/intern.texi, doc/mastermenu.el:
* doc/snapshot.texi, doc/sparse.texi, doc/tar-snapshot-edit.texi:
* doc/value.texi, lib/Makefile.am, scripts/backup-specs:
* scripts/dump-remind.in, scripts/tar-snapshot-edit, scripts/tarcat:
* scripts/xsparse.c, src/arith.h, src/buffer.c, src/compare.c:
* src/create.c, src/delete.c, src/exit.c, src/suffix.c, src/tar.c:
* src/tar.h, src/update.c, src/warning.c, src/xheader.c:
* tests/append01.at, tests/append02.at, tests/atlocal.in:
* tests/delete03.at, tests/exclude.at, tests/exclude06.at:
* tests/extrac04.at, tests/extrac05.at, tests/extrac06.at:
* tests/extrac07.at, tests/filerem01.at, tests/filerem02.at:
* tests/incr01.at, tests/incr02.at, tests/incr03.at, tests/incr06.at:
* tests/label02.at, tests/label03.at, tests/label04.at:
* tests/label05.at, tests/link02.at, tests/link03.at:
* tests/listed01.at, tests/listed02.at, tests/long01.at:
* tests/longv7.at, tests/multiv01.at, tests/multiv02.at:
* tests/multiv03.at, tests/multiv05.at, tests/multiv06.at:
* tests/multiv07.at, tests/multiv08.at, tests/options.at:
* tests/options02.at, tests/remfiles03.at, tests/rename01.at:
* tests/rename02.at, tests/rename03.at, tests/rename04.at:
* tests/rename05.at, tests/same-order01.at, tests/same-order02.at:
* tests/shortfile.at, tests/shortupd.at, tests/sparse01.at:
* tests/sparse02.at, tests/sparsemv.at, tests/sparsemvp.at:
* tests/star/README, tests/star/gtarfail2.at:
* tests/star/multi-fail.at:
* tests/star/pax-big-10g.at, tests/star/quicktest.sh:
* tests/star/ustar-big-2g.at, tests/star/ustar-big-8g.at:
* tests/update01.at, tests/update02.at, tests/volsize.at:
* tests/volume.at:
Remove trailing spaces and tabs from lines, and remove
trailing empty lines from files.  This makes it a bit easier
to share code among coreutils and other projects that do this.
2010-08-19 15:50:07 -07:00
Paul Eggert
0a694a16e5 tar: update licenses to latest versions from www.gnu.org
* COPYING: Update to latest version; this is just minor formatting.
* doc/fdl.texi: Update from GFDL 1.2 to 1.3.
* doc/tar.texi: Adjust to new format of fdl.texi.  Omit trailing
white space.
2010-08-19 04:15:42 -07:00
Paul Eggert
b3b15f7cbc * src/misc.c (struct wd): Fix comment to match code. 2010-07-18 12:34:13 -07:00
Paul R. Eggert
8c662c9f29 tar: no need to report getcwd error if never using the result
* src/misc.c (struct wd): Rename 'saved' to 'err', with new semantics.
(chdir_arg, chdir_do): Adjust to new semantics.  Do not report an
error merely because save_cwd fails; report an error only if
save_cwd's result is needed later.
* tests/extrac09.at: New file, to test for bug that was fixed.
* tests/testsuite.at: Include it.
* tests/Makefile.am (TESTSUITE_AT): Add it.
2010-07-18 12:20:47 -07:00
Paul R. Eggert
427b3b8c79 tar: go back to absolutifying filenames in normalize_filename for now
* src/misc.c (normalize_filename): For now, go back to making
filenames absolute, even though this causes 'tar' to fail when
getcwd fails.  However, do not attempt to resolve ".." as this
does not work with symlinks.  Also, do the right thing with
leading file system prefixes and on hosts where // != /.
2010-07-17 15:47:46 -07:00
Sergey Poznyakoff
c1b30c268f Allow for size suffixes in -L and --record-size options.
* src/tar.c (TAR_SIZE_SUFFIXES): New define.
(parse_opt): Allow for size suffixes in arguments to
-L and --record-size options.
* NEWS, doc/tar.texi: Update.
2010-07-17 11:38:08 +03:00
Paul R. Eggert
cc40c57a37 tar: don't crash if getcwd fails
* src/extract.c: Don't include xgetcwd.h.
(extract_dir): stat "." rather than statting getcwd's output.
* src/misc.c (normalize_filename_x): Rewrite so as not to resolve
/../, which can't be done reliably in the presence of symlinks.
Don't reject valid names such as ".".
(normalize_filename): Don't make it absolute; that way, we don't
have to invoke xgetcwd which might fail.  Don't bother to realloc
at the end, since that uses time and now saves little space.
(chdir_do): Don't crash if xgetcwd fails.
* tests/Makefile.am (TESTSUITE_AT): Add listed03.at.
* tests/listed03.at: New file.
* tests/testsuite.at: Include listed03.at.
2010-07-15 11:25:15 -07:00
Sergey Poznyakoff
ab6dd4948d Keep a detailed map of archive members stored in the record buffer.
A separate map (bufmap) provides information for creating
multi-volume continuation headers.

* src/buffer.c (bufmap): New struct.
(bufmap_head, bufmap_tail, inhibit_map): New variables.
(mv_begin_write): New function.
(mv_begin): Rename to mv_begin_read. Rewrite using mv_begin_write.
All callers changed.
(mv_total_size): Remove.
(bufmap_locate, bufmap_free, bufmap_reset): New functions.
(_flush_write): Update bufmap.
(close_archive): Free bufmap.
(add_chunk_header): Take a bufmap argument.
(gnu_add_multi_volume_header): Likewise.
(add_multi_volume_header): Likewise.
(_gnu_flush_write): Rewrite using bufmap.
(real_s_name, real_s_totsize)
(real_s_sizeleft)
(save_name, save_totsize, save_sizeleft): Removed. All
uses updated.
(mv_size_left): Update bufmap_head.
(mv_end): Rewrite.
(multi_volume_sync): Remove.

* src/common.h (mv_begin_write): New prototype.
(mv_begin): Rename to mv_begin_read.
* src/create.c: Use mv_begin_write instead of mv_begin.
Remove calls to mv_size_left and mv_end.
* src/sparse.c: Likewise.

* tests/multiv07.at: Close stdin.
* tests/spmvp00.at: Update AT_KEYWORDS.
* tests/spmvp10.at: Likewise.

* tests/multiv08.at: New testcase.
* tests/Makefile.am, tests/testsuite.at: Add multiv08.at.
2010-07-11 22:57:17 +03:00
Sergey Poznyakoff
b4bcb97e38 Version 1.23.90
* NEWS, configure.ac: Version 1.23.90
* doc/tar.texi: Document the use of lbzip2.
2010-07-11 19:36:43 +03:00
Sergey Poznyakoff
9c194c9942 Fix exclusion of long file names when extracting from pax format archives.
* src/list.c (read_and): Call decode_header before attempting
name_match.
(list_archive): Remove call to decode_header.

* src/compare.c (diff_archive): Remove call to decode_header.
* src/extract.c (extract_archive): Likewise.

* test/exclude06.at: New test case.
* tests/testsuite.at: Include exclude06.at.
* tests/Makefile.am (TESTSUITE_AT): Add exclude06.at.
2010-06-28 16:56:54 +03:00
Sergey Poznyakoff
80a6ef7d94 Minor fix.
* src/buffer.c (magic): Split the character constant to help
cc recognize character boundaries (7 is a valid hex character).
2010-06-28 00:04:49 +03:00
Sergey Poznyakoff
9b31db388e Minor fix.
* src/buffer.c (magic): Fix xz magic.
2010-06-27 23:47:20 +03:00
Paul Eggert
f6edb92580 Remove some lint, found by gcc -W etc.
* src/common.h (label_notfound): New decl.
* src/buffer.c (set_volume_start_time, compress_type):
(guess_seekable_archive, open_compressed_archive, init_buffer):
(_flush_write, archive_is-dev, increase_volume_number):
(change_tape_menu, try_new_volume, add_chunk_header):
(multi_volume_sync):
Declare as 'static' if it's not exported.
Use function prototype (void) rather than old-style ().
* src/checkpoint.c (expand_checkpoint_string): Likewise.
* src/incremen.c (dirlist_replace_prefix, makedumpdir, read_incr_db_2):
Likewise.
* src/list.c (print_volume_label): Likewise.
* src/misc.c (normalize_filename_x): Likewise.
* src/names.c (make_name, free_name, check_name_alloc, name_next_elt):
Likewise.
* src/tar.c (tar_list_quoting_style, add_exclude_array):
(set_stat_signal): Likewise.
* src/transform.c (new_transform, _single_transform_name_to_obstack):
(_transform_name_to_obstack): Likewise.
* src/unlink.c (dunlink_alloc): Likewise.

* src/buffer.c (struct zip_magic): Use const when appropriate.
* src/incremen.c (obstack_code_rename, write_directory_file_entry):
Likewise.
* src/sparse.c (COPY_STRING): Likewise.
* src/system.c (dec_to_env, time_to_env, oct_to_env, str_to_env):
(chr_to_env): Likewise.
* src/tar.c (tar_list_quoting_style, set_stat_signal): Likewise.

* src/extract.c (extract_node): Don't return garbage.

* src/names.c: Remove old-style declarations of getgrnam etc.
All modern systems declare these, and it's not worth the hassle
of ignoring the warnings on modern systems for old-style decls.
2010-06-16 13:04:12 -07:00
Sergey Poznyakoff
e21d54e8cd Bugfix.
* src/incremen.c (make_directory): Retain the slash if it is the
only character in a filename.
2010-05-17 20:22:16 +03:00
Sergey Poznyakoff
c79f0d06bc Recode NEWS back to UTF-8 2010-04-02 14:24:58 +03:00
Sergey Poznyakoff
2c97cb7ea2 Fix the gzip.at test case.
* tests/gzip.at: Suppress gzip error output, as it can differ
depending on its version etc. Bug reported by Ludovic Courtès.
2010-04-01 00:03:51 +03:00
Sergey Poznyakoff
fc61c17410 New option --full-time.
* src/common.h (full_time_option): New global.
* src/tar.c (FULL_TIME_OPTION): New constant.
(options): New option --full-time.
(parse_opt): Handle the --full-time option.
* src/list.c (simple_print_header): Pass full_time_option
as the 2nd argument to tartime.
* doc/tar.texi: Update.
* NEWS: Update.
2010-03-28 12:26:37 +03:00
Sergey Poznyakoff
2981fcc5cb Minor fixes in the testsuite.
* tests/extrac07.at: Fix a typo (invalid number
of arguments before format list).
* tests/link02.at: Use `ln' instead of `link'.
* tests/link03.at: Likewise.
2010-03-27 22:46:18 +02:00
Sergey Poznyakoff
40dea1ae7f Fix coredump.
* src/names.c (collect_and_sort_names): Remove
entry from the table before freeing it.
2010-03-27 22:24:19 +02:00
Sergey Poznyakoff
b60e56fdb6 Fix dead loop on extracting existing symlinks with the -k option.
* src/extract.c (create_placeholder_file)
(extract_link, extract_symlink)
(extract_node, extract_fifo): Handle all possible
return values from maybe_recoverable. This complements
8f390db92f. Reported by Ico Doornekamp <bug-tar@zevv.nl>.
* NEWS: Update.
2010-03-27 22:02:28 +02:00
Sergey Poznyakoff
340dbf5aab Fix undesired error exit on receiving SIGPIPE.
* src/tar.c: Do not ignore SIGPIPE.
* tests/sigpipe.at: New testcase.
* tests/Makefile.am, tests/testsuite.at: Add sigpipe.at
* tests/remfiles01.at: Fix error code expectation.
* NEWS: Update.
2010-03-20 13:20:30 +02:00
Sergey Poznyakoff
c1d3d13493 Fix --remove-files.
Tar --remove-files relied on canonicalize_file_name,
which replaces symlinks in file name components with
the directories they point to. Due to this, tar
effectively ignored existence of symbolic links and
was unable to remove a directory that contained any
(Alexander Kozlov <akozlov@nada.kth.se>, 2010-03-15).

* gnulib.modules: Remove canonicalize.
* src/misc.c (normalize_filename): Rewrite
from scratch. The function operates only on
its input string, it makes no attempt to test
components for existence or to resolve symbolic
links.
* tests/Makefile.am (TESTSUITE_AT): Add remfiles03.at.
* tests/testsuite.at: Likewise.
* tests/remfiles03.at: New test case.
* NEWS: Update.
2010-03-17 11:52:40 +02:00
Sergey Poznyakoff
67b4f3519d Bugfixes.
* src/buffer.c (check_label_pattern): Initialize result.
* tests/remfiles01.at: Skip if run with root privileges.
2010-03-12 09:48:46 +02:00
Sergey Poznyakoff
0ba8bdf5f3 Fix --test-label' and --label -r' behavior.
* doc/tar.texi (Including a Label in the Archive): Revise
the section.
* NEWS: Update

* src/buffer.c (open_archive): Check volume label on
ACCESS_UPDATE as well.
* src/list.c (test_archive_label): Rewrite to match the
documentation.
* src/names.c (regex_usage_warning): Return int.
(names_notfound): Rewrite the conditional.
(label_notfound): New function.

* tests/label03.at: New testcase.
* tests/label04.at: New testcase.
* tests/label05.at: New testcase.
* tests/Makefile.am: Add new testcases.
* tests/testsuite.at: Likewise.
2010-03-11 17:41:23 +02:00
Sergey Poznyakoff
8d3cc6c3cf Doc fixes.
* doc/tar.texi: Consistently use lowercase `see' within sentences.
More fixes spotted by Denis Excoffier.
* THANKS: Update.
2010-03-11 15:06:18 +02:00
Sergey Poznyakoff
3f4a6d83f0 Shut up a gcc warning message.
* src/tar.c (tar_help_filter): Use a separate const
variable to hold returns from gettext. Reported by
Peter Breitenlohner.
2010-03-11 15:05:57 +02:00
Sergey Poznyakoff
a3f1d933cc Bugfix.
* src/names.c (collect_and_sort_names): Initialize prev_name.
Reported by Dmitry V. Levin.
2010-03-11 12:19:32 +02:00
Sergey Poznyakoff
e8e0b6cb7a Version 1.23
* configure.ac, NEWS: Update version number.
2010-03-10 13:53:15 +02:00
Sergey Poznyakoff
338add8d10 Doc changes.
* NEWS: Update.
* THANKS: Update.
* doc/snapshot.texi, doc/snapshot.texi,
doc/sparse.texi, doc/tar-snapshot-edit.texi,
doc/tar.texi: Spellchecked and proof-read. Thanks
to Denis Excoffier.
* gnulib.modules: Remove utime.
2010-03-10 13:22:49 +02:00
Kamil Dudka
46b07a52f9 Fix possible overflow in code_timespec (tiny change)
* src/misc.c (code_timespec): ignore invalid values of ns
2010-03-08 12:34:58 +02:00
Sergey Poznyakoff
a06b3a29fb Minor fix in the testsuite.
* tests/extrac05.at: Skip test if creating
sparse file fails.
2010-03-08 12:31:59 +02:00
Sergey Poznyakoff
6f02669c7b Fix eventual memory override and fd exhaustion in create.c
Both bugs reported by Kamil Dudka.

* src/create.c (check_exclusion_tags): Do not keep
pointer to a location within tagname: it may change
after xrealloc. Use byte offset instead.
(dump_file0): Close fd before returning without
dumping the directory.
2010-03-08 12:27:23 +02:00
Sergey Poznyakoff
e1e1f87eb4 Minor change.
* doc/tar.texi: Improve some wording.
2010-03-02 18:48:20 +02:00
Antonio Diaz Diaz
bffe1074aa Add Lzip support
* configure.ac: Add TAR_COMPR_PROGRAM(lzip)
* doc/tar.texi: Reflect lzip support.
* src/buffer.c (compress_type) <ct_lzip>: New constant.
(magic): Add magic for lzip.
* src/suffix.c (compression_suffixes): Add lz.
* src/tar.c: New option --lzip.
2010-03-02 18:44:25 +02:00
Sergey Poznyakoff
9a3e8a6f43 Minor fix.
* tests/exclude05.at: Rewrite awk invocation to avoid
overflowing awk's file table on Solaris.
2010-03-02 18:39:40 +02:00
Eric Blake
a0fd0d95e2 Fix large file support.
* scripts/xsparse.c (read_map): Use fseeko.
* src/incremen.c (write_directory_file): Likewise.
2010-03-02 18:08:07 +02:00
Sergey Poznyakoff
3925776b41 Bugfix
* src/buffer.c (seek_archive): Rewrite size computation
to prevent it from reaching negative values. Based on
report by Denis Excoffier <Denis.Excoffier@free.fr>.
2010-03-02 11:20:20 +02:00
Sergey Poznyakoff
762be4f2bd Supply more information to the --to-command script.
* src/system.c (stat_to_env): Pass information about the current
volume in variables TAR_ARCHIVE, TAR_VOLUME, TAR_BLOCKING_FACTOR,
TAR_FORMAT.
* doc/tar.texi: Document new environment variables.
* NEWS: Likewise.
* configure.ac: Version number 1.22.91.
2010-02-25 10:41:18 +02:00
Sergey Poznyakoff
b7899bb121 Minor change.
* src/names.c (regex_usage_warning): Fix warning message.
2010-02-17 16:48:34 +02:00
Sergey Poznyakoff
6e196273a4 Update THANKS 2010-02-05 18:41:15 +02:00
Ondřej Vašík
bdb9de4b1e Bugfix (tiny change)
* src/xheader.c (xheader_read): Remove unnecessary call
to xheader_init.
2010-02-05 18:39:53 +02:00
Sergey Poznyakoff
c4acbdaa97 Enable silent build mode.
* configure.ac: Require automake 1.11, autoconf 2.63. Enable silent rules.
* NEWS: Update.
* lib/Makefile.am (rmt-command.h): Silent the rule.
2010-01-26 13:42:48 +02:00
Sergey Poznyakoff
c3fa22fc80 Read POSIX multivolume archives split at the header boundary.
* src/common.h (read_header_mode): New enum.
(read_header): Change type of the 3rd argument.
* src/list.c (read_header): Change type of the 3rd argument.
All callers updated.
* src/buffer.c (try_new_volume): Allow for volumes split at the
extended/ustar header boundary. This is against POSIX specs, but
we must be able to read such archives anyway.

* tests/multiv07.at: New test case.
* tests/Makefile.am: Add multiv07.at
* tests/testsuite.at: Likewise.

* src/compare.c: Update calls to read_header.
* src/delete.c: Likewise.
* src/update.c: Likewise.
2010-01-25 17:03:28 +02:00
Sergey Poznyakoff
706bd01915 Minor change.
* NEWS: Update.
* doc/tar.texi: Update.
* src/create.c (finish_header): Minor change.
2010-01-24 22:45:57 +02:00
Rob Vermaas
0057cd6803 Bugfix (tiny change).
* src/tar.c (format_default_settings)[REMOTE_SHELL]: Fix
misplaced comma.
2010-01-24 22:24:49 +02:00
Sergey Poznyakoff
45cf3a7426 Minor fix.
* src/incremen.c (read_incr_db_01)
(read_directory_file): Initialize bufsize to 0.
Suggested by noordsij@cs.helsinki.fi.
2010-01-24 18:09:31 +02:00
Sergey Poznyakoff
28f2669b15 Improve handling of --test-label.
* src/list.c (print_volume_label): New function.
(print_header): Call print_volume_label.
(test_archive_label): New function.
* src/buffer.c (VOLUME_LABEL_APPEND): Remove.
(VOLUME_TEXT, VOLUME_TEXT_LEN): New macros
(drop_volume_label_suffix): New function.
(check_label_pattern): Use drop_volume_label_suffix.
* src/common.h (subcommand): New constant TEST_LABEL_SUBCOMMAND.
(test_label_option): Remove.
(drop_volume_label_suffix): New proto.
(test_archive_label): New proto.
* src/names.c (all_names_found): Remove test for test_label_option.
* src/tar.c (subcommand_string): Handle TEST_LABEL_SUBCOMMAND.
(set_subcommand_option): Improve diagnostics.
(parse_opt): Set subcommand if --test-label is given.
(main): Handle TEST_LABEL_SUBCOMMAND.
2010-01-24 16:58:04 +02:00
Sergey Poznyakoff
166b7c7d02 Fix listing of volume labels (in particular in PAX archives).
* src/buffer.c (match_volume_label): Call set_volume_label.
(check_label_pattern): Get label string
as argument.
(match_volume_label): Handle volume labels stored in
global PAX headers.
* src/common.c (print_header,read_header): Change signature.
(read_header_primitive): Remove prototype.
* src/list.c (recent_global_header): New static.
(list_archive): Always print volume labels.
(read_header_primitive): Remove.
(read_header): Change the signature (all callers updated)
Save the recent global header.
(volume_label_printed): New static.
(simple_print_header): New function (ex-print_header).
(print_header): Change the signature (all callers updated).
For POSIX formats, print first volume header (if set).
* src/xheader.c (xheader_write_global): Write the data
accumulated in xhdr->stk even if keyword_global_override_list
is empty.
(xheader_read): On unexpected EOF, report error instead of
coredumping.
(XHDR_PROTECTED, XHDR_GLOBAL): New defines.
(struct xhdr_tab): Remove `protected' with `flags'. All uses updated.
(decg): If XHDR_GLOBAL bit is set, call the keyword's decode
method instead of adding it to `kwl'.

* src/compare.c: Update calls to read_header.
* src/create.c: Likewise.
* src/delete.c: Likewise.
* src/update.c: Likewise.
* src/extract.c: Likewise.
(extract_volhdr): Do not print "Reading <label>" statement, because
it is inconsistent: it is not printed if the volume begins with a
member continued from the previous volume.

* tests/label01.at: New testcase.
* tests/label02.at: New testcase.
* tests/Makefile.am, tests/testsuite.at: Add new testcases.
2010-01-24 15:52:22 +02:00
Sergey Poznyakoff
cd91cd3c62 Fix prefix length calculation in ustar mode.
* src/create.c (split_long_name): Fix prefix length
calculation.
(write_ustar_long_name): Improve ustar mode compatibility
with the Sun version.
2010-01-22 17:52:42 +02:00
Sergey Poznyakoff
cac45fffc5 Rewrite update algorithm.
* src/common.h (namebuf_t): New typedef.
(namebuf_create, namebuf_free)
(namebuf_name): New prototypes.
(remname): New prototype.
* src/misc.c (struct namebuf): New structure.
(namebuf_create, namebuf_free)
(namebuf_name): New functions.
* src/create.c (dup_dir0): Remove is_avoided_name
checks. This is taken care of in update_archive.
* src/incremen.c (scan_directory): Use namebuf
to produce full file names.
* src/names.c (nametail): Remove extra level of
indirection. All uses updated.
(avoided_name_table, add_avoided_name)
(is_avoided_name): Remove.
* src/update.c (update_archive): Change algorithm.
Instead of adding unmodified files to the avoided_name
table, create namelist so that it contains only
modified files.

* tests/Makefile.am: Add update01.at, update02.at
* tests/testsuite.at: Likewise.
* tests/update.at (AT_KEYWORDS): Add update00.
2009-10-14 23:26:52 +03:00
Sergey Poznyakoff
0c6c288b53 Minor changes.
* src/tar.c (main): Ignore SIGPIPE.
* src/system.c (sys_child_open_for_compress)
(sys_child_open_for_uncompress): Reset SIGPIPE
in child to default.
* tests/remfiles01.at: Avoid race conditions.
* tests/remfiles02.at: Likewise.
2009-10-14 17:55:15 +03:00
Sergey Poznyakoff
87240ee7c4 Bugfix.
* src/buffer.c (_open_archive): Call guess_seekable_archive
only if the call to open_compressed_archive succeeded.
2009-10-14 17:51:19 +03:00
Sergey Poznyakoff
84a55f12e5 Improve previous changes.
* acinclude.m4: Fix typos.
* gnulib.modules: Add xvasprintf.
* src/common.h: Include xvasprintf.h.
* src/tar.c (options): Remove docstrings for --gzip, --bzip2,
--compress, --lzop, --lzma and --xz.
(tar_help_filter): Generate these using actual values of
*_PROGRAM constants.
(format_default_settings): Use xasprintf.
(parse_opt): Use *_PROGRAM defines instead of hardcoded
program names.
2009-10-10 19:49:38 +03:00
Sergey Poznyakoff
a7e9b6a17b Allow installers to specify alternative program names for compression programs.
This adds --with-gzip, --with-bzip2 etc. switches to the configure, so that
one can do, e.g. ./configure --with-bzip2=lbzip2 and have lbzip2 executed
whenever user calls `tar --bzip2'.

* acinclude.m4: New file.
* configure.ac: Add TAR_COMPR_PROGRAM invocations for
the supported compressors.
* src/buffer.c (magic): Use *_COMPRESSOR defines instead
of hardcoded program names.
* src/suffix.c (compression_suffixes): Likewise.
2009-10-10 17:30:53 +03:00
Sergey Poznyakoff
f0ceef8596 Minor fix.
* src/buffer.c (magic): Fix `xz' entry: add the name of the program.
* src/suffix.c (compression_suffixes, nsuffixes): Mark as static.
2009-10-09 11:49:26 +03:00
Sergey Poznyakoff
63e092548a Provide a way to explicitly set mtime for extended header ustar blocks.
* src/tar.c (struct textual_date): ts is a copy of the structure,
not a pointer to it. Date is a copy as well, hence the `const' is
taken away.
(get_date_or_file): Return 0/1 depending on success/failure.
Copy timestamp to the `ts' member. Store a copy of the string
in `date'.
(report_textual_dates): Report only if verbose_option is set,
but always free the list.
(expand_pax_option): New function.
(parse_opt): Preprocess the argument to xheader_set_option with
expand_pax_option.
(decode_options): Call report_textual_dates unconditionally.
* src/xheader.c (exthdr_mtime_option, exthdr_mtime)
(globexthdr_mtime_option, globexthdr_mtime): New statics.
(xheader_set_keyword_equal): handle exthdr.mtime and globexthdr.mtime.
(xheader_write): Override `t' argument if a corresponding
exthdr.mtime or globexthdr.mtime option is set.
* NEWS: Update
* doc/tar.texi: Document the changes.
2009-10-07 21:08:29 +03:00
Sergey Poznyakoff
7cb84c25ee Use file's mtime as mtime for its extended header.
This makes two pax archives binary equivalent if they
have the same contents and care is taken to make extended
headers otherwise reproducible, e.g. by using:

  --pax-option=exthdr.name=%d/PaxHeaders/%f,atime:=0

Proposed by Michael D. Adams <mdmkolbe@gmail.com>.

* src/common.h (start_private_header): Take time_t as 3rd param.
(xheader_write): Likewise.
* src/create.c (start_private_header): Take time_t as 3rd param.
All callers updated.
(write_extended): Use file's mtime as mtime for its extended header,
Use current time stamp as mtime for global headers.
(xheader_write): Take time_t as 3rd param.
2009-10-07 18:40:07 +03:00
Sergey Poznyakoff
4dfcd6c054 Fix bugs in handling the --remove-files option.
Make sure the files are deleted only if they were succesfully stored
to the archive.

* src/exit.c: New file.
* src/unlink.c: New file.
* src/Makefile.am (tar_SOURCES): Add exit.c and unlink.c.
* src/common.h: Include progname.h
(program_name): Remove global.
(records_written): New extern.
(queue_deferred_unlink, finish_deferred_unlinks): New prototypes.
(fatal_exit_hook): New extern.
* src/create.c (create_archive): Call finish_deferred_unlinks.
(dump_hard_link, dump_file0): Don't actually unlink the file,
queue it to deferred_unlinks instead.
* src/delete.c (records_written): Remove extern: declared in
common.h.
* src/extract.c (extract_archive): Set fatal_exit_hook.
(fatal_exit, xalloc_die): Move to exit.c
* src/system.c (sys_wait_for_child): Exit immediately
if the child dies or exits with a non-zero status.
(sys_child_open_for_compress)
(sys_child_open_for_uncompress): Use set_program_name,
instead of setting program_name directly.
* src/tar.c (main): Use set_program_name,
instead of setting program_name directly.

* tests/Makefile.am (TESTSUITE_AT): Add remfiles01.at
and remfiles02.at.
* tests/testsuite.at: Likewise.
* tests/gzip.at: Reflect the above changes.
2009-10-07 16:42:06 +03:00
Sergey Poznyakoff
2947023d27 Fix bug in OLDGNU format creation.
See tests/append02.at for a detailed description

* src/common.h (MODE_FROM_HEADER): Take additional argument.
(mode_from_header): Likewise.
* src/create.c (mode_to_chars): Store all mode bits if
using OLDGNU_FORMAT. This reverses f4e4adea80.
* src/list.c (decode_header): Use header mode field
to discern between GNU and OLDGNU formats.
(mode_from_header): Store unrecognized mode bits (from 10th up)
in the location pointed to by the third parameter.
* tests/append02.at: Update documentation and references.
2009-10-04 23:38:34 +03:00
Sergey Poznyakoff
92773d860f Restore extra help output.
* src/tar.c (tar_list_quoting_styles): Change first argument to
struct obstack.
(format_default_settings): New function.
(show_default_settings)
(show_default_settings_fs): Removed.
(tar_help): Removed.
(tar_help_filter): New function.
(argp): Set help_filter.
(parse_opt): Fix error message.
2009-09-16 11:52:34 +03:00
Sergey Poznyakoff
dccb3806a6 Improve command line option handling.
* gnulib.modules: Add argp-version-etc and progname,
use getopt-gnu instead of getopt.
* src/tar.c (HANG_OPTION, USAGE_OPTION)
(VERSION_OPTION): Remove.
(options): Remove corresponding options. Let argp
handle them.
(parse_opt): Likewise.
(_argp_hang): Removed.
(tar_authors): New variable.
(decode_options): Call argp_version_setup.
Do not use ARGP_NO_HELP flag in the call to argp_parse.
2009-09-08 11:08:49 +03:00
Sergey Poznyakoff
0d8e324912 Avoid overwriting exit_status with a value indicating less important condition.
* src/tar.c (set_exit_status): New function.
* src/common.h (set_exit_status): New prototype.
* src/compare.c: Use set_exit_status instead of
exit_status assignments.
* src/create.c: Likewise.
* src/misc.c: Likewise.

* src/system.c (wait_for_grandchild): Use auto variable
instead of the global exit_status.
* src/incremen.c (scan_directory): Use file_removed_diag
instead of stat_diag.
2009-09-08 11:04:48 +03:00
Sergey Poznyakoff
cef4d5e838 Automatic detection of seekable archives.
* src/buffer.c (guess_seekable_archive): New function.
(_open_archive): Call guess_seekable_archive for archives
open for reading.
(new_volume): Likewise.
* src/common.h (seek_option): New global.
* src/tar.c (options): New option --no-seek.
(parse_opt): --seek and --no-seek set seek_option,
not seekable_archive.
(decode_options): Initialize seek_option to -1.

* NEWS: Update.
* doc/tar.texi: Update.
2009-09-08 10:27:57 +03:00
Sergey Poznyakoff
ba954ea1e1 Fix testcases.
* tests/extrac08.at: Ensure a predictable umask value.
* tests/xform-h.at (xform): do not depend on file name
ordering.
2009-08-27 20:12:14 +03:00
Sergey Poznyakoff
006c1efbe8 Fix interaction between --listed-incremental and -C
* src/incremen.c (read_directory_file): Execute eventual -C dir
after opening the snapshot file.
(collect_and_sort_names): Remove call to chdir_do
* tests/incr05.at, tests/incr06.at: Use relative file names for
snapshot files.
2009-08-13 16:45:49 +03:00
Sergey Poznyakoff
aeffa4f266 Update for new exclude module from gnulib. Add testcases by Phil Proudman.
* src/names.c (is_pattern): Remove.
(regex_usage_warning): Use fnmatch_pattern_has_wildcards instead of
is_pattern.
* src/tar.c: New option --exclude-backups.
(vcs_file_table, backup_file_table): New globals.
(add_exclude_array): New function.
* tests/exclude01.at, tests/exclude02.at,
tests/exclude03.at, tests/exclude04.at,
tests/exclude05.at: New testcases. Supplied by Phil Proudman.
* tests/Makefile.am (TESTSUITE_AT): Add new tests.
* tests/testsuite.at: Add new tests.
* THANKS: Update.
2009-08-12 19:25:29 +03:00
Sergey Poznyakoff
829b3feb26 Remove src/version.c (reappeared after migration to Git) 2009-08-10 01:03:31 +03:00
Sergey Poznyakoff
88347995b2 Minor fixes.
* src/misc.c (file_removed_diag): Set exit code to TAREXIT_DIFFERS.
2009-08-09 11:20:52 +03:00
Sergey Poznyakoff
acd833fb98 Minor fixes 2009-08-08 22:33:16 +03:00
Sergey Poznyakoff
51aee274e8 Fix handling of files removed during incremental dumps.
Changes to src/create.c and src/incremen.c are partially
based on patch from Alexander Peslyak <solar at openwall.com>.

The new testcases require paxutils commit f653a2b or later.

* src/common.h (struct name): New member `cmdline'.
(dump_file): Change type of the 2nd argument to bool.
(file_removed_diag, dir_removed_diag): New prototypes.
(addname): New argument `cmdline'.
(name_from_list): Change return value.
* src/create.c (dump_dir0, dump_dir): top_level is bool.
(create_archive): Update calls to name_from_list.
Take advantage of the name->cmdline to set top_level argument
during incremental backups.
(dump_file0): top_level is bool.
Do not bail out if a no-top-level file disappears during incremental
backup, use file_removed_diag instead.
(dump_filed): top_level is bool.
* src/incremen.c (update_parent_directory): Silently ignore
ENOENT.  It should have already been reported elsewhere.
(scan_directory): Use dir_removed_diag to report missing directories.
* src/misc.c (file_removed_diag, dir_removed_diag): New functions.
* src/names.c (name_gather): Set ->cmdname.
(addname): Likewise. All uses updated.
(name_from_list): Return struct name const *. All uses updated.

* tests/filerem01.at: New testcase.
* tests/filerem02.at: New testcase.
* tests/Makefile.am, tests/testsuite.at: Add filerem01.at, filerem02.at
* tests/grow.at, test/truncate.at: Use new syntax for genfile --run.

* NEWS: Update.
* doc/tar.texi: Minor fix.
2009-08-08 19:53:54 +03:00
Sergey Poznyakoff
2b1bffbad6 Optimize searches for directory structures by keeping a pointer to struct directory in struct name.
* src/common.h (struct name): New member `directory' replaces
dir_contents. Rearrange members.
(rebase_directory): Change signature.
(scan_directory): Change signature.
(name_fill_directory)
(directory_contents, safe_directory_contents): New prototypes.
(append_incremental_renames): Change signature.
(replace_prefix): New proto.
* src/compare.c (diff_dumpdir): Use directory_contents + scan_directory.
* src/create.c
* src/incremen.c (replace_prefix): Move to misc.c
(rebase_directory): Rewrite.
(scan_directory): Return pointer to struct directory.
(directory_contents, safe_directory_contents): New functions.
(get_directory_contents): Remove.
(name_fill_directory): New function.
(append_incremental_renames): Rewrite. This also fixes a memory leak.
* src/names.c (name_gather, addname): Reflect changes in struct name.
(add_hierarchy_to_namelist): Rewrite using name_fill_directory and
directory_contents.
(rebase_child_list): Update call to rebase_directory.
(collect_and_sort_names): Optimize

* src/misc.c (replace_prefix): New function.
* src/names.c (add_hierarchy_to_namelist): Use new get_directory_contents.

* tests/incr05.at: New test case.
* tests/incr06.at: New test case.
* tests/Makefile.am, test/testsuite.at: Add incr05.at and incr06.at.

* doc/Makefile.am (check-options): Improve rule.
* doc/tar.texi, NEWS: Update.
2009-08-08 15:29:19 +03:00
Sergey Poznyakoff
df59690240 Minor fixes.
* src/common.h (rebase_directory): New prototype.
* src/incremen.c (rebase_directory): Use replace_prefix.
* src/names.c (collect_and_sort_names): Abort if
hash_insert fails.
2009-08-07 23:07:01 +03:00
Sergey Poznyakoff
1bcbbcf1ff Improve listed incremental dumps.
The modified algorithm tries to avoid dumping the same
directory twice and ensures the order of the directories
in the resulting archive is the same, whatever their order
on the command line.  It also fixes the operation of
--listed-incremental -C.

* gnulib.modules: Add canonicalize
* src/common.h (incremental_level): New global.
(check_exclusion_tags): first argument is const.
(get_directory_contents): Add third argument.
(zap_slashes, normalize_filename): New prototypes.
(chdir_count): New prototype.
(WARN_VERBOSE_WARNINGS): New define.
(WARN_ALL): Exclude WARN_VERBOSE_WARNINGS.
* src/compare.c (diff_dumpdir): Update the call to get_directory_contents.
* src/create.c (check_exclusion_tags): First argument is const.
Use ISSLASH and DIRECTORY_SEPARATOR instead of referring to '/'.

* src/incremen.c (struct directory): New member `caname'.
(hash_directory_name): Rename to hash_directory_canonical_name. Operate
on the canonical name.
(compare_directory_names): Rename to compare_directory_canonical_names.
Operate on the canonical name.
(make_directory): Take two arguments.
(free_directory): Free caname.
(attach_directory): Create caname.
(find_directory): Use caname for lookups.
(PD_VERBOSE): Remove.
(PD_FORCE_INIT): New define.
(procdir): First argument is const.
Reinitialize directory if PD_FORCE_INIT bit is set.
Do not use PD_VERBOSE or verbose_option for issuing warnings.
Rely on WARNOPT instead.
Always set *entry.
(scan_directory): Take three arguments. The third one is a boolean
which is true if the directory is explicitly mentioned on the command
line.
(get_directory_contents): Remove.  Use scan_directory instead.
All callers updated.
(read_directory_file): Truncate the file if --level=0 is given.
* src/misc.c: Include canonicalize.h
(zap_slashes, normalize_filename): New functions.
(chdir_count): New function.
* src/names.c (add_hierarchy_to_namelist): Take three arguments, as
get_directory_contents and scan_directory.
(collect_and_sort_names): Allow at most one -C, before file name
arguments.
Read directory file after eventual changing to another directory.
Avoid adding the same directory under different pathnames to
the list.
* src/tar.c: New option --level.

* tests/incr03.at, tests/incr04.at, tests/listed01.at,
tests/listed02.at, tests/rename01.at, tests/rename02.at,
tests/rename03.at: Update for new tar behavior.
* tests/multiv01.at: Do not use --listed-incremental.
2009-08-07 14:52:55 +03:00
Sergey Poznyakoff
ac5288c1ac Forgotten to push src/warning.c 2009-08-05 22:18:33 +03:00
Sergey Poznyakoff
67a1a0eac5 Implement the --warning option.
* src/warning.c: New file.
* src/Makefile.am: Add warning.c
* src/common.h: Provide definitions for warning classes.
(warning_option): New global.
(WARNOPT): New define.
(set_warning_option): New prototype.
* src/tar.c: New option `--warning'.
* src/compare.c: When applicable WARNOPT instead of WARN.
* src/create.c: Likewise.
* src/extract.c: Likewise.
* src/incremen.c: Likewise.
* src/list.c: Likewise.

* NEWS, doc/tar.texi: Update.
2009-08-05 13:52:38 +03:00
Carl Worth
471c0f76cd Fix descriptions of some options (tiny change) 2009-08-05 10:42:42 +03:00
Sergey Poznyakoff
755c246588 Fix backup handling and restoring file modes of existing directories
* NEWS, THANKS: Update
* src/extract.c (extract_dir): reset status to 0 if the
directory already exists.
* src/misc.c (maybe_backup_file): Assign before_backup_name
and clear after_backup_name before checking if we really need
to backup the file.
* tests/backup01.at: New testcase.
* tests/extrac08.at: New testcase.
* tests/Makefile.am, tests/testsuite.at: Add extrac08.at and
backup01.at
2009-08-05 10:38:50 +03:00
Sergey Poznyakoff
5944f452b0 Fix hard links recognition with -c --remove-files
* src/create.c (dump_hard_link): Always look up in the link table
if remove_files_option is set. Patch suggested by Theodore Ts'o
<tytso@mit.edu>.
(check_links): Remove extra newline from the warning message.
* tests/link02.at, tests/link03.at: New testcases.
* tests/Makefile.am (TESTSUITE_AT): Add link02.at and link03.at
* tests/testsuite.at: Include link02.at and link03.at
2009-07-30 23:49:32 +03:00
Sergey Poznyakoff
f74cab3a93 Fix handling of hard link targets by -c --transform
* src/create.c (file_count_links): Transform link target
before the look up.
* tests/xform-h.at: New test case.
* tests/Makefile.am (TESTSUITE_AT): Add xform-h.at.
* tests/testsuite.at: Add xform-h.at
2009-07-30 11:43:16 +03:00
Sergey Poznyakoff
01c4475b17 Minor fix.
* src/extract.c (file_newer_p): Do not report error on ENOENT
2009-06-23 16:52:33 +03:00
Sergey Poznyakoff
b7d206cb1e Remove rebox.el (reappeared after migration to Git) 2009-06-19 15:49:17 +03:00
Sergey Poznyakoff
c30c4ffb9f Remove files that were removed in CVS, but reappeared after migration to Git 2009-06-18 14:24:50 +03:00
David Bartley
b216fed634 Fix Solaris bug where chmod fails if we don't have PRIV_SYS_LINKDIR
* gnulib.modules: Add priv-set.
* src/extract.c (set_mode, extract_archive): Restore
PRIV_SYS_LINKDIR on chmod failure.
* src/tar.c (main): Drop PRIV_SYS_LINKDIR on startup.
2009-06-18 13:57:10 +03:00
Sergey Poznyakoff
0d6720288b Ensure default behavior for SIGPIPE
* src/tar.c (main): Install default handler for SIGPIPE.
Proposed by Bastian Blank.
2009-06-18 13:05:48 +03:00
Eric Blake
da760e3faa Follow autoconf recommendation for TESTSUITEFLAGS.
* tests/Makefile.am (check-local, installcheck-local): Honor
TESTSUITEFLAGS.
2009-06-18 12:30:04 +03:00
Sergey Poznyakoff
af30244849 Fix handling of sub-subprocess returns.
* src/system.c (wait_for_grandchild): New function.
(sys_child_open_for_compress)
(sys_child_open_for_uncompress): Use wait_for_grandchild
to manage grandchild return.
2009-06-18 12:22:47 +03:00
Sergey Poznyakoff
be34933b63 Report record size only if the archive refers to a device.
* Makefile.am (INCLUDES): Add ../lib, for rmt-command.h
* src/buffer.c (short_read): Report the actual record size
only if the archive descriptor refers to a device.
* tests/pipe.at, tests/shortrec.at,
tests/sparsemvp.at: Reflect the above change.
* NEWS, configure.ac: Version 1.22.90
2009-05-25 10:18:59 +03:00
Sergey Poznyakoff
8f390db92f Do not issue errors on existing files when given the -k option
* Makefile.am (dist-hook): Fix rule.
* src/extract.c (maybe_recoverable): Return three-state value.
(extract_dir): Skip extraction if maybe_recoverable indicates so.
(extract_file): Likewise.
2009-05-14 11:28:41 +03:00
Eric Blake
705fab49eb Avoid undefined behavior
* src/xheader.c (xheader_set_keyword_equal): Pass correct type to
ctype macros.
* src/transform.c (run_case_conv): Likewise.
2009-05-12 12:12:15 +03:00
Sergey Poznyakoff
f14558de94 Remove src/Makefile.in 2009-05-12 12:11:17 +03:00
Sergey Poznyakoff
67cad0792b Bugfixes.
* bootstrap (symlink_to_dir): Fix symlink calculation.
* doc/tar.texi: Minor fixes by Victor Villa and Stepan Kasal.
2009-03-12 16:15:06 +02:00
Sergey Poznyakoff
9077de9fa9 Remove Makefile.in 2009-03-07 16:32:06 +02:00
Sergey Poznyakoff
ac6caa71bc Migrate to Git 2009-03-07 16:30:44 +02:00
Sergey Poznyakoff
1ffb4377a4 Update 2009-03-05 07:26:41 +00:00
Sergey Poznyakoff
a00f276fe9 Version 1.22 2009-03-05 07:25:27 +00:00
Sergey Poznyakoff
5fa60b8d43 Version 1.22 2009-03-05 07:22:56 +00:00
Sergey Poznyakoff
29887e47d3 Update 2009-03-04 17:24:28 +00:00
Sergey Poznyakoff
a6318ea0ef v.1.21.90 2009-03-04 16:53:37 +00:00
Sergey Poznyakoff
c10830a35b Add xz support.
* src/buffer.c, src/suffix.c: Add support for xz compression.
* src/tar.c: New option --xz, for compression/decompression using xz.
Re-assign -J as a short equivalent of --xz.
* doc/tar.texi, NEWS: Document --xz
2009-03-04 16:50:31 +00:00
Sergey Poznyakoff
7a968d67c8 Minor fix 2009-01-19 10:53:58 +00:00
Sergey Poznyakoff
7b68ef3d91 Fix testsuite and bootstrap. Implement -I.
* bootstrap.conf: Include size_max.
* gnulib.modules: Remove memset, rmdir. Replace strdup with
strdup-posix. Patch by Eric Blake.
* src/tar.c: Implement -I as a shorthand for --use-compress-program.
* doc/tar.texi: Document -I.
* tests/pipe.at, tests/shortrec.at: Account for eventual 'Record
size' output.
* tests/testsuite.at (AT_TAR_CHECK_HOOK): New define
(AT_TAR_WITH_HOOK, TAR_IGNREC_HOOK): New macros.
2008-12-29 09:27:00 +00:00
Sergey Poznyakoff
970f999818 Version 1.21 2008-12-27 11:40:31 +00:00
Sergey Poznyakoff
cd39b5a1b7 * src/xheader.c: Remove duplicate inclusion of fnmatch.h. Reported
by Jim Meyering.
2008-11-30 12:33:12 +00:00
Sergey Poznyakoff
7f6e6e6a3e Do not try to drain the input pipe before closing the archive.
* src/buffer.c (close_archive): Remove call to
sys_drain_input_pipe. Pass hit_eof as the second
argument to sys_wait_for_child.
* src/common.h (sys_drain_input_pipe): Remove
(sys_wait_for_child): Declare second argument.
* src/system.c (sys_drain_input_pipe): Remove.
(sys_wait_for_child): Take two arguments. The second one helps to
decide whether to tolerate child termination on SIGPIPE.
2008-11-25 12:33:28 +00:00
Sergey Poznyakoff
99e3a2604f * src/buffer.c (_write_volume_label): Fix typo, which prevented
`-V label -M' from working.
2008-11-03 19:15:52 +00:00
Sergey Poznyakoff
b4ec8aedf9 * NEWS, configure.ac: Version 1.20.91
* doc/tar.texi: Document transformation scope flags.
* src/common.h (transform_symlinks_option): Remove in favor of
transformation scope flags.
(XFORM_REGFILE, XFORM_LINK, XFORM_SYMLINK, XFORM_ALL): New macros.
(transform_name, transform_member_name, transform_name_fp): Take
an additional argument, specifying scope flags.
* src/create.c: Reflect changes to transform_name.
* src/extract.c (extract_link, extract_symlink): Remove calls to
transform_member_name. It is done in read_header.
* src/list.c (decode_xform): Reflect change in data type of 2nd
argument.
(transform_member_name): 2nd arg is int.
(decode_header): Transform file name and link target names.
* src/tar.c: Remove --transform-symlinks.
* src/transform.c (struct transform): New member `flags'.
(transform_flags): New variable.
(parse_transform_expr): Parse transformation scope flags. Allow to
set global flags using `flags=' syntax.
(_transform_name_to_obstack, transform_name_fp)
(transform_name): Take an additional argument, specifying scope
flags.
2008-10-30 14:13:01 +00:00
Sergey Poznyakoff
5354888e40 * src/buffer.c (short_read): Remove !read_full_records condition,
which was always false on a first record and thus disabled record
size autodetection.  Thanks Ed Leaver for the patch.
(_gnu_flush_read): Handle blocking_factor == 1.
* tests/sparsemv.at: Reflect changes to buffer.c.
* tests/sparsemvp.at: Likewise.
* tests/volsize.at: Likewise.
* NEWS: Update.
* THANKS: Add Ed Leaver.
2008-10-22 20:55:35 +00:00
Sergey Poznyakoff
57bfbbde90 * src/common.h (transform_symlinks_option): New global.
* src/create.c (dump_file0): Transform symlink targets only if
explicitly required.  Thanks Cyril Strejc for reporting the
problem.
* src/tar.c (parse_opt): New options --transform-symlinks and
--no-transform-symlinks. New alias --xform to the --transform
option.
* doc/tar.texi: Document --transform-symlinks
* NEWS: Update.
* THANKS: Update.

* src/names.c (name_gather): Use xzalloc.
* src/buffer.c (short_read): Move record size detection before
the loop.
2008-10-16 11:07:19 +00:00
Sergey Poznyakoff
7b69ee5a24 Update 2008-10-07 07:19:23 +00:00
Sergey Poznyakoff
1428b7f176 (options): Add --lzop option. 2008-10-07 07:19:09 +00:00
Sergey Poznyakoff
6901594ac4 Bugfix.
* src/checkpoint.c (checkpoint_compile_action): Add missing
`else'.
2008-10-05 09:09:16 +00:00
Sergey Poznyakoff
c78356feda Implement --no-null option.
* NEWS: Update.
* doc/tar.texi: Update.
* src/tar.c: New option --no-null.
2008-09-24 10:58:19 +00:00
Sergey Poznyakoff
60c00c18b5 Update 2008-09-23 17:07:17 +00:00
Sergey Poznyakoff
c1b55e02b1 ChangeLog 2008-09-23 17:06:43 +00:00
Sergey Poznyakoff
15abf5c4d9 Update 2008-09-18 09:46:39 +00:00
Sergey Poznyakoff
1353511226 Remove incorrect example. 2008-09-18 09:46:34 +00:00
Sergey Poznyakoff
85c7909497 Bugfixes.
* src/incremen.c (dumpdir_create0): Eliminate gcc warning.
(attach_directory): Bugfix - add missing return statement.
* THANKS: Add Enric Hernandez
2008-09-07 08:49:10 +00:00
Sergey Poznyakoff
db83069aea Update 2008-07-31 07:13:13 +00:00
Sergey Poznyakoff
dbbffde583 Fix incremental archiving of renamed directories.
* src/incremen.c (struct directory): New member `next'.  Change
type of `name'.
(dirhead, dirtail): New statics.
(make_directory): Reflect changes to struct directory.
(free_directory, attach_directory): New functions.
(dirlist_replace_prefix): New function.
(note_directory): Use attach_directory, instead of make_directory,
(find_directory, find_directory_meta): Use free_directory.
(procdir): Replace directory prefixes in directory list to avoid
marking subdirectories as renamed after renaming their parent
directory.
(append_incremental_renames): Iterate over directory list, not
hash table, to preserve logical ordering of renames.
* tests/rename04.at, tests/rename05.at: New test cases.
* tests/Makefile.am, tests/testsuite.at: Add rename04.at and
rename05.at.
* tests/atlocal.in (decho): New function.
* tests/multiv06.at: Use decho instead of echo2.
* tests/incremental.at: Raise wait interval to 2 seconds.
2008-07-31 07:12:50 +00:00
Sergey Poznyakoff
1d79c6734c Untabify 2008-07-24 18:16:51 +00:00
Sergey Poznyakoff
3af9cc0f15 Fix multivolume archive creation when volume length=record size.
* src/tar.c (decode_options): Do not allow volume length less
than record size.
* src/buffer.c (_gnu_flush_write): Compensate for the effect
of eventual flush_archive occurring in the middle of buffer
move.
Increment records_written only if _flush_write was able to write
something.
* tests/multiv06.at: New testcase.
* tests/Makefile.am, test/testsuite.at: Add tests/multiv06.at
2008-07-24 18:16:08 +00:00
Sergey Poznyakoff
c9a7297a8a * configure.ac, NEWS: Version 1.20.90
* doc/tar.texi: Document -J, --no-auto-compress, etc.
* src/buffer.c (ct_tar): New constant.
(magic): Add lzop support.  Proposed by Kevin Day
<thekevinday@gmail.com>.
(check_compressed_archive): Do not use autodetect if the
compression program was specified explicitly.
Fall back to analyzing archive name, if the autodetection fails.
* src/suffix.c: Add .lzo
* src/tar.c: New options --lzop and --no-auto-compress.
New short option -J (alias for --lzma).
2008-06-26 10:19:19 +00:00
Sergey Poznyakoff
985637ab5a Bugfixes.
* src/buffer.c (try_new_volume): Print more information with error
diagnostics.
(_gnu_flush_write): Improve error checking.  Adjust
real_s_sizeleft before calling new_volume to avoid creating
malformed multivolume headers.
* tests/delete05.at, tests/gzip.at, tests/ignfail.at,
tests/longv7.at, tests/lustar01.at, tests/lustar02.at,
tests/shortfile.at: Update to match new diagnostic wording
(see 2008-05-06).

* NEWS: Update.
2008-06-26 06:32:25 +00:00
Sergey Poznyakoff
1024343a2b Update 2008-06-14 10:17:42 +00:00
Sergey Poznyakoff
1efa1f3b43 Remove a TZ dependency.Remove a TZ dependency. 2008-06-14 10:17:34 +00:00
Sergey Poznyakoff
5f1a4f9f12 Fix typos. 2008-06-14 10:17:14 +00:00
Sergey Poznyakoff
969d2b986b Update 2008-06-14 10:16:09 +00:00
Sergey Poznyakoff
d5f2066cac (exclude): Document support for new VCS. 2008-06-14 10:16:01 +00:00
Sergey Poznyakoff
79ce0e6789 (exclude_vcs_files): Support for Bazaar, Mercurial and Darcs. 2008-06-14 10:15:25 +00:00
Sergey Poznyakoff
6a052fd5a3 Update 2008-05-05 21:33:51 +00:00
Sergey Poznyakoff
8aa729b90e (main): Reword the "delayed error" message. New wording proposed by Karl Berry. 2008-05-05 21:33:39 +00:00
Sergey Poznyakoff
057dd26a60 Update 2008-05-05 21:31:13 +00:00
Sergey Poznyakoff
b94eed6d03 Version 1.20.
* configure.ac: Raise version number to 1.20
* src/compare.c (diff_dumpdir): const.
* src/common.h (dumpdir_t,dumpdir_iter_t): New data types.
(dumpdir_create0,dumpdir_create,dumpdir_free,dumpdir_locate)
(dumpdir_first,dumpdir_next): New functions.
* src/incremen.c (dumpdir_create0,dumpdir_create,dumpdir_free)
(dumpdir_first,dumpdir_next): New functions.
(dumpdir_locate): Rewrite using binary search.
(struct directory): Change members char *contents, *icontents to
struct dumpdir *dump, *idump. All references updated.
(note_directory): Last arg is const.
* src/names.c (add_hierarchy_to_namelist): buffer is const.
* tests/incr03.at, tests/incr04.at, tests/rename02.at,
tests/rename03.at: Insert calls to sleep between creation of files
and adding them to the archive.
2008-05-05 21:30:57 +00:00
Sergey Poznyakoff
192860abb8 Update 2008-03-31 08:03:00 +00:00
Sergey Poznyakoff
c2d2e806a1 (dump_file0): Count links only for actually dumped files 2008-03-31 08:02:53 +00:00
Sergey Poznyakoff
2a89f7a0a8 * NEWS: Document --no-check-device and --check-device.
* doc/rendition.texi: Change the way FIXME-*refs are handled in
!PROOF.
* doc/intern.texi, doc/tar.texi: Update.
* doc/untabify.el: New file.
* doc/Makefile.am (EXTRA_DIST): Add untabify.el
(untabify, final, check-format, check-refs, check-fixmes)
(check-unrevised, all-check-docs, check-docs): New rules.
2008-03-27 10:11:05 +00:00
Sergey Poznyakoff
71d2a66f42 * src/common.h (check_device_option): New global.
* src/incremen.c (procdir): Use boolean and instead of bitwise
one. Patch by Jean-Louis Martineau.
Compare device numbers only if check_device_option is set.
* src/tar.c: New command line options --no-check-device and
--check-device. Proposed by Jean-Louis Martineau.
(parse_opt): Hanlde new options.
(decode_options): Initialize check_device_option to true.
2008-03-27 08:56:26 +00:00
Sergey Poznyakoff
e496c1b529 * bootstrap: Use rsync to get translations.
* doc/tar.texi: Minor change.
* lib/.cvsignore: Update
* po/.cvsignore: Update
* src/system.c: Remove include setenv.h.
* tests/atlocal.in (STAR_DATA_URL): Update.
* tests/star/README: Update URL.
2008-03-06 08:17:33 +00:00
Sergey Poznyakoff
6667fa7fb8 Update 2008-02-09 10:36:40 +00:00
Sergey Poznyakoff
a16ad3112e Fix a typo 2008-02-09 10:35:55 +00:00
Sergey Poznyakoff
7efe3850f6 * NEWS: Update.
* configure.ac: Version 1.19.90
* po/POTFILES.in: Add missing files.
* src/compare.c (verify_volume): Honor --ignore-zeros.
Proposed by Jan-Benedict Glaw.
* tests/shortfile.at (AT_KEYWORDS): Add shortfile0.
2008-02-08 14:12:22 +00:00
Sergey Poznyakoff
d0694ee604 Update the description 2008-02-08 10:32:15 +00:00
Sergey Poznyakoff
37f0faf1c0 (dump_file0): Apply transform_name to symlink targets. 2008-02-07 15:46:41 +00:00
Sergey Poznyakoff
b893aee6d2 Update 2008-02-07 15:46:28 +00:00
Sergey Poznyakoff
f60d655908 Update 2008-02-04 10:39:05 +00:00
Sergey Poznyakoff
549481a0a7 Update 2008-02-04 10:38:27 +00:00
Sergey Poznyakoff
e08afc2002 Document changes to the --transform option. 2008-02-04 10:38:18 +00:00
Sergey Poznyakoff
338591a486 Support multiple --transform options. Support semicolon-separated lists of replace expressions. 2008-02-04 10:35:20 +00:00
Paul Eggert
c0e0d06e69 * doc/tar.texi: Update Back-Cover text to reflect new GNU wording.
2007-12-17  Paul Eggert  <eggert@cs.ucla.edu>

Exit with nonzero status if a close fails on an archive.
Problem (and initial trivial fix)
* src/buffer.c (close_archive, new_volume): close_error, not close_warn.
2008-01-31 00:50:12 +00:00
Sergey Poznyakoff
6e85425618 Update 2007-12-05 09:48:37 +00:00
Sergey Poznyakoff
336519aa4f Add shortupd.at. 2007-12-05 09:45:35 +00:00
Sergey Poznyakoff
5f4d99491d (check_compressed_archive): Do not bail out if the
file is too short, set boolean flag, passed as an argument
instead.  This fixes a bug introduced on 2007-08-24. See also
tests/shortupd.at.
2007-12-05 09:45:22 +00:00
Paul Eggert
48d83be336 Don't read from name[-1].
* src/incremen.c (make_directory): Handle namelen == 0, since
find_directory_meta calls make_directory ("").
2007-11-13 07:01:26 +00:00
Sergey Poznyakoff
60d351cc5a Update 2007-11-07 08:48:39 +00:00
Sergey Poznyakoff
e33be3d0a1 Add fseeko and snprintf. 2007-11-07 08:48:28 +00:00
Sergey Poznyakoff
32562b9412 (checkout): Use URL of the gnulib CVS mirror. 2007-11-07 08:48:19 +00:00
Sergey Poznyakoff
dfd87ba1d0 (magic): Fix lzma option 2007-10-31 13:10:55 +00:00
Sergey Poznyakoff
5d4a682a55 Update 2007-10-31 12:57:04 +00:00
Sergey Poznyakoff
8e3a2a520d (sys_exec_info_script,sys_exec_checkpoint_script): pass the current blocking factor in TAR_BLOCKING_FACTOR environment variable. 2007-10-31 12:56:46 +00:00
Sergey Poznyakoff
745832a280 New actions: bell and ttyout 2007-10-31 12:56:27 +00:00
Sergey Poznyakoff
458efab23b Minor fix 2007-10-30 14:58:52 +00:00
Sergey Poznyakoff
23dcaa117f Update 2007-10-30 14:09:20 +00:00
Sergey Poznyakoff
5099ddf6cc Document --hard-dereference and --checkpoint-action options. Improve documentation of --check-links. 2007-10-30 14:09:04 +00:00
Sergey Poznyakoff
8476145508 Use texi2html and the CVS version of gendocs.sh to create HTML versions of the manual 2007-10-30 14:08:41 +00:00
Sergey Poznyakoff
362492fe70 Use texi2html and the CVS version of gendocs.sh to create HTML versions of the manual 2007-10-30 14:08:21 +00:00
Sergey Poznyakoff
7111008659 Update 2007-10-29 16:57:32 +00:00
Sergey Poznyakoff
ec4741d732 (parse_opt): New options --hard-dereference, --checkpoint-action.
(decode_options): Call checkpoint_finish_compile.
2007-10-29 16:56:56 +00:00
Sergey Poznyakoff
bed7de0271 (sys_exec_checkpoint_script): New function.
(sys_exec_info_script): Restore SIGPIPE handler.
2007-10-29 16:56:33 +00:00
Sergey Poznyakoff
eaaadcfd36 (file_count_links): do nothing if hard_dereference_option is set. 2007-10-29 16:56:13 +00:00
Sergey Poznyakoff
a8830fbb86 (enum checkpoint_style): Remove.
(checkpoint_style): Remove.
(DEFAULT_CHECKPOINT): New define.
(hard_dereference_option): New variable.
(sys_exec_checkpoint_script): New declaration.
2007-10-29 16:55:58 +00:00
Sergey Poznyakoff
848659f1c6 (checkpoint, do_checkpoint): Remove.
(_flush_write, simple_flush_read, _gnu_flush_read): Use
checkpoint_run.
2007-10-29 16:55:37 +00:00
Sergey Poznyakoff
17cbd4862c checkpoint handling 2007-10-29 16:55:16 +00:00
Sergey Poznyakoff
64ded9e702 (tar_SOURCES): add checkpoint.c 2007-10-29 16:54:51 +00:00
Sergey Poznyakoff
ccd0a527e4 Version 1.19.1 2007-10-29 16:54:38 +00:00
Sergey Poznyakoff
3f869877a4 Version 1.19.1 2007-10-29 16:53:28 +00:00
Sergey Poznyakoff
8c528937a9 Update 2007-10-29 16:53:20 +00:00
Sergey Poznyakoff
460f4ec146 Update 2007-10-29 08:53:58 +00:00
Sergey Poznyakoff
eb59c14a1f (sys_exec_info_script): Initialize buf. Problem reported by Bengt-Arne Fjellner. 2007-10-29 08:51:46 +00:00
Paul Eggert
3c4f4ca423 Avoid compiler warnings.
* src/list.c (read_header_primitive): Define two locals, to
avoid incorrect "may be used uninitialized" warnings.
* src/incremen.c (procdir): Remove decl of unused local, "len".

expired.
SCALAR(0x830b08c)
2007-10-18 21:36:38 +00:00
Sergey Poznyakoff
506b4db5d0 Update 2007-10-18 07:59:48 +00:00
Sergey Poznyakoff
5bfb6c5f9d (gzip): Remove compression patent warning. According to Brett Smith, the patent is expired. 2007-10-18 07:59:39 +00:00
Sergey Poznyakoff
3725b5606f Update 2007-10-17 09:12:54 +00:00
Sergey Poznyakoff
d1a7eebc30 Update 2007-10-17 09:12:03 +00:00
Sergey Poznyakoff
dfe280dcca Add Lasse Collin and Jean-Pierre Demailly. 2007-10-17 09:11:50 +00:00
Sergey Poznyakoff
620a136e74 New options --auto-compress (-a) and --lzma 2007-10-17 09:11:34 +00:00
Sergey Poznyakoff
3fb5d67b28 (set_comression_program_by_suffix): New prototype. 2007-10-17 09:11:23 +00:00
Sergey Poznyakoff
c30a794679 (magic): Add an entry for new lzma format. Proposed by Lasse Collin 2007-10-17 09:11:08 +00:00
Sergey Poznyakoff
00bb0d8f5c Add suffix.c 2007-10-17 09:10:46 +00:00
Sergey Poznyakoff
af3e05b6af New file. Determine compression algorithm by archive file name suffix. Suggested by Jean-Pierre Demailly. 2007-10-17 09:10:34 +00:00
Paul Eggert
6060d613d1 * src/utf8.c (string_ascii_p): Recode to avoid bogus GCC 4.2.1
warning about "comparison is always true due to limited range of
data type" when char is unsigned.
2007-10-13 05:49:18 +00:00
Paul Eggert
3f12066739 Adjust to recent gnulib changes.
* configure.ac: Dont' check for strerror, since gnulib now does this.
* .cvsignore: Add m4, tar-[0-9]*.
* lib/.cvsignore: Adjust to various gnulib file name changes.
Add .deps, rmt-command.h.

SCALAR(0x830b0dc)
directories.

SCALAR(0x831ad2c)
2007-10-11 22:04:44 +00:00
Sergey Poznyakoff
3b74fbfc3b Update 2007-10-10 11:04:25 +00:00
Sergey Poznyakoff
14d39a2c14 Update 2007-10-10 11:03:42 +00:00
Sergey Poznyakoff
7b57922073 Version 1.19 2007-10-10 11:03:14 +00:00
Sergey Poznyakoff
05c6da4c62 Update 2007-10-05 11:21:40 +00:00
Sergey Poznyakoff
4ece30109d (dump_regular_file): Fix file padding in case of truncation to zero size. 2007-10-05 11:20:27 +00:00
Sergey Poznyakoff
55f1eadbf2 Update 2007-10-04 07:16:52 +00:00
Sergey Poznyakoff
9b22262fc6 Use AT_DATA for sample output. 2007-10-04 07:16:39 +00:00
Sergey Poznyakoff
2de140fa95 Update 2007-10-03 20:18:47 +00:00
Sergey Poznyakoff
6f6864df13 (try_purge_directory): Ensure that arguments to T and R are safe. 2007-10-03 20:18:32 +00:00
Sergey Poznyakoff
519a7c0c75 Update 2007-09-29 00:48:08 +00:00
Sergey Poznyakoff
1ef212d0fb (obstack_code_rename): Apply safer_name_suffix to name arguments before storing them in T and R records. Reported by Nicholas Cole. 2007-09-29 00:47:59 +00:00
Sergey Poznyakoff
333780b227 Update 2007-09-27 09:16:38 +00:00
Sergey Poznyakoff
2c56ca0e7f Raise version number to 1.18.90 2007-09-27 09:16:24 +00:00
Sergey Poznyakoff
63f8de655b Update 2007-09-27 08:05:38 +00:00
Sergey Poznyakoff
2743e1ba5b Document version 2 2007-09-27 08:05:31 +00:00
Sergey Poznyakoff
40ece6bf4d Update 2007-09-26 22:08:51 +00:00
Sergey Poznyakoff
63e835f5c0 New option --exclude-vcs
(exclude_vcs_files): New function
2007-09-26 22:08:36 +00:00
Sergey Poznyakoff
efe6609cd9 (struct directory): New member tagfile
(make_directory): Initialize tagfile to NULL
(procdir): New argument: entry
Hanlde exclusion tags.
(makedumpdir): Take into account directory->tagfile.
(scan_directory): Hanlde exclusion tags.
2007-09-26 22:08:13 +00:00
Sergey Poznyakoff
b0d5935cb0 (exclusion_tag_warning, check_exclusion_tags): Remove static qualifier.
(check_exclusion_tags): account for dirname without terminating
slash.
(dump_dir0): exclusion_tag_all is handled elsewhere.
2007-09-26 22:07:44 +00:00
Sergey Poznyakoff
a1b1b7cc8a (exclusion_tag_warning, check_exclusion_tags): New prototypes 2007-09-26 22:06:43 +00:00
Sergey Poznyakoff
8940247418 Update 2007-09-26 22:06:24 +00:00
Paul Eggert
0dacafbbb0 * AUTHORS: Remove unnecessary information. Just list the
principal authors.
* THANKS: Remove info duplicated from AUTHORS.

SCALAR(0x82892dc)


SCALAR(0x8279918)

SCALAR(0x8289444)


stripping and name suffix normalization.
2007-09-14 21:00:37 +00:00
Sergey Poznyakoff
e3e50c987b Minor rewording 2007-09-08 08:49:35 +00:00
Sergey Poznyakoff
923f0cda43 Update 2007-08-26 09:02:09 +00:00
Sergey Poznyakoff
c485b7984d (apply_nonancestor_delayed_set_stat): Rename st->sb to avoid shadowing another local. 2007-08-26 09:01:38 +00:00
Sergey Poznyakoff
d769b724f4 (diff_dumpdir): Rename stat->stat_data to avoid shadowing the syscall. 2007-08-26 09:01:08 +00:00
Sergey Poznyakoff
a0eb52da3f (check_exclusion_tags): Remove declaration of unused local, "ret". 2007-08-26 08:59:28 +00:00
Sergey Poznyakoff
87ac3207fb Don't include <getline.h>. No longer needed. 2007-08-26 08:59:08 +00:00
Sergey Poznyakoff
c634f2c6f1 Raise version number to 1.18.1 2007-08-24 12:23:19 +00:00
Sergey Poznyakoff
5416153391 Update 2007-08-24 12:08:58 +00:00
Sergey Poznyakoff
5bb69a88d8 Add shortfile.at 2007-08-24 12:08:47 +00:00
Sergey Poznyakoff
0a848ff669 New test case for the today's change in src/buffer.c (1.111) 2007-08-24 12:08:35 +00:00
Sergey Poznyakoff
7c0b81cbb9 (check_compressed_archive): Detect files smaller than 512 bytes. 2007-08-24 12:07:32 +00:00
Sergey Poznyakoff
862770bf91 Update 2007-08-19 09:17:32 +00:00
Sergey Poznyakoff
89d682d0b9 Gnulib initialization destroyed paxutils m4 files.
Initialize paxutils structure after that of gnulib.
2007-08-19 09:17:21 +00:00
Sergey Poznyakoff
764174dc1d Update 2007-08-12 08:25:35 +00:00
Sergey Poznyakoff
5ab30f709a (symlink_to_gnulib): Make sure the target directory exists and create it if it does not. 2007-08-12 08:25:27 +00:00
Sergey Poznyakoff
e2b8c8fa9f (contains_dot_dot): Fix double-dot recognition in case of duplicate /. Patch by Dmitry V. Levin. 2007-08-12 08:25:00 +00:00
Sergey Poznyakoff
42250f5010 Update 2007-08-12 07:15:11 +00:00
Sergey Poznyakoff
62571aa7c3 Fix a typo 2007-08-12 07:14:29 +00:00
Sergey Poznyakoff
32f7047037 Update 2007-06-29 20:23:05 +00:00
Sergey Poznyakoff
a69be0adce Add to the repository 2007-06-29 20:22:48 +00:00
Sergey Poznyakoff
1fb35e7374 Final update for GPLv3 2007-06-29 20:20:02 +00:00
Sergey Poznyakoff
7e69b14775 Update 2007-06-28 17:01:18 +00:00
Sergey Poznyakoff
625c45d304 Update for the change of the TP URL 2007-06-28 17:00:35 +00:00
Sergey Poznyakoff
3fe0f0d7f8 Update 2007-06-27 14:06:55 +00:00
Sergey Poznyakoff
c3d4fee823 Restore after an accidental remove 2007-06-27 13:46:15 +00:00
Sergey Poznyakoff
a0fb51e136 Relicense under GPLv3 2007-06-27 13:30:12 +00:00
Sergey Poznyakoff
ac8690fc4e Update copyright year 2007-06-21 08:52:22 +00:00
Sergey Poznyakoff
395df04927 Update 2007-06-21 08:51:15 +00:00
Sergey Poznyakoff
89a91c7b44 Skip test if genfile is unable to create the file 2007-06-21 08:51:03 +00:00
Sergey Poznyakoff
5635a428ab (AT_TAR_MKHIER): Skip test if genfile is unable to create the file 2007-06-21 08:50:09 +00:00
Sergey Poznyakoff
8b5f10a6c4 Resolve testsuite failures 40-42 on cygwin. 2007-06-21 07:12:09 +00:00
Sergey Poznyakoff
6e98015774 Update 2007-06-16 12:10:24 +00:00
Sergey Poznyakoff
bd13e18a63 Add back write permissions on dir 2007-06-16 12:10:14 +00:00
Sergey Poznyakoff
01cf5c5315 New file 2007-06-16 12:09:59 +00:00
Sergey Poznyakoff
0dd814fac2 (Fixing Snapshot Files): New appendix 2007-06-16 12:09:50 +00:00
Sergey Poznyakoff
b27b516b68 (tar_TEXINFOS): Add tar-snapshot-edit.texi 2007-06-16 12:09:34 +00:00
Sergey Poznyakoff
c7f69c265b Update 2007-06-09 17:07:54 +00:00
Sergey Poznyakoff
bc00f45420 Sort the output 2007-06-09 17:07:46 +00:00
Paul Eggert
57304e8b0a Fix typo: occurence -> occurrence. 2007-06-08 18:49:19 +00:00
Sergey Poznyakoff
d3f04456e8 Raise version number to 1.17 2007-06-08 09:34:18 +00:00
Sergey Poznyakoff
d78083e82c Update 2007-06-08 08:27:40 +00:00
Sergey Poznyakoff
c8d4ceccc1 (Operation Summary): Restore alphabetical order of the options. 2007-06-08 08:27:32 +00:00
Sergey Poznyakoff
6287d3045f Update 2007-06-08 08:15:41 +00:00
Sergey Poznyakoff
9d3142805b s/(ASCII|ID|BSD)/@acronym{&}/;s/"[^"]+"/``&''/
Use `path' only when it refers to search paths, use
`file name' otherwise.
Fix various errors (based on patch by Benno Schulenberg)
2007-06-08 08:14:12 +00:00
Sergey Poznyakoff
05eddc1a58 Update testsuite 2007-06-01 21:57:30 +00:00
Sergey Poznyakoff
78bfbb5661 Update 2007-06-01 21:24:41 +00:00
Sergey Poznyakoff
fe576585e6 (decode_xform): Exempt symbolic links from component
stripping and name suffix normalization.
2007-06-01 21:24:30 +00:00
Sergey Poznyakoff
080a6b2ac5 Update calls to transform_member_name 2007-06-01 21:24:08 +00:00
Sergey Poznyakoff
f236f33643 (xform_type): New data type
(transform_member_name): Last argument is of xform_type type
All callers updated
2007-06-01 21:23:53 +00:00
Sergey Poznyakoff
a4ffcfb875 Update 2007-05-30 19:15:32 +00:00
Sergey Poznyakoff
967fcb9318 (decx): Unknown pax keywords produce a warning,not error. 2007-05-30 19:15:17 +00:00
Paul Eggert
12b3a5d5b1 * src/misc.c (set_file_atime): Use gl_futimens, not futimens,
due to gnulib change.

SCALAR(0x828a248)

SCALAR(0x828a404)
2007-05-29 16:48:23 +00:00
Sergey Poznyakoff
eeb610da48 Update 2007-05-19 17:04:34 +00:00
Sergey Poznyakoff
749e20e6fa Update 2007-05-19 17:03:59 +00:00
Sergey Poznyakoff
56f6556f94 (tarball_prereq): Discard eventual md5sum output. 2007-05-19 17:03:44 +00:00
Sergey Poznyakoff
43c5343194 Minor fix 2007-05-19 17:03:35 +00:00
Sergey Poznyakoff
250db35f17 Global extended_header removed, use new xheader calls instead. 2007-05-19 17:03:28 +00:00
Sergey Poznyakoff
6f929b2c89 (buffer_write_global_xheader): New function
Update to use new xheader calls.
2007-05-19 17:03:01 +00:00
Sergey Poznyakoff
64cddf2fbc (xheader_init): New function
(xheader_decode_global,xheader_store,xheader_read)
(xheader_write_global,xheader_write,xheader_string_begin)
(xheader_string_add,xheader_string_end): Take xhdr as first
argument.
2007-05-19 17:02:46 +00:00
Sergey Poznyakoff
ccdbafb276 (struct xheader): New definition
(struct tar_stat_info): New member xhdr (extended header).
2007-05-19 17:02:29 +00:00
Sergey Poznyakoff
bd222d606a (buffer_write_global_xheader): New function
(struct xheader): Move definition to tar.h
(extended_header): Remove global
(xheader_init): New function
(xheader_decode_global,xheader_store,xheader_read)
(xheader_write_global,xheader_write,xheader_string_begin)
(xheader_string_add,xheader_string_end): Take xhdr as first
argument.
2007-05-19 17:02:13 +00:00
Sergey Poznyakoff
94fb06f5db Fix typos 2007-05-18 09:14:54 +00:00
Sergey Poznyakoff
74d217db74 Update 2007-05-18 08:22:33 +00:00
Sergey Poznyakoff
17ef61b2fd (dump_file0): Original ctime cannot be used as a directory change indicator if --remove-files is given. 2007-05-18 08:22:21 +00:00
Paul Eggert
f32828d577 Adjust to latest Gnulib.
* lib/.cvsignore: Add dirfd.c, dirfd.h, float+.h, mbscasecmp.c,
stdio.h, stdio_.h, stdlib.h, stdlib_.h, time.h, time_.h, unistd.h.
Remove exit.h, getcwd.h, mempcpy.h, memrchr.h, mkdtemp.h, stpcpy.h,
strcase.h, strchrnul.h, strdup.h, strndup.h, strnlen.h, time_r.h,
vsnprintf.h.
* m4/.cvsignore: Remove localedir.h.  Sort.
2007-04-13 00:51:07 +00:00
Sergey Poznyakoff
e67e085421 Update 2007-04-03 21:52:52 +00:00
Sergey Poznyakoff
ca856c2585 (main): Don't call closeopen. 2007-04-03 21:52:42 +00:00
Sergey Poznyakoff
18641602c1 Don't include <sys/time.h>, <sys/resource.h>; no longer needed. 2007-04-03 21:52:20 +00:00
Sergey Poznyakoff
8bdbc08a89 (closeopen): Remove decl. 2007-04-03 21:52:01 +00:00
Sergey Poznyakoff
a5d5cc599f Update 2007-04-03 21:38:40 +00:00
Sergey Poznyakoff
761895d43c Update 2007-04-03 21:38:14 +00:00
Sergey Poznyakoff
5d4f057e31 (sys_exec_info_script): Store the inter-communication fd in the environment variable TAR_FD 2007-04-03 21:38:00 +00:00
Sergey Poznyakoff
7c0ba663c8 Update 2007-04-03 12:31:24 +00:00
Sergey Poznyakoff
51118be241 Expect a warning on stderr 2007-04-03 12:30:43 +00:00
Sergey Poznyakoff
69f5d77383 Update 2007-04-03 12:18:53 +00:00
Sergey Poznyakoff
d989864712 (main): Move closeopen after decode_options to allow shell process substitution to work. 2007-04-03 12:18:40 +00:00
Sergey Poznyakoff
983d328ff2 Restore accidentally deleted lines 2007-03-30 19:28:22 +00:00
Sergey Poznyakoff
586c684815 (transform_name_fp): Change signature. All callers updated. 2007-03-30 19:20:52 +00:00
Sergey Poznyakoff
bbf7dec45e Fix indentation 2007-03-30 19:19:56 +00:00
Sergey Poznyakoff
40f79286ab Update 2007-03-30 19:18:46 +00:00
Sergey Poznyakoff
ebc522d521 (all_names_found): Remove check for matching_flags. 2007-03-30 19:18:35 +00:00
Sergey Poznyakoff
ad85f632c6 (transform_member_name): New function
(decode_header): Use transform_member_name
2007-03-30 19:18:24 +00:00
Sergey Poznyakoff
062b37115f (extract_link, extract_symlink): Use
transform_member_name instead of safer_name_suffix so that
--transform and --strip-components affect links as well.
2007-03-30 19:18:10 +00:00
Sergey Poznyakoff
6261c58ae8 (transform_name_fp): Change signature
(transform_member_name): New function
2007-03-30 19:17:44 +00:00
Sergey Poznyakoff
427bda01a3 Update 2007-03-30 08:50:21 +00:00
Sergey Poznyakoff
1d26fff0f3 Do not include mkdtemp.h 2007-03-30 08:50:08 +00:00
Sergey Poznyakoff
bb6b92e37d (slurp): Remove any occurrences of $bt from the generated gnulib.mk 2007-03-30 08:49:56 +00:00
Sergey Poznyakoff
8ca4064a8c Update 2007-03-30 08:49:38 +00:00
Paul Eggert
5c890a6003 Adjust to recent gnulib changes.
* lib/.cvsignore: Add fchownat.c, rmt-command.h, strerror.c, string.h,
string_.h, sys, sys_time_.h, unistd_.h, wchar_.h, wctype_.h.
Remove localedir.h, size_max.h, xsize.h.
* src/xheader.c: Don't include stpcpy.h; no longer needed, now that
gnulib string.h defines stpcpy on all platforms.
2007-01-26 23:02:40 +00:00
Sergey Poznyakoff
3705fd6452 Update 2007-01-23 10:26:40 +00:00
Sergey Poznyakoff
bde442ba15 Add exclude.at 2007-01-23 10:26:30 +00:00
Sergey Poznyakoff
c9a8f1bc33 New test case 2007-01-23 10:26:20 +00:00
Sergey Poznyakoff
66e9b9cd6c New options --exclude-caches-all, --exclude-caches-under, --exclude-tag-all, --exclude-tag-under 2007-01-23 10:25:21 +00:00
Sergey Poznyakoff
b9588c4722 (struct exclude_tag): rename to exclusion_tag
(check_exclusion_tags): New function
(cachedir_file_p): New function (from check_cache_directory)
(dump_dir0,dump_file0): Use check_exclusion_tags
2007-01-23 10:25:06 +00:00
Sergey Poznyakoff
9a41b3b3db (exclude_caches_option): Remove
(enum exclusion_tag_type): New data type
(add_exclude_tag): Rename to add_exclusion_tag
(cachedir_file_p): New prototype
2007-01-23 10:24:43 +00:00
Sergey Poznyakoff
990e7d4437 Document --exclude-caches* and --exclude-tag* options. 2007-01-23 10:24:19 +00:00
Sergey Poznyakoff
173d3229e3 Update 2007-01-19 15:43:13 +00:00
Sergey Poznyakoff
2d261da8f9 Version 1.16.2 2007-01-19 15:42:43 +00:00
Sergey Poznyakoff
99527fa17b (sparse_skip_file,pax_dump_header_1)
(pax_decode_header): Keep track of the number of bytes written.
2007-01-19 15:42:26 +00:00
Sergey Poznyakoff
868ee74028 (expand_sparse): use ftruncate to handle the trailing hole 2007-01-19 15:41:55 +00:00
Sergey Poznyakoff
8c90bf0414 Fix typos 2007-01-19 15:41:39 +00:00
Sergey Poznyakoff
892cdea8a1 Require strerror 2007-01-19 15:41:32 +00:00
Sergey Poznyakoff
00763876f1 Update 2007-01-04 20:06:33 +00:00
Sergey Poznyakoff
1a1cfaafa6 (list_dumpdir): Minor fixes. 2007-01-04 20:05:32 +00:00
Sergey Poznyakoff
445d95be07 (diff_dumpdir): Compare directory contents using
dumpdir_cmp.  Do not free dumpdir_buffer, it will leave the
incremental directory table in the inconsistent state and trigger
full dump.
(read_and_process): Process dumpdirs no matter what the archive
format.
2007-01-04 20:05:05 +00:00
Sergey Poznyakoff
6fe55234c9 Update 2007-01-04 16:16:00 +00:00
Sergey Poznyakoff
e24d8574a8 (read_and_process): Fix type of "size" 2007-01-04 16:15:10 +00:00
Sergey Poznyakoff
4da5205ed6 Update 2006-12-13 08:22:18 +00:00
Sergey Poznyakoff
8241687465 Skip the test if genfile is not able to create the filename with an embedded newline. 2006-12-13 08:22:04 +00:00
Paul Eggert
8e3f3adf98 Port to Forte Developer 7 C 5.4 and C99.
* src/common.h (add_exclude_tag): Add decl; C99 requires this
and Forte warns about it.
* src/incremen.c: Include <mkdtemp.h> for mkdtemp prototype,
for same reason.
* src/misc.c (get_max_open_files): Rewrite to avoid code that
Forte C complains about as being unreachable.
* src/xheader.c (mtime_code): Rewrite to avoid Forte error
reported by Trond Hasle Amundsen.

* src/incremen.c (compare_dirnames): Rewrite to avoid casts.
* src/utf8.c (string_ascii_p): Likewise.
* src/xheader.c (mtime_coder, volume_size_coder, volume_offset_coder):
Likewise.

SCALAR(0x8283218)
2006-12-12 23:56:24 +00:00
Sergey Poznyakoff
e5ef01710a Fix wording 2006-12-08 16:59:56 +00:00
Sergey Poznyakoff
e70e63612a Update 2006-12-08 16:45:34 +00:00
Sergey Poznyakoff
28b26242c7 Add paxutils files to dot_ignore. 2006-12-08 16:45:09 +00:00
Sergey Poznyakoff
6b279a6f8c Update 2006-12-08 13:40:15 +00:00
Sergey Poznyakoff
079f2d6807 Raise version number to 1.16.1 2006-12-08 13:40:07 +00:00
Sergey Poznyakoff
b09417ca8d (slurp): Create .(cvs|git)ignore if not present 2006-12-08 13:39:58 +00:00
Sergey Poznyakoff
b15e3f1bbd Remove autogenerated files 2006-12-08 12:42:32 +00:00
Sergey Poznyakoff
1616b1d1b4 Update 2006-12-07 14:35:13 +00:00
Sergey Poznyakoff
f23bc997fd Update 2006-12-07 14:34:48 +00:00
Sergey Poznyakoff
8ec119a27f Update 2006-12-07 14:34:28 +00:00
Sergey Poznyakoff
e35d05b1d2 Use genfile instead of dd, because on some systems /dev/zero is not available. 2006-12-07 14:34:15 +00:00
Sergey Poznyakoff
cdb77dcd7b (extract_file): Call skip_member if open fails.
Patch proposed by Jan-Benedict Glaw <jbglaw@lug-owl.de>
2006-12-07 14:33:54 +00:00
Sergey Poznyakoff
9bf87b195e (dump_dir0): Move checks for exclude tags to
dump_file0.
(dump_dir): Move calls to ensure_slash to dump_file0
2006-12-07 14:33:42 +00:00
Sergey Poznyakoff
643e3f2441 Update documentation of --exclude-tag 2006-12-07 14:33:30 +00:00
Sergey Poznyakoff
6e75833cb7 (distclean-local): Fixed 2006-12-07 14:33:17 +00:00
Paul Eggert
908d78d208 * NEWS: Fix some race conditions with tar -x --same-owner.
* src/extract.c (ARCHIVED_PERMSTATS): Add a comment saying that
S_IRWXG | S_IRWXO might be masked out.
(set_mode): Set the mode if some bits were masked out originally.
(set_stat): Don't chmod before chown, as that might temporarily
grant permissions that we don't want to grant.  The chmod was
there only to work around broken hosts, so add a comment advising
users not to use those broken hosts instead.
(repair_delayed_set_stat, extract_dir):
Remember to mask out current umask before inverting permissions.
(extract_dir): If the owner might change, or if the mode has
special bits, create the directory 700 at first, but restore it later.
(open_output_file): New arg mode; all uses changed.
(extract_file, extract_node, extract_fifo): If the owner might
change, omit group and other bits at first, but restore them after
changing the owner.
2006-12-04 21:35:56 +00:00
Paul Eggert
192f55e2a0 * doc/tar.texi (Long Options): Remove doubled word. 2006-12-04 09:33:31 +00:00
Sergey Poznyakoff
9d99fd13cd Update 2006-11-30 09:54:07 +00:00
Sergey Poznyakoff
07902e9f9a (xheader_read): Remove unused variable 2006-11-30 09:53:20 +00:00
Sergey Poznyakoff
0c94a109b9 Update 2006-11-30 09:42:59 +00:00
Sergey Poznyakoff
27094c4fc3 Implement --update-po and .bootstrap 2006-11-30 09:42:12 +00:00
Sergey Poznyakoff
5aca761e1b Remove src/mangle.c 2006-11-30 09:41:50 +00:00
Sergey Poznyakoff
cc82db7f2d (exclude): Document --exclude-tag 2006-11-30 09:41:42 +00:00
Sergey Poznyakoff
137ebf41fd (dump_dir0): Implement --exclude-tag option 2006-11-30 09:40:47 +00:00
Paul Eggert
49ea4c5057 * NEWS: Remove support for mangled names.
* doc/tar.texi (verbose tutorial): Likewise.
* src/Makefile.am (tar_SOURCES): Remove mangle.c.
* src/common.h (extract_mangle): Remove decl.
* src/extract.c (extract_mangle_wrapper): Remove.
(prepare_to_extract): Remove support for mangled names.
* src/list.c (read_and, print_header): Likewise.
* src/mangle.c: Remove.
* src/tar.h (GNUTYPE_NAMES): Remove.
2006-11-30 06:39:29 +00:00
Paul Eggert
409bddf38c * lib/.cvsignore: Add fstatat.c, gnulib.mk, openat-proc.c, same-inode.h, stat_.h,
tempname.c, tempname.h, uinttostr.c.
2006-11-30 06:27:24 +00:00
Paul Eggert
c930802f31 Port to latest gnulib. There were a lot of changes, so the
simplest way to get this up and running was to switch to coreutils
bootstrap procedure.  I noticed one feature missing after this
merge: the ability to update a single .po file.  I can add that
later if need be.
* README-cvs, bootstrap.conf: New files.
* lib/.cvsignore: Remove Makefile.am, printf-parse.c, vasnprintf.c.
* lib/printf-parse.c, lib/vasnprintf.c: New files, from coreutils,
to override gnulib, so that we don't need xsize.h.
* bootstrap: Replace with coreutils bootstrap, except add support
for paxutils.
* configure.ac (gl_USE_SYSTEM_EXTENSIONS): Remove, as gl_EARLY now
does this.
(gl_EARLY, gl_INIT): Add.
(tar_GNULIB): Remove.
* gnulib.modules: Add configmake.
* lib/Makefile.tmpl: Remove, replacing with....
* lib/Makefile.am: New file.
* src/Makefile.am (tar.o): Remove dependency: Automake does this
for us.
* src/tar.c: Include <configmake.h> and <rmt-command.h>, not
<localedir.h>.
2006-11-30 00:14:10 +00:00
Paul Eggert
ca14885884 Remove trailing white space. 2006-11-29 18:28:45 +00:00
Paul Eggert
01d6188297 Remove trailing white space. 2006-11-29 18:16:27 +00:00
Paul Eggert
759c5208c5 Remove trailing white space. 2006-11-29 18:11:34 +00:00
Sergey Poznyakoff
8457e06b99 Do not depend on command timing. 2006-11-13 10:42:19 +00:00
Sergey Poznyakoff
8719c4f680 Update 2006-11-13 10:41:47 +00:00
Sergey Poznyakoff
574022ab78 Do not use 'k' modifier in dd options. 2006-11-13 10:41:34 +00:00
Sergey Poznyakoff
304d8b9f0c (start_header): Pass mtime as a call-specific data to xheader_store. 2006-11-13 10:39:51 +00:00
Sergey Poznyakoff
6712656eb2 (mtime_coder): Treat non-null data as a pointer to struct timespec, overriding st->mtime 2006-11-13 10:39:15 +00:00
Sergey Poznyakoff
415d9c9e15 Update copyright year 2006-11-01 00:30:45 +00:00
Sergey Poznyakoff
1a8141ab8a Update 2006-11-01 00:24:44 +00:00
Sergey Poznyakoff
023c766600 Do not assume tar's default archive is stdout 2006-11-01 00:24:19 +00:00
Sergey Poznyakoff
fdb46aa2e2 Add more keywords 2006-11-01 00:24:09 +00:00
Sergey Poznyakoff
2504e7d3ae Add new test cases. 2006-11-01 00:23:52 +00:00
Sergey Poznyakoff
b0765e257c (enum read_file_list_state.file_list_skip): New value
(read_name_from_file): Skip zero-length entries
2006-11-01 00:23:24 +00:00
Sergey Poznyakoff
73d4c40a87 Update 2006-10-31 20:19:30 +00:00
Sergey Poznyakoff
7aed52718f Call last_component instead of base_name. The latter returns a malloced string since 2006-03-11. 2006-10-31 20:18:50 +00:00
Sergey Poznyakoff
f572ca0cfb Update 2006-10-21 16:48:08 +00:00
Sergey Poznyakoff
29236a68fa (distclean-local): New rule 2006-10-21 16:47:56 +00:00
Sergey Poznyakoff
a4b1564d4a Version 1.16 2006-10-21 16:47:42 +00:00
Sergey Poznyakoff
94d0385a57 Update 2006-10-17 08:14:06 +00:00
Sergey Poznyakoff
603c1d60a6 Fix help output formatting. Thanks Benno Schulenberg. 2006-10-17 08:13:43 +00:00
Sergey Poznyakoff
29e9004b69 Update 2006-10-16 07:51:40 +00:00
Sergey Poznyakoff
8da152d2b3 Update 2006-10-16 07:49:00 +00:00
Sergey Poznyakoff
00746182f3 (dist-hook): Create a cpio archive. 2006-10-16 07:48:51 +00:00
Sergey Poznyakoff
6c8815909d Update 2006-10-14 21:13:28 +00:00
Sergey Poznyakoff
fde336b21a (AT_KEYWORDS): Keyword `filechange'
Test tar exit status.
2006-10-14 21:12:42 +00:00
Sergey Poznyakoff
394b12d950 New test grow.at 2006-10-14 21:12:04 +00:00
Sergey Poznyakoff
372638ae7a Do not attempt to close stderr after call to close_stdout. 2006-10-14 21:11:43 +00:00
Sergey Poznyakoff
c455373e5b (dump_regular_file,dump_file0): Set exit_status to
TAREXIT_DIFFERS if the file being dumped was truncated or
otherwise changed.
2006-10-14 21:11:27 +00:00
Sergey Poznyakoff
f2541c66cd (Synopsis): Document tar exit codes. 2006-10-14 21:11:03 +00:00
Sergey Poznyakoff
7e6d54d0c0 Update 2006-10-14 10:48:14 +00:00
Sergey Poznyakoff
876e554157 (AT_KEYWORDS): Add stdout keyword 2006-10-14 10:46:24 +00:00
Sergey Poznyakoff
1118d24fd3 New test verbose.at 2006-10-14 10:46:13 +00:00
Sergey Poznyakoff
dc6f7ebf20 (_open_archive): Make sure stdlis is set to stderr
when we are writing archive to stdout (unless --index-file is
used). Bug introduced on 2006-07-06.
2006-10-14 10:45:44 +00:00
Sergey Poznyakoff
1102eeef1f Update 2006-10-02 15:45:08 +00:00
Sergey Poznyakoff
e8a4c35a73 Add new testcase: multiv05.at: 2006-10-02 15:44:52 +00:00
Sergey Poznyakoff
e359fad641 (xheader_string_end): Fix diagnostic message. 2006-10-02 15:44:20 +00:00
Sergey Poznyakoff
f5504a3bae (new_volume): Initialize current_block 2006-10-02 15:44:09 +00:00
Sergey Poznyakoff
341be8f405 Add Joerg Weilbier 2006-10-02 15:43:59 +00:00
Sergey Poznyakoff
4f2a22f306 Update 2006-09-27 09:03:23 +00:00
Sergey Poznyakoff
a76ab340dd (doc0, doc1, initialize_argp_doc): Removed. Rely on the new argp method instead 2006-09-27 09:03:13 +00:00
Sergey Poznyakoff
3ad3ca8734 Minor fix 2006-09-27 09:03:02 +00:00
Sergey Poznyakoff
82b2829e10 Use ${package} instead of hardcoding package name 2006-09-27 09:02:45 +00:00
Sergey Poznyakoff
f852428d5f Update 2006-09-12 09:59:08 +00:00
Sergey Poznyakoff
86e91a5bfc Fix typo 2006-09-12 09:56:39 +00:00
Paul Eggert
ec5743a628 * tests/testsuite.at (AT_TAR_MKHIER): Use install-sh -d
rather than the no-longer-included mkinstalldirs.
2006-09-08 23:29:43 +00:00
Paul Eggert
bf7f4fdc1e Add at-func.c, configmake.h, fchmodat.c,
fcntl.h, fcntl_.h, inttypes_.h, lstat.c, lstat.h.
2006-09-08 23:27:45 +00:00
Sergey Poznyakoff
98b9522499 Update 2006-09-08 16:47:15 +00:00
Sergey Poznyakoff
6398dbe1a5 List texinfo among build prerequisites for the CVS version. 2006-09-08 16:47:01 +00:00
Sergey Poznyakoff
37724f5e20 (try_purge_directory): Initialize struct st. Fix condition for selecting candidates for removal. 2006-09-08 16:45:41 +00:00
Sergey Poznyakoff
c8c351684c (intl_files_to_remove): Do not remove m4/inttypes-h.m4 and m4/inttypes-pri.m4 2006-09-08 15:17:56 +00:00
Paul Eggert
01b6fb98bf * bootstrap: Set XGETTEXT_OPTIONS to flag our printf-format functions,
so that translators are warned about strings that are formats but
don't look like formats.  This might help prevent core dumps.
* configure.ac (AM_GNU_GETTEXT): Upgrade to need-formatstring-macros.
Suggested by Eric Blake to avoid problems like
<http://lists.gnu.org/archive/html/bug-coreutils/2006-07/msg00087.html>.
(AM_GNU_GETTEXT_VERSION): Upgrade from 0.12.1 to 0.15.  The gettext
manual says we should use the version number normally expected of
maintainers, neither more nor less.
2006-08-11 21:39:36 +00:00
Paul Eggert
f1309bffbf * bootstrap (get_translations):
Don't exclude ky.po; it is working again.
2006-08-11 07:44:21 +00:00
Paul Eggert
c732eb584e * bootstrap: Don't exclude ja.po; it is working again.
Don't remove all old .po files if we're merely updating one.
* po/.cvsignore: Add Makevars.
2006-08-09 18:30:16 +00:00
Paul Eggert
0680ad4d42 * src/tar.c: Work around limitation imposed by gettext 0.15
by concatenating strings with "\v" after translation.
(doc): Remove, splitting into:
(doc0, doc1): New constants.
(argp): Don't use doc; just initialize to NULL.
(initialize_argp_doc): New function.
(decode_options): Use it.
2006-08-08 05:28:32 +00:00
Paul Eggert
1942370acd Fix typo: remove po/tar.html. 2006-08-07 22:58:12 +00:00
Paul Eggert
94de7c4c77 * bootstrap: Redo po file retrieval to match Bison's method,
since the translation project changed its index format.
Don't use --assume-autoconf; it's now replaced
by looking in configure.ac.
(m4/codeset.m4, m4/intdiv.m4, m4/inttypes-pri.m4, m4/isc-posix.m4):
(m4/lcmessage.m4, m4/onceonly_2_57.m4, m4/gettext.m4, m4/glibc21.m4):
(m4/inttypes_h.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4):
(m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4):
Don't rename to ..._gl.m4, as this is no longer needed.
(m4/geteext.m4): Patch to remove the need for intl/*.
Use autopoint manually, then remove the intl files,
then undo changes to gnulib files that autoreconf made,
and then run aclocal/autoconf/autoheader/automake.
This makes our bootstrap procedure closer to Bison's.
(po/Makevars): Generate automatically.
* configure.ac (AC_PREREQ): Update from 2.59 to 2.60.
(gl_AC_TYPE_INTMAX_T, jm_AC_TYPE_UINTMAX_T): Remove.
* gnulib.modules: Add inttypes, stdint.
* lib/.cvsignore: Add close-stream.c, close-stream.h,
stdint.h, stdint_.h.
* po/Makefile: Remove; now automatically generated.
2006-08-07 22:57:25 +00:00
Paul Eggert
05805868f2 (read_incr_db_01): Check input strings more
carefully.  Do not pass arbitrary char values to isspace, as
this has undefined behavior.  Likewise for assigning arbitrary
uintmax_t values to other types.
(read_negative_num, read_unsigned_num, read_timespec):
New functions, to check input values a bit more carefuly.
(read_num): Use read_unsigned_num.  New arg MAX_VAL;
all callers changed.
(read_incr_db_2): Use these new functions.
Use a consistent diagnostic for unexpected EOF.
(read_directory_file): Do not assign arbitrary uintmax_t value
to int.
(read_timespec, write_directory_file_entry, write_directory_file):
Handle negative time_t values correctly.  We don't bother to do
this with pre-2 formats, since presumably the time stamps were
output incorrectly.
2006-08-07 21:29:27 +00:00
Paul Eggert
57aa98047e gettext 0.15 rejects this. 2006-08-07 21:12:21 +00:00
Sergey Poznyakoff
7573967406 Update 2006-07-24 09:14:18 +00:00
Sergey Poznyakoff
ab8711413c Add append02.at 2006-07-24 09:14:00 +00:00
Sergey Poznyakoff
9fd9a0913d New test case 2006-07-24 09:13:44 +00:00
Sergey Poznyakoff
f4e4adea80 (to_chars_subst): Update comment regarding OLDGNU
vs. GNU format differences.
(mode_to_chars): Treat OLDGNU_FORMAT same as GNU_FORMAT. Fixes bug
reported by TAMUKI Shoichi <tamuki@linet.gr.jp>, which caused
equivalent `tar cf ...' and `tar rf ...' commands to produce
different archives.
2006-07-24 09:13:21 +00:00
Sergey Poznyakoff
7110641821 (decode_options): Do not require -L with -M -Hpax.
It could be needed in future, but currently it is not.
2006-07-24 09:12:55 +00:00
Paul Eggert
fce454b5ca * bootstrap: Adjust to today's change to gnulib-tool by invoking
it with --assume-autoconf='latest-stable'.
2006-07-20 16:57:31 +00:00
Paul Eggert
8ad985ea6c Adjust to recent gnulib changes.
* lib/.cvsignore: Remove atexit.c, exit.c, getndelim2.c, getndelim2.h,
pathmax.h, paxconvert.c, paxerror.h, xstrdup.c.
Add inttypes.h, mktime.c, wcwidth.h, xstrndup.c, xstrndup.h.
* src/create.c (start_header): Adjust to API change to mode_adjust.
2006-07-17 05:47:26 +00:00
Sergey Poznyakoff
37edfd9e8f Update 2006-07-09 11:26:46 +00:00
Sergey Poznyakoff
016f7c87a7 Update 2006-07-09 11:26:16 +00:00
Sergey Poznyakoff
52b8bea074 Add Ralf Wildenhues 2006-07-09 11:25:47 +00:00
Sergey Poznyakoff
5addfdcb03 Fix some typos 2006-07-09 11:25:18 +00:00
Sergey Poznyakoff
e707b47aba Fix entry ordering 2006-07-06 20:10:37 +00:00
Sergey Poznyakoff
76dc519f9f Update 2006-07-06 20:08:53 +00:00
Sergey Poznyakoff
2a00376816 (TESTSUITE_AT): Add indexfile.at 2006-07-06 20:08:20 +00:00
Sergey Poznyakoff
9766528b07 Include indexfile.at 2006-07-06 20:08:09 +00:00
Sergey Poznyakoff
f26a90783b New test case 2006-07-06 20:08:01 +00:00
Sergey Poznyakoff
36fe16aaf5 (decode_options): Initialize stdlis 2006-07-06 20:07:37 +00:00
Sergey Poznyakoff
89f1667fdb (_open_archive): Remove stdlis initialization 2006-07-06 20:05:30 +00:00
Sergey Poznyakoff
f2d65dda39 Update 2006-07-05 06:46:53 +00:00
Sergey Poznyakoff
8370746251 (FIXME): Do not use deprecated @quote-args.
Do not use @allow-recursion. In its current form the macro is not
recursive.
2006-07-05 06:46:32 +00:00
Sergey Poznyakoff
2614af6d3c (manual): Fix TEXINPUTS 2006-07-05 06:46:11 +00:00
Sergey Poznyakoff
614def3113 Update 2006-07-04 21:53:40 +00:00
Sergey Poznyakoff
b6365e9b03 Update 2006-07-04 21:52:53 +00:00
Sergey Poznyakoff
bf789e3642 Update --directory description 2006-07-04 21:52:34 +00:00
Sergey Poznyakoff
1421ee630d (main): Call closeopen 2006-07-04 21:52:14 +00:00
Sergey Poznyakoff
9869d0ae17 (chdir_arg): Use x2nrealloc to reallocate wd.
(get_max_open_files,closeopen): New functions
(chdir_do): Do not use save_cwd if it was already used more than
max_open_files-4 times to avoid running off the file
descriptors.
2006-07-04 21:52:05 +00:00
Sergey Poznyakoff
edc0b12c5e (closeopen): New function 2006-07-04 21:51:42 +00:00
Sergey Poznyakoff
808cafa454 (AC_CHECK_FUNCS): Check for getdtablesize 2006-07-04 21:51:33 +00:00
Sergey Poznyakoff
d1dedae402 (update_po): Fix single translation update 2006-07-03 16:46:14 +00:00
Sergey Poznyakoff
de754902da Update 2006-06-27 13:39:20 +00:00
Sergey Poznyakoff
bc7f4ad027 Update 2006-06-26 14:42:35 +00:00
Sergey Poznyakoff
55abc110f5 Add cross-references 2006-06-26 14:42:18 +00:00
Sergey Poznyakoff
4d753fced1 Minor fixes 2006-06-26 12:48:25 +00:00
Sergey Poznyakoff
85a4e0fdeb Do not depend on getopt.h 2006-06-26 11:18:54 +00:00
Sergey Poznyakoff
583415c2c1 Update 2006-06-26 08:09:18 +00:00
Sergey Poznyakoff
6488588c5f Update 2006-06-26 08:08:47 +00:00
Sergey Poznyakoff
ac40b1e6f6 Update 2006-06-25 12:46:43 +00:00
Sergey Poznyakoff
4bf5f6dca4 --sparse-version turns on --sparse 2006-06-25 12:46:12 +00:00
Sergey Poznyakoff
ecaff7cbba Use ST_IS_SPARSE instead of sparse_file_p (update paxutils first) 2006-06-25 12:45:57 +00:00
Sergey Poznyakoff
ea9e2d8d8e (sparse_file_p): Remove 2006-06-25 12:45:16 +00:00
Sergey Poznyakoff
39e5d9182c (Other Tars): New node describing how to extract
GNU-specific member formats using third-party tars.
2006-06-25 12:45:03 +00:00
Sergey Poznyakoff
c7aa519f09 (tar_TEXINFOS): Sorted 2006-06-25 12:44:15 +00:00
Sergey Poznyakoff
bf5ba3dbef A sample utility to expand sparse files
extracted by third-party tars. It is not meant to be installed nor
to be included in the distribution. It is here, so that it can be
obtained either from CVS or from the tar web site.
2006-06-25 12:44:04 +00:00
Sergey Poznyakoff
ea368b6d1b Update 2006-06-24 16:50:11 +00:00
Sergey Poznyakoff
d0201294c0 (xhdr_tab.decoder): pass keyword as a second
argument. All callers changed.
(decode_record): Check for numeric overflow
(xheader_string_end): Return boolean value. Check for possible
numeric overflow
2006-06-24 16:49:33 +00:00
Sergey Poznyakoff
c5b15c4ac1 (segm_count): Change type to size_t 2006-06-24 16:49:05 +00:00
Sergey Poznyakoff
4b3dd17c00 (pax_dump_header_0): Return false if
xheader_string_end fails (for 0.1 formats).
(pax_dump_header): Return meaningful value
2006-06-24 16:48:45 +00:00
Sergey Poznyakoff
d339cc38af Remove not used variables 2006-06-24 16:48:24 +00:00
Sergey Poznyakoff
796a69787e (extract_volhdr): Add missing return 2006-06-24 16:48:08 +00:00
Sergey Poznyakoff
4c54e234c1 (name_init): New prototype.
(xheader_string_end): Return bool.
2006-06-24 16:47:57 +00:00
Sergey Poznyakoff
c027e03924 (print_total_stats): Add default case 2006-06-24 16:47:29 +00:00
Sergey Poznyakoff
6d615f12d4 Update 2006-06-23 15:24:53 +00:00
Sergey Poznyakoff
8f970d2c1e Include sparsemvp.at, spmvp00.at, spmvp01.at, spmvp10.at 2006-06-23 15:24:43 +00:00
Sergey Poznyakoff
d04af8f714 Rewritten as an include file.
(TAR_MVP_TEST): New macro
2006-06-23 15:24:10 +00:00
Sergey Poznyakoff
e2ecb82711 Explicitely give `-f -' to the tar invocation 2006-06-23 15:23:47 +00:00
Sergey Poznyakoff
8e2e731733 Add spmvp00.at, spmpv01.at, spmpv10.at 2006-06-23 15:23:16 +00:00
Sergey Poznyakoff
19a63e523d Implement new keywords: GNU.sparse.name, GNU.sparse.major, GNU.sparse.minor, GNU.sparse.realsize 2006-06-23 15:22:50 +00:00
Sergey Poznyakoff
5679d3020e (struct tar_stat_info.sparse_major,sparse_minor): New members 2006-06-23 15:22:31 +00:00
Sergey Poznyakoff
1001c1b326 New option --sparse-version 2006-06-23 15:22:12 +00:00
Sergey Poznyakoff
090d1d36ae Implement sparse format versioning. Implement new
version (1.0) of PAX sparse format.
(pax_sparse_member_p): Fix condition
(pax_dump_header): A dispatcher function
(pax_dump_header_0,pax_dump_header_1): New functions.
(pax_optab): Update
(oldgnu_dump_header): Minor fix: make sure
sparse_header.isextended is set before calling
set_next_block_after
2006-06-23 15:21:48 +00:00
Sergey Poznyakoff
2e1f904f2c (tar_sparse_major,tar_sparse_minor): New globals. 2006-06-23 15:20:06 +00:00
Sergey Poznyakoff
6a0b5421b9 Update master menu 2006-06-23 15:19:47 +00:00
Sergey Poznyakoff
9c764b14a9 (Sparse Formats): New node 2006-06-23 15:19:27 +00:00
Sergey Poznyakoff
ae67839879 (tar_TEXINFOS): Add sparse.texi 2006-06-23 15:19:08 +00:00
Sergey Poznyakoff
9588a106a7 New files 2006-06-23 15:18:18 +00:00
Sergey Poznyakoff
b3627f3f07 Update 2006-06-21 10:44:29 +00:00
Sergey Poznyakoff
ca7df3fe6b Raise version number to 1.15.92 2006-06-21 10:44:16 +00:00
Sergey Poznyakoff
ab19642053 Implement new option, --mtime, allowing to set
modification times for all archive members during creation.
(struct tar_args): textual_date_option replaced with a linked list
textual_date. All references updated.
(get_date_or_file,report_textual_dates): New functions.
2006-06-21 10:40:39 +00:00
Sergey Poznyakoff
a71b154289 (start_header): Override mtime if requested 2006-06-21 10:40:10 +00:00
Sergey Poznyakoff
ceaef10443 (set_mtime_option,mtime_option): New globals 2006-06-21 10:39:58 +00:00
Sergey Poznyakoff
5da6733724 (Overriding File Metadata): New node
Document --mtime option.
2006-06-21 10:39:52 +00:00
Sergey Poznyakoff
8d6c177ecb update 2006-06-20 15:15:11 +00:00
Sergey Poznyakoff
1ecd6672e1 (GNU.sparse.name): New variable for storing sparse file name. 2006-06-20 15:14:59 +00:00
Sergey Poznyakoff
ca2f855c90 (pax_dump_header): Store original sparse file name
in GNU.sparse.name variable. The name field in the ustar header
now contains generated name (%d/GNUSparseFile.%p/%f), so that
non-pax-aware tars won't extract the file under the original
filename.
2006-06-20 15:14:47 +00:00
Sergey Poznyakoff
693134a4e7 (name_next_elt): Call register_individual_file
(namelist_match): Remove third argument
(name_match): Change return type to bool
(name_scan): Remove second argument
2006-06-20 15:14:19 +00:00
Sergey Poznyakoff
90cec95580 (maybe_backup_file): Second argument is bool 2006-06-20 15:14:00 +00:00
Sergey Poznyakoff
b6fcb4ba8f (procdir): Use is_individual_file to check for
files explicitely specified in the command line. Fixes bug
reported by Dat Head on 19 Jun 2006 (descending into mountpoints
with --one-file-system in use)
2006-06-20 15:13:49 +00:00
Sergey Poznyakoff
6d1e9ab67e Remove second argument from calls to name_scan 2006-06-20 15:13:30 +00:00
Sergey Poznyakoff
300210aa15 (struct name.explicit): Remove
Use variable names in all declarations
(name_scan): Remove second argument
2006-06-20 15:13:20 +00:00
Sergey Poznyakoff
532b2dd31f Fix typo in a comment 2006-06-16 07:19:34 +00:00
Sergey Poznyakoff
3358f5fcc3 Update 2006-06-13 19:34:20 +00:00
Sergey Poznyakoff
51e3f3f1ca Update 2006-06-13 14:59:43 +00:00
Sergey Poznyakoff
caf6b29f1e (Using Multiple Tapes,Multi-Volume Archives): Rewritten 2006-06-13 14:59:32 +00:00
Sergey Poznyakoff
12ae9f6912 Update 2006-06-13 13:35:46 +00:00
Sergey Poznyakoff
64041696c9 (xopindex,opsummary): New macros 2006-06-13 13:35:34 +00:00
Sergey Poznyakoff
8ee09b9939 Define op as codeindex. Use xopindex and opsummary to
populate it
Consequently prefer @dfn{long options} over @dfn{mnemonic
options}.
Document --unquote, --no-unquote
(Short Option Summary): Build a table of cross-references to the
corresponding long options.
2006-06-13 13:35:14 +00:00
Sergey Poznyakoff
72f60f9e5f (FIXME) [!PROOF_FOOTNOTED]: Enclose in a cartouche 2006-06-13 13:34:32 +00:00
Sergey Poznyakoff
378818cb3e (check-options): Expand macros before grepping in $(info_TEXINFOS) 2006-06-13 13:34:14 +00:00
Sergey Poznyakoff
c980a06329 Update 2006-06-12 22:51:32 +00:00
Sergey Poznyakoff
4c7a2b10b8 Implement --overwrite-dir option (long ago documented) 2006-06-12 22:50:29 +00:00
Sergey Poznyakoff
8f3ed604b9 Update 2006-06-12 22:50:17 +00:00
Sergey Poznyakoff
b886724818 (check-options): New goal 2006-06-12 22:49:37 +00:00
Sergey Poznyakoff
f143fa5d64 Update 2006-06-12 13:21:28 +00:00
Sergey Poznyakoff
1e3568d947 (options, parse_opt): Allow for optional argument to
the --totals option, which specifies a signal upon delivery of which
the statistics must be output.
(main): Call print_total_stats if total_option is set.
2006-06-12 13:20:10 +00:00
Sergey Poznyakoff
b229a86dd7 (check_time): Use volume_start_time when checking
for the timestamp plausability.
2006-06-12 13:19:43 +00:00
Sergey Poznyakoff
05b250d4a4 (records_skipped): Remove static qualifier, the
variable is used by print_total_stats in buffer.c
2006-06-12 13:19:16 +00:00
Sergey Poznyakoff
42d180b24e (volume_start_time,last_stat_time): New globals
(print_total_written): Replaced with:
(print_total_stats): New function
2006-06-12 13:18:59 +00:00
Sergey Poznyakoff
8c10111c66 (total_blocks_deleted): New variable
(set_start_time): Set volume_start_time and last_stat_time as well
(set_volume_start_time): New function
(compute_duration): Do not call set_start_time, update
last_stat_time instead. Use it in calculation instead of
start_time, which is now set only once, upon startup.
(print_total_written): Removed.
(print_total_stats): New function for printing byte/speed statistics.
(_open_archive): Detect attempts to update compressed archives.
(_gnu_flush_write): Always update prev_written.
(open_archive): Call set_volume_start_time.
2006-06-12 13:18:26 +00:00
Sergey Poznyakoff
15a55db341 Update 2006-06-12 13:17:54 +00:00
Sergey Poznyakoff
e721e74259 Document better the --totals option. 2006-06-12 13:17:42 +00:00
Sergey Poznyakoff
1bea3b4b25 Update 2006-06-11 20:07:20 +00:00
Sergey Poznyakoff
4ef056729e (xheader_set_single_keyword): Fix typo.
(decode_time): Avoid using gotos.
2006-06-11 20:06:46 +00:00
Sergey Poznyakoff
37986cdff9 Update 2006-06-11 15:05:52 +00:00
Sergey Poznyakoff
5fe07ac97d Update master menu 2006-06-11 15:05:22 +00:00
Sergey Poznyakoff
a35935e973 (master-menu): New goal 2006-06-11 15:04:39 +00:00
Sergey Poznyakoff
e832cab432 New file 2006-06-11 15:04:17 +00:00
Sergey Poznyakoff
578f46309f Update 2006-06-10 09:55:20 +00:00
Sergey Poznyakoff
4396675861 Remove leftover include 2006-06-10 09:54:02 +00:00
Sergey Poznyakoff
a3dd97d9be Update 2006-06-09 13:55:36 +00:00
Sergey Poznyakoff
13adf3f762 Update 2006-06-09 13:50:20 +00:00
Sergey Poznyakoff
f1b1e9a476 Fix indentation, introduce end-of-format marker for texify.sed 2006-06-09 13:50:04 +00:00
Sergey Poznyakoff
fc4502c17e Update 2006-06-09 13:49:51 +00:00
Sergey Poznyakoff
0abf3a5ac9 Fix typo 2006-06-09 13:49:39 +00:00
Sergey Poznyakoff
19b36aaf60 Auxiliary script to convert ../src/tar.h to header.texi 2006-06-09 13:48:28 +00:00
Sergey Poznyakoff
9b44f8efed *** empty log message *** 2006-06-09 13:46:53 +00:00
Sergey Poznyakoff
97bfe578ed New file 2006-06-09 13:46:34 +00:00
Sergey Poznyakoff
fb88325f56 (tar_TEXINFOS): Add intern.texi
(EXTRA_DIST): Remove convtexi.pl, add texify.sed
2006-06-09 13:46:11 +00:00
Sergey Poznyakoff
a1b2406646 Update 2006-06-08 22:36:30 +00:00
Sergey Poznyakoff
5e14ef32c0 Minor fixes. 2006-06-08 22:35:52 +00:00
Sergey Poznyakoff
f9bd340c1b --checkpoint takes an optional argument specifying
number of records between two successive checkpoints (proposed
by Jason Armistead on 2004-06-22).Optional dot starting the
argument means "print dots instead of textual checkpoints".
(tar_help): New function
2006-06-08 22:35:39 +00:00
Sergey Poznyakoff
46defea70e (checkpoint_option): Change type to unsigned
(checkpoint_style): New variable.
2006-06-08 22:34:56 +00:00
Sergey Poznyakoff
5daab19c27 Implement more flexible checkpoint style 2006-06-08 22:34:38 +00:00
Sergey Poznyakoff
7214086d3d Update 2006-06-08 22:34:16 +00:00
Sergey Poznyakoff
93560dd669 Add Jason Armistead 2006-06-08 22:33:33 +00:00
Sergey Poznyakoff
c1f55f1c37 Update 2006-06-08 14:43:23 +00:00
Sergey Poznyakoff
2d2e1d411e (dumpdir_locate,obstack_code_rename,purge_directory): Re-implement renaming. Introduce
X control code.
(make_tmp_dir_name): Remove
2006-06-08 14:43:05 +00:00
Sergey Poznyakoff
5591fa407a Document dumpdir format 2006-06-08 14:42:20 +00:00
Sergey Poznyakoff
e2dbba2f07 (tar_TEXINFOS): Add dumpdir.texi 2006-06-08 14:42:07 +00:00
Sergey Poznyakoff
018de58373 New file 2006-06-08 14:41:56 +00:00
Sergey Poznyakoff
17111bef8f Add mkdtemp 2006-06-08 14:41:15 +00:00
Sergey Poznyakoff
3a9f2ea587 Update 2006-06-08 09:51:06 +00:00
Sergey Poznyakoff
02c7b862a3 (add_char_segment): Fix length assignement 2006-06-08 09:50:56 +00:00
Sergey Poznyakoff
9154c0c43b Update 2006-06-08 09:43:44 +00:00
Sergey Poznyakoff
5108a3dc41 Update 2006-06-08 09:34:03 +00:00
Sergey Poznyakoff
c52e5fc4e8 Update 2006-06-08 09:28:18 +00:00
Sergey Poznyakoff
0fc3177ed2 Update 2006-06-08 09:27:38 +00:00
Sergey Poznyakoff
6be1349236 (set_transform_expr,_transform_name_to_obstack): Implement NUMBER flag. 2006-06-08 09:27:25 +00:00
Sergey Poznyakoff
a2625311c8 Update 2006-06-07 14:57:57 +00:00
Sergey Poznyakoff
6e2760f7d7 Update 2006-06-07 14:57:29 +00:00
Sergey Poznyakoff
8b2f4ad670 (_transform_name_to_obstack,set_transform_expr): Implement case conversion operations (GNU extension). 2006-06-07 14:57:10 +00:00
Sergey Poznyakoff
d4c0836ec2 Update 2006-06-06 21:36:17 +00:00
Sergey Poznyakoff
40afe4d362 Update 2006-06-06 21:35:22 +00:00
Sergey Poznyakoff
435edb824e (transform_name_fp): Run fun even if _transform_name_to_obstack returns false. 2006-06-06 21:33:25 +00:00
Sergey Poznyakoff
9d2e8df195 Update 2006-06-06 21:30:26 +00:00
Sergey Poznyakoff
aa7476a68e Update 2006-06-03 20:53:17 +00:00
Sergey Poznyakoff
16c48ef8d0 Update 2006-06-02 15:07:00 +00:00
Sergey Poznyakoff
0da8aac59f Use genfile --files-from 2006-06-02 15:06:29 +00:00
Sergey Poznyakoff
bb6f707781 Fix typo in the comment 2006-06-02 15:06:19 +00:00
Sergey Poznyakoff
7cb01d37bb Add incr04.at 2006-06-02 15:06:10 +00:00
Sergey Poznyakoff
d79bbe0fd1 (set_transform_expr): New function 2006-06-02 15:05:52 +00:00
Sergey Poznyakoff
f984c43b82 Update 2006-06-02 15:05:36 +00:00
Sergey Poznyakoff
d75890c1b8 (options): Minor rewording 2006-06-02 10:54:05 +00:00
Sergey Poznyakoff
b3b4347821 Update 2006-06-02 10:42:25 +00:00
Sergey Poznyakoff
39080c7628 Update 2006-06-02 08:08:10 +00:00
Sergey Poznyakoff
c58063c17a New option --transform
New option --show-transformed-names generalizes
--show-stored-names. The latter is retained as an alias.
2006-06-02 08:06:46 +00:00
Sergey Poznyakoff
ae7bd36423 (print_header): Update displayable name selection. 2006-06-02 08:05:04 +00:00
Sergey Poznyakoff
973b611290 (extract_archive): safer_name_suffix and stripped_prefix_len are now called by decode_header 2006-06-02 08:04:37 +00:00
Sergey Poznyakoff
29fb7356df (dump_file0): Transform file name 2006-06-02 08:03:53 +00:00
Sergey Poznyakoff
bbee515590 (transform_name, transform_name_fp): New functions
(show_stored_names_option): Renamed to
show_transformed_names_option. All uses changed
2006-06-02 08:03:08 +00:00
Sergey Poznyakoff
c8aa01c80c New file 2006-06-02 08:02:24 +00:00
Sergey Poznyakoff
43ba23114f (tar_SOURCES): New module transform.c 2006-06-02 08:01:44 +00:00
Sergey Poznyakoff
7bfcbd6a27 Update 2006-06-02 08:01:33 +00:00
Sergey Poznyakoff
c5fd5f9e8d Update 2006-05-31 12:45:44 +00:00
Sergey Poznyakoff
a23a95b4a0 (make_directory): Fix initialization of struct directory. 2006-05-31 12:45:14 +00:00
Sergey Poznyakoff
19498c9172 Initialize AM_CPPFLAGS 2006-05-25 19:29:03 +00:00
Sergey Poznyakoff
edff149522 Update 2006-05-25 14:13:07 +00:00
Sergey Poznyakoff
f20e08dd45 (parse_opt): Add comment before --preserve case. 2006-05-25 14:12:51 +00:00
Sergey Poznyakoff
e6d15fc7af Updated 2006-05-25 14:12:35 +00:00
Sergey Poznyakoff
c96ba08e06 Update 2006-05-25 11:02:50 +00:00
Sergey Poznyakoff
6f89b1fce5 Document use of wildcards 2006-05-25 11:02:09 +00:00
Sergey Poznyakoff
93f8f6780a Update 2006-05-25 07:05:58 +00:00
Sergey Poznyakoff
75f37f4cef Make AT_SETUP more readable. 2006-05-25 07:05:41 +00:00
Sergey Poznyakoff
3947e63c25 (options): Move globbing-related options into a
separate group. Set -l as an alias to --check-links, as required
by UNIX98
(struct tar_args): New fields
wildcards,matching_flags,include_anchored
(MAKE_EXCL_OPTIONS,MAKE_INCL_OPTIONS): New macros
(parse_opt): Use x2nrealloc to grow archive_name_array.
Use MAKE_EXCL_OPTIONS,MAKE_INCL_OPTIONS to create appropriate
fnmatch options, and name_add_name,name_add_dir to handle member
name and -C arguments.
(decode_options): Likewise
(main): Remove call to init_names.
2006-05-25 07:05:28 +00:00
Sergey Poznyakoff
8b471d55ff Rewritten handling of member names in the command
line. Tar no longer attempts to guess globbing patterns, instead
it relies on --wildcard option.
(init_names): Removed.
(struct name_elt): New structure.
(name_array): Change type to struct name_elt. All references updated
(name_add_name,name_add_dir): New functions
(name_next_elt): New function
(name_next): Rewritten using name_next_elt.
(namelist_match): Rewritten pattern matching using
exclude_fnmatch.
(names_notfound): Warn if globbing patterns were used without
--wildcards option
2006-05-25 07:04:53 +00:00
Sergey Poznyakoff
c2c2df6c93 (dump_file,dump_file0): First argument is const char*. All callers updated. 2006-05-25 07:04:15 +00:00
Sergey Poznyakoff
cf857388c1 (struct name): Refactured
(warn_regex_usage): New variable.
(dump_file): First argument is const char*.
(name_init,name_add): Removed
(name_add_name,name_add_dir): New functions
(name_next): Return const char*.
2006-05-25 07:03:57 +00:00
Sergey Poznyakoff
9dfad74683 (AM_INIT_AUTOMAKE): Use tar-ustar option. Raise version requirement to 1.9 2006-05-25 07:03:30 +00:00
Sergey Poznyakoff
57267f7ed9 Update 2006-05-25 07:02:59 +00:00
Sergey Poznyakoff
476abe556b Update 2006-05-23 07:10:55 +00:00
Sergey Poznyakoff
fe72c79ad8 (change_tape_menu): Fix typo (uninitialized variable) introduced yesterday. 2006-05-23 07:10:34 +00:00
Sergey Poznyakoff
8fea578b22 Update 2006-05-22 10:02:32 +00:00
Sergey Poznyakoff
a46704b1bf (change_tape_menu): Break the loop after obtaining new archive name. Check for empty input line 2006-05-22 10:02:23 +00:00
Sergey Poznyakoff
6f8cbc5ca8 Use @var{file_name} instead of @var{file name} 2006-05-22 10:01:34 +00:00
Sergey Poznyakoff
c03131aba9 Update 2006-05-15 09:52:29 +00:00
Sergey Poznyakoff
c9195c75be (AT_TAR_CHECK): Declare expected failure if $XFAILFILE exists. 2006-05-15 09:52:16 +00:00
Sergey Poznyakoff
5632d195f5 Create $XFAILFILE on failure 2006-05-15 09:52:03 +00:00
Sergey Poznyakoff
ef90e05363 (XFAILFILE): New variable 2006-05-15 09:51:53 +00:00
Sergey Poznyakoff
939d63b92d Update 2006-05-13 14:03:46 +00:00
Sergey Poznyakoff
0ff13351f0 Update 2006-05-13 14:01:26 +00:00
Sergey Poznyakoff
c57418b462 New file 2006-05-13 14:01:13 +00:00
Sergey Poznyakoff
3c7dd57a17 Update 2006-05-13 13:58:59 +00:00
Sergey Poznyakoff
0b3fe146dd Update 2006-05-13 12:16:09 +00:00
Sergey Poznyakoff
90088ff00d Update 2006-05-13 12:02:58 +00:00
Sergey Poznyakoff
a183d6f7f5 Update 2006-05-13 12:00:06 +00:00
Sergey Poznyakoff
4883aab47d (AT_STAR_PREREQ): Provide md5 sum. 2006-05-13 11:59:51 +00:00
Sergey Poznyakoff
30873dbd97 Add keywords. 2006-05-13 11:59:36 +00:00
Sergey Poznyakoff
74849d8119 (AT_TARBALL_PREREQ): New defun
(AT_STAR_PREREQ): Rewrite using tarball_prereq
Include chtype.at and volsize.at
2006-05-13 11:59:08 +00:00
Sergey Poznyakoff
3962eb6a3e (TEST_DATA_URL,STAR_DATA_URL)
(STAR_TESTSCRIPTS): Provide default values.
(tarball_prereq): New function
2006-05-13 11:58:41 +00:00
Sergey Poznyakoff
c99076e925 (TESTSUITE_AT): Add chtype.at, volsize.at
(check-full): New target
2006-05-13 11:58:16 +00:00
Sergey Poznyakoff
6315d1700b (read_header_primitive): New function
(read_header): Front end for read_header_primitive
2006-05-13 11:57:52 +00:00
Sergey Poznyakoff
520104f5f8 (extract_volhdr): New function
(prepare_to_extract): Use extract_volhdr as extractor for volume
names.
2006-05-13 11:57:36 +00:00
Sergey Poznyakoff
34e5f66589 (read_header_primitive): New function 2006-05-13 11:57:20 +00:00
Sergey Poznyakoff
d2b3114a3b (read_header0): Use read_header_primitive to avoid clubbering current_tar_info. All callers updated. 2006-05-13 11:57:06 +00:00
Sergey Poznyakoff
2b27e8de1f Update 2006-05-13 11:56:51 +00:00
Sergey Poznyakoff
a85cfd69e3 (find_directory_meta): Bugfix 2006-05-13 08:38:12 +00:00
Sergey Poznyakoff
4b951034f3 Update 2006-05-08 12:48:27 +00:00
Sergey Poznyakoff
1524831224 Call AT_SORT_PREREQ. Remove fd 2 redirection after sort invocations 2006-05-08 12:46:41 +00:00
Sergey Poznyakoff
ee6f14194d Call AT_UNPRIVILEGED_PREREQ 2006-05-08 12:46:16 +00:00
Sergey Poznyakoff
ac7f4e853d (AT_SORT_PREREQ, AT_UNPRIVILEGED_PREREQ): New defines 2006-05-08 12:46:01 +00:00
Sergey Poznyakoff
47dd75e87b Update 2006-05-08 12:12:45 +00:00
Sergey Poznyakoff
6054b5e9d5 (AT_KEYWORDS): Add missing incremental kw 2006-05-08 12:12:09 +00:00
Sergey Poznyakoff
edd6df370d Update for the new behavior 2006-05-08 12:11:53 +00:00
Sergey Poznyakoff
fd89d5a3cd Add incr03.at,rename01.at,rename02.at,rename03.at 2006-05-08 12:11:43 +00:00
Sergey Poznyakoff
71f2e412ae New testcase 2006-05-08 12:11:26 +00:00
Sergey Poznyakoff
67877f7de2 (collect_and_sort_names): Update dir_contents of the first non-fake name entry when in listed incremental mode. 2006-05-08 12:10:36 +00:00
Sergey Poznyakoff
c9e7465642 (struct directory.contents, flags): New members
(nfs,found,new): Remove. Replaced by appropriate bitmask values in
`flags' field. All uses updated.
(directory_meta_table): New table.
(hash_directory): Rename to hash_directory_name
(compare_directories): Rename to compare_directory_names
(hash_directory_meta,compare_directory_meta,find_directory_meta):
New functions
(compare_dirents): Removed
(note_directory): Get 7th argument: directory contents.
All callers updated
(dumpdir_locate,makedumpdir): New functions
(scan_directory): Rewritten. Use makedumpdir to create a sorted
dumpdir array. This makes the obstack argument unnecessary. Besides,
ALL_CHILDREN flag is set only for new directories.
(procdir): Change return type to struct directory. Return
immediately if the directory was already initialized. Discover
directory renames using directory_meta_table.
(append_incremental_renames): New function.
(read_directory_file, write_directory_file): Use new snapshot file
format.
2006-05-08 12:10:14 +00:00
Sergey Poznyakoff
a0b4431f26 (rename_directory): New function 2006-05-08 12:09:46 +00:00
Sergey Poznyakoff
192ac7136a (rename_directory,append_incremental_renames): New functions. 2006-05-08 12:09:35 +00:00
Sergey Poznyakoff
c2775aedf1 Raise version number to 1.15.91 2006-05-08 12:09:15 +00:00
Sergey Poznyakoff
f1fe157dfe Update 2006-05-08 12:09:07 +00:00
Sergey Poznyakoff
dd197c5ccb Update 2006-05-02 19:16:23 +00:00
Sergey Poznyakoff
c576ac1354 Always use genfile --file, this enables extra error checking. 2006-05-02 19:16:12 +00:00
Sergey Poznyakoff
53d1279719 Attempt to extract a member with truncated file name from the archive. 2006-05-02 19:15:50 +00:00
Sergey Poznyakoff
729b91adb1 (try_new_volume): Attempt to continue if the name is apparently truncated in a GNU format volume. 2006-05-02 19:15:35 +00:00
Sergey Poznyakoff
dc7c0f1309 Update 2006-05-02 16:33:10 +00:00
Sergey Poznyakoff
783e58b394 (_open_archive): Remove unnecessary argument to check_compressed_archive. 2006-05-02 16:32:40 +00:00
Sergey Poznyakoff
c0e5268e75 Update 2006-04-25 17:27:03 +00:00
Sergey Poznyakoff
1518cef987 (@copying): Remove the reference to not existing invariant section. 2006-04-25 17:26:30 +00:00
Sergey Poznyakoff
8dd9a2105e Skip the test if the file system does not support sparse files. 2006-04-25 17:23:35 +00:00
Sergey Poznyakoff
9ec31e3438 Update 2006-04-11 12:02:27 +00:00
Sergey Poznyakoff
d4a41d5311 New testcase 2006-04-11 12:01:28 +00:00
Sergey Poznyakoff
a46e6aa4dc Include extrac06.at 2006-04-11 12:01:02 +00:00
Sergey Poznyakoff
b4d40436fd (TESTSUITE_AT): Add extrac06.at 2006-04-11 12:00:37 +00:00
Sergey Poznyakoff
f97d80335a (directory.new): New member
(note_directory,find_directory: Use make_directory to create
struct directory entries
(procdir): Avoid duplicating  directories in the incremental
backup map.
2006-04-11 12:00:23 +00:00
Sergey Poznyakoff
90b061cf55 Minor changes 2006-04-11 11:59:54 +00:00
Sergey Poznyakoff
8300c820d5 (extract_dir): Fix toggling existing directory
permissions. Use parts of patch provided by Ian Jackson
<iwj@ubuntu.com>.
2006-04-11 11:59:40 +00:00
Paul Eggert
e0b3fc61e1 * tests/atlocal.in (PATH): Add build-aux from the source tree,
not the build tree.
2006-03-19 04:04:54 +00:00
Sergey Poznyakoff
533854fd45 Update 2006-03-13 09:46:52 +00:00
Sergey Poznyakoff
e99d4f83df Add Benno Schulenberg 2006-03-13 09:44:15 +00:00
Sergey Poznyakoff
b8d5835375 Sort the two lines of stderr from the
first `tar -v --listed-incremental'.  They would come out
reversed and provoke a test failure on a tmpfs
file system.
2006-03-13 09:43:37 +00:00
Sergey Poznyakoff
61dd37ec86 (options): Consistently begin help messages with a lowercase letter. 2006-03-13 09:42:55 +00:00
Sergey Poznyakoff
48d20d8f9e Minor fixes. 2006-03-13 09:42:22 +00:00
Sergey Poznyakoff
adbbde5d4f Update 2006-03-11 22:42:46 +00:00
Sergey Poznyakoff
208389f3ad (AM_CPPFLAGS): Define LOCALEDIR 2006-03-11 22:42:07 +00:00
Paul Eggert
db0f0804f5 Remove unistd_.h from lib/.cvsignore. 2006-03-08 02:00:47 +00:00
Paul Eggert
18486cf8d7 * src/buffer.c (record_buffer_aligned): New var.
(init_buffer): Use it to ensure that the buffer is aligned.
This doesn't result in any measurable performance improvement
on my host (Debian GNU/Linux 3.1 stable, with default block size),
but I assume it does help on some hosts.
2006-03-08 00:55:56 +00:00
Paul Eggert
6c1020d386 * lib/.cvsignore: Add unistd_.h. Sort. 2006-03-08 00:23:34 +00:00
Sergey Poznyakoff
38c0884898 Update 2006-03-04 09:58:26 +00:00
Sergey Poznyakoff
7bcb876c5a Use -f - to read from stdin. 2006-03-04 09:57:44 +00:00
Sergey Poznyakoff
dfd5ec2519 Update 2006-02-21 07:10:52 +00:00
Sergey Poznyakoff
e81556858b Fix typo: --to-command instead of --to-program 2006-02-21 07:09:39 +00:00
Paul Eggert
92554b7c94 * tests/multiv04.at (split directory members in a MV archive):
Don't use %X in an awk printf format; this doesn't work with
Solaris 10 /usr/bin/awk.  Use %x instead.
2006-02-21 05:55:28 +00:00
Sergey Poznyakoff
631de61428 Fix copyright years 2006-02-20 10:01:47 +00:00
Sergey Poznyakoff
8bfefd8854 Uniformly start all test titles with a lower case letter 2006-02-20 10:00:48 +00:00
Sergey Poznyakoff
f7a29307e2 Update 2006-02-20 09:45:23 +00:00
Sergey Poznyakoff
66ef04d4c8 New test 2006-02-20 09:43:58 +00:00
Sergey Poznyakoff
b6ffcac4db (AT_TAR_MKHIER): New macro
(lustar01.at,lustar02.at,lustar03.at): New tests.
2006-02-20 09:43:00 +00:00
Sergey Poznyakoff
28698a5334 Reword test title 2006-02-20 09:42:28 +00:00
Sergey Poznyakoff
e304b58fff Remove mkhier, use AT_TAR_MKHIER instead 2006-02-20 09:42:08 +00:00
Sergey Poznyakoff
c532f12464 Add build-aux to the PATH 2006-02-20 09:41:56 +00:00
Sergey Poznyakoff
9fdd5baa0c (lustar01.at,lustar02.at,lustar03.at): New tests. 2006-02-20 09:41:43 +00:00
Sergey Poznyakoff
31ef7e3afb (split_long_name): Fix maximum length estimation. Patch by Jim Lowe. 2006-02-20 09:41:29 +00:00
Paul Eggert
f2bf9f2ffa Avoid installation glitches on Solaris 8 with Sun C 5.4.
* lib/.cvsignore: Add system-ioctl.h.
* lib/Makefile.tmpl (noinst_HEADERS): Add system-ioctl.h.
* src/buffer.c: Include system-ioctl.h.
* src/compare.c: Likewise.
* src/delete.c: Likewise.
* src/system.c: Include <getline.h>, <setenv.h>.
* src/tar.c: Include <getline.h>.
2006-02-20 08:15:31 +00:00
Paul Eggert
cad45a0bae * bootstrap: Don't claim lib/Makefile.am is generated automatically
from itself.
2006-02-20 08:14:21 +00:00
Sergey Poznyakoff
f6ede25815 Update 2006-02-19 21:13:22 +00:00
Sergey Poznyakoff
476019d083 (new_volume): Prompt the user for archive name if unable to open next archive. 2006-02-19 21:12:50 +00:00
Sergey Poznyakoff
cf440a191f Update 2006-02-19 20:37:14 +00:00
Sergey Poznyakoff
588f444efe (add_chunk_header): Free st.orig_file_name after calling finish_header() 2006-02-19 20:36:31 +00:00
Sergey Poznyakoff
b4051cb07c Updated 2006-02-19 19:28:47 +00:00
Sergey Poznyakoff
5032e08eb9 Raise version number to 1.15.90 2006-02-19 19:28:17 +00:00
Sergey Poznyakoff
36f41eabf4 (dump_file0): Restore file_count_links,accidentally removed on 2005-11-29. 2006-02-19 19:27:28 +00:00
Sergey Poznyakoff
108edf3692 Updated 2006-02-08 21:34:44 +00:00
Sergey Poznyakoff
780cf6f079 (tar_set_quoting_style): Provide second argument to the format spec: program_invocation_short_name. Reported by Jim Meyering. 2006-02-08 21:34:15 +00:00
Paul Eggert
84378fa99a * gnulib.modules: Add closeout, exitfial.
* lib/.cvsignore: Add __fpending.c, __fpending.h, closeout.c,
closeout.h.
* src/buffer.c: Incluse closeout.h.
(_open_archive): Use freopen rather than fopen, so
that stdlis is always either stdout or stderr.  Use
close_stdout_set_file_name to report its name.
* src/tar.c: Include closeout.h and exitfail.h.
(parse_opt, usage): Call close_stdout as appropriate, to check for
write errors.
(decode_options): Exit with status TAREXIT_FAILURE, not 1.
(main): Set exit_failure, to exit with proper status on memory
allocation failure and the like.
Use close_stdout rather than rolling our own test.
2006-02-07 23:51:37 +00:00
Paul Eggert
78b078b455 * NEWS: --version now outputs copyright etc., to conform to the
GNU coding standards.  Remove --license.
* gnulib.modules: Add version-etc-fsf.
* doc/tar.texi: Document the change.
* lib/.cvsignore: Add version-etc-fsf.c, version-etc.c, version-etc.h.
* scripts/Makefile.am (SED_CMD): Update PAKCAGE_NAME, not PACKAGE.
* scripts/backup.in: Remove --license.  Change --version to conform
to GCS.
* scripts/restore.in: Likewise.
* scripts/backup.sh.in (license): Output briefer license in the
style of coreutils, for consistency with other changes.
* src/tar.c: Include <version-etc.h>.
(LICENSE_OPTION): Remove.
(options): Remove --license.
(license): Remove.
(parse_opt): Use version_etc instead of rolling it ourselves.
Remove --license.
* tests/version.at (tar --version): Check only the first line of
output.
2006-02-07 22:18:36 +00:00
Paul Eggert
e86e864544 Update copyright year to 2006. 2006-02-07 20:55:49 +00:00
Sergey Poznyakoff
d21d48dfba Update 2006-02-07 13:58:03 +00:00
Sergey Poznyakoff
cf1e8b086b (sparse_map_decoder): Fix misleading diagnostic. 2006-02-07 13:57:41 +00:00
Sergey Poznyakoff
6912b7fb15 Update 2006-01-31 11:28:59 +00:00
Sergey Poznyakoff
6c28751ca7 (struct tar_stat_info): New members is_dumpdir and skipped. 2006-01-31 11:28:45 +00:00
Sergey Poznyakoff
0e848e7b2c (list_archive): Use is_dumpdir
Do not wrap skip_member in mv_begin/mv_end, the function itself
takes care of it.
(decode_header): Set stat_info->is_dumpdir
(skip_member): Do nothing if skipped is true
2006-01-31 11:28:32 +00:00
Sergey Poznyakoff
ab8a184336 (get_gnu_dumpdir): Static
(is_dumpdir): New function
(purge_directory): Use is_dumpdir
2006-01-31 11:28:07 +00:00
Sergey Poznyakoff
48ce2946d9 (prepare_to_extract): Use is_dumpdir member to check for dumpdirs. 2006-01-31 11:27:41 +00:00
Sergey Poznyakoff
dde5c2391b (get_gnu_dumpdir): Remove prototype
(is_dumpdir): New function
2006-01-31 11:27:14 +00:00
Sergey Poznyakoff
860577ee0e Update 2006-01-21 23:39:52 +00:00
Sergey Poznyakoff
a349bd80b9 (decode_options): Refuse using --delete with compression options 2006-01-21 23:39:20 +00:00
Sergey Poznyakoff
ba10157a0c Update 2006-01-18 15:36:23 +00:00
Sergey Poznyakoff
514ea6ead4 Implement new options --quoting-style, --quote-chars and --no-quote-chars. 2006-01-18 15:36:15 +00:00
Sergey Poznyakoff
6a97a00688 Initial documentation for --quoting-style, --quote-chars and --no-quote-chars option. 2006-01-18 15:36:01 +00:00
Sergey Poznyakoff
7d822e225e (DEFAULT_QUOTING_STYLE): New configuration variable 2006-01-18 15:35:44 +00:00
Sergey Poznyakoff
38f08784bc Updated 2006-01-18 15:35:34 +00:00
Paul Eggert
c17a9f91d0 * bootstrap: Default to pserver, and switch to cvs.sv.gnu.org,
to accommodate recent changes to the GNU CVS server.
2006-01-09 22:53:55 +00:00
Paul Eggert
0f4660c786 Add argp-pin.c, mkdirat.c, openat-priv.h. 2006-01-09 22:52:34 +00:00
Sergey Poznyakoff
5e01ba7dbe Update 2005-12-14 13:00:23 +00:00
Sergey Poznyakoff
288315211a Update invocations of name_scan. 2005-12-14 12:58:56 +00:00
Sergey Poznyakoff
dacac1b6be (name_scan): Change prototype. 2005-12-14 12:58:34 +00:00
Sergey Poznyakoff
85cf996677 (name_scan): Take an additional argument requesting the exact matching. 2005-12-14 12:58:22 +00:00
Sergey Poznyakoff
6cbd7e1608 Update 2005-12-13 13:33:21 +00:00
Sergey Poznyakoff
b794387cba (addname,add_hierarchy_to_namelist): Initialize explicit member appropriately. 2005-12-13 13:32:29 +00:00
Sergey Poznyakoff
91abd3da82 (procdir): If name_scan() returns something, check if it was explicitely given in the command line 2005-12-13 13:32:14 +00:00
Sergey Poznyakoff
5b3dc9e3dd (struct name): New member explicit'. Remove unused member isdir' 2005-12-13 13:31:56 +00:00
Sergey Poznyakoff
d3e525009d Update 2005-12-12 22:56:25 +00:00
Sergey Poznyakoff
86ef91adff If --one-file-system is given and a
directory is found to be on another device, *and* this directory
is explicitely given in the command line, then do not omit it.
2005-12-12 22:55:39 +00:00
Sergey Poznyakoff
a92a8ff22d Update 2005-12-11 14:12:54 +00:00
Sergey Poznyakoff
1cdb7823ae (options,parse_opt): New options --delay-directory-restore and --no-delay-directory-restore 2005-12-11 14:12:12 +00:00
Sergey Poznyakoff
e73e4428e2 (directories_first): Replaced by delay_directory_restore_option. All uses changed. 2005-12-11 14:11:41 +00:00
Sergey Poznyakoff
d2dd096f1d (delay_directory_restore_option): New global. 2005-12-11 14:11:16 +00:00
Sergey Poznyakoff
fb0a0aaf52 Document --delay-directory-restore option.
(Configuring Help Summary): Document usage of ARGP_HELP_FMT
variable to customize help output.
2005-12-11 14:10:53 +00:00
Sergey Poznyakoff
d102bc35a5 Update 2005-12-11 14:10:05 +00:00
Sergey Poznyakoff
bb8c1d6a72 Update 2005-12-09 10:05:10 +00:00
Sergey Poznyakoff
f03fc1e078 (read_directory_file): Fix format string 2005-12-09 10:05:02 +00:00
Sergey Poznyakoff
273810a9f7 (to_chars_subst): Remove unused variable
Make sure useful result code is returned.
2005-12-09 10:04:52 +00:00
Sergey Poznyakoff
69abc76d13 (set_file_atime): Add prototype. 2005-12-09 10:04:38 +00:00
Sergey Poznyakoff
12cd9cea81 (open_archive): Add default case to shut up gcc. 2005-12-09 10:04:26 +00:00
Sergey Poznyakoff
bfa1bba5fd Fix typo 2005-12-08 15:55:53 +00:00
Sergey Poznyakoff
09b46a0b47 Update 2005-12-08 15:41:38 +00:00
Sergey Poznyakoff
a169d65b94 (gid_to_chars, major_to_chars, minor_to_chars)
(mode_to_chars, off_to_chars, size_to_chars, time_to_chars)
(uid_to_chars, uintmax_to_chars): Return bool
(to_chars): Return bool
(start_header): Check return values of convertion routines. Fail
if unable to store data in the header.
2005-12-08 15:41:28 +00:00
Sergey Poznyakoff
89e65f936d (gid_to_chars, major_to_chars, minor_to_chars)
(mode_to_chars, off_to_chars, size_to_chars, time_to_chars)
(uid_to_chars, uintmax_to_chars): Return bool
2005-12-08 15:41:11 +00:00
Sergey Poznyakoff
c9ac15ae0f (Current status): Renamed to 'Changes' and moved to
appendices.
(Large or Negative Values): Rewritten
2005-12-08 15:40:52 +00:00
Sergey Poznyakoff
67770b89f2 Change permissions in the sample outputs to more usual ones 2005-12-07 16:17:44 +00:00
Sergey Poznyakoff
f3e6ea7d49 Updated 2005-12-07 15:12:38 +00:00
Sergey Poznyakoff
0d2cdcb797 Remove @set's 2005-12-07 15:12:00 +00:00
Sergey Poznyakoff
49e7ba5b17 Following the discussion with Karl Berry,
discontinue using @value{} substitutions for Texinfo commands.
Properly index all long options. Print a
separate long option index.
2005-12-07 15:11:45 +00:00
Sergey Poznyakoff
3f6d87a61c Update 2005-12-07 09:43:09 +00:00
Sergey Poznyakoff
80855932f0 Resolve some more FIXMEs 2005-12-07 09:42:30 +00:00
Sergey Poznyakoff
9e50e81558 Fix typosin the recent entry 2005-12-07 08:40:46 +00:00
Sergey Poznyakoff
02ec34f473 Update 2005-12-06 23:18:20 +00:00
Sergey Poznyakoff
075c726752 Update 2005-12-06 23:16:10 +00:00
Sergey Poznyakoff
2e7a943d0e (options): Add --restrict option. Use macros for option grouping.
(license): Print full list of copyright years
2005-12-06 23:15:41 +00:00
Sergey Poznyakoff
4ba3b41e2e (sys_exec_info_script): The script can supply new
archive name to use by writing it to file descriptor 3.
2005-12-06 23:15:14 +00:00
Sergey Poznyakoff
4669306854 (sys_exec_info_script): Update delaration
(restrict_option): New global
2005-12-06 23:14:56 +00:00
Sergey Poznyakoff
ffc4fb7bdd (new_volume): Update invocation
(change_tape_menu): New function. Disable '!' command if given
--restrict option.
2005-12-06 23:14:44 +00:00
Sergey Poznyakoff
c7ab8eaba4 Use TAR_VOLUME instead of reading volno file. 2005-12-06 23:13:28 +00:00
Sergey Poznyakoff
3f166ce0f5 Update --info-scripts documentation 2005-12-06 23:13:19 +00:00
Paul Eggert
ac74317f46 * configure.ac (DENSITY_LETTER): Fix m4 overquoting.
* .cvsignore: Ignore .bootstrap.
2005-12-06 21:43:17 +00:00
Sergey Poznyakoff
ce522dce26 Update 2005-12-06 16:33:17 +00:00
Sergey Poznyakoff
f018d69aac (archive_format_string): Remove static qualifier.
(subcommand_string): New function.
2005-12-06 16:32:37 +00:00
Sergey Poznyakoff
ea019af0cc (sys_exec_info_script): New function. 2005-12-06 16:32:17 +00:00
Sergey Poznyakoff
0251059267 (archive_format_string,subcommand_string,sys_exec_info_script): New prototypes. 2005-12-06 16:32:05 +00:00
Sergey Poznyakoff
13d43c302f (new_volume): Use sys_exec_info_script() instead of system(). 2005-12-06 16:31:49 +00:00
Sergey Poznyakoff
a5da71b142 Document --to-command and --info-script options. Add missing xrefs. 2005-12-06 16:31:37 +00:00
Sergey Poznyakoff
853edfaff4 Update 2005-12-01 14:51:19 +00:00
Sergey Poznyakoff
ca43ee9769 Obtain root_device here, to make sure it works correctly with -C. 2005-12-01 14:50:57 +00:00
Sergey Poznyakoff
888b0d82b7 Update 2005-12-01 12:58:17 +00:00
Sergey Poznyakoff
b84053c7be Add Guerkan Karaman 2005-12-01 12:57:50 +00:00
Sergey Poznyakoff
c040cabb98 Add incr02.at 2005-12-01 12:51:58 +00:00
Sergey Poznyakoff
ae00dc0d37 (purge_directory): Skip the member and return if the archive is not in incremental format. 2005-12-01 12:51:20 +00:00
Sergey Poznyakoff
5249a99377 Fix restoring of directory timestamps from
incremental archives.
(directories_first): New variable.
(prepare_to_extract): Set directories_first
(extract_archive): Call apply_nonancestor_delayed_set_stat() only
if not extracting from an incremental archive
2005-12-01 12:50:58 +00:00
Paul Eggert
2edff367d9 * doc/tar.texi (Option Summary): Rewrite the
--atime-preserve=system description in response to Ian Turner's
proposed patch.
* doc/tar.texi (Extracting Specific Files): Remove obsolescent
FIXME.
2005-12-01 00:18:05 +00:00
Paul Eggert
f8f4f49011 (parse_opt): Remove bogus \n in new atime diagnostic. 2005-11-29 19:41:34 +00:00
Paul Eggert
3fbdf738de * lib/.cvsignore: Add malloc.h, regcomp.c, regex.c, regex.h,
regex_internal.c, regex_internal.h, regexc.c; used by rpmatch.
2005-11-29 19:39:06 +00:00
Paul Eggert
7209cbed6c * THANKS: Add Ian Turner. 2005-11-29 19:26:13 +00:00
Paul Eggert
aa976a5170 * NEWS: New option --atime-preserve=system, which uses O_NOATIME.
* configure.ac: Prefer AC_CHECK_HEADERS_ONCE to AC_CHECK_HEADERS.
Check for stropts.h and sys/filio.h too, for _FIOSATIME.
* doc/tar.texi: Change "modification time" to "data modification
time", "change time" to "status change time", and "filesystem" to
"file system", so that we use terminology consistent with POSIX.
Use American spacing rather than French for sentence ends.
"non-dependable" -> "undependable".
(Option Summary, Attributes): Explain better the pitfalls of the
--atime-preserve option, and suggest read-only mounts,loopback
mounts, and noatime mounts for older systems.
* doc/value.texi (op-atime-preserve-system): Renamed from
op-atime-preserver-system to fix a misspelling.
* src/common.h (enum atime_preserve): Use lower case for enum values.
* src/compare.c: Don't include utimens.h; no longer needed.
(diff_file): Use set_file_atime rather than utimens; avoid closing
diff_handle until after this, so that we can set the file time stamp
via the file descriptor rather than via its name.
* src/create.c: Don't include utimens.h; no longer needed.
(dump_regular_finish): Remove.  All callers now do its work inline.
(dump_dir): New arg FD.  All callers changed.
Use fdsavedir rather than savedir.
(unknown_file_error): Arg is a const pointer now.
(dump_file0): 2nd arg is a const pointer now.
Treat directories more like files, with respect to --atime-preserve.
For example, also warn if a directory changes while we are dumping it.
Prefer file descriptors to file names when retrieving/setting file
attributes; this saves path-resolution time and allows us to avoid
changing mtime/ctime on Solaris when restoring atime as root.
Use O_DIRECTORY when opening directories, to avoid some race conditions.
Do not reset atime if mtime has changed.  Report an error if
we cannot reset atime.

First cut at adding support for --atime-preserve=system.
* doc/tar.texi (Option Summary): First cut at documenting it.
All other uses of --atime-preserve changed to --atime-preserve=replace.
* doc/value.texi (op-atime-preserve-replace, op-atime-preserver-system):
New.
(op-atime-preserve): Mention METHOD.
* src/common.h (atime_preserve): New enum.
(atime_preserve_option): Now of the enum type rather than bool.
All uses changed.
* src/compare.c (diff_file): Read with O_NOATIME if asked for.
* src/create.c (dump_file0): Read regular and CTG files with O_NOATIME
if asked for.
* src/tar.c (usage): Mention new usage.
(parse_opt): Parse new usage.
2005-11-29 19:14:21 +00:00
Paul Eggert
7b00db5675 Convert back to UTF-8, sort (using LC_ALL=en_US.UTF-8
on Debian stable), and consistently use tabs rather than spaces.
2005-11-29 18:53:34 +00:00
Sergey Poznyakoff
36be286c03 Update 2005-11-27 12:00:42 +00:00
Sergey Poznyakoff
d543d2dbbd Remove prematurely introduced parts of new MV format support 2005-11-27 11:59:34 +00:00
Sergey Poznyakoff
5df61b429a Update 2005-11-26 19:32:55 +00:00
Sergey Poznyakoff
9590e781c0 (xheader_format_name): Fix memory leak. 2005-11-26 19:31:02 +00:00
Sergey Poznyakoff
87dfaf3176 Update 2005-11-11 12:18:14 +00:00
Sergey Poznyakoff
c81a5e8bf5 Close stdin so that if something fails causing tar to ask for the next volume, it won't hang the testsuite. 2005-11-11 12:17:38 +00:00
Sergey Poznyakoff
b5775215d7 (confirm): Rewritten using rpmatch.
(decode_options): Minor optimizations
(main): Call stdopen() to ensure the first three descriptors are
open.
2005-11-11 12:17:10 +00:00
Sergey Poznyakoff
df970c7332 Add rpmatch.c 2005-11-11 12:16:41 +00:00
Sergey Poznyakoff
f1f3b524f6 Add stdopen, imported from coreutils. 2005-11-11 12:16:28 +00:00
Sergey Poznyakoff
575ea074cc Add rpmatch 2005-11-11 12:15:46 +00:00
Sergey Poznyakoff
6204e3c718 Updated 2005-11-11 00:28:27 +00:00
Sergey Poznyakoff
ecce6f3e9a (Tarcat): New node 2005-11-11 00:27:58 +00:00
Sergey Poznyakoff
85890103ae Handle archives in pax format. Improve handling of traditional archives. 2005-11-11 00:27:21 +00:00
Sergey Poznyakoff
7e51be5fe2 Update 2005-11-11 00:26:39 +00:00
Sergey Poznyakoff
05ba292a93 (AT_TAR_CHECK): Define TEST_TAR_FORMAT 2005-11-11 00:26:18 +00:00
Sergey Poznyakoff
1ebdd88caf (xheader_format_name): Remove static
qualifier. Change last argument.
Correct buffer size calculation (allocated too much space).
(xheader_write): Increase global_header_count here ...
(xheader_write_global): ... instead of here
2005-11-11 00:26:09 +00:00
Sergey Poznyakoff
b6d3432810 (write_extended): Change type and meaning of the first argument. All callers updated 2005-11-11 00:25:41 +00:00
Sergey Poznyakoff
1e8f6d41c4 (flush_read,flush_write): Functions, again.
(write_extended): Changed declaration
(xheader_format_name): New declaration
2005-11-11 00:25:20 +00:00
Sergey Poznyakoff
5b1df7b55e (flush_write,flush_read): Change data type.
(flush_archive): Compute actual buffer fill level before calling
low level function.
(close_archive): Call flush_archive again if the first call
resulted in partially filled buffer.
(try_new_volume): Rewritten handling of initial headers.
(add_chunk_header): New function. Write an additional header
before the continuation chunk. The purpose of the header is to
allow third-party tars to extract the member.
(simple_flush_write): Take an argument.
(_gnu_flush_write): Correctly handle partially filled buffers.
2005-11-11 00:24:52 +00:00
Sergey Poznyakoff
692f449623 Updated 2005-11-10 13:01:34 +00:00
Sergey Poznyakoff
5f060c2025 Add new test cases 2005-11-10 13:00:11 +00:00
Sergey Poznyakoff
d1867fd76c (xhdr_tab): New keyword GNU.volume.filename. 2005-11-10 12:59:38 +00:00
Sergey Poznyakoff
813aa07a89 Do not pad compressed output if it goes to stdout. 2005-11-10 12:59:25 +00:00
Sergey Poznyakoff
9a42d94543 (sparse_dump_region): Call mv_size_left.
(sparse_dump_file): Enclose the loop in mv_begin/mv_end.
2005-11-10 12:59:13 +00:00
Sergey Poznyakoff
b9b37ee191 (try_new_volume): Bugfix. Always check
continued_file_name. If it is absent, the volume is out
of sync.
(add_multi_volume_header): Create GNU.volume.filename keyword in
the extended header.
2005-11-10 12:58:43 +00:00
Sergey Poznyakoff
04549e1f21 Update 2005-11-09 13:13:00 +00:00
Sergey Poznyakoff
f3a24a7a51 (AT_KEYWORDS): Improve to allow executionof related tests in groups. 2005-11-09 13:09:44 +00:00
Sergey Poznyakoff
e1286c1989 (xhdr_tab): Support for new GNU keywords. 2005-11-09 13:09:25 +00:00
Sergey Poznyakoff
5eecc4c994 (decode_options): Allow to use --multi-volume and --label with pax archives. 2005-11-09 13:09:12 +00:00
Sergey Poznyakoff
cb3d8b0db9 Use mv_.* functions where necessary. 2005-11-09 13:08:55 +00:00
Sergey Poznyakoff
52429bb956 Use mv_.* functions uniformly instead of fiddling with the global variables. 2005-11-09 13:08:42 +00:00
Sergey Poznyakoff
7200f4f5f7 (save_name,save_sizeleft,save_totsize): Remove
globals.
(volume_label,continued_file_name,continued_file_size): New
variables.
(flush_read,flush_write): Pointers to functions
(mv_begin,mv_end,mv_total_size,mv_size_left): New functions
(write_extended): New function.
2005-11-09 13:08:13 +00:00
Sergey Poznyakoff
737b0251de Rewritten in a more modular fashion to provide
GNU extensions (multi-volume archives and archive labels) in
pax format.
(volume_label,continued_file_name,continued_file_size)
(continued_file_offset): New globals.
(save_name,save_totsize,save_sizeleft): Make static
(mv_begin,mv_end,mv_total_size,mv_size_left): New functions
(open_archive,flush_write,flush_read): Rewritten
2005-11-09 13:07:45 +00:00
Sergey Poznyakoff
48d508b78b Update 2005-11-09 13:07:26 +00:00
Paul Eggert
57c2124d68 * src/tar.c (NS_PRECISION_FORMAT_MASK): New macro.
(tar_timespec_cmp): New function. Wrapper over
timespec_cmp using the timespec precision provided by the
current archive format.
* src/common.h (tar_timespec_cmp): New declaration.
* src/compare.c (diff_file): Use tar_timespec_cmp.
* src/extract.c (file_newer_p): Likewise.
* src/update.c (update_archive): Likewise.
* tests/truncate.at: Reverted changes
* tests/update.at: Reverted changes
2005-11-08 07:20:02 +00:00
Paul Eggert
06379466c1 (xheader_store): Last arg is void const *. 2005-11-07 05:11:55 +00:00
Paul Eggert
3eec6b3f46 (xheader_store): Last arg here is void const *, too. 2005-11-07 05:11:40 +00:00
Paul Eggert
60f8dd83b8 (struct xhdr_tab.coder): Last arg is void const *,
not void *, to avoid create.c warning from GCC "passing argument 3
of 'xheader_store' discards qualifiers from pointer target type".
(dummy_coder, atime_coder, gid_coder, gname_coder, linkpath_coder):
(ctime_coder, mtime_coder, path_coder, size_coder, uid_coder):
(uname_coder, sparse_size_coder, sparse_numblocks_coder):
(sparse_offset_coder, sparse_numbytes_coder, dumpdir_coder):
Likewise.
2005-11-07 05:03:09 +00:00
Paul Eggert
cfbf693855 * tests/truncate.at: Create files whose time stamps must fall on
1-second boundaries.  This prevents tests from failing on hosts
like Solaris 8 that have nanosecond-resolution file time stamps.
* tests/update.at: Likewise.
2005-11-07 04:03:29 +00:00
Sergey Poznyakoff
35f5b48815 Update 2005-11-07 02:55:25 +00:00
Sergey Poznyakoff
374ae10d39 (xheader_keyword_deleted_p): Remove static
qualifier.
(struct xhdr_tab.decoder): Change prototype. POSIX allows string
values to contain embedded nulls, so take an extra argument
specifying the length of the string.
(decx,decg,dummy_decoder,atime_decoder,gid_decoder)
(gname_decoder,linkpath_decoder,ctime_decoder,mtime_decoder)
(path_decoder,size_decoder,uid_decoder,uname_decoder)
(sparse_size_decoder,sparse_numblocks_decoder)
(sparse_offset_decoder,sparse_numbytes_decoder): Likewise.
(decode_record): Pass value length to the handler
(run_override_list): Pass value length to the decoder
(xheader_print_n): New function
(xheader_print): Rewritten using xheader_print_n
(xheader_finish): Do not rely om strlen to compute the length of
the collected string: it can contain embedded nulls
(xheader_string_begin,xheader_string_add,xheader_string_end): New
functions.
(sparse_map_decoder,dumpdir_coder,dumpdir_decoder): New
functions. Handle GNU.sparse.map and GNU.dumpdir variables.
(xhdr_tab): Add new variables.
2005-11-07 02:52:58 +00:00
Sergey Poznyakoff
4d22cbd47c Test gnu, oldgnu, and posix formats 2005-11-07 02:51:22 +00:00
Sergey Poznyakoff
e20e79e7ff (struct tar_stat_info.dumpdir): New member. 2005-11-07 02:50:25 +00:00
Sergey Poznyakoff
f865597c89 Incremental options are allowed with --format=pax
(tar_stat_destroy): Free dumpdir
2005-11-07 02:50:14 +00:00
Sergey Poznyakoff
1b9c48d934 (sparse_diff_file): Bugfix: set seekable.
(pax_dump_header): Store sparse map in GNU.sparse.map. If this
variable has been explicitely deleted, use GNU.sparse.offset/
GNU.sparse.numbytes variables.
2005-11-07 02:49:45 +00:00
Sergey Poznyakoff
f6458a827a (list_archive): Handle incremental backups in pax
format.
(decode_header): Initialize stat_info.dumpdir
2005-11-07 02:49:23 +00:00
Sergey Poznyakoff
08a8d2dec6 (dumpdir_size, get_gnu_dumpdir): New functions.
(purge_directory): Use stat_info.dumpdir instead of getting its
value explicitely.
2005-11-07 02:48:51 +00:00
Sergey Poznyakoff
aea1d50da9 (dump_dir0): Handle incremental backups in pax archives 2005-11-07 02:48:23 +00:00
Sergey Poznyakoff
588232f859 (dumpdir_size,get_gnu_dumpdir)
(xheader_string_begin,xheader_string_add)
(xheader_string_end): New functions.
2005-11-07 02:48:08 +00:00
Paul Eggert
4c4c5a4dc1 Minor language and white space fixes. 2005-11-07 00:25:52 +00:00
Paul Eggert
d144e7c217 * tests/truncate.at: Use -H pax to preserve full time stamp resolution.
This prevents tests from failing on hosts like Solaris 8 that have
nanosecond-resolution file time stamps.
* tests/update.at: Likewise.
2005-11-06 23:29:30 +00:00
Paul Eggert
ef9ad717ba * src/xheader.c (strtoimax, strtoumax): Remove decls; now done
in system.h.
2005-11-06 22:48:34 +00:00
Sergey Poznyakoff
85ce2c24f8 Update 2005-11-06 11:52:02 +00:00
Sergey Poznyakoff
d01f65092c Properly document incremental dumps 2005-11-06 11:51:12 +00:00
Sergey Poznyakoff
04e2551256 Update 2005-11-05 16:49:47 +00:00
Sergey Poznyakoff
8b2504deca Update 2005-11-05 16:49:17 +00:00
Sergey Poznyakoff
ad09c8373b New file 2005-11-05 16:47:49 +00:00
Sergey Poznyakoff
5b91f80787 Update 2005-11-05 15:57:07 +00:00
Sergey Poznyakoff
ef981aae38 Never skip the test. It should work on any filesystem 2005-11-05 15:55:38 +00:00
Sergey Poznyakoff
36f1d689e4 Sleep 1 sec before creating second file. 2005-11-05 15:55:19 +00:00
Sergey Poznyakoff
1e304fc5fd (struct directory.mtime): New member.
(note_directory): Take additional arguments. All callers updated.
(scan_directory): Updated to use more metadata. In particular,
this allows to correctly detect renamed files.
(read_directory_file,write_directory_file)
(write_directory_file_entry): Support new directory file format.
2005-11-05 15:55:05 +00:00
Sergey Poznyakoff
b100f6ae5b (dump_file): Call update_parent_directory. 2005-11-05 15:54:30 +00:00
Sergey Poznyakoff
a6d2158837 (update_parent_directory): New prototype. 2005-11-05 15:54:14 +00:00
Paul Eggert
c641a16cba (set_stat): Rewrite to avoid bug in Forte
Developer 7 C 5.4 Patch 111708-09 (2004-02-19).
2005-11-04 21:25:47 +00:00
Sergey Poznyakoff
65a7536d1f Updated 2005-11-04 12:42:03 +00:00
Sergey Poznyakoff
8c119485a9 Updated 2005-11-04 12:41:25 +00:00
Sergey Poznyakoff
a02a9ed099 Update 2005-11-04 07:48:32 +00:00
Sergey Poznyakoff
71976fa77e Add Eric Blake 2005-11-04 07:38:44 +00:00
Sergey Poznyakoff
c2552c6c40 Fix quoting in help output.
(update_po): Use backward-compatible wget option --cache instead
of deprecated -C to accomodate for wget 1.10.
Changes proposed by Eric Blake
2005-11-04 07:38:23 +00:00
Paul Eggert
b272b3e2cf * doc/tar.texi: Consistently put two spaces after sentences,
and put commas after "i.e." and "e.g.".  This is the usual GNU
style in manuals.
2005-11-02 23:03:39 +00:00
Paul Eggert
c44d0d037f * lib/.cvsignore: Accommodate recent gnulib changes. 2005-11-02 22:45:07 +00:00
Paul Eggert
9c50f854a6 Add creat-safer.c, fcntl--.h, fcntl-safer.h,
open-safer.c, openat-die.c, verify.h, to accommodate recent gnulib
changes.
2005-11-02 22:44:46 +00:00
Sergey Poznyakoff
fc42672fe0 Updated 2005-10-28 09:29:31 +00:00
Sergey Poznyakoff
64aea5de53 If file `.bootstrap' exists in the cwd and is readable, prepend its contents to the command line 2005-10-28 09:29:16 +00:00
Sergey Poznyakoff
391c6f6bdb Add John Thomas McDole 2005-10-28 09:28:39 +00:00
Sergey Poznyakoff
9684c2728d (diff_dumpdir): Pass a valid device number to get_directory_contents. 2005-10-28 09:28:20 +00:00
Sergey Poznyakoff
cb8aacd9ef Updated 2005-10-21 18:15:09 +00:00
Sergey Poznyakoff
3ae9e51181 Skip test if ln fails (suppose the OS does not support hard links) 2005-10-21 18:13:59 +00:00
Sergey Poznyakoff
7a246ab602 Updated 2005-10-04 07:31:28 +00:00
Sergey Poznyakoff
35b9ca72db (decode_options): Report error if -A or -r is used together with compression option. 2005-10-04 07:30:48 +00:00
Sergey Poznyakoff
ecdef9daaa Fix cover page 2005-09-30 19:49:37 +00:00
Sergey Poznyakoff
eb744655a8 Updated 2005-09-29 16:31:27 +00:00
Sergey Poznyakoff
57fcb1639e Use @option and @kbd consistently. Document new options. 2005-09-29 16:28:06 +00:00
Sergey Poznyakoff
49f39c25b4 Updated 2005-09-28 20:42:39 +00:00
Sergey Poznyakoff
40da86b2a1 Implement --show-stored-names option 2005-09-28 20:41:57 +00:00
Sergey Poznyakoff
15b75f848e (print_header): If show_stored_names_option is given,
list member names as stored in the archive. Patch proposed by Erik
Cumps <erik.cumps@icos.be>
2005-09-28 20:41:38 +00:00
Sergey Poznyakoff
2a25112552 (show_stored_names_option): New variable 2005-09-28 20:41:10 +00:00
Sergey Poznyakoff
b2b60efaaf Updated 2005-09-28 19:42:09 +00:00
Sergey Poznyakoff
ddb0f96f00 New option --test-label tests the archive volume label. The option proposed by Wouter Verhelst 2005-09-28 19:41:40 +00:00
Sergey Poznyakoff
13aead50a8 (all_names_found): If test_label_option is set return true 2005-09-28 19:41:15 +00:00
Sergey Poznyakoff
8f1d2fd9c3 (print_header): Special handling if test_label_option is set 2005-09-28 19:41:00 +00:00
Sergey Poznyakoff
a274294656 (test_label_option): New variable 2005-09-28 19:40:41 +00:00
Paul Eggert
63f64e4aaf * tests/Makefile.am (clean-local): Don't attempt to run
$(TESTSUITE) if it doesn't exist.  Problem reported by
Eric Blake.
2005-09-21 19:26:12 +00:00
Paul Eggert
3209329337 Don't filter time stamps through the resolution supported
by struct stat; keep them to full nanosecond resolution.
This affects behavior only on older hosts or file systems
that have lower-resolution time stamps.
* src/common.h (OLDER_STAT_TIME): Parenthesize arg.
(OLDER_TAR_STAT_TIME): New macro.
(code_timespec): New function.
(BILLION, LOG10_BILLION, TIMESPEC_STRSIZE_BOUND): New constants.
* src/compare.c (diff_file): Use full time stamp resolution.
* src/create.c (start_header, dump_file0): Likewise.
(start_header, dump_file0): Adjust to new structure layout.
(dump_regular_finish): Simplify by using timespec_cmp.
* src/extract.c (struct delayed_set_stat): Don't store stat info
that we don't need, to save space.  All uses changed.
(struct delayed_set_stat, struct delayed_link, file_newer_p):
(create_placeholder_file, extract_link, apply_delayed_links):
Use full time stamp resolution.
(check_time): Use code_timespec rather than rolling our own code.
(set_stat, delay_set_stat): Arg now points to tar_stat_info to
avoid losing time information.  All callers changed.
* src/list.c (read_and, decode_header, print_heaeder):
Use full time stamp resolution.
* src/misc.c (code_timespec): New function.
* src/tar.h (struct tar_stat_info): Record atime, mtime, ctime
separately, for benefit of hosts with lower resolution.
* src/update.c (update_archive): Use full time stamp resolution.
* src/xheader.c (code_time): Use new code_timespec function
to simplify code.
(atime_coder, atime_decoder, ctime_coder, ctime_decoder):
(mtime_coder, mtime_decoder): Use full time stamp resolution.

Report time stamps to full resolution in environment.
Report memory allocation failures rather than ignoring them.
* src/system.c (time_to_env): New function.
(oct_to_env, str_to_env, chr_to_env): Report memory allocation failures.
(stat_to_env): Report full resolution in time stamps.
2005-09-17 06:41:55 +00:00
Paul Eggert
2f800ce3fb Merge changes from gnulib for file system sub-second time stamps.
* configure.ac: Remove checks for struct stat.st_spare1, struct
stat.st_atim.tv_nsec, struct stat.st_atimespec.tv_nsec, struct
stat.st_atimensec, as gnulib now does this for us.
Similarly for LIB_CLOCK_GETTIME.
* gnulib.modules: Add stat-time.
* lib/.cvsignore: Add stat-time.h.
* src/common.h: Include stat-time.h.
(timespec_lt): Remove.  All callers changed to use timespec_cmp.
(get_stat_atime, get_stat_ctime, get_stat_mtime):
(set_stat_atime, set_stat_ctime, set_stat_mtime):
Remove; now defined by stat-time.h.
2005-09-16 07:03:44 +00:00
Sergey Poznyakoff
ae5473fe02 Updated 2005-09-14 13:25:57 +00:00
Sergey Poznyakoff
1f4437aa66 (list_dumpdir): New function. 2005-09-14 13:25:41 +00:00
Sergey Poznyakoff
8952196bc1 (list_archive): Use list_dumpdir() to display GNUTYPE_DUMPDIR blocks. Do that only if two or more -v options are given. 2005-09-14 13:23:38 +00:00
Sergey Poznyakoff
9093ca15d8 (list_dumpdir): New function. Used to dump contents of GNUTYPE_DUMPDIR blocks. 2005-09-14 13:23:12 +00:00
Paul Eggert
76efed4ca4 hard link patches 2005-09-12 18:46:38 +00:00
Paul Eggert
a2b6327eda Adjust to current gnulib and modules used.
Add getdelim.c, getdelim.h, mbchar.c, mbchar.h, mbuiter.h, memchr.c,
pipe-safer.c, size_max.h, strdup.c, strdup.h, strnlen.h, strnlen1.c,
strnlen1.h, unistd--.h.
Remove getndelim2.c, getndelim2.h, pathmax.h, sysexits.h, xstrdup.c.
2005-09-12 18:46:26 +00:00
Paul Eggert
af5d05729a Treat fishy-looking hard links like fishy-looking symlinks.
(struct delayed_set_stat): Rename after_symlinks
member to after_links.  All uses changed.
(struct delayed_link): Renamed from struct delayed_symlink.
All uses changed.  New member is_symlink.
(delayed_link_head): Renamed from delayed_symlink_head.  All uses
changed.
(create_placeholder_file): New function, taken from extract_symlink.
(extract_link): Create placeholders for fishy-looking hard links.
(extract_symlink): Move code into create_placeholder_file.
(apply_delayed_links): Renamed from apply_delayed_symlinks.
All uses changed.  Create both hard links and symlinks.
2005-09-12 18:45:59 +00:00
Paul Eggert
3070fff7d7 Mention gzip version problems, and valgrind. 2005-09-03 21:00:10 +00:00
Paul Eggert
6bb5c17aea * README-alpha: Modernize description of software required for
developers.
2005-09-03 20:54:59 +00:00
Sergey Poznyakoff
ecd43c1314 Update 2005-09-03 10:29:19 +00:00
Sergey Poznyakoff
f58c189f3e Updated 2005-09-03 10:28:29 +00:00
Sergey Poznyakoff
931e305002 Add incr01.at 2005-09-03 10:28:17 +00:00
Sergey Poznyakoff
a57ecc51aa New test. 2005-09-03 10:27:39 +00:00
Sergey Poznyakoff
a5375b618c (purge_directory): Do not dereference symbolic links. Bug reported by Ralph Corderoy <ralph@inputplus.co.uk> and David Brown <davidb@davidb.org> 2005-09-03 10:27:13 +00:00
Sergey Poznyakoff
c40ba72fd3 Add strdup 2005-09-03 10:24:45 +00:00
Sergey Poznyakoff
eacde4bca7 Updated 2005-08-17 14:52:12 +00:00
Sergey Poznyakoff
220ffceb44 (read_directory_file): Use strtoumax to read snapshot file contents. 2005-08-17 14:51:50 +00:00
Sergey Poznyakoff
b65b1ff9eb Updated 2005-08-01 06:28:15 +00:00
Sergey Poznyakoff
e0b0becead Remove dependency on file order. 2005-08-01 06:22:43 +00:00
Sergey Poznyakoff
c9c76e7d56 (file_dumpable_p,dump_file0): Fix handling of sparse files to /dev/null with --totals option. 2005-08-01 06:22:21 +00:00
Sergey Poznyakoff
9d23481b5f Updated 2005-07-08 14:40:59 +00:00
Sergey Poznyakoff
aa76a67b76 Fix typo 2005-07-08 14:40:26 +00:00
Sergey Poznyakoff
59a4026674 Updated 2005-07-07 16:20:19 +00:00
Sergey Poznyakoff
9106e53684 Pipe the output from `tar xfv' through sort. 2005-07-07 16:20:03 +00:00
Sergey Poznyakoff
a34b0ad8c9 Updated 2005-06-25 09:13:20 +00:00
Sergey Poznyakoff
1992b53b8c (tar_sparse_init): Fill structure with zeros. Call
sparse_select_optab(). All callers updated.
(sparse_member_p, sparse_fixup_header): Use tar_sparse_init().
2005-06-25 09:13:01 +00:00
Sergey Poznyakoff
f319c5575b Updated 2005-06-23 12:57:38 +00:00
Sergey Poznyakoff
44ce72fa96 Adapt to the new output format 2005-06-23 12:57:18 +00:00
Sergey Poznyakoff
2e9ea5f4a7 (pax_sparse_member_p): Checking member size vs. file size is not reliable enough. Use sparse_map_avail. 2005-06-23 12:57:07 +00:00
Sergey Poznyakoff
4bd38118e0 Updated 2005-06-23 12:17:00 +00:00
Sergey Poznyakoff
b65039526c Updated 2005-06-23 12:16:00 +00:00
Sergey Poznyakoff
fb1b9e3d0f New test. 2005-06-23 12:15:50 +00:00
Sergey Poznyakoff
aedacf9d29 Updated 2005-06-23 09:51:31 +00:00
Sergey Poznyakoff
d9045bf409 (size_decoder): Do not set archive_file_size 2005-06-23 09:51:05 +00:00
Sergey Poznyakoff
8d52260315 Updated 2005-06-23 09:10:51 +00:00
Sergey Poznyakoff
225e690142 (sparse_scan_file): Fix another bug, introduced yesterday: Initialize
archive_file_size to 0. The variable keeps size of the file *as stored
in the archive*, not the size reported by stat.
2005-06-23 09:10:28 +00:00
Sergey Poznyakoff
c877b48d68 Updated 2005-06-23 08:27:41 +00:00
Sergey Poznyakoff
37d2462d7c (tar_sparse_init): Fix recent bugfixes: Initialize dumped_size to 0. 2005-06-23 08:27:22 +00:00
Paul Eggert
040b5ab5f9 A sweep of the sparse code prompted by a bug report by Jim Meyering.
* src/sparse.c: Include <inttostr.h>.
(struct tar_sparse_file): offset and dumped_size are off_t, not
size_t.  optab is now const *.
(dump_zeros): Return bool success flag, not off_t.
All callers changed.
Use a constant-zero buffer rather than clearing a buffer each time.
Don't mess up if write fails.
(dump_zeros, check_sparse_region):
Don't assume off_t is no wider than size_t.
(tar_sparse_init): Don't bother clearing a field that is already clear.
(zero_block_p): First arg is const *, not *.
(clear_block, SPARSES_INIT_COUNT): Remove.
(sparse_add_map): First arg is now struct start_stat_info *, not
struct tar_sparse_file *.  All callers changed.
Use x2nrealloc to check for size_t overflow.
(parse_scan_file): Cache commonly-used parts of file.
Use an auto buffer, not a static one.
Don't bother clearing the buffer; not needed.
Don't bother clearing items that are already clear.
(oldgnu_optab, star_optab, pax_optab): Now const.
(sparse_dump_region): Don't bother clearing the buffer before
reading into it; just clear the parts that aren't read into.
(sparse_dump_file): Clear the whole local variable 'file'.
(diff_buffer): Remove; now a local var.
(check_sparse_region): Don't bother clearing buffer before
reading into it.  Don't assume off_t is promoted to long.
(oldgnu_get_sparse_info, star_get_sparse_info):
Use an auto status, not static.
* src/tar.h (struct tar_stat_info): had_trailing_slash is
now bool, not int.
* src/xheader.c (sparse_offset_coder, sparse_numbytes_coder):
Rewrite to avoid cast.
(sparse_offset_decoder, sparse_numbytes_decoder):
Diagnose excess entries rather than crashing.
2005-06-23 06:55:01 +00:00
Paul Eggert
4f4a858eb6 * src/common.h (timespec_lt): Add a return type: bool. 2005-06-23 03:19:03 +00:00
Paul Eggert
d659cbaccd Carefully crafted invalid headers can cause buffer overrun.
Invalid header fields go undiagnosed.
Some valid time strings are ignored.

* NEWS: Better support for full-resolution time stamps.
The -v option now prints time stamps only to 1-minute resolution.
* gnulib.modules: Add utimens.
* lib/.cvsignore: Add imaxtostr.c, inttostr.c, inttostr.h,
offtostr.c, umaxtostr.c, utimens.c, utimens.h.  Remove paxconvert.c.
* lib/Makefile.tmpl (libtar_a_SOURCES): Remove paxconvert.c.
* lib/paxconvert.c: Remove; superseded by umaxtostr.c.
* po/POTFILES.in: Remove lib/paxconvert.c.  Add lib/xalloc-die.c,
lib/obstack.c.
* src/buffer.c (set_start_time, compute_duration, start_time):
Use gettime rather than rolling our own code.
* src/common.h (OLDGNU_NAME_FIELD_SIZE, MAXOCTAL11, MAXOCTAL7): Remove.
(newer_ctime_option): Remove.
(timespec_lt): New function.
(OLDER_STAT_TIME): Use it.
(string_to_chars): First arg is char const *, not char *.
(tartime): Time arg is now struct timespec.  New bool arg.
All callers changed.
(code_ns_fraction): New decl.
(sys_stat_nanoseconds): Remove decl.
(get_stat_atime, get_stat_ctime, get_stat_mtime): New functions.
(set_stat_atime, set_stat_ctime, set_stat_mtime): New functions.
* src/compare.c: Include utimens.h rather than rolling our own.
(diff_dir, diff_file, diff_link, diff_symlink, diff_special):
Prototype.
(diff_dumpdir, diff_multivol): Prototype.
(diff_file): Support higher-resolution time stamps.
* src/create.c: Include utimens.h rather than rolling our own.
(MAX_OCTAL_VAL): New macro.
(tar_copy_str, string_to_chars): Don't bother to zero-fill;
the destination is already zeroed.
(string_to_chars): First arg is char const *.
(start_private_header): Use MINOR_TO_CHARS, not MAJOR_TO_CHARS,
for minor device number.
(write_header_name, dump_hard_link, dump_file0):
Simplify test for old GNU format.
(start_header): Put in placeholders for uid, etc., even when
using extended headers, for benefit of older "tar" implementations.
Don't assume uintmax_t is wider than 32 bits.
Output extended header for mtime if needed.
(dump_regular_finish, dump_file0):
Support extended time stamp resolution.
* src/extract.c: Include utimens.h rather than rolling our own.
(check_time): Support extended time stamp resolution.
* src/list.c: Include <inttostr.h>.
(tartime): Use umaxtostr rather than stringify_uintmax_t_backwards.
* src/xheader.c: Include <inttostr.h>.
Do not include <xstrtol.h>.
(strtoimax) [!HAVE_DECL_STRTOIMAX && !defined strtoimax]: New decl.
(strtoumax) [!HAVE_DECL_STRTOUMAX && !defined strtoumax]: New decl.
(BILLION, LOG10_BILLION): New constants.
(to_decimal): Remove; superseded by inttostr.  All callers changed
to use umaxtostr.
(xheader_format_name): Don't assume pids and uintmax_t values
fit in 63 bytes (!) when printed.
(decode_record): Don't bother to check for ERANGE; an out of range
value must be treater than len_max anyway.
If the length is out of range, output it in the diagnostic.
(format_uintmax): Remove; all callers changed to use umaxtostr.
(xheader_print): Don't assume sizes can be printed in 99 bytes (!).
(out_of_range_header): New function.
(decode_time): Use it.
(code_time): Accept struct timespec, not time_t and unsigned long.
All callers changed.  Size sbuf properly, and remove unnecessary check.
Don't assume time stamps can fit in 199 bytes.
Handle negative time stamps.  Handle fractional time stamps
more consistently.  Don't output unnecessary trailing zeros.
(decode_time): Yield struct timespec, not time_t and unsigned long.
All callers changed.
Handle negative time stamps.  Truncate towards minus infinity
consistently.  Improve overflow checks, and output a better
diagnostic on overflow.
(code_num): Don't assume uintmax_t can be printed in 99 bytes (!).
(decode_num): New function, for better diagnostics.
(atime_coder, atime_decoder, gid_decoder, ctime_coder):
(ctime_decoder, mtime_coder, mtime_decoder, size_decoder):
(uid_decoder, sparse_size_decoder, sparse_numblocks_decoder):
(sparse_offset_decoder, sparse_numbytes_decoder):
Use decode_num, etc., instead of xstrtoumax, etc.

* src/xheader.c (sparse_numblocks_decoder): Remove unchecked use
of `calloc'.  Use xcalloc instead.
(decode_time, gid_decoder, size_decoder, uid_decoder):
(sparse_size_decoder, sparse_offset_decoder, sparse_numblocks_decoder):
Ensure that the result of calling xstrtoumax is no larger than
the maximum value for the target type.  Upon any failure, exit with
a diagnostic.
(sparse_numblocks_decoder): Avoid buffer overrun/heap corruption:
use x2nrealloc, rather than `n *= 2' and xrealloc(p, n,....
(decode_time): Rewrite to accept time strings like
1119018481.000000000.  Before, such strings were always ignored.
2005-06-22 06:24:39 +00:00
Sergey Poznyakoff
f6445e4ed6 Updated 2005-06-13 19:14:52 +00:00
Sergey Poznyakoff
3fe8fc3ef9 Add update.at 2005-06-13 19:11:43 +00:00
Sergey Poznyakoff
372ff169e7 New test 2005-06-13 19:10:56 +00:00
Sergey Poznyakoff
c6cde895e3 (dump_file0): Check for is_avoided_name() first. Fixes bug reported by Martin Lohmeier 2005-06-13 19:09:45 +00:00
Sergey Poznyakoff
28b44cc69c Updated 2005-06-13 12:54:45 +00:00
Sergey Poznyakoff
eb70fd51cb (AC_STRUCT_ST_BLKSIZE,AC_STRUCT_ST_BLOCKS): Removed. Handled by system.m4. 2005-06-13 12:53:25 +00:00
Paul Eggert
5c4ea58bd7 * src/names.c (excluded_name): excluded_filename ->
excluded_file_name, because the name was changed in gnulib.
2005-06-02 21:02:58 +00:00
Sergey Poznyakoff
85ad04d822 Updated 2005-05-30 15:15:25 +00:00
Sergey Poznyakoff
fb7b2f3645 (read_name_from_file,update_argv): Automatically detect nul-terminated list files. 2005-05-30 15:15:10 +00:00
Sergey Poznyakoff
ab03bd6a2c Updated 2005-05-30 13:38:21 +00:00
Sergey Poznyakoff
9d5fd390dc Bugfixes. 2005-05-27 12:03:39 +00:00
Sergey Poznyakoff
e5e43aa7a4 Updated 2005-05-26 12:51:18 +00:00
Sergey Poznyakoff
77e56f876d Document new backup scripts behavior 2005-05-26 12:50:43 +00:00
Sergey Poznyakoff
2c49c610be (mt_begin,mt_rewind,mt_offline,mt_status): Use $MT to invoke mt
(init_common): Set --rsh-command option for mt if TAPE_FILE is a
 remote archive.
2005-05-26 12:50:30 +00:00
Sergey Poznyakoff
ec89da307c Minor fixes 2005-05-26 12:50:11 +00:00
Sergey Poznyakoff
ee870c97b9 Updated 2005-05-21 23:13:38 +00:00
Sergey Poznyakoff
ca5e64504b (hash_string_hasher,hash_string_compare)
(hash_string_insert,hash_string_lookup,removed_prefixes_p)
(safer_name_suffix): Moved to paxutils
2005-05-21 23:11:26 +00:00
Sergey Poznyakoff
cc07b9e170 Include paxlib.h instead of paxerror.h
(safer_name_suffix,removed_prefixes_p): Removed. The functions are
imported from paxutils
2005-05-21 23:10:57 +00:00
Sergey Poznyakoff
f2c8b1dff3 Update invocations of safer_name_suffix() 2005-05-21 23:10:42 +00:00
Sergey Poznyakoff
9129c846e7 Add new paxutils files 2005-05-21 23:09:42 +00:00
Sergey Poznyakoff
df0913f3fe Updated 2005-05-21 23:09:16 +00:00
Sergey Poznyakoff
e20fdceb38 Updated 2005-05-19 15:35:14 +00:00
Sergey Poznyakoff
5c35fdb275 Remove defines and declarations imported from paxutils 2005-05-19 15:34:19 +00:00
Sergey Poznyakoff
113b619383 Add paxerror.c paxexit.c paxconvert.c 2005-05-19 15:33:45 +00:00
Sergey Poznyakoff
517205c31c (libtar_a_SOURCES): Add paxerror.c paxexit.c paxconvert.c 2005-05-19 15:33:17 +00:00
Sergey Poznyakoff
dfabe2397a Remove checking for LIB_SETSOCKOPT, it is handled by paxutils 2005-05-19 15:32:56 +00:00
Sergey Poznyakoff
8f1f0955cf (copy_files): Accept optional third argument: a prefix
to be appended to destination file names.
Import paxutils/paxlib files.
2005-05-19 15:32:38 +00:00
Paul Eggert
1672258959 * src/misc.c (remove_any_file): Fix typo in previous change. 2005-05-17 08:34:16 +00:00
Paul Eggert
c172481f41 (remove_any_file): Fix typo in previous change. 2005-05-17 08:34:03 +00:00
Paul Eggert
46f09016e8 Port to Solaris 10's treatment of unlinking directories.
* gnulib-modules: Add unlinkdir.
* lib/.cvsignore: Add unlinkdir.h, unlinkdir.c.
* src/common.h (we_are_root): Remove extern decl; it's now static.
* src/extract.c (we_are_root): Now static.
* src/misc.c: Include <unlinkdir.h>.
(remove_any_file): Use cannot_unlink_dir () rather than	we_are_root.
2005-05-15 06:23:49 +00:00
Paul Eggert
120e96c480 Update FSF postal mail address. 2005-05-15 03:59:08 +00:00
Sergey Poznyakoff
271ed97494 Updated 2005-05-12 15:46:40 +00:00
Sergey Poznyakoff
3ac99bc540 Updated 2005-05-12 15:46:18 +00:00
Sergey Poznyakoff
a33b37a9a3 Add truncate.at 2005-05-12 15:40:07 +00:00
Sergey Poznyakoff
c9365a1d09 New test case 2005-05-12 15:39:54 +00:00
Sergey Poznyakoff
8d064bb816 (file_newer_p): Return false if file does not exist 2005-05-12 15:39:34 +00:00
Sergey Poznyakoff
29c902bc49 (dump_regular_file): Correctly pad archive members that shrunk during archiving. Repored by Frank Heckenbach. 2005-05-12 15:39:21 +00:00
Sergey Poznyakoff
d78f85d61d (diff_file): diff_handle was not initialized 2005-05-12 15:39:02 +00:00
Sergey Poznyakoff
73be90ea0d (Genfile): New appendix 2005-05-12 15:38:48 +00:00
Sergey Poznyakoff
9adc789138 (tar_TEXINFOS): Add genfile.texi 2005-05-12 15:38:37 +00:00
Sergey Poznyakoff
cfe4eef5c2 Install files from paxutils/doc 2005-05-12 15:38:27 +00:00
Sergey Poznyakoff
0e61fd397f Updated 2005-05-12 15:38:19 +00:00
Paul Eggert
bb8dcc1e8c Update copyright. 2005-05-02 08:05:59 +00:00
Paul Eggert
87bd7f5d1c Update copyright. 2005-05-02 08:05:23 +00:00
Paul Eggert
ecac16a4a0 * src/incremen.c (hash_directory): Likewise.
* src/names.c (hash_string_hasher): Likewise.
* src/tar.c (parse_opt): Set it, and adjust to new modechange API.
2005-05-02 08:03:02 +00:00
Paul Eggert
89a4824c73 Tell awk to read from /dev/null. 2005-05-02 08:02:35 +00:00
Paul Eggert
9b7c6df82b Adjust to new hash API. 2005-05-02 08:02:09 +00:00
Paul Eggert
e2c431e9c2 Adjust to recent gnulib changes. 2005-05-02 07:36:26 +00:00
Paul Eggert
82c746410d (parse_opt): Adjust to new modechange API. 2005-05-02 07:36:09 +00:00
Paul Eggert
2e025f2dea (start_ueader): Adjust to new modechange API. 2005-05-02 07:35:47 +00:00
Paul Eggert
f2e17c0d8c (initial_umask): New var. 2005-05-02 07:34:53 +00:00
Paul Eggert
ed08ef0458 Add dup-safer.c, fd-safer.c, unistd-safer.h. 2005-05-02 07:34:26 +00:00
Sergey Poznyakoff
3ab983facf Updated 2005-04-19 09:06:07 +00:00
Sergey Poznyakoff
6c6fe16aaa Add shortrec.at 2005-04-19 09:05:32 +00:00
Paul Eggert
27b98aa8ae * src/buffer.c (reading_from_pipe): Remove. All uses removed.
(short_read): Don't warn about short reads; they're normal.
* tests/shortrec.at: New file.
* tests/testsuite.at: Include it.
2005-04-18 18:21:50 +00:00
Paul Eggert
18850a18f1 (gnulib_modules): Don't create a file modlist.tmp, as
it is sometimes left behind as a garbage file (maybe due to the
multiple traps?).
2005-04-18 18:14:58 +00:00
Paul Eggert
005d0d455c Use UTF-8 uniformly, rather than UTF-8 sometimes and Latin-1 sometimes. 2005-04-16 07:22:13 +00:00
Sergey Poznyakoff
a71807a247 Updated 2005-04-14 13:14:56 +00:00
Sergey Poznyakoff
d7af510d49 (SOLARIS_XHDTYPE): New define 2005-04-14 13:14:38 +00:00
Sergey Poznyakoff
ef0e611663 Handle Solaris 'X' type flag 2005-04-14 13:14:23 +00:00
Sergey Poznyakoff
8f9ecca0db Updated 2005-04-07 17:29:45 +00:00
Sergey Poznyakoff
9147c6c9f6 Add multiv04.at 2005-04-07 17:28:53 +00:00
Sergey Poznyakoff
ee738da4a8 Test splittind directory members between the archive volumes. 2005-04-07 17:28:34 +00:00
Sergey Poznyakoff
42e53a98e1 Modified to match the new behavior 2005-04-07 17:27:30 +00:00
Sergey Poznyakoff
2d34da98d5 Assign orig_file_name
to save_name uniformly over the program. This fixes matching
directory names at the start of an archive volume.
2005-04-07 17:27:07 +00:00
Sergey Poznyakoff
781d3818e5 (diff_init): Read directory file if in listed
incremental. This prevents spurious 'Contents differ' diagnostics.
(diff_archive): Minor fixes to text messages
(diff_file,diff_dumpdir,diff_multivol): Assign orig_file_name
to save_name uniformly over the program. This fixes matching
directory names at the start of an archive volume.
2005-04-07 17:26:42 +00:00
Sergey Poznyakoff
c861b96651 (flush_write): Warn when the name of the archive
straddling volume boundary is longer than 100 characters. Earlier
behavior was to issue a fatal error.
(struct zip_magic): Reverted part of changes from 2005-04-04.
They make the maintenance too costly. Removing `unsigned'
qualifier from `magic' member should be enough.
2005-04-07 17:26:11 +00:00
Sergey Poznyakoff
2872a5ae81 Minor fixes to text messages. Proposed by Benno Schulenberg.
(extract_file): Assign orig_file_name
        to save_name uniformly over the program. This fixes matching
        directory names at the start of an archive volume.
2005-04-07 17:25:29 +00:00
Sergey Poznyakoff
62599b5285 Minor fixes to text messages. Proposed by Benno Schulenberg. 2005-04-07 17:24:56 +00:00
Paul Eggert
263604c2ec Sort and simplify. 2005-04-04 18:46:00 +00:00
Paul Eggert
7ebf107f89 Update copyright date. 2005-04-04 18:37:52 +00:00
Paul Eggert
5fe7f641e8 Rename config/ to build-aux/. 2005-04-04 18:35:53 +00:00
Paul Eggert
dbf96ec903 Spelling fixes. 2005-04-04 18:31:44 +00:00
Paul Eggert
5d87077565 * src/buffer.c: Fix struct zip_magic to avoid problems with pedantic
C compilers.  Make 'magic' const and redo it to save alignment and space.
2005-04-04 18:22:44 +00:00
Paul Eggert
7d4bd5b38d (struct zip_magic): Use char arrays, not pointers.
The unsigned char * pointer ran afoul of pedantic C compilers, and
we didn't need pointers anyway.  Put the size field before the
data to avoid unnecessary padding.  All uses changed.
(magic) Make it const, since it doesn't change.  All uses changed.
2005-04-04 18:21:55 +00:00
Paul Eggert
ad0bd3c9c4 * src/xheader.c (decode_record): Don't dump core when given
a corrupted extended header.
2005-04-02 06:39:37 +00:00
Paul Eggert
95fa3422d7 (decode_record): Don't dump core when given
a corrupted extended header.  Problem reported by Jim Meyering.
Also, check for other ways that the header might be invalid,
e.g., missing newline at end.  Do not allow keys with nulls.
Allow blanks before and after length, as POSIX requires.
Do not allow leading "-" in length.  Check for length overflow.
(xheader_decode, xheader_decode_global): Let decode_record
check for exhaustion of record.
(xheader_read): Null-terminate the extended record;
decode_record relies on this.
2005-04-02 06:39:19 +00:00
Paul Eggert
67c7284d07 * bootstrap (TP_URL): Change from
<http://www2.iro.umontreal.ca/~gnutra/po/maint/tar/> to
<http://www.iro.umontreal.ca/translation/maint/tar/> to avoid
some redirection glitches.
Use "trap - 0" rather than "trap 0" to fix a POSIX-conformance bug.
* doc/.cvsignore: Change "tar.info" to "tar.info*".  Sort.
2005-03-21 21:56:02 +00:00
Sergey Poznyakoff
6811232d8f Updated 2005-03-03 23:17:07 +00:00
Sergey Poznyakoff
fdbb1d8c7c (restore_fs): Use root_fs 2005-03-03 23:16:03 +00:00
Sergey Poznyakoff
f04c7701fa Use `head -n 1'. Provide missing argument to ${MT_STATUS}. Fixed typo in MT_OFFLINE assignment. Proposed by Jan Merka. 2005-03-03 23:14:52 +00:00
Sergey Poznyakoff
63e90fdc62 Use `head -n 1'. Provide missing argument to ${MT_STATUS}. Proposed by Jan Merka. 2005-03-03 23:14:23 +00:00
Sergey Poznyakoff
b320151a23 (sparse_scan_file): Bugfix. offset had incorrect type. 2005-03-03 23:13:30 +00:00
Sergey Poznyakoff
9fc348aae9 Correctly parse empty uname/gname 2005-03-03 23:13:14 +00:00
Sergey Poznyakoff
0fd49f51a0 (print_header): Print UID/GID in case of
empty user/group name. This could occur when dumping
files belonging to non-existing users and when listing
broken archives.
Reported by Igor Lautar.
2005-03-03 23:13:04 +00:00
Sergey Poznyakoff
002cd6843a Updated 2005-02-15 15:25:14 +00:00
Sergey Poznyakoff
b4fb3e9f74 Use -print with find 2005-02-15 15:24:51 +00:00
Sergey Poznyakoff
549a691ada Replace strdup with xstrdup 2005-02-15 15:24:35 +00:00
Sergey Poznyakoff
e7e66c4426 Updated 2005-02-15 14:47:06 +00:00
Sergey Poznyakoff
ea9df3c243 Added reference to bug-tar archive 2005-02-15 14:46:16 +00:00
Sergey Poznyakoff
1d804e4f68 Updated 2005-02-10 22:53:22 +00:00
Sergey Poznyakoff
eaa66dc858 Added append01.at 2005-02-10 22:52:13 +00:00
Sergey Poznyakoff
a66ab8591f Test appending of files with long names 2005-02-10 22:52:00 +00:00
Sergey Poznyakoff
6e63133691 (read_header): Removed assignment to oldgnu_header.isextended. It was breaking append mode. 2005-02-10 22:51:21 +00:00
Sergey Poznyakoff
b480196651 Added Tim Adye. Fixed UTF. 2005-02-10 22:51:04 +00:00
Sergey Poznyakoff
371af209a7 Updated 2005-02-06 20:02:23 +00:00
Sergey Poznyakoff
5c2e32780e Various fixes in help and diagnostic messages 2005-02-06 20:01:22 +00:00
Sergey Poznyakoff
4d8ddc720e Merge list of required modules from paxutils with that from tar proper 2005-02-06 20:00:56 +00:00
Sergey Poznyakoff
5f405b1a2d List of required gnulib modules. 2005-02-06 20:00:09 +00:00
Sergey Poznyakoff
ef68503367 Updated 2005-02-05 22:25:50 +00:00
Sergey Poznyakoff
64ba4757bc Reverted changes 2005-02-05 22:08:49 +00:00
Sergey Poznyakoff
cd02b0855c (options): Improved sorting. Document --backup=off.
(decode_options): Clear backup_option if necessary.
2005-02-05 22:03:10 +00:00
Sergey Poznyakoff
35bb355734 (sys_exec_command): Use xclose, xpipe, xfork, xdup2 and exec_fatal. 2005-02-05 22:02:08 +00:00
Sergey Poznyakoff
fa63755f6b (exec_error,fork_error,dup2_error,pipe_error): Removed unneeded functions. 2005-02-05 22:01:49 +00:00
Sergey Poznyakoff
ea12939af0 (extract_archive): Do not check for EXTRACT_OVER_PIPE, decode_options() does this. 2005-02-05 22:01:08 +00:00
Sergey Poznyakoff
9a71d32d2f Code clean up. 2005-02-05 22:00:48 +00:00
Sergey Poznyakoff
6609c2a607 (EXTRACT_OVER_PIPE): New macro 2005-02-05 22:00:29 +00:00
Sergey Poznyakoff
c580a1c407 Updated 2005-02-05 10:49:26 +00:00
Sergey Poznyakoff
91ce177fc7 Added Hansjoerg Lipp 2005-02-05 10:35:46 +00:00
Sergey Poznyakoff
4d24adbecb Handle new options --to-command,--ignore-command-error 2005-02-05 10:35:18 +00:00
Sergey Poznyakoff
0b939d7dbc (sys_exec_command,sys_wait_command): New functions 2005-02-05 10:34:46 +00:00
Sergey Poznyakoff
75a16f75a9 (exec_error, fork_error, dup_error,pipe_error): New functions 2005-02-05 10:34:25 +00:00
Sergey Poznyakoff
e758088191 (extract_file): Handle to_command_option
Fix error recovery: decrease `size' by `written', not
by `count', otherwise tar misses the next header
Do not diagnose write errror if to_command_option
is set, since the command may have exited prematurely.
It would be better to check for sigpipe, though.
(prepare_to_extract): Handle to_command_option
2005-02-05 10:34:01 +00:00
Sergey Poznyakoff
f96dc77bbc (to_command_option)
(ignore_command_error_option): New globals
(sys_exec_command,sys_wait_command): New commands
2005-02-05 10:33:25 +00:00
Sergey Poznyakoff
23cf312ef1 Do not use 8-bit chars in comments 2005-02-05 10:33:05 +00:00
Sergey Poznyakoff
0e4b59b4b2 Get setenv module from gnulib 2005-02-05 10:32:35 +00:00
Paul Eggert
a6f6974f75 Improved checksum diagnostics; adjust to gnulib changes. 2005-02-04 01:52:48 +00:00
Paul Eggert
8f0112cb23 (from_header): New arg OCTAL_ONLY, normally false.
All uses changed.  Fix typo that sometimes suppressed all "Archive
contains obsolescent base-64 headers" warnings, not just the first
one.
(tar_checksum): Accept only octal checksums, since they aren't
supposed to overflow into weird formats.
2005-02-04 01:52:20 +00:00
Paul Eggert
9c2f942930 Adjust to gnulib changes.
* lib/.cvsignore: Add chdir-long.c, chdir-long.h, memrchr.c,
memrchr.h, openat.c, openat.h.  Remove pathmax.h (added by
mistake, perhaps?), sysexit.h (my typo), xstrdup.c (gnulib removed
this file).  Sort entries.
2005-02-04 01:44:45 +00:00
Sergey Poznyakoff
5422166048 Updated 2005-02-04 01:43:41 +00:00
Sergey Poznyakoff
0ad4063606 (update_argv): Changed type to void 2005-02-04 01:42:58 +00:00
Sergey Poznyakoff
db2d3f2344 Removed unused variables. 2005-02-04 01:42:33 +00:00
Sergey Poznyakoff
5179c0b5e6 Further rewrite 2005-02-04 01:41:32 +00:00
Sergey Poznyakoff
87a7b31a82 Updated 2005-02-04 00:05:46 +00:00
Sergey Poznyakoff
1044149e3a Determine path to the tar executable. 2005-02-04 00:04:55 +00:00
Sergey Poznyakoff
d8dc269927 (options) Minor spelling fix 2005-02-04 00:04:40 +00:00
Sergey Poznyakoff
1e2e868af5 Add translators' comments 2005-02-04 00:04:16 +00:00
Sergey Poznyakoff
c8764440d9 (extract_archive): Rewritten 2005-02-04 00:03:59 +00:00
Sergey Poznyakoff
59f314a2c4 (start_private_header,write_header_name)
(dump_hard_link): Restore compatibility with 1.13.25
2005-02-04 00:03:42 +00:00
Sergey Poznyakoff
0e45413e1e (OLDGNU_NAME_FIELD_SIZE): New constant 2005-02-04 00:03:15 +00:00
Sergey Poznyakoff
2fcd454e17 Updated 2005-02-03 16:29:58 +00:00
Sergey Poznyakoff
e318ac6fe8 (RE_CHECK): Added missing space 2005-02-03 16:29:45 +00:00
Sergey Poznyakoff
71b7086ff7 sort ls output 2005-02-03 16:29:27 +00:00
Sergey Poznyakoff
5cf84df777 Add translators' comment 2005-02-03 16:29:08 +00:00
Sergey Poznyakoff
4a7703ff21 Use quote() 2005-02-03 16:28:37 +00:00
Sergey Poznyakoff
91c69c885b (short_read): Use ngettext()
(new_volume): use quote().
2005-02-03 16:28:12 +00:00
Sergey Poznyakoff
63c140752f Added tests/genfile.c 2005-02-03 16:27:11 +00:00
Sergey Poznyakoff
ce852113e0 Updated 2005-02-03 00:06:34 +00:00
Sergey Poznyakoff
ccb2072c7e Extract and compare sparse file 2005-02-03 00:04:43 +00:00
Sergey Poznyakoff
d8b24b63e8 Skip the test on filesystems that do not update ctime of a file when renaming it. To be reverted when the new incremental mode is ready. 2005-02-03 00:04:30 +00:00
Sergey Poznyakoff
0dcb0ad279 Added sparse02.at 2005-02-03 00:04:02 +00:00
Sergey Poznyakoff
0cde2ad44c Test extracting sparse files over a pipe. 2005-02-03 00:03:44 +00:00
Sergey Poznyakoff
88e9b05867 Updated 2005-02-02 11:02:12 +00:00
Sergey Poznyakoff
198596f161 Extract sparse files even if the output fd is not seekable. 2005-02-02 11:01:49 +00:00
Sergey Poznyakoff
ccac216e67 Updated 2005-02-01 05:52:10 +00:00
Sergey Poznyakoff
660d760587 Ignore all *.m4 files 2005-02-01 05:51:24 +00:00
Sergey Poznyakoff
771ac30e0f Updated 2005-02-01 05:48:06 +00:00
Sergey Poznyakoff
ebd88883f5 Add append.at 2005-02-01 05:47:20 +00:00
Sergey Poznyakoff
81572b57a3 Insert Emacs magic to the first line. 2005-02-01 05:47:05 +00:00
Sergey Poznyakoff
5be8e9d4c7 Add a comment to lib/Makefile.am saying that this is an autogenerated file.
Exit with code 1 if any of autotools fails.
2005-02-01 05:46:49 +00:00
Sergey Poznyakoff
4e52e75bbe Updated 2005-01-18 01:53:09 +00:00
Sergey Poznyakoff
4caea8d763 Updated 2005-01-18 01:20:41 +00:00
Sergey Poznyakoff
0037ae7f9e Remove inclusion of obstack.h 2005-01-18 01:18:45 +00:00
Sergey Poznyakoff
01778aa4a9 Updated 2005-01-18 01:18:07 +00:00
Sergey Poznyakoff
3360b2cce4 Moved rendition macros and option value definitions from tar.texi into separate files 2005-01-18 01:15:48 +00:00
Sergey Poznyakoff
5f19de0372 Document new options. Moved rendition macros and option value definitions into separate files 2005-01-18 01:14:04 +00:00
Sergey Poznyakoff
cdb27293db New options --unquote (--no-unquote) and --add-file
(add_file_id,read_name_from_file,update_argv): New functions
(parse_opt): Rewritten handling of -T option. Handle hidden
--HANG option for debugging purposes.
(decode_options): Init unquote_option to true. Init argv_stk.
Remove unneded references to files_from_option
2005-01-18 01:12:34 +00:00
Sergey Poznyakoff
937202acb9 (name_file): Removed variable.
(read_name_from_file): Removed function. All callers changed.
(name_close): Removed function. All callers changed.
2005-01-18 01:11:56 +00:00
Sergey Poznyakoff
3971a56b22 (stat_fatal): New function 2005-01-18 01:11:22 +00:00
Sergey Poznyakoff
18ee9a103a Remove inclusion of obstack.h src/incremen.c 2005-01-18 01:11:05 +00:00
Sergey Poznyakoff
de772cad88 Include obstack.h
(files_from_option): Removed
(unquote_option): New variable
(stat_fatal): New function
(name_close): Removed function.
2005-01-18 01:10:39 +00:00
Sergey Poznyakoff
2c9d869851 Raised version number to 1.15.2 2005-01-18 01:10:12 +00:00
Sergey Poznyakoff
2b9556cb8e Complete the reference 2005-01-14 09:27:03 +00:00
Sergey Poznyakoff
47b2def4a2 *** empty log message *** 2005-01-14 08:47:36 +00:00
Paul Eggert
f389e8657d * tests/testsuite.at (RE_CHECK): Use "join - file", not "join file -". 2005-01-13 20:57:40 +00:00
Paul Eggert
c6ca601327 (RE_CHECK): Use "join - file", not
"join file -", to work around a bug in Solaris 8 join.
2005-01-13 20:57:23 +00:00
Sergey Poznyakoff
5dc9944b5a Updated 2005-01-13 16:19:23 +00:00
Sergey Poznyakoff
fabcc30f69 Updated 2005-01-13 16:13:43 +00:00
Sergey Poznyakoff
8a59f40796 Updated 2005-01-13 16:07:35 +00:00
Sergey Poznyakoff
1859998c22 Added Josef Bauer 2005-01-13 16:01:14 +00:00
Sergey Poznyakoff
e7db56c0ef Added long01.at 2005-01-13 16:00:59 +00:00
Sergey Poznyakoff
14d8c8a035 Sort tar output 2005-01-13 16:00:45 +00:00
Sergey Poznyakoff
471cf501e5 Test listing of GNU long names divisible by 512. 2005-01-13 16:00:23 +00:00
Sergey Poznyakoff
4719a5d55b Use memset instead of bzero, memmove
(or memcpy, if appropriate), instead of bcopy, and
strchr/strrchr instead of index/rindex.
Rename isnumber to isnumber_p. Proposed by Albert Chin.
2005-01-13 15:59:26 +00:00
Sergey Poznyakoff
cff5cfb5ce Updated 2005-01-12 00:08:10 +00:00
Sergey Poznyakoff
ef96e14fe1 Template file for gendocs.sh 2005-01-12 00:07:49 +00:00
Sergey Poznyakoff
248069ea4a Updated 2005-01-11 16:28:17 +00:00
Sergey Poznyakoff
d882e8f39b Reworded docstrings for --[no-]same-permissions 2005-01-11 16:28:07 +00:00
Sergey Poznyakoff
3e5686c1ec Updated docs for --[no-]same-permissions 2005-01-11 16:27:57 +00:00
Sergey Poznyakoff
b8efe40f54 Use gendocs.sh to generate web documentation 2005-01-11 16:27:43 +00:00
Sergey Poznyakoff
73777093b1 Updated for 1.15.1 2005-01-11 16:27:26 +00:00
Sergey Poznyakoff
746e6b45b6 Updated 2005-01-06 18:33:29 +00:00
Sergey Poznyakoff
c251377da9 Updated 2005-01-06 18:27:36 +00:00
Sergey Poznyakoff
39a00a8f4f Do not create useless directory 2005-01-06 18:17:20 +00:00
Sergey Poznyakoff
85d8f1d2a2 Add options02.at 2005-01-06 18:16:50 +00:00
Sergey Poznyakoff
2266e14d8c Test that tar correctly handles non-option arguments interspersed with options. 2005-01-06 18:16:30 +00:00
Sergey Poznyakoff
941d7586db Call tar_PAXUTILS 2005-01-06 18:15:50 +00:00
Sergey Poznyakoff
1c7a6c11ce Create m4/paxutils.m4 2005-01-06 18:15:12 +00:00
Sergey Poznyakoff
2ad41b6fe0 (parse_opt): Bugfix: Use ARGP_KEY_ARG. Thanks Mike Frysinger <vapier@gentoo.org> for reporting. 2005-01-05 17:30:36 +00:00
Paul Eggert
af2fa08aa0 * lib/Makefile.tmpl (localedir.h): Omit needless quotes and a
needless sed command.
2005-01-04 20:20:56 +00:00
Paul Eggert
93e4188e60 Accommodate latest gnulib. 2004-12-24 07:44:30 +00:00
Paul Eggert
c0eaf364d0 Add getdate.texi. 2004-12-24 07:43:52 +00:00
Paul Eggert
86c379f7c1 Do not treat alloca-opt specially; this is no
longer needed (and breaks builds) with latest gnulib.
2004-12-24 07:43:32 +00:00
Sergey Poznyakoff
3352016cf0 Updated 2004-12-22 10:54:22 +00:00
Sergey Poznyakoff
6bc808b25f (main): Reverted recent changes (#ifdef). 2004-12-22 10:53:48 +00:00
Sergey Poznyakoff
19f60610d1 Updated 2004-12-21 16:21:53 +00:00
Sergey Poznyakoff
2433f6813e (open_compressed_archive): Do not attemt to determine compression type if handling multi-volume archive 2004-12-21 15:10:56 +00:00
Sergey Poznyakoff
76bbb5710f Minor improvement: reset hit_eof in open_compressed_archive 2004-12-21 15:00:29 +00:00
Sergey Poznyakoff
e8fbac5ec1 Updated 2004-12-21 14:45:18 +00:00
Sergey Poznyakoff
5842962ed6 (main): Protect invocation of setlocale by ifdef. 2004-12-21 14:44:15 +00:00
Sergey Poznyakoff
368172bf25 (from_header, tar_checksum): Changed declaration. All callers updated. 2004-12-21 14:44:03 +00:00
Sergey Poznyakoff
0f9b299745 (tar_checksum): changed declaration 2004-12-21 14:42:15 +00:00
Sergey Poznyakoff
ab3b31cfef (check_compressed_archive): Check remote archves as well 2004-12-21 14:41:35 +00:00
Sergey Poznyakoff
f152367c57 Updated 2004-12-21 13:38:01 +00:00
Sergey Poznyakoff
a34d0e906f Updated 2004-12-21 13:27:50 +00:00
Sergey Poznyakoff
dcedecad2b Rewritten in xhtml to follow recent GNU site standards. 2004-12-21 13:27:28 +00:00
Sergey Poznyakoff
436741221c Discard stderr from sort, on some systems it spits out lots of irrelevant info. 2004-12-21 13:27:06 +00:00
Sergey Poznyakoff
8ccde495f4 Use AT_GZIP_PREREQ 2004-12-21 13:26:41 +00:00
Sergey Poznyakoff
29a6b977e9 (comprec.at,pipe.at): New tests 2004-12-21 13:26:07 +00:00
Sergey Poznyakoff
5129d9eb8c New test 2004-12-21 13:24:37 +00:00
Sergey Poznyakoff
b5c890b887 (main): Protect invocation of setlocale by ifdef. 2004-12-21 13:24:00 +00:00
Sergey Poznyakoff
2d57bb240d Bugfix. Changes introduced 2004-11-26 broke extraction from stdin. 2004-12-21 13:23:46 +00:00
Sergey Poznyakoff
554e50b438 Entry for 1.15.1 2004-12-21 13:23:27 +00:00
Sergey Poznyakoff
c6834baaf6 Raise version number to 1.15.1; Check for locale.h 2004-12-21 13:23:10 +00:00
Sergey Poznyakoff
17600e0de8 Updated 2004-12-20 14:02:22 +00:00
Sergey Poznyakoff
fb782b023f Updated 2004-12-20 13:59:15 +00:00
Sergey Poznyakoff
8d44c6b51e Added to the repository 2004-12-20 13:56:41 +00:00
Sergey Poznyakoff
c575787495 Removed 2004-12-20 13:56:31 +00:00
Sergey Poznyakoff
71850c6ab3 Document quicktest.sh 2004-12-20 13:55:37 +00:00
Sergey Poznyakoff
fa87656256 Distribute star/quicktest.sh 2004-12-20 13:55:22 +00:00
Sergey Poznyakoff
7c3510b40d (update_po): Give -r to wget. Always remove index.html
Ignore alloca-opt module (it duplicates alloca)
2004-12-20 13:55:06 +00:00
Sergey Poznyakoff
5f1e6a6a3b Raised version number to 1.15 2004-12-20 13:54:01 +00:00
Sergey Poznyakoff
aa600ee769 Updated 2004-12-18 20:14:34 +00:00
Sergey Poznyakoff
bf2b8556e8 Updated 2004-12-18 20:09:55 +00:00
Sergey Poznyakoff
8263cc7bc0 Added delete05.at 2004-12-18 20:08:56 +00:00
Sergey Poznyakoff
6af2e16b9b Fixed typo in AT_SETUP 2004-12-18 20:08:11 +00:00
Sergey Poznyakoff
664ec232d4 Test deletion of non-existing members 2004-12-18 20:07:59 +00:00
Sergey Poznyakoff
90b1e24487 (decode_options): Ignore --seek if used with --delete.
Delete.c is based on the assumption that the archive is being
actually read, not lseeked.
2004-12-18 20:07:04 +00:00
Sergey Poznyakoff
94f7d4e7c1 Document auto-detection of compressed archive formats. 2004-12-18 20:06:39 +00:00
Sergey Poznyakoff
6323ff0880 Updated 2004-12-18 20:06:18 +00:00
Sergey Poznyakoff
7b29b10847 Updated 2004-12-17 16:12:01 +00:00
Sergey Poznyakoff
e6a67c2eb5 (delete_archive_members): Bugfix: when
attempting to delete an unexisting member, the last
blocking_factor blocks were zeroed.
2004-12-17 16:10:36 +00:00
Paul Eggert
2e7378e819 * TODO: Mention sub-second resolution, lutimes, lchmod. 2004-12-14 19:07:44 +00:00
Paul Eggert
849ec50941 Mention sub-second resolution, lutimes, lchmod. 2004-12-14 19:07:20 +00:00
Paul Eggert
889b8a1046 Remove unnecessary entries from lib/.cvsignore and m4/.cvsignore. 2004-11-28 06:41:15 +00:00
Paul Eggert
2f034ae71b Remove pathmax.h, xstrdup.c. 2004-11-28 06:40:35 +00:00
Paul Eggert
bf8852627a Remove malloc.m4, pathmax.m4, realloc.m4. 2004-11-28 06:40:03 +00:00
Paul Eggert
73b52b1b9b Adjust to recent gnulib changes. 2004-11-28 06:32:01 +00:00
Sergey Poznyakoff
c69d2f6539 Updated 2004-11-26 19:12:09 +00:00
Sergey Poznyakoff
412fbeb90d Updated 2004-11-26 19:10:20 +00:00
Sergey Poznyakoff
322114744f (tar_checksum): New function 2004-11-26 19:09:48 +00:00
Sergey Poznyakoff
b5db978830 (tar_checksum): New function 2004-11-26 19:09:26 +00:00
Sergey Poznyakoff
4674867a23 (hit_eof): Changed type to boolean
(read_full_records,reading_from_pipe): New variables
(check_compressed_archive,open_compressed_archive): New functions
(open_archive): Autodetect compressed archives and act accodingly.
Set reading_from_pipe. This fixes contraversial set of changes
introduced 2004-05-11,2004-03-22.
2004-11-26 19:08:58 +00:00
Sergey Poznyakoff
d5f1626556 Updated 2004-11-26 19:08:25 +00:00
Sergey Poznyakoff
c8b0fd28c2 Concatenate multivolume archives 2004-11-26 19:08:14 +00:00
Sergey Poznyakoff
dcdbe18968 Raised version number to 1.14.91 2004-11-26 19:07:42 +00:00
Sergey Poznyakoff
6c941e0826 Updated 2004-11-26 15:55:32 +00:00
Sergey Poznyakoff
ff989f4b84 Updated 2004-11-16 11:03:05 +00:00
Sergey Poznyakoff
b2a65edf5c Fixed -o semantics. Thanks Jean Delvare <khali@linux-fr.org> 2004-11-16 11:02:45 +00:00
Sergey Poznyakoff
d305c258bf Updated 2004-10-25 15:59:44 +00:00
Sergey Poznyakoff
8ff11f27c1 Use locale_charset() from gnulib 2004-10-25 15:57:48 +00:00
Sergey Poznyakoff
5dee0c1348 (options): Use OPTION_NO_TRANS 2004-10-25 15:57:29 +00:00
Sergey Poznyakoff
b55daca933 (decode_header): Set uname/gname to NULL if their header counterparts are empty 2004-10-25 15:56:57 +00:00
Sergey Poznyakoff
f218c29b13 (LDADD): Add LIBICONV 2004-10-25 15:56:37 +00:00
Sergey Poznyakoff
1625cc5f67 Initialize SUFFIXES and CLEANFILES since the makefile snippet from localcharset uses '+=' on them. 2004-10-25 15:56:20 +00:00
Sergey Poznyakoff
c0f0d25271 Add localcharset 2004-10-25 15:55:59 +00:00
Sergey Poznyakoff
2ab1422c04 Minor fix 2004-10-25 15:55:27 +00:00
Sergey Poznyakoff
53a80edafc Updated 2004-10-25 15:55:11 +00:00
Sergey Poznyakoff
75284507b3 Updated 2004-10-04 09:33:11 +00:00
Sergey Poznyakoff
9b712b0fc8 Added Bryan Ford 2004-10-04 09:32:22 +00:00
Sergey Poznyakoff
d47a177d3d Added argp-help.c 2004-10-04 09:30:17 +00:00
Sergey Poznyakoff
2c7d98238b (.text): Fixed rule 2004-10-04 09:29:25 +00:00
Sergey Poznyakoff
9e2233007c Updated 2004-10-04 09:27:53 +00:00
Sergey Poznyakoff
06742ec624 New function check_cache_directory(),
called from dump_dir0() if exclude_caches_option is set,
to check for a cache directory tag and exclude the directory
if such a tag is found.
2004-10-04 09:27:13 +00:00
Sergey Poznyakoff
5b56886a72 New variable exclude_caches_option. 2004-10-04 09:26:42 +00:00
Sergey Poznyakoff
5db60955f5 New option --exclude-caches, to exclude
cache directories automatically on archive creation.
Cache directories are directories containing a
standardized tag file, as specified at:
	http://www.brynosaurus.com/cachedir/spec.html
2004-10-04 09:26:25 +00:00
Sergey Poznyakoff
52030539f7 Updated 2004-09-16 13:42:32 +00:00
Sergey Poznyakoff
e370518b43 Minor fix 2004-09-16 13:42:22 +00:00
Sergey Poznyakoff
3cb52ac16a Updated 2004-09-12 12:51:37 +00:00
Sergey Poznyakoff
75bf036edc Normalized use of remove_any_file(). 2004-09-12 12:50:31 +00:00
Sergey Poznyakoff
6cf99ce8ae (parse_opt): Emit warning if -l option is used.
(show_default_settings): REMOTE_SHELL may be undefined
2004-09-12 12:50:06 +00:00
Sergey Poznyakoff
ae3238495d Comment WANT_DIRECTORY_REMOVE_OPTION 2004-09-12 12:49:41 +00:00
Sergey Poznyakoff
33491a8d7c Added 'rtapelib.o: localedir.h' dependency 2004-09-12 12:48:54 +00:00
Sergey Poznyakoff
5fd2daf959 Updated 2004-09-07 18:53:08 +00:00
Sergey Poznyakoff
37ac08b3fe Updated 2004-09-07 18:52:03 +00:00
Sergey Poznyakoff
35cae74c4c Rewritten testsuite in autotest 2004-09-07 18:48:13 +00:00
Sergey Poznyakoff
a1c8c7bd47 Updated 2004-09-07 18:43:26 +00:00
Sergey Poznyakoff
71c05b230c Rewritten for autotest 2004-09-07 18:43:17 +00:00
Sergey Poznyakoff
cf2fa13bc5 (argp_program_version): Modified. 2004-09-07 18:43:05 +00:00
Sergey Poznyakoff
7d6865480e Updated for autotest 2004-09-07 18:42:47 +00:00
Sergey Poznyakoff
cadabfc4c7 Updated 2004-09-07 13:27:39 +00:00
Sergey Poznyakoff
6b401f904a Use genfile instead of mksparse 2004-09-07 13:27:22 +00:00
Sergey Poznyakoff
f3f06e8a71 Removed mksparse 2004-09-07 13:27:14 +00:00
Sergey Poznyakoff
8fed513af1 Integrated into (paxutils) genfile.c 2004-09-07 13:27:05 +00:00
Sergey Poznyakoff
00478f4bd3 Integrated into paxutils. 2004-09-07 13:26:41 +00:00
Sergey Poznyakoff
4ad940344a Install genfile.c from paxutils 2004-09-07 13:26:03 +00:00
Sergey Poznyakoff
b5d9942a35 Updated 2004-09-06 14:30:57 +00:00
Sergey Poznyakoff
c0b641f055 Updated 2004-09-06 14:30:21 +00:00
Sergey Poznyakoff
7347b4f5d5 Started merging with cpio into paxutils. 2004-09-06 14:28:55 +00:00
Sergey Poznyakoff
e3bd2a63a6 Updated 2004-09-03 09:22:20 +00:00
Sergey Poznyakoff
430b139592 Do not depend on any particular ordering of output. 2004-09-03 09:19:32 +00:00
Sergey Poznyakoff
06bb349ca9 Updated 2004-09-02 13:54:24 +00:00
Sergey Poznyakoff
2e419759d1 (usage): Minor fix 2004-09-02 13:53:30 +00:00
Sergey Poznyakoff
da3f3e0b3b Install rmt into rmtdir 2004-09-02 13:53:18 +00:00
Sergey Poznyakoff
a0404319e2 ew option --with-rmt. New configuration variable DEFAULT_RMT_DIR. Removed DEFAULT_RMT_COMMAND. 2004-09-02 13:53:03 +00:00
Sergey Poznyakoff
a2a6547e2d Document the use of -C option in file lists. Document --seek option. 2004-09-02 13:52:40 +00:00
Sergey Poznyakoff
5e30076bfd Updated 2004-09-01 15:10:04 +00:00
Sergey Poznyakoff
7c7da5f79f use genfile instead of dd 2004-09-01 15:09:33 +00:00
Sergey Poznyakoff
d1f3689d96 Raised version number to 1.14.90 2004-09-01 15:08:14 +00:00
Sergey Poznyakoff
ac830291f1 Updated 2004-09-01 15:06:09 +00:00
Sergey Poznyakoff
44283eb6ca Added listed02.sh 2004-09-01 15:06:00 +00:00
Sergey Poznyakoff
4ad0f97e2c New test 2004-09-01 15:05:50 +00:00
Sergey Poznyakoff
d14f101217 (register_individual_file,is_individual_file): New functions. 2004-09-01 15:05:28 +00:00
Sergey Poznyakoff
19335cdfb4 (dump_file0): Fix bug introduced 2004-02-21. 2004-09-01 15:05:09 +00:00
Sergey Poznyakoff
4e4e8c57fd (is_individual_file): New prototype 2004-09-01 15:04:46 +00:00
Sergey Poznyakoff
df6161b9fe Updated 2004-08-31 11:57:09 +00:00
Sergey Poznyakoff
33da1b2f64 Updated 2004-08-31 11:51:58 +00:00
Sergey Poznyakoff
28efbf6944 (unquote_string): Unquote '\a' and '\v'. Reported by Helmut Waitzmann <helmut.waitzmann@web.de> 2004-08-31 11:49:28 +00:00
Sergey Poznyakoff
678a4411ea (main): Call set_start_time() 2004-08-31 11:49:03 +00:00
Sergey Poznyakoff
001e5cf813 Fixed initialization of stat_info->is_sparse 2004-08-31 11:48:51 +00:00
Sergey Poznyakoff
fc264a87a8 (set_start_time, removed_prefixes_p): New prototypes. 2004-08-31 11:48:23 +00:00
Sergey Poznyakoff
68bd7ac50a When computing write rate do not take
into account the time needed to verify the archive(s).
The bug reported by John L. Males <jlmales@yahoo.com>
(set_start_time,compute_duration): New functions.
(print_total_written): Use the result of compute_duration().
(close_archive): Call compute_duration.
2004-08-31 11:48:05 +00:00
Sergey Poznyakoff
3f4f5a4bf4 (removed_prefixes_p): New function 2004-08-31 11:47:02 +00:00
Sergey Poznyakoff
e563240b95 (verify_volume): Call set_next_block_after
if read_header returns HEADER_FAILURE
Destroy and reinitialize content of current_stat_info and
extended_header after each iteration.
Issue a warning if the archive created contains some members
whose file names were stripped off their leading prefixes.
This is a temporary fix of the issue reported by Bdale Garbee
<bdale@gag.com> (Refs: Debian bug 230064, Message-Id
<87n07kyzhi.fsf@rover.gag.com>, Sun, 15 Feb 2004 11:22:17 -0700)
2004-08-31 11:45:55 +00:00
Sergey Poznyakoff
6522c25b8d (sparse_add_map): Fixed improper initializations
of sparse_map_size. We assume that whatever number it contains
describes adequately the current size of sparse_map. The only
number we need to reset is sparse_map_avail.
2004-08-31 11:45:16 +00:00
Sergey Poznyakoff
0ec47c16a9 Updated 2004-08-30 15:18:09 +00:00
Sergey Poznyakoff
b1f2c77860 Fix copy-n-paste errors in the license 2004-08-30 15:16:00 +00:00
Sergey Poznyakoff
607c1bf3b4 Updated 2004-08-19 13:13:37 +00:00
Sergey Poznyakoff
74b3e8ab49 Updated 2004-08-19 13:10:01 +00:00
Sergey Poznyakoff
8771e7c560 Renamed LIBPATH to LIBDIR.
New option -a (--all). Do not start restore unless
-a or patterns are given.
(restore_fs,restore_files): Fixed use of --listed option.
2004-08-19 13:09:37 +00:00
Sergey Poznyakoff
1992ef9496 (test_root): Append / to ROOT_FS unless it already ends in it. 2004-08-19 13:09:16 +00:00
Sergey Poznyakoff
73030de19f Renamed LIBPATH to LIBDIR.
Use ROOT_FS with -C option. Do not send mail
if ADMINISTRATOR is set to NONE.
2004-08-19 13:08:43 +00:00
Sergey Poznyakoff
a5f5e75388 Updated 2004-08-17 16:06:05 +00:00
Sergey Poznyakoff
bd599facc8 Fixed typo 2004-08-17 16:05:03 +00:00
Paul Eggert
7f27104062 In bootstrap, set LC_ALL=C and save some more gnulib m4 files. 2004-08-12 20:24:51 +00:00
Paul Eggert
e24d4efed0 Set LC_ALL=C so that file names sort consistently.
Prefer the gnulib copies of gettext.m4, glibc21.m4,
lib-ld.m4, lib-prefix.m4, po.m4 too.
2004-08-12 20:24:13 +00:00
Paul Eggert
a418ef678e Merge argp, getopt, xalloc changes from gnulib. 2004-08-12 18:37:09 +00:00
Paul Eggert
83acd3c604 Remove; gnulib now works unpatched. 2004-08-12 18:35:24 +00:00
Paul Eggert
303132dcdc Adjust to changes to gnulib xalloc module.
(extr_init): Remove assignment to xalloc_fail_func; no longer needed.
(xalloc_die): New function.
2004-08-12 18:34:40 +00:00
Paul Eggert
3848b93af6 Add fnmatch.h, getopt_.h, sysexit.h, xalloc-die.c. 2004-08-12 18:34:18 +00:00
Paul Eggert
93becc4f52 (_getopt_long_only_r): Remove check.
gl_ARGP now does this for us.
2004-08-12 18:33:13 +00:00
Paul Eggert
03092879ac (gnulib_modules): Add xalloc-die. 2004-08-12 18:32:54 +00:00
Sergey Poznyakoff
38f39174f2 Updated 2004-08-10 11:24:25 +00:00
Sergey Poznyakoff
1c0a13aade Added multiv03.sh 2004-08-10 11:17:58 +00:00
Sergey Poznyakoff
2d041189aa (flush_write): Limit filenames
of the members that straddle multivolume archive
boundary to 100 characters.
2004-08-10 11:17:16 +00:00
Sergey Poznyakoff
f6c0aee290 Updated 2004-08-09 11:26:16 +00:00
Sergey Poznyakoff
54e4a0df65 Rearranged leading comments. Added explicit references to original report messages wherever available. 2004-08-09 11:25:15 +00:00
Sergey Poznyakoff
34ff480be9 Added extrac05.sh 2004-08-09 11:24:31 +00:00
Sergey Poznyakoff
260acce7a3 (read_and): Call decode_header before calling skip_member()
(skip_member): Use is_sparse field to determine if the
member is a sparse file.
2004-08-09 11:24:06 +00:00
Sergey Poznyakoff
5a8a98cffe Updated 2004-08-08 14:22:00 +00:00
Sergey Poznyakoff
320298c663 Added link01.sh 2004-08-08 14:21:38 +00:00
Sergey Poznyakoff
4f3e70b0f9 New file 2004-08-08 14:21:07 +00:00
Sergey Poznyakoff
c50565d965 Improved compatibility with 1.13.25 2004-08-08 14:20:17 +00:00
Sergey Poznyakoff
df2c78e32b Extended --update-po option to take an optional argument specifying the po file to update. 2004-08-08 14:19:49 +00:00
Paul Eggert
56389381fc Remove patches/argp.diff; no longer needed. 2004-08-07 06:50:56 +00:00
Paul Eggert
45a6a18d85 Merge from gnulib; mostly FILESYSTEM_PREFIX_LEN -> FILE_SYSTEM_PREFIX_LEN. 2004-08-07 06:37:30 +00:00
Paul Eggert
68ff77508c (purge_directory): Fix format buffer typos in warning strings. 2004-08-07 06:33:59 +00:00
Paul Eggert
43ca8709c0 (parse_opt): FILESYSTEM_PREFIX_LEN -> FILE_SYSTEM_PREFIX_LEN 2004-08-07 06:33:34 +00:00
Paul Eggert
c4e054673b (excluded_name, safer_name_suffix, stripped_prefix_len):
FILESYSTEM_PREFIX_LEN -> FILE_SYSTEM_PREFIX_LEN.
2004-08-07 06:33:07 +00:00
Paul Eggert
df6200e97e (must_be_dot_or_slash): FILESYSTEM_PREFIX_LEN -> FILE_SYSTEM_PREFIX_LEN. 2004-08-07 06:32:41 +00:00
Paul Eggert
9ae5a981fc Include <getcwd.h>.
(extract_archive): Rewrite with new macro IS_ABSOLUTE_FILE_NAME.
(make_directories):
FILESYSTEM_PREFIX_LEN -> FILE_SYSTEM_PREFIX_LEN.
2004-08-07 06:32:12 +00:00
Paul Eggert
7287be445e Remove addext.c, malloc.c, realloc.c. 2004-08-07 06:31:20 +00:00
Paul Eggert
cafa07d966 Don't use valloc; it's buggy on some GNU/Linux systems, and it returns
storage that can't be freed on older BSD systems.
2004-08-03 04:46:37 +00:00
Paul Eggert
9038410bb7 (valloc): Remove. 2004-08-03 04:45:57 +00:00
Paul Eggert
f3da0c26b8 (quote_n, quote): Remove these redundant functions.
(ptr_align): New function, from coreutils/src/system.h.
(page_aligned_alloc): New function.
2004-08-03 04:45:05 +00:00
Paul Eggert
82eff37f6f (page_aligned_alloc): New decl. 2004-08-03 04:44:39 +00:00
Paul Eggert
6869d0f6b3 (diff_init): Don't use valloc; on older or buggy hosts, you can't
free the result.  Use page_aligned_alloc instead.
2004-08-03 04:44:13 +00:00
Paul Eggert
81460a0349 (record_buffer): New var.
(open_archive): Don't use valloc; on older or buggy hosts, you can't
free the result.  Use page_aligned_alloc instead.
Record the pointer to be freed into record_buffer.
(close_archive): Free record_buffer.
2004-08-03 04:43:38 +00:00
Paul Eggert
ae29dcca87 Add getpagesize.m4. 2004-08-03 04:42:53 +00:00
Paul Eggert
ac7c2b7116 Add getpagesize.h. 2004-08-03 04:42:35 +00:00
Paul Eggert
08cba4e4e5 (valloc): Remove check; valloc no longer used. 2004-08-03 04:42:18 +00:00
Paul Eggert
d81b5d6f1e (gnulib_modules): Add getpagesize. 2004-08-03 04:41:48 +00:00
Paul Eggert
55ec665a41 Add fchown-stub.c 2004-07-10 06:51:38 +00:00
Paul Eggert
4ab8cff6b3 * lib/.cvsignore: Add fchown-stub.c. 2004-07-10 06:51:17 +00:00
Paul Eggert
e4afe72b7a src/extract.c (extract_archive): Do not report an error
when hard-linking X to X when X exists.
2004-07-10 06:14:51 +00:00
Paul Eggert
0a3a9744f7 (extract_archive): Do not report an error
when hard-linking X to X when X exists.
2004-07-10 06:13:28 +00:00
Sergey Poznyakoff
ad548198f3 Added Martin Simmons 2004-06-29 10:17:38 +00:00
Sergey Poznyakoff
4f732c1595 Updated 2004-06-29 10:13:14 +00:00
Sergey Poznyakoff
f94cf6216b (gnu_restore): Renamed to purge_directory().
Do not attempt to purge the directory if it is on a different
device and one_file_system_option is set.
2004-06-29 10:11:46 +00:00
Sergey Poznyakoff
44391cb932 (extr_init): Save the device number
of the root device.
(extract_archive): Renamed gnu_restore() to purge_directory().
2004-06-29 10:11:13 +00:00
Sergey Poznyakoff
af15956c4d (root_device): New global.
(gnu_restore): Renamed to purge_directory().
2004-06-29 10:10:26 +00:00
Sergey Poznyakoff
402b50d4d2 Updated 2004-06-29 10:09:52 +00:00
Sergey Poznyakoff
240a4ed90a Updated 2004-06-25 10:33:06 +00:00
Sergey Poznyakoff
6938706958 The actual default for exclude patterns is --no-anchored. Thanks "Felix Natter" <felix.natter@ldc.de> for noticing. 2004-06-25 10:32:44 +00:00
Sergey Poznyakoff
cd2c8d4fbb The actual default for exclude patterns is --no-anchored. Fixed. 2004-06-25 10:32:27 +00:00
Sergey Poznyakoff
421043b6b1 Updated 2004-06-22 09:30:57 +00:00
Sergey Poznyakoff
24aa94e5cf Fixed docstring for --checkpoint option. 2004-06-22 09:30:32 +00:00
Sergey Poznyakoff
8160c0dae9 Fixed several inconsistencies. 2004-06-22 09:30:01 +00:00
Sergey Poznyakoff
53614b3dff Updated 2004-05-19 14:30:21 +00:00
Sergey Poznyakoff
23c2244ddf Updated 2004-05-19 14:28:20 +00:00
Sergey Poznyakoff
ebdf1bc7a6 Determine type of the archive before appending to it. 2004-05-19 14:27:41 +00:00
Sergey Poznyakoff
ba08e339a6 (struct fmttab): Accept 'pax' as alias
for 'posix'
(options): New option -n (--seek).
2004-05-19 14:27:22 +00:00
Sergey Poznyakoff
951b0370df (skip_file): Use seek_archive() if possible. 2004-05-19 14:26:25 +00:00
Sergey Poznyakoff
167f5ba2bc (seek_archive): New function
(seekable_archive): New global.
2004-05-19 14:25:55 +00:00
Sergey Poznyakoff
488430f739 (seek_archive): New function 2004-05-19 14:25:27 +00:00
Sergey Poznyakoff
80c29e6315 Fix typo 2004-05-19 10:59:25 +00:00
Sergey Poznyakoff
432b157a28 Updated 2004-05-19 10:58:04 +00:00
Sergey Poznyakoff
b121917368 (safer_name_suffix): Fixed bug intraduced 2004-05-11. 2004-05-19 10:57:25 +00:00
Sergey Poznyakoff
fa8cb1895c Updated 2004-05-19 10:35:23 +00:00
Sergey Poznyakoff
64759986a9 Document -H option 2004-05-19 10:34:09 +00:00
Sergey Poznyakoff
d4d6c23008 New option -H (short alias to --format) 2004-05-19 10:33:26 +00:00
Sergey Poznyakoff
325a45f0f1 New option --update-po 2004-05-19 10:32:52 +00:00
Sergey Poznyakoff
f41e484f23 Updated 2004-05-16 20:57:53 +00:00
Sergey Poznyakoff
141d267691 Minor formatting fix 2004-05-16 20:56:05 +00:00
Sergey Poznyakoff
3331593d8d Updated 2004-05-16 20:55:18 +00:00
Sergey Poznyakoff
3344bf9380 Minor fix 2004-05-16 20:51:21 +00:00
Sergey Poznyakoff
463d99453f Fix improper use of 'path' word 2004-05-16 20:50:55 +00:00
Sergey Poznyakoff
d2d5d64cb4 Minor fix. 2004-05-16 20:49:53 +00:00
Sergey Poznyakoff
32ebe16224 Updated 2004-05-16 20:48:14 +00:00
Sergey Poznyakoff
a447fd3714 Use argp for command line parsing. 2004-05-16 20:47:47 +00:00
Sergey Poznyakoff
792965270b Check for _getopt_long_only_r and force using included version of getopt if the function is not available. 2004-05-16 20:47:07 +00:00
Sergey Poznyakoff
916019e417 Added to the repository 2004-05-16 20:46:30 +00:00
Sergey Poznyakoff
3ee93d341e Apply patches from 'patches' subdirectory 2004-05-16 20:46:02 +00:00
Sergey Poznyakoff
dd4cef1699 Added to the repository 2004-05-16 09:04:16 +00:00
Sergey Poznyakoff
8286de0946 Updated. 2004-05-13 08:25:51 +00:00
Sergey Poznyakoff
a65779d558 Renamed strip_path_option to strip_components_option 2004-05-13 08:24:32 +00:00
Sergey Poznyakoff
e1a4fea80d Raised version number to 1.14.1 2004-05-13 08:23:47 +00:00
Sergey Poznyakoff
5608be67f7 Renamed --strip-path to --strip-components
Changed improper use of _() to ngettext().
2004-05-13 08:22:28 +00:00
Sergey Poznyakoff
0a79415a97 Updated 2004-05-11 14:25:18 +00:00
Sergey Poznyakoff
f730b47314 Minor correction 2004-05-11 14:24:50 +00:00
Sergey Poznyakoff
48c24ac711 (decode_options): Fixed typo in the comment. 2004-05-11 14:24:23 +00:00
Sergey Poznyakoff
3e8f210904 (open_archive): Removed assignment to read_full_records_option. 2004-05-11 14:23:25 +00:00
Sergey Poznyakoff
ee56bd0d0b (sys_child_open_for_uncompress): Do not
set read_full_records_option: the compressed archive is
likely not to contain integer number of records. Should
the user wish to use reblocking, he may always give tar
-B option. This is a minor improvement over the change
dated 2004-03-22.
2004-05-11 14:17:28 +00:00
Sergey Poznyakoff
ecb338ad8e (safer_name_suffix): (safer_name_suffix): Use "%s"
as the format argument, rather than a possibly-translated variable
string. Patch provided by Jim Meyering  <jim@meyering.net>
2004-05-11 14:12:39 +00:00
Sergey Poznyakoff
ce486a8fd7 Updated 2004-05-11 13:15:18 +00:00
Sergey Poznyakoff
abba83af27 New file 2004-05-11 13:12:56 +00:00
Sergey Poznyakoff
823f96841c Rewritten. Added rules for generating documentation for the project's website. 2004-05-11 13:10:45 +00:00
Sergey Poznyakoff
95256b3c07 Updated 2004-05-11 09:25:59 +00:00
Sergey Poznyakoff
a7109edd94 Added copyleft statement 2004-05-11 09:25:30 +00:00
Sergey Poznyakoff
0500b1ba3e Raised version number to 1.14 2004-05-11 09:25:15 +00:00
Sergey Poznyakoff
e8fa866d3a Updated 2004-05-10 13:50:42 +00:00
Sergey Poznyakoff
3e0962674f Quote TAR_ARCHIVE_FORMATS 2004-05-10 13:48:57 +00:00
Sergey Poznyakoff
3295d54e21 (compare): Fixed argument quoting under eval 2004-05-10 13:48:23 +00:00
Sergey Poznyakoff
be8899e6aa Fixed prerequisite headers for sys/buf.h (needed on FreeBSD) 2004-05-10 13:47:52 +00:00
Sergey Poznyakoff
b5aff8401f Updated 2004-05-10 11:48:07 +00:00
Sergey Poznyakoff
933d42174f Updated 2004-05-10 11:46:56 +00:00
Sergey Poznyakoff
33715a50a3 New option --rmt-command.
(decode_options): Handle --rmt-command. Initialize
rmt_command_option to DEFAULT_RMT_COMMAND.
2004-05-10 11:42:23 +00:00
Sergey Poznyakoff
3be53a3c2f Use rmt_command_option instead of hardcoded "/etc/rmt". 2004-05-10 11:41:43 +00:00
Sergey Poznyakoff
4c004cff39 (read_and): Print block number before
issuing 'Skipping to next header' diagnostics, if
requested by block_number_option.
2004-05-10 11:41:23 +00:00
Sergey Poznyakoff
1c623b11f6 (rmt_command_option): New variable. 2004-05-10 11:40:55 +00:00
Sergey Poznyakoff
898dc536c6 (localedir.h rule): Generate correct DEFAULT_RMT_COMMAND variable. 2004-05-10 11:39:51 +00:00
Sergey Poznyakoff
2b708cb119 Fixed --version output. 2004-05-10 11:38:54 +00:00
Sergey Poznyakoff
c6096f64c5 Fixed --version output.
Fixed initialization of the listing files and printing
the time of the last previous level dump.
2004-05-10 11:38:16 +00:00
Sergey Poznyakoff
b9c6ebab26 Install the scripts only if requested by the configure. 2004-05-10 11:37:54 +00:00
Sergey Poznyakoff
bc07e8cce4 Call gl_AC_TYPE_INTMAX_T. Document
DEFAULT_.* variables. Use DEFAULT_RMT_COMMAND to set
the pathname of the rmt utility.
New option --enable-backup-scripts.
2004-05-10 11:37:31 +00:00
Sergey Poznyakoff
289687bd1c Updated 2004-05-10 11:36:40 +00:00
Sergey Poznyakoff
ee3b833d37 Updated 2004-05-10 08:04:37 +00:00
Sergey Poznyakoff
ad63cd4904 Updated 2004-05-08 22:25:22 +00:00
Sergey Poznyakoff
d58eaa815d Minor fix 2004-05-08 22:22:24 +00:00
Sergey Poznyakoff
f71b35b3f6 Removed 2004-05-08 22:19:40 +00:00
Sergey Poznyakoff
10eef2def8 Updated 2004-05-08 22:18:38 +00:00
Sergey Poznyakoff
07727fe74a Updated 2004-05-08 22:16:17 +00:00
Sergey Poznyakoff
ef87ce7d10 New file 2004-05-08 22:14:52 +00:00
Sergey Poznyakoff
22fae29fb7 New file. Source for backup.sh 2004-05-08 22:14:05 +00:00
Sergey Poznyakoff
981980ac31 Removed 2004-05-08 22:12:18 +00:00
Sergey Poznyakoff
6246fffacd Updated 2004-05-08 22:11:21 +00:00
Sergey Poznyakoff
e128aa980c Updated 2004-05-07 15:04:44 +00:00
Sergey Poznyakoff
21002fe811 Updated 2004-05-07 15:04:10 +00:00
Sergey Poznyakoff
13ac1dcc0f Updated 2004-05-07 15:01:31 +00:00
Sergey Poznyakoff
1695e161be Added copyleft header 2004-05-07 14:59:19 +00:00
Sergey Poznyakoff
66cc5df1c6 Added copyleft header 2004-05-07 14:54:29 +00:00
Sergey Poznyakoff
fc22e70a00 Updated 2004-05-07 14:49:35 +00:00
Sergey Poznyakoff
43d020e35c test if -C works when used with --same-order 2004-05-07 14:48:59 +00:00
Sergey Poznyakoff
6c1654791d (name_gather): Bugfix: Honor single -C with --same-order 2004-05-07 14:46:37 +00:00
Sergey Poznyakoff
4cca5e5887 Updated 2004-05-06 09:26:58 +00:00
Sergey Poznyakoff
24af03768f Updated 2004-05-06 09:16:53 +00:00
Sergey Poznyakoff
d2d8f9ab55 Updated 2004-05-06 09:16:06 +00:00
Sergey Poznyakoff
31e36b1e93 Updated for new directory contents. 2004-05-06 09:15:35 +00:00
Sergey Poznyakoff
6c4dc180dd Added to the repository 2004-05-06 09:14:51 +00:00
Sergey Poznyakoff
0273b1ae09 Removed 2004-05-06 09:14:29 +00:00
Sergey Poznyakoff
640effdebd Check whether date accepts +format argument (for backup scripts). 2004-05-06 09:11:32 +00:00
Sergey Poznyakoff
d21a12cf62 Oops, sorry. Mistakingly added... 2004-05-05 20:49:07 +00:00
Sergey Poznyakoff
6d9cdefe83 Added to the repository 2004-05-05 20:45:36 +00:00
Sergey Poznyakoff
19d51157a5 Updated 2004-05-05 11:56:23 +00:00
Sergey Poznyakoff
4e2d5f2ee8 --utc implies -vv 2004-05-05 11:56:04 +00:00
Sergey Poznyakoff
de5ec134a1 Udated 2004-05-05 11:55:18 +00:00
Sergey Poznyakoff
45399a7e81 Updated 2004-04-28 07:44:41 +00:00
Sergey Poznyakoff
e662d0f367 Make sure ICONV_CONST is defined. AM_ICONV does not define it if it fails to find iconv.h. 2004-04-28 07:44:19 +00:00
Sergey Poznyakoff
b7336abee0 Updated 2004-04-26 13:49:10 +00:00
Sergey Poznyakoff
dca678e62f Updated 2004-04-26 13:48:50 +00:00
Sergey Poznyakoff
39e95d7eee Synchronized with the recent changes. 2004-04-26 13:44:19 +00:00
Sergey Poznyakoff
4b6f666105 Include stpcpy.h 2004-04-26 13:43:20 +00:00
Sergey Poznyakoff
a963130dd7 Updated 2004-04-26 13:42:24 +00:00
Sergey Poznyakoff
6f7d0eb14d Updated 2004-04-26 13:41:27 +00:00
Sergey Poznyakoff
8ad16912cf Generate Makefile.am from Makefile.tmpl 2004-04-26 13:40:50 +00:00
Sergey Poznyakoff
e17093af78 Invoke tar_GNULIB to configure gnulib stuff. 2004-04-26 13:38:41 +00:00
Sergey Poznyakoff
c5997e92f0 Use gnulib-tool to generate lib/Makefile.am and parts of configure.ac 2004-04-26 13:38:14 +00:00
Sergey Poznyakoff
7be4d61e92 Updated 2004-04-26 09:24:27 +00:00
Sergey Poznyakoff
af244aeef3 Produce an error, not warning, if the filename is too long. 2004-04-26 09:19:07 +00:00
Sergey Poznyakoff
005449337c Updated 2004-04-20 11:07:33 +00:00
Sergey Poznyakoff
a6d294236b Fixed typo 2004-04-20 11:07:04 +00:00
Sergey Poznyakoff
f5461e304c Bugfix by Jrgen Weigert 2004-04-20 11:06:35 +00:00
Sergey Poznyakoff
3087f4c1c9 Fixed test for iconv_t 2004-04-20 11:06:08 +00:00
Paul Eggert
1b0a1ba7ed Merge getdate documentation changes from coreutils. 2004-04-05 05:46:08 +00:00
Paul Eggert
2bda83b48d Merge recent gnulib changes, and remove some lint. 2004-04-05 02:29:18 +00:00
Sergey Poznyakoff
41d042c05f Updated 2004-04-04 13:33:54 +00:00
Sergey Poznyakoff
b826791a01 Added mksparse 2004-04-04 13:32:11 +00:00
Sergey Poznyakoff
2a384c4a84 Protect inclusion of <sys/time.h>
by ifdef.
Declare time() if HAVE_DECL_TIME is 0
2004-04-04 13:31:26 +00:00
Sergey Poznyakoff
f9dc020f90 Raised version number to 1.13.94 2004-04-04 13:30:42 +00:00
Sergey Poznyakoff
466e40abe5 Updated 2004-04-04 13:30:14 +00:00
Sergey Poznyakoff
f131340d6d Updated 2004-04-04 10:12:56 +00:00
Sergey Poznyakoff
7e2a46c522 Added missing call to 'after' 2004-04-04 10:12:08 +00:00
Sergey Poznyakoff
6dd96965de Updated 2004-04-04 09:53:18 +00:00
Sergey Poznyakoff
1bcc35dda0 Updated 2004-04-04 09:50:42 +00:00
Sergey Poznyakoff
2b861845e9 Updated 2004-04-04 09:48:45 +00:00
Sergey Poznyakoff
6cab217353 Added Mads Martin Joergensen 2004-04-04 09:47:35 +00:00
Sergey Poznyakoff
a5bafe7962 (usage): Prototype moved to common.h 2004-04-04 09:47:08 +00:00
Sergey Poznyakoff
096bf74fcf include <fnmatch.h>
(size_decoder): Assign to both st->archive_file_size and
st->stat.st_size.
(st->stat.st_size): Assign to st->stat.st_size
(sparse_numbytes_decoder): Removed unused variable
2004-04-04 09:43:09 +00:00
Sergey Poznyakoff
a55ec0a319 (utf8_convert): Changed prototype
(get_input_charset): Removed unused variable
2004-04-04 09:42:27 +00:00
Sergey Poznyakoff
61f44c9361 (usage): Prototype moved to common.h 2004-04-04 09:41:16 +00:00
Sergey Poznyakoff
55a96565b5 Include <sys/time.h> and <utime.h> when available 2004-04-04 09:33:41 +00:00
Sergey Poznyakoff
15a607fc11 (struct tar_sparse_optab.sparse_member_p)
(struct tar_sparse_optab.fixup_header): New member
(tar_sparse_member_p): New function.
(tar_sparse_init): Return true if decode_header is not provided
(tar_sparse_fixup_header)
(sparse_member_p,sparse_fixup_header)
(sparse_skip_file)
(oldgnu_sparse_member_p,oldgnu_fixup_header,star_sparse_member_p)
(star_fixup_header, pax_sparse_member_p): New function
(pax_decode_header): Remove
2004-04-04 09:33:25 +00:00
Sergey Poznyakoff
1329cfe9f8 include "common.h" 2004-04-04 09:32:33 +00:00
Sergey Poznyakoff
3ff03c0c5e (decode_header): Use sparse_fixup_header to correct
the st_size value.
(print_header): Do not rely on GNUTYPE_SPARSE type.
Use st->stat.st_size to print real file size.
(skip_member): Assign stat_info.file_name to save_name. This fixes
bug reported by Mads Martin Joergensen <mmj@suse.de>
Use sparse_skip_file() to skip sparse members.
2004-04-04 09:31:44 +00:00
Sergey Poznyakoff
3030a247b1 (extract_archive): Use sparse_member_p instead of GNUTYPE_SPARSE. 2004-04-04 09:26:11 +00:00
Sergey Poznyakoff
22c2e2ab8a Removed unused variables 2004-04-04 09:25:48 +00:00
Sergey Poznyakoff
be48ff0699 (diff_archive): Use is_sparse member instead of GNUTYPE_SPARSE. 2004-04-04 09:25:30 +00:00
Sergey Poznyakoff
a1d15e7c89 Added missing prototypes 2004-04-04 09:25:01 +00:00
Sergey Poznyakoff
ad2c53d626 Added new tests 2004-04-04 09:24:44 +00:00
Sergey Poznyakoff
8c0cb259bf Updated 2004-03-26 19:43:51 +00:00
Sergey Poznyakoff
472f860074 Add longv7.sh 2004-03-26 19:40:27 +00:00
Sergey Poznyakoff
d8981440bb (write_long_name): Do not allow more than
NAME_FIELD_SIZE-1 characters in a file name for V7 format
archives.
2004-03-26 19:39:40 +00:00
Sergey Poznyakoff
7f2e3cf63a Updated 2004-03-22 12:01:46 +00:00
Sergey Poznyakoff
f7dbd14d57 Updated to match the recent changes 2004-03-22 12:00:12 +00:00
Sergey Poznyakoff
106a24176e (open_archive): Clear read_full_records_option
if reading from a pipe.
(short_read): Display warning about the deduced record size
if version > 1
2004-03-22 11:59:35 +00:00
Sergey Poznyakoff
c83fcab116 Updated 2004-03-22 09:18:36 +00:00
Sergey Poznyakoff
4cb8697f60 Use genfile instead of dd 2004-03-22 09:17:48 +00:00
Sergey Poznyakoff
6bd7b64c78 (to_decimal): New function.
(xheader_format_name): Use to_decimal() instead of snprintf.
2004-03-22 09:17:18 +00:00
Sergey Poznyakoff
e5882c8220 (start_header): Check for GNU_FORMAT if incremental_option is set. 2004-03-22 09:16:49 +00:00
Sergey Poznyakoff
72e3da5dc7 Added gl_FUNC_STRTOULL 2004-03-22 09:15:56 +00:00
Sergey Poznyakoff
7b0b6c4e7a Updated 2004-03-12 10:39:27 +00:00
Sergey Poznyakoff
683390b02d (read_and): Stop processing the archive after
encountering a single zero record. Many old archives contain
arbitrary garbage after it.
The warning is issued anyway.
2004-03-12 10:38:46 +00:00
Sergey Poznyakoff
e189bd8eca Updated 2004-03-02 09:36:20 +00:00
Sergey Poznyakoff
5282ef9709 (utf8_convert): Indentation fix. 2004-03-02 09:35:13 +00:00
Sergey Poznyakoff
b38e4b4520 Added Leland Lucius 2004-03-02 09:34:44 +00:00
Sergey Poznyakoff
9f14fd52de (rmt_lseek__,rmt_ioctl__): Bugfix. The
conversion buffer was not null terminated. Fix provided
by Leland Lucius <llucius@tiny.net>
2004-03-02 09:34:06 +00:00
Sergey Poznyakoff
2345d02c63 Updated 2004-02-29 10:21:17 +00:00
Sergey Poznyakoff
6f219c485e Updated 2004-02-29 10:18:05 +00:00
Sergey Poznyakoff
a06ed48867 Added multi-fail.sh 2004-02-29 10:17:18 +00:00
Sergey Poznyakoff
d6929326e7 New test. 2004-02-29 10:16:33 +00:00
Sergey Poznyakoff
7fb546943e (sys_child_open_for_uncompress): Minor stylistic fix. 2004-02-29 10:16:02 +00:00
Sergey Poznyakoff
37400fa94e (flush_read): Bugfix: the condition at line 714 included
|| (status > 0 && !read_full_records_option)

which is grossly wrong, since even if new_volume() below succeeds,
the subsequent call to rmtread will overwrite the chunk of data
already read in the buffer and thus spoil everything.
2004-02-29 10:15:45 +00:00
Sergey Poznyakoff
8c1b242931 Updated 2004-02-29 00:15:05 +00:00
Sergey Poznyakoff
176557a004 New file 2004-02-29 00:09:31 +00:00
Sergey Poznyakoff
427f8d6185 Accomodate for the new testsuite logic 2004-02-29 00:07:00 +00:00
Sergey Poznyakoff
d584c1ed0f Rewritten 2004-02-29 00:06:36 +00:00
Sergey Poznyakoff
a8d1b579d7 Added new tests 2004-02-29 00:06:16 +00:00
Sergey Poznyakoff
5a9174376b New options: --utc and keep-newer-files 2004-02-29 00:06:03 +00:00
Sergey Poznyakoff
cedd9d6e81 (tartime): Print UTC if --utc was given. 2004-02-29 00:05:31 +00:00
Sergey Poznyakoff
29584d69fd Handle --keep-newer-files option 2004-02-29 00:05:12 +00:00
Sergey Poznyakoff
236deef28e (utc_option): new global
(enum old_files.KEEP_NEWER_FILES): New element
2004-02-29 00:04:50 +00:00
Sergey Poznyakoff
ca84e28ee5 Removed spurious AC_CHECK_LIB(iconv) 2004-02-29 00:04:21 +00:00
Sergey Poznyakoff
81bf1687f8 Updated 2004-02-29 00:04:03 +00:00
Paul Eggert
7afd75ed24 Append period to dircategory entry. 2004-02-26 18:02:50 +00:00
Sergey Poznyakoff
3dbc6a6645 Updated 2004-02-24 15:28:27 +00:00
Sergey Poznyakoff
d8b790047f (decode_header): Call xheader_decode before the assignment to current_stat_info.archive_file_size. 2004-02-24 15:27:54 +00:00
Paul Eggert
fb9a7d180f Invoke AM_ICONV, to define ICONV_CONST if needed. 2004-02-23 22:31:20 +00:00
Sergey Poznyakoff
6a887bbbe5 Updated 2004-02-23 10:07:21 +00:00
Sergey Poznyakoff
9e0d059205 Use prereq() instead of passing arguments to 'before'. 2004-02-23 10:05:42 +00:00
Sergey Poznyakoff
97b9e3d31c Move testing of the prerequisite archive formats
to the separate function 'prereq'. Do not expect any arguments
2004-02-23 10:05:22 +00:00
Sergey Poznyakoff
7add6e4274 Updated 2004-02-23 10:04:49 +00:00
Sergey Poznyakoff
96148abcfe Added UTF-8 support. Finished global extended header support. 2004-02-22 21:00:07 +00:00
Sergey Poznyakoff
a00631babf Give credit to Andreas Schuldei. 2004-02-22 20:55:12 +00:00
Sergey Poznyakoff
b8754a37c7 Use keywords from the global headers.
Correctly handle UTF-8 conversions.
(xheader_list_destroy): New function.
(xheader_set_single_keyword,xheader_set_keyword_equal): Added
missing gettext markers
(decode_record): Rewritten using caller-provided handler and
data closure.
2004-02-22 20:54:44 +00:00
Sergey Poznyakoff
fb766eefb4 Decode encountered global headers. 2004-02-22 20:54:04 +00:00
Sergey Poznyakoff
b1f33c8362 (write_header_name) In pax format, use "path" keyword if the file name is not ASCII 2004-02-22 20:53:27 +00:00
Sergey Poznyakoff
7a8bded5dd Added utf8.c 2004-02-22 20:52:56 +00:00
Sergey Poznyakoff
2de1477b3d Conversions to and from utf-8. 2004-02-22 20:52:34 +00:00
Sergey Poznyakoff
634927b7d2 Detect libiconv 2004-02-22 20:51:10 +00:00
Sergey Poznyakoff
7eeb467132 Minor fix 2004-02-22 20:50:33 +00:00
Sergey Poznyakoff
6847d128e9 Updated 2004-02-21 09:41:19 +00:00
Sergey Poznyakoff
44da0983c0 Sorry, the version number is .93 2004-02-21 09:40:45 +00:00
Sergey Poznyakoff
dfbfc2446f Updated 2004-02-21 09:38:29 +00:00
Sergey Poznyakoff
c145d8a6e3 Added listed01.sh 2004-02-21 09:36:15 +00:00
Sergey Poznyakoff
985199c260 Check listed incremental backups on individual files. 2004-02-21 09:35:44 +00:00
Sergey Poznyakoff
e8af2fec8a Minor stylistic fixes. 2004-02-21 09:35:10 +00:00
Sergey Poznyakoff
ee6aa2bea8 Raised patchlevel to 92a 2004-02-21 09:34:39 +00:00
Sergey Poznyakoff
2ad098dfff Updated 2004-02-21 09:34:22 +00:00
Sergey Poznyakoff
b960c38c4b (dump_file0): The conditional at line
1296 prevented incremental backups on individual files
from working, as reported by Andreas Schuldei
<andreas@schuldei.org>.

This is due to the condition

  (0 < top_level || !incremental_option)

Removing it makes incremental backups work for individual
files as well as for directories. On the other hand, it does
not affect other functionality, as shown by the reasoning below:

To begin with, the two parts of this condition are mutually
superfluous, because

  1) when top_level < 0, incremental_option == 1
  so the condition yields false
  2) when top_level >= 0, incremental_option == 0
  so the condition yields true.

In other words, it is completely equivalent to

      (!incremental_option)

Now, let's consider the effect of its removal. There are two cases:

1) when incremental_option==1
This means incremental backup in progress. In this case dump_file
is invoked only for directories or for files marked with 'Y' by
get_directory_contents. The latter are those that did not meet the
condition in incremen.c:242, which is exactly the same condition
as this at create.c:1296. So, for these files the check
(!incremental_option) is useless, since the rest of the
conditional will yield false anyway. On the other hand, if
dump_file is invoked on a directory, the conditional will yield
false due to !S_ISDIR assertion, so these will be processed as usual.

Thus, for this case the extra condition (!incremental_option) is
irrelevant, and its removal won't alter the behavior of tar,
*except* that it will enable incremental backups on individual
files, which is the wanted effect.

2) when incremental_option==0
In this case the condition yields true and its removal does not
affect the functionality.
2004-02-21 09:33:58 +00:00
Sergey Poznyakoff
ccaedb6b29 Updated 2004-02-20 15:42:41 +00:00
Sergey Poznyakoff
d46025b23c (sort_obstack): Fixed typo in the comment 2004-02-20 15:40:47 +00:00
Sergey Poznyakoff
72ac31581d (decode_header): Call xheader_decode unconditionally. 2004-02-20 15:39:45 +00:00
Sergey Poznyakoff
64cca92a1f (delete_archive_members): Call xheader_decode unconditionally. 2004-02-20 15:39:29 +00:00
Sergey Poznyakoff
c487595864 Require gnu or oldgnu format 2004-02-20 15:36:18 +00:00
Sergey Poznyakoff
29e59e07b1 Require gnu, oldgnu or posix format 2004-02-20 15:35:30 +00:00
Sergey Poznyakoff
74d29bc5de Accept an optional list of allowed archive
formats. Exit with the status 77 if the current archive
format does not match any of them.
2004-02-20 15:35:19 +00:00
Sergey Poznyakoff
069c0d99ae Document new default for extended header names. 2004-02-20 15:34:37 +00:00
Sergey Poznyakoff
f038194718 (xheader_format_name): Bugfix.
(xheader_xhdr_name): Changed the default extended header name
to '%d/PaxHeaders.%p/%f', as POSIX requires.
(xheader_ghdr_name): Removed unused argument.
(xheader_write,xheader_write_global): New function.
(xheader_decode): Modified to honor overrides whatever
the current archive format is.
2004-02-20 15:34:12 +00:00
Sergey Poznyakoff
eff25ef359 (update_archive): Write global extended header if constructed. 2004-02-20 15:33:12 +00:00
Sergey Poznyakoff
b3060eabaf (assert_format): Do not bail out if several
--format arguments are given. This is a common case when
TAR_OPTIONS are used.
(decode_options): New option --show-defaults displays the
compiled-in defaults.

Use POSIX format if no --format option was given and
--pax-option was specified.

Do not allow to use --pax-option unless the archive format is
set to POSIX (or reading subcommand is requested).
2004-02-20 15:32:56 +00:00
Sergey Poznyakoff
93a4273b66 (start_private_header): Removed static qualifier.
(write_extended): Removed superfluous last argument. Use
xheader_write()
(simple_finish_header): New function.
(finish_header): Use simple_finish_header() to break recursive
dependency between this function and write_extended().
2004-02-20 15:32:12 +00:00
Sergey Poznyakoff
17be45c834 (simple_finish_header,start_private_header): New
declarations
(xheader_ghdr_name): Changed declaration
2004-02-20 15:30:26 +00:00
Sergey Poznyakoff
694f427d0e Updated 2004-02-20 11:46:33 +00:00
Sergey Poznyakoff
b4e605a829 Added a comment 2004-02-20 11:45:15 +00:00
Sergey Poznyakoff
b58452bdbd Documented --pax-option 2004-02-20 11:44:46 +00:00
Sergey Poznyakoff
ff541dcac6 Updated 2004-02-18 14:56:56 +00:00
Sergey Poznyakoff
6613170489 Updated 2004-02-18 14:49:08 +00:00
Sergey Poznyakoff
6ac0d0aadd Updated 2004-02-18 14:44:53 +00:00
Sergey Poznyakoff
694e8376ab Minor fixes 2004-02-18 14:41:41 +00:00
Sergey Poznyakoff
440e65ef2c Implement pax -o option. Fixed misleading heading comment (introduced 2003-09-02). 2004-02-18 14:41:23 +00:00
Sergey Poznyakoff
d0eceef438 New option --pax-option (equivalent to -o option of pax). 2004-02-18 14:41:00 +00:00
Sergey Poznyakoff
434f2a22ba (write_extended): Call xheader_xhdr_name
instead of using hardcoded "././@PaxHeader" name.
2004-02-18 14:40:21 +00:00
Sergey Poznyakoff
0bfb6e136d (xheader_xhdr_name,xheader_ghdr_name): New functions 2004-02-18 14:39:36 +00:00
Sergey Poznyakoff
7d31c8176c Added stpcpy 2004-02-18 14:39:24 +00:00
Sergey Poznyakoff
cbde0aa660 Updated 2004-02-18 14:39:10 +00:00
Sergey Poznyakoff
251935d751 Updated 2004-02-17 13:34:14 +00:00
Sergey Poznyakoff
b840052b46 Fixed typo 2004-02-17 13:33:52 +00:00
Sergey Poznyakoff
67d29a4d60 Minor changes 2004-02-17 13:33:14 +00:00
Sergey Poznyakoff
df7792b5d8 Removed accumulator stuff in favor of obstack.
get_directory_contents): Split into two functions
2004-02-17 13:32:41 +00:00
Paul Eggert
8b107d09e1 Fix Debian bug 230872, originally reported by Jeff King in
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=230872>.
2004-02-15 08:36:20 +00:00
Sergey Poznyakoff
f6db096374 Updated 2004-01-21 10:38:38 +00:00
Sergey Poznyakoff
814c517a15 Updated 2004-01-21 10:37:28 +00:00
Sergey Poznyakoff
9771467dc8 Updated TP URL, improved help output. Default
to :ext:anoncvs and set CVS_RSH, unless already set.
2004-01-21 10:34:30 +00:00
Sergey Poznyakoff
64dd6a38b4 Updated 2004-01-21 10:32:40 +00:00
Sergey Poznyakoff
65ef81b0a3 Require automake-1.8/autoconf-2.59. Removed m4/Makefile. 2004-01-21 10:32:06 +00:00
Sergey Poznyakoff
143e677b5e Removed m4 2004-01-21 10:31:06 +00:00
Sergey Poznyakoff
092b81cb95 Updated 2004-01-20 23:32:26 +00:00
Sergey Poznyakoff
0ad27d1986 Use $option instead of $1 so all options will be parsed. Bugfix by Marco Gerards 2004-01-20 23:31:26 +00:00
Sergey Poznyakoff
6c347931b1 Updated 2004-01-03 22:35:22 +00:00
Sergey Poznyakoff
d7860cb091 Added recurse.sh and mksparse.c 2004-01-03 22:27:58 +00:00
Sergey Poznyakoff
1665d38fb7 New file. 2004-01-03 22:27:36 +00:00
Sergey Poznyakoff
da99cd963d New test case. 2004-01-03 22:26:58 +00:00
Sergey Poznyakoff
bda7d59010 (time_to_start_writing): Changed data type. 2004-01-03 22:26:30 +00:00
Sergey Poznyakoff
463e7278f4 (decode_options): More option compatibility checks (moved from buffer.c) 2004-01-03 22:26:11 +00:00
Sergey Poznyakoff
829b1dc328 Updated assignment to write_archive_to_stdout 2004-01-03 22:25:41 +00:00
Sergey Poznyakoff
dd6094f6c0 Updated invocations of safer_name_suffix 2004-01-03 22:25:24 +00:00
Sergey Poznyakoff
bc89f023c1 (maybe_backup_file): Changed return type 2004-01-03 22:24:35 +00:00
Sergey Poznyakoff
95be2c50b4 (new_volume,check_label_pattern): Changed return type.
(time_to_start_writing): Changed data type
(file_to_switch_to): Removed. Variable never assigned to.
(open_archive) Moved option compatibility checks to tar.c
Other minor changes.
2004-01-03 22:23:48 +00:00
Sergey Poznyakoff
7631b4e595 New option --no-po 2004-01-03 22:22:01 +00:00
Sergey Poznyakoff
aa5d3fc8a6 Updated 2004-01-03 11:46:36 +00:00
Sergey Poznyakoff
2690759c06 (dump_dir0): Bugfix. Thanks Piotr Czerwinski <pius@pld-linux.org> for the patch. 2004-01-03 11:45:31 +00:00
Sergey Poznyakoff
b74232b9ad (sparse_diff_file): Bugfix. Thanks Martin Simmons for the patch. 2004-01-03 11:44:45 +00:00
uid65632
3d09d579c1 Synchronize with Gettext 0.13.1, Automake 1.8, Autoconf 2.59,
and translation website.
2003-12-27 06:41:48 +00:00
uid65697
a39523cc61 Updated 2003-12-25 10:26:40 +00:00
uid65697
c506c33ad3 (safer_name_suffix): Reverted change made 2003-11-14. Reason: Discussion with Paul Eggert and Jean-Louis Martineau. See also ChangeLog entry from 1999-08-14. 2003-12-25 10:20:54 +00:00
uid65697
3710b34c7e (code_time,decode_time): Support for subsecond precision. (atime_coder,atime_decoder,ctime_coder,ctime_decoder) (mtime_coder,mtime_decoder): Update invocations of code_time and decode_time. (gid_decoder,size_decoder,uid_decoder,sparse_size_decoder) (sparse_numblocks_decoder,sparse_offset_decoder) (sparse_numbytes_decoder): Updated 2003-12-25 10:20:43 +00:00
uid65697
ad37f06975 (tar_stat_info.atime_nsec,mtime_nsec,ctime_nsec): New members. 2003-12-25 10:20:32 +00:00
uid65697
12b111ffa3 (sys_stat_nanoseconds): New function 2003-12-25 10:20:19 +00:00
uid65697
5160a64f71 (sparse_scan_file): Correctly handle files with a hole at the end. (sparse_dump_region,sparse_extract_region): Allow for zero size trailing blocks 2003-12-25 10:20:05 +00:00
uid65697
f30c03c934 (safer_name_suffix): Reverted change made 2003-11-14. Reason: Discussion with Paul Eggert and Jean-Louis Martineau. See also ChangeLog entry from 1999-08-14. 2003-12-25 10:19:40 +00:00
uid65697
67a6a93b2f (read_and): Treat only two successive zero filled blocks as an EOF indicator. Issue a warning if a single one is encountered. 2003-12-25 10:19:24 +00:00
uid65697
50b2227279 (print_header): Use archive_file_size member when printing real file size. 2003-12-25 10:19:12 +00:00
uid65697
defde32533 (decode_header): Discern between pax and ustar formats 2003-12-25 10:19:00 +00:00
uid65697
fc184a85e1 (write_directory_file): Use sys_truncate 2003-12-25 10:18:48 +00:00
uid65697
f7ce5a4ec5 (dump_file0): Use sys_stat_nanoseconds(). 2003-12-25 10:18:37 +00:00
uid65697
2a027394ef (sys_stat_nanoseconds): New function 2003-12-25 10:18:25 +00:00
uid65697
278a8945a6 (short_read): Issue a warning on short reads. 2003-12-25 10:18:14 +00:00
uid65697
bb0b5c01c9 Check for varios members of struct stat that may represent file modification times with a subsecond precision. Check for utimes (for future use) 2003-12-25 10:18:00 +00:00
uid65697
15cb6d782c Raised version number to 1.13.92 2003-12-25 10:17:48 +00:00
uid65697
3b3f5da0e9 Updated 2003-12-25 10:17:18 +00:00
uid65697
2a822f7a76 Updated 2003-12-25 10:17:05 +00:00
uid65697
fb8788008b Updated 2003-12-25 10:16:52 +00:00
uid65697
6eafe45176 Updated 2003-12-25 10:16:39 +00:00
Sergey Poznyakoff
084291fca1 Updated 2003-12-01 21:31:13 +00:00
Sergey Poznyakoff
5f32345fe6 Minor fix 2003-12-01 21:28:11 +00:00
Sergey Poznyakoff
fa2801b6dc (struct xhdr_tab.coder; all coder function): Added
extra argument
Implemeted GNU.sparse.* keywords.
2003-12-01 21:21:11 +00:00
Sergey Poznyakoff
f193c4c04a (usage): Cleaned up the sample argument to --newer
option.
(decode_options): Allow --sparse for POSIX_FORMAT archives.
2003-12-01 21:20:47 +00:00
Sergey Poznyakoff
47e73c7a44 (extract_archive): Check reported size vs.
archive file size to determine if we have to do with a
sparse file.
2003-12-01 21:19:37 +00:00
Sergey Poznyakoff
2632f1c8d2 Update calls to xheader_store 2003-12-01 21:19:16 +00:00
Sergey Poznyakoff
4dcf7987f8 (xheader_store): Changed prototype. 2003-12-01 21:19:01 +00:00
Sergey Poznyakoff
374ce58aa0 Initial implementation of GNU/pax sparse file format. 2003-12-01 21:18:30 +00:00
Sergey Poznyakoff
475a54cc06 Updated 2003-12-01 21:18:10 +00:00
Sergey Poznyakoff
b741d17b27 Updated 2003-11-30 21:19:31 +00:00
Sergey Poznyakoff
a41d27ff5b Check for setlocale. Thanks Bruno Haible for reporting. 2003-11-30 21:18:12 +00:00
Sergey Poznyakoff
869326ae90 Updated 2003-11-25 07:05:15 +00:00
Sergey Poznyakoff
25d9ca1163 (write_gnu_long_link): Use oldgnu magic with @LongLink blocks. 2003-11-25 07:04:45 +00:00
Sergey Poznyakoff
d7e8c16a89 Updated 2003-11-17 15:21:57 +00:00
Sergey Poznyakoff
8d6e47cc7f Support for star sparse format 2003-11-17 15:20:46 +00:00
Sergey Poznyakoff
b3404769c3 Updated 2003-11-17 11:07:26 +00:00
Sergey Poznyakoff
bb798080be (diff_archive): Use sparse_diff_file. 2003-11-17 11:05:18 +00:00
Sergey Poznyakoff
d4e70d3656 (sys_compare_uid,sys_compare_gid): New functions
(sys_compare_uid_gid): Removed.
(sys_compare_links): Changed declaration
2003-11-17 11:05:06 +00:00
Sergey Poznyakoff
82e94dab6d (sys_compare_uid,sys_compare_gid): New functions
(sys_compare_uid_gid): Removed.
(sys_compare_links,report_difference): Changed prototype
(sparse_diff_file): New function
2003-11-17 11:04:40 +00:00
Sergey Poznyakoff
a8b2b68c33 (sparse_diff_file): New function 2003-11-17 11:04:16 +00:00
Sergey Poznyakoff
40ede4e2df Updated 2003-11-17 07:44:44 +00:00
Sergey Poznyakoff
22ae47de82 Use new diagnostics functions. 2003-11-17 07:39:33 +00:00
Sergey Poznyakoff
7c05e2f650 (close_diag,open_diag,read_diag_details)
(readlink_diag,savedir_diag,seek_diag_details,stat_diag): New
diagnostics functions.
2003-11-17 07:39:09 +00:00
Sergey Poznyakoff
80e5de9310 Minor changes 2003-11-17 07:38:37 +00:00
Sergey Poznyakoff
3999bf6360 (diff_sparse_files): Temporary placeholder. 2003-11-17 07:38:03 +00:00
Sergey Poznyakoff
87fa28ed2a Use new sparse file interface. 2003-11-17 07:37:03 +00:00
Sergey Poznyakoff
3cdbeffe30 Major rewrite. 2003-11-17 07:36:18 +00:00
Sergey Poznyakoff
80b8de13ce (struct sp_array): Declaration from common.h
(struct tar_stat_info): New members archive_file_size,
sparse_map_avail,sparse_map.
2003-11-17 07:34:55 +00:00
Sergey Poznyakoff
caa20e5bac (struct sp_array,sparsearray,sp_array_size)
(init_sparsearray,fill_in_sparse_array): Removed
(enum dump_status): New data type
(pad_archive,close_diag,open_diag,read_diag_details)
(readlink_diag,savedir_diag,seek_diag_details,stat_diag): New
functions.
(sparse_file_p,sparse_dump_file,sparse_extract_file): New
functions.
2003-11-17 07:34:16 +00:00
Sergey Poznyakoff
18ef8acac5 Added sparse.c 2003-11-17 07:32:37 +00:00
Sergey Poznyakoff
fad21ebf58 Updated 2003-11-14 13:33:30 +00:00
Sergey Poznyakoff
69bbe71607 Fixed check for setsockopt 2003-11-14 13:33:11 +00:00
Sergey Poznyakoff
7836f927b3 Updated 2003-11-14 12:28:06 +00:00
Sergey Poznyakoff
8c0a6b24b2 Do not zero-terminate name field if
the name is exactly 100 characters long.
(write_ustar_long_name): Fixed cheking for unsplittable
names.
2003-11-14 12:27:50 +00:00
Sergey Poznyakoff
ebeb3d4f30 Updated 2003-11-14 09:58:11 +00:00
Sergey Poznyakoff
3bfdc3f8ce (safer_name_suffix): If the input file name ends with a slash, output one should do so as well. 2003-11-14 09:57:49 +00:00
Sergey Poznyakoff
bc73e3d68d Removed debugging hook 2003-11-14 09:56:11 +00:00
Sergey Poznyakoff
5f152198cb Updated 2003-11-14 09:28:41 +00:00
Sergey Poznyakoff
8f5dc5ffa4 Documented --format=ustar 2003-11-14 09:28:18 +00:00
Sergey Poznyakoff
f92c7cf4c8 (start_header): Removed debugging hook
(dump_file): Fixed handling of linkname field.
2003-11-14 09:27:50 +00:00
Sergey Poznyakoff
ca99923dcd Updated 2003-11-13 22:28:20 +00:00
Sergey Poznyakoff
347ea38cc4 Updated 2003-11-13 22:27:56 +00:00
Sergey Poznyakoff
7e2f7ead1c New option --format=ustar forces POSIX.1-1988 archive format. 2003-11-13 22:27:44 +00:00
Sergey Poznyakoff
052118a907 (safer_name_suffix): Skip leading ./ 2003-11-13 22:27:23 +00:00
Sergey Poznyakoff
fe4ee38fce Added POSIX.1-1988 support. 2003-11-13 22:27:09 +00:00
Sergey Poznyakoff
040bc32535 (archive_format): USTAR_FORMAT: New type. 2003-11-13 22:26:55 +00:00
Sergey Poznyakoff
d4f872de37 Updated 2003-11-13 08:49:10 +00:00
Sergey Poznyakoff
4ed709c3c2 (atime_decoder,gid_decoder,ctime_decoder)
(mtime_decoder,size_decoder,uid_decoder): Use xstrtoumax.
Fixes "pax-big-10g" bug
2003-11-13 08:47:25 +00:00
Sergey Poznyakoff
c95535bae8 (all_names_found): Check if the argument
contains valid filename. Fixes coredump on "not_a_tar_file"
2003-11-13 08:46:53 +00:00
Sergey Poznyakoff
cc8628df0c (read_and): Initialize current_stat_info
and extended_header at the start of the loop.
2003-11-13 08:46:26 +00:00
Paul Eggert
572225dfdc Fix some C compatibility bugs reported by Joerg Schilling. 2003-11-13 06:23:23 +00:00
Sergey Poznyakoff
182091e79f Updated 2003-11-12 11:46:26 +00:00
Sergey Poznyakoff
f035e8f9e2 (decode_header): Initialize st_atime and st_ctime. 2003-11-12 11:46:04 +00:00
Sergey Poznyakoff
8a3b098acf Update 2003-11-11 15:03:06 +00:00
Sergey Poznyakoff
8cea4725f4 Fixed spelling. Thanks Martin Buchholz
<martin@xemacs.org> for spotting.
2003-11-11 15:02:27 +00:00
Sergey Poznyakoff
f6be77cada (tar_save_LIBS): Bugfix. Thanks Adrian
Bunk <bunk@fs.tum.de> for reporting.
2003-11-11 15:01:13 +00:00
Paul Eggert
4414f1a82c Make xhdr_tab extern, not static. 2003-11-05 01:33:35 +00:00
Paul Eggert
761802e87a Include bounds in forward declaration for xhdr_tab. 2003-11-03 23:03:35 +00:00
Paul Eggert
b7ed638806 * system.c (sys_spawn_shell): Cast trailing null to (char *). 2003-10-27 05:41:15 +00:00
Sergey Poznyakoff
5d0b6564f3 Updated 2003-10-19 19:34:51 +00:00
Sergey Poznyakoff
9e445dcdd1 Texinfo does not like macros in @copying and @shorttitlepage text... 2003-10-19 19:17:39 +00:00
Sergey Poznyakoff
c2ba0ffa3e Documented new features. 2003-10-19 19:05:45 +00:00
Sergey Poznyakoff
4bc226bb42 (decode_options): Removed superfluous archive format check 2003-10-19 19:02:03 +00:00
Sergey Poznyakoff
1a1f2d33d5 Updated 2003-10-19 18:56:49 +00:00
Sergey Poznyakoff
80088dcafc Updated 2003-10-08 11:21:34 +00:00
Sergey Poznyakoff
006d3dc1d5 [MSDOS]: Fixed spelling of EACCES. Added macro overriding broken mkdir prototypes. 2003-10-08 11:18:01 +00:00
Sergey Poznyakoff
80e978dc2e Removed spurious includes. 2003-10-08 11:17:52 +00:00
Sergey Poznyakoff
89d2ad35e6 Added missing includes. 2003-10-08 11:17:36 +00:00
Sergey Poznyakoff
bf6b473b3b Added missing headers 2003-10-08 11:17:23 +00:00
Sergey Poznyakoff
151d1386e1 Added Wojciech Polak 2003-10-08 11:17:11 +00:00
Sergey Poznyakoff
32c1e664e5 Updated 2003-10-08 11:16:47 +00:00
Sergey Poznyakoff
cb090cfe82 Added checks for missing functions. Raised version number to indicate alpha release. 2003-10-08 11:16:37 +00:00
Paul Eggert
1e7d274cd8 Fix some misspellings. 2003-10-04 22:30:52 +00:00
Sergey Poznyakoff
4f644c3479 Updated 2003-10-04 18:22:46 +00:00
Sergey Poznyakoff
0008f61237 Added system.c 2003-10-04 18:19:34 +00:00
Sergey Poznyakoff
a0d91086c4 Moved system dependencies to system.c 2003-10-04 18:18:02 +00:00
Sergey Poznyakoff
c1b9212b16 Moved system dependencies to system.c 2003-10-04 18:14:32 +00:00
Sergey Poznyakoff
3b76d26206 (SET_BINARY_MODE, ERRNO_IS_EACCESS): New defines 2003-10-04 18:13:51 +00:00
Sergey Poznyakoff
719c762d80 Prototypes for functions from system.c 2003-10-04 18:13:37 +00:00
Sergey Poznyakoff
b085ca3097 System-dependent functions 2003-10-04 18:13:02 +00:00
Sergey Poznyakoff
cf08a6de1b Added missing files. 2003-10-04 18:12:16 +00:00
Sergey Poznyakoff
86f7407ffe Check for dev_t and ino_t. 2003-10-04 18:10:08 +00:00
Sergey Poznyakoff
33b04d5ecd Updated 2003-10-04 14:09:46 +00:00
Sergey Poznyakoff
eb6bef9909 New option --occurrence 2003-10-04 14:08:16 +00:00
Sergey Poznyakoff
bbbbf42fa6 Updated 2003-10-04 14:05:14 +00:00
Sergey Poznyakoff
91493ea9b6 Count number of occurrences of each name in the
archive.
(name_match): Honor --occurence option.
(names_done): Removed
(all_names_found,names_notfound): Rewritten.
2003-10-04 13:50:41 +00:00
Sergey Poznyakoff
dcb7c93527 (read_and): Honor --occurence option. 2003-10-04 13:50:20 +00:00
Sergey Poznyakoff
f4935ab55d (delete_archive_members): Honor --occurence option. 2003-10-04 13:49:46 +00:00
Sergey Poznyakoff
660c6d9b64 (occurrence_option): New global
(struct name): Changed `found' member to `uintmax_t
found_count'.
(names_done): Removed
(all_names_found): Changed prototype.
(ISFOUND,WASFOUND): New macros
2003-10-04 13:49:25 +00:00
Sergey Poznyakoff
35d44a05eb Updated 2003-10-04 13:48:52 +00:00
Sergey Poznyakoff
4cf3121472 Updated 2003-10-02 15:08:01 +00:00
Sergey Poznyakoff
7c1a245918 Updated 2003-10-02 15:07:25 +00:00
Sergey Poznyakoff
634baf4d87 Updated 2003-10-02 14:38:23 +00:00
Sergey Poznyakoff
a6344f97a6 Removed extra precaution regarding subcommand_option == CAT_SUBCOMMAND 2003-10-02 14:37:24 +00:00
Sergey Poznyakoff
e23ad5b4f6 Updated 2003-10-02 10:42:14 +00:00
Sergey Poznyakoff
f364d50661 Take regexps into account 2003-10-02 10:41:48 +00:00
Sergey Poznyakoff
17878ad672 New option --first-copy 2003-10-02 10:29:43 +00:00
Sergey Poznyakoff
13be4005e7 Updated 2003-10-02 10:29:18 +00:00
Sergey Poznyakoff
6c16197226 New option --first-copy 2003-10-02 10:29:00 +00:00
Sergey Poznyakoff
05b3fdccc1 (read_and): Use all_names_found() as `while' condition. 2003-10-02 10:28:45 +00:00
Sergey Poznyakoff
9373182407 (names_done): New function. 2003-10-02 10:28:30 +00:00
Paul Eggert
00ac26f00c Don't translate "Copyright". 2003-09-24 19:11:44 +00:00
Paul Eggert
07286647fb --strip strips file system prefix too, and it counts adjacent
slashes as if they were one slash.
2003-09-22 18:54:50 +00:00
Paul Eggert
b0e8ba8839 (extracting untrusted archives): New section. 2003-09-22 18:26:50 +00:00
Paul Eggert
21dd6332cc * README-alpha: Document maintainer tool assumptions a bit.
* configure.ac (AC_AIX, AC_MINIX): Remove.
* lib/.cvsignore, m4/.cvsignore: Update.
2003-09-18 06:29:27 +00:00
Paul Eggert
867f933aac Add restrict.m4, time_r.m4. 2003-09-18 06:28:13 +00:00
Paul Eggert
6848f79e3b Add exit.h, time_r.c, time_r.h. 2003-09-18 06:27:52 +00:00
Paul Eggert
491bcfb153 (AC_AIX, AC_MINIX): Remove; subsumed by gl_USE_SYSTEM_EXTENSIONS. 2003-09-18 06:27:34 +00:00
Paul Eggert
6de6421787 Document maintainer tool assumptions a bit. GNU 'sed' is no longer
required.  For GNU m4 1.4, suggest the patch in Debian bug 211447.
Fix minor misspellings/whitespace nits.
2003-09-18 06:26:47 +00:00
Paul Eggert
0e1e4d8381 bootstrap: Don't use "for option; do". 2003-09-17 17:35:16 +00:00
Paul Eggert
54e322110c Don't use "for option; do"; Solaris 8 /bin/sh doesn't like that. 2003-09-17 17:33:32 +00:00
Sergey Poznyakoff
659f70a38a Updated 2003-09-17 12:37:58 +00:00
Sergey Poznyakoff
9e783c548c Updated 2003-09-17 10:30:45 +00:00
Sergey Poznyakoff
a0c656364a Updated 2003-09-17 10:19:01 +00:00
Sergey Poznyakoff
674691c7ba Added src/xheader.c 2003-09-17 10:18:11 +00:00
Sergey Poznyakoff
0289902e4a (cut_path_elements): Added proto. 2003-09-17 10:17:09 +00:00
Sergey Poznyakoff
187c23b8d7 Updated 2003-09-05 13:25:32 +00:00
Sergey Poznyakoff
91b2d65e9d Use ngettext where appropriate. 2003-09-05 13:24:15 +00:00
Sergey Poznyakoff
99f41a1224 Update 2003-09-04 15:49:37 +00:00
Sergey Poznyakoff
eada0a9b35 New option --strip-path=NUM.
(decode_options) Assign boolean values to bool variables.
2003-09-04 15:48:02 +00:00
Sergey Poznyakoff
3590887776 (cut_path_elements): New functon. 2003-09-04 15:47:26 +00:00
Sergey Poznyakoff
ddab1f615e (extract_archive): Implemented --strip-path 2003-09-04 15:44:44 +00:00
Sergey Poznyakoff
d93cbfbf0b (strip_path_elements): New variable. 2003-09-04 15:44:07 +00:00
Sergey Poznyakoff
5b9d8c93c7 Updated 2003-09-04 15:43:35 +00:00
Sergey Poznyakoff
08cfd54f54 Added *.shar.gz 2003-09-04 15:42:55 +00:00
Sergey Poznyakoff
75b511727c Updated 2003-09-04 14:01:22 +00:00
Sergey Poznyakoff
a86cdfa58b Explicitly request GNU format. This will
disappear when GNU extended header keywords are working.
2003-09-04 14:00:25 +00:00
Sergey Poznyakoff
f3875c4a26 (xheader_decode): Store the header as well (for eventual delete). 2003-09-04 13:59:52 +00:00
Sergey Poznyakoff
8b4453b4e2 (main): Do not check for volume_label_option unless subcommand_option is CREATE_SUBCOMMAND. 2003-09-04 13:59:35 +00:00
Sergey Poznyakoff
7645d20465 (read_header): Minor change. 2003-09-04 13:59:03 +00:00
Sergey Poznyakoff
08780d289d Fixed deletion from the POSIX archives. 2003-09-04 13:58:42 +00:00
Sergey Poznyakoff
e400810b5d Updated 2003-09-04 09:38:14 +00:00
Sergey Poznyakoff
3f998f69b9 (decode_record): Reversed the return condition. 2003-09-04 09:37:48 +00:00
Sergey Poznyakoff
aea0a1d970 Support for "linkpath" extended keyword 2003-09-04 09:37:05 +00:00
Sergey Poznyakoff
87ff702389 Updated 2003-09-03 11:03:58 +00:00
Sergey Poznyakoff
c92c357a62 Updated 2003-09-03 11:03:23 +00:00
Sergey Poznyakoff
0ba3b75ad4 Use DEFAULT_ARCHIVE_FORMAT macro
(archive_format_string): New function.
(usage): Updated help output.
2003-09-03 11:03:07 +00:00
Sergey Poznyakoff
9f0cdc8f56 Allow to redefine the default output format. 2003-09-03 11:02:38 +00:00
Paul Eggert
c54ec5a895 Remove some lint caught by gcc -Wall -W, etc. 2003-09-03 06:23:42 +00:00
Paul Eggert
10edb315da (struct xhdr_tab.keyword): Now pointer to const.
(struct xhdr_tab.coder, struct xhdr_tab.decoder, locate_handler,
decode_record, xheader_store, xheader_print, code_string, code_time,
code_num, dummy_coder, dummy_decoder, atime_coder, atime_decoder,
gid_coder, gid_decoder, gname_coder, gname_decoder, linkpath_coder,
linkpath_decoder, ctime_coder, ctime_decoder, mtime_coder,
mtime_decoder, path_coder, path_decoder, size_coder, size_decoder,
uid_coder, uid_decoder, uname_coder, uname_decoder):
Use pointers to const when possible.
(xhdr_tab): Now const.

(struct xhdr_tab.decoder, dummy_decoder,
atime_decoder, gid_decoder, gname_decoder, linkpath_decoder,
ctime_decoder, mtime_decoder, path_decoder, size_decoder,
uid_decoder, uname_decoder): Remove unused keyword arg.
All uses changed.

(xhdr_tab, format_uintmax): Now static.

(dummy_coder, dummy_decoder, atime_coder,
atime_decoder, gid_coder, gid_decoder, gname_coder, gname_decoder,
linkpath_coder, linkpath_decoder, mtime_coder, mtime_decoder,
ctime_coder, ctime_decoder, path_coder, path_decoder, size_coder,
size_decoder, uid_coder, uid_decoder, uname_coder, uname_decoder):
Remove forward decls; no longer needed.
(xhdr_tab): Move to end, so that the forward decls aren't needed.
Add a forward declaration.

(decode_record): Return bool, not int.

(decode_record): Fix misspelling in diagnostic
"extended headed" -> "extended header".

(decode_record, xheader_decode):
Do not use decls like "char *p, *q;".
2003-09-03 06:22:34 +00:00
Paul Eggert
df06a57b8c (update_archive): Abort if HEADER_SUCCESS_EXTENDED occurs,
as it's not possible.
Pass false to read_header, not 0.
2003-09-03 06:20:41 +00:00
Paul Eggert
14e8c10222 (struct fmttab.name): Now char const *. All uses changed.
(fmttab): Now const.  All uses changed.  Avoid GCC warning by
not eliding initializers.
(set_archive_format): Report an error if no format name matches,
instead of returning an undefined value.
(set_archive_format): Now static.
2003-09-03 06:19:00 +00:00
Paul Eggert
a546fc7c21 (read_and): Abort if HEADER_SUCCESS_EXTENDED occurs, as it's not
possible.  Pass false to read_header, not 0.
2003-09-03 06:15:32 +00:00
Paul Eggert
86a9b9261d (delete_archive_members): Handle case of
HEADER_SUCCESS_EXTENDED followed by HEADER_FAILURE.
Pass true/false to read_header, not 1/0.
2003-09-03 06:14:37 +00:00
Paul Eggert
7653d2f6b8 (write_extended): Remove unused local 'bufsize'. 2003-09-03 06:13:26 +00:00
Paul Eggert
2c390b2c21 (verify_volume): read_header (0) -> read_header (false), since
read_header accepts a bool.
2003-09-03 06:11:52 +00:00
Paul Eggert
c4d396f8d1 (destroy_stat, xheader_decode, xheader_store,
xheader_read, xheader_finish, xheader_destroy): Add decls;
required in C99.
2003-09-03 06:10:55 +00:00
Sergey Poznyakoff
40138ceb05 Updated 2003-09-03 00:06:12 +00:00
Sergey Poznyakoff
99a5f5d4f9 (xhdr_tab): Reserved GNU keywords (commented out for the time being) 2003-09-03 00:03:32 +00:00
Sergey Poznyakoff
01decb5737 (list_archive): Always decode the header. This
is necessary so the extended header is processed and the correct
filename is printed no matter what the state of verbose_option.
2003-09-03 00:03:09 +00:00
Sergey Poznyakoff
ce059f3cc8 (start_header): Store long file names
in "path" keyword of an extended header if in POSIX
mode.
(finish_header): print header before calling write_extended().
2003-09-03 00:02:32 +00:00
Paul Eggert
01f19e973b Merge changes from gnulib. 2003-09-02 04:09:03 +00:00
Sergey Poznyakoff
c76e8a861e Updated 2003-09-01 17:45:10 +00:00
Sergey Poznyakoff
8750043986 Added new files 2003-09-01 17:43:24 +00:00
Sergey Poznyakoff
49ce0ebbea Updated 2003-09-01 17:20:47 +00:00
Sergey Poznyakoff
9e4f9e232c obstack is autodetermined... 2003-09-01 17:19:56 +00:00
Sergey Poznyakoff
c3440ae0c9 Added 'gl_OBSTACK' 2003-09-01 17:11:11 +00:00
Sergey Poznyakoff
d71b31e241 Added obstack 2003-09-01 17:06:11 +00:00
Sergey Poznyakoff
4d0ac610b0 Minor formatting change 2003-09-01 17:04:21 +00:00
Sergey Poznyakoff
c22a8b44d7 Added obstack. 2003-09-01 17:03:49 +00:00
Sergey Poznyakoff
4189af3785 Implemented coder functions. 2003-09-01 17:03:33 +00:00
Sergey Poznyakoff
33b63ebe94 (OLDGNU_COMPATIBILITY): Removed
(struct extra_header): Removed unused structure.
(union block.extra_header): Removed unused member.
2003-09-01 17:03:07 +00:00
Sergey Poznyakoff
879ae47aa1 New option --format 2003-09-01 17:02:45 +00:00
Sergey Poznyakoff
53eec8f039 (print_header): Take user/group from current_stat_info. 2003-09-01 17:02:11 +00:00
Sergey Poznyakoff
83c68b4e40 (gid_to_gname,gname_to_gid,uid_to_uname,uname_to_uid): Changed prototypes 2003-09-01 17:01:35 +00:00
Sergey Poznyakoff
cb3ec64970 (string_to_chars): New function.
(write_extended): New function
(start_header): Create extended POSIX headers if necessary.
(finish_header): Likewise.
2003-09-01 17:00:26 +00:00
Sergey Poznyakoff
72e5a9beb6 (MAXOCTAL11,MAXOCTAL7): New defines
(string_to_chars): New functions
(struct xheader): Changed structure
(gid_to_gname,gname_to_gid,uid_to_uname,uname_to_uid): Changed
prototypes.
2003-09-01 16:59:56 +00:00
Sergey Poznyakoff
7657bd4323 Updated 2003-08-31 23:03:40 +00:00
Sergey Poznyakoff
518748f939 Use current_stat_info 2003-08-31 22:55:21 +00:00
Sergey Poznyakoff
db783659b0 (destroy_stat): New function. 2003-08-31 22:45:58 +00:00
Sergey Poznyakoff
d858a433c8 Use current_stat_info 2003-08-31 22:41:32 +00:00
Sergey Poznyakoff
096bc2bffd (decode_header): Added initial support for POSIX extended
and STAR headers.
(skip_member): Check oldgnu_header only if current_format is set
to OLDGNU_FORMAT.
2003-08-31 22:40:34 +00:00
Sergey Poznyakoff
6f12dbc264 (orig_file_name,current_file_name)
(current_trailing_slash,current_link_name): Removed variables.
(current_stat_info): New variable
(current_stat): Removed
(extended_header): New variable
(decode_header): Changed prototype.
2003-08-31 22:39:43 +00:00
Sergey Poznyakoff
450636adfa (decode_header): Added initial support for POSIX extended
and STAR headers.
(skip_member): Check oldgnu_header only if current_format is set
to OLDGNU_FORMAT
2003-08-31 22:38:55 +00:00
Sergey Poznyakoff
4e59b9d7e3 Added xheader.c 2003-08-31 22:36:09 +00:00
Sergey Poznyakoff
5be0f2ba49 New file 2003-08-31 22:35:35 +00:00
Paul Eggert
81a9e2ae36 Drop en_GB locale; it was more trouble than it was worth (e.g., different
users in en_GB disagree about -ize versus -ise).
2003-08-30 05:37:55 +00:00
Sergey Poznyakoff
a18256492a Updated 2003-07-28 12:02:16 +00:00
Sergey Poznyakoff
cab627b49d Updated 2003-07-28 11:57:26 +00:00
Sergey Poznyakoff
317fbb9d5f Removed references to the obsolete command line options. 2003-07-28 11:41:17 +00:00
Sergey Poznyakoff
a687cf05b7 Removed support for the obsolete command line options. 2003-07-28 11:40:35 +00:00
Sergey Poznyakoff
df2f967cdd Updated 2003-07-27 12:14:22 +00:00
Sergey Poznyakoff
d52a1bb366 New option --check-links.
Changed semantics of -o to comply to UNIX98 when extracting and
to its previous semantics otherwise.
(main): Call check_links if --check-links. was given.
2003-07-27 12:01:59 +00:00
Sergey Poznyakoff
2adfef0149 (print_header): Use orig_file_name. 2003-07-27 12:01:04 +00:00
Sergey Poznyakoff
bee35fc152 /tmp/F 2003-07-27 12:00:31 +00:00
Sergey Poznyakoff
1fef6258aa (check_links_option): New variable
(orig_file_name): New variable
(check_links): New proto.
2003-07-27 11:59:58 +00:00
Sergey Poznyakoff
b68057816b Updated 2003-07-27 11:59:30 +00:00
Sergey Poznyakoff
6dd7e857e5 Updated 2003-07-25 15:08:45 +00:00
Sergey Poznyakoff
eb42c0070d (tar.dvi): Fixed TEXINPUTS value. 2003-07-25 15:08:17 +00:00
Sergey Poznyakoff
d4bcefe915 Started the entry for 1.13.26 2003-07-25 15:06:32 +00:00
Sergey Poznyakoff
7219c538eb (print_header): Revised 2003-07-25 15:05:41 +00:00
Sergey Poznyakoff
5a73638d27 Updated 2003-07-24 14:55:12 +00:00
Sergey Poznyakoff
83a5c01349 Added missing files. 2003-07-24 14:53:09 +00:00
Sergey Poznyakoff
b84cc97df7 Minor changes. 2003-07-24 14:48:44 +00:00
Sergey Poznyakoff
4f48e61fcf (print_header): Print trailing slash if
current_trailing_slash was set (extrac03.sh,extrac04.sh tests).
2003-07-24 14:48:08 +00:00
Sergey Poznyakoff
eb66edaa9f (flush_read): Fixed behavior on short
reads right after opening the new archive (multiv01.sh test).
(new_volume): Special handling for "-".
2003-07-24 14:45:29 +00:00
Sergey Poznyakoff
31d9c7e2a4 (chdir_do): Fixed call to restore_cwd 2003-07-24 14:44:51 +00:00
Sergey Poznyakoff
cd206cd899 Added exitfail.[hc] 2003-07-24 14:44:24 +00:00
Sergey Poznyakoff
4dc30d7397 Added to the repository 2003-07-24 14:43:30 +00:00
Paul Eggert
96148b87b7 ChangeLog entries from 1.13.25 through today. 2003-07-05 21:17:47 +00:00
Paul Eggert
09c4d7dc3c Mention --index-file, --no-overwrite-dir, new translations. 2003-07-05 21:12:43 +00:00
Paul Eggert
46f2740ff9 Add more suggestions. 2003-07-05 21:06:10 +00:00
Paul Eggert
88ffc1355e Initial revision 2003-07-05 20:14:48 +00:00
Paul Eggert
4a16f6c039 Initial revision 2003-07-05 20:13:29 +00:00
Paul Eggert
33cdac5e60 Initial revision 2003-07-05 20:10:59 +00:00
Paul Eggert
bce576a03b Remove tests/genfile.c; it doesn't need to
be translated, since it's not a user-visible tool.
2003-07-05 20:10:23 +00:00
Paul Eggert
f7ccf5eb1c Initial revision 2003-07-05 20:04:48 +00:00
Paul Eggert
8912f582ac Convert to UTF-8.
Don't include <print-copyr.h>.
(DEFAULT_PATTERN): Renamed from DEFAULT.
(ZEROS_PATTERN): Renamed from ZEROS.
(main): Use gettext to translate (C), not print_copyright.
2003-07-05 08:24:55 +00:00
Paul Eggert
4c690508bd Add comment about what other letters are used. 2003-07-05 08:19:48 +00:00
Paul Eggert
42d05fcb6e Do not include <print-copyr.h>.
Include <getdate.h>.
(get_date): Remove decl.
(ATIME_PRESERVE_OPTION, CHECKPOINT_OPTION, FORCE_LOCAL_OPTION,
IGNORE_FAILED_READ_OPTION, INDEX_FILE_OPTION, NO_OVERWRITE_DIR_OPTION,
NUMERIC_OWNER_OPTION, RECURSIVE_UNLINK_OPTION, REMOVE_FILES_OPTION,
SHOW_OMITTED_DIRS_OPTION, TOTALS_OPTION): New constants.
(long_options, decode_options): Use them.
(OVERWRITE_DIR_OPTION): Remove.
(long_options): New options --index-file, --no-overwrite-dir.
Remove --overwrite-dir option.
(usage): Use PACKAGE_BUGREPORT.
(decode_options): Terminate new argv properly.
Use PACKAGE_NAME, PACKAGE_VERSION.
If verbose, report how we grokked any textual date option.
(main): Add support for index-file.
2003-07-05 08:18:46 +00:00
Paul Eggert
40835c2c55 Use newer form for bug report and version. 2003-07-05 07:55:34 +00:00
Paul Eggert
1722082cfe Remove PARAMS. 2003-07-05 07:21:49 +00:00
Paul Eggert
45dd602433 Don't include print-copyr.h.
(prepare_input_buffer): Renamed from prepare_record_buffer.
New arg FD.  All uses changed.
Do not read more than INT_MAX bytes at once,
since it breaks on some brain damaged Tru64 hosts.
Do not mix int and size_t pointers.  Divide size by two
when retrying instead of subtracting 1024; for speed.
(main): Use gettext to translate (C), not print_copyright.
2003-07-05 07:21:19 +00:00
Paul Eggert
935cd4f515 (namelist_match): Allow partial matches only if recursive.
(hash_string_hasher): Renamed from hash_avoided_name.
(hash_string_compare): Renamed from compare_avoided_anames.
(hash_string_insert, hash_string_lookup): New functions.
(add_avoided_name, is_avoided_name): Use them.
(safer_name_suffix): New function.
(contains_dot_dot): Moved here from misc.c.  Now returns bool, not int.
2003-07-05 07:17:20 +00:00
Paul Eggert
f29b54b237 (read_and): Give full type for procedure arg.
(read_header): Strip trailing slashes, setting current_trailing_slash.
(tartime): Avoid int overflow when printing year (!).
(print_header): New arg specifing block ordinal.  All uses changed.
Print link as 'h' type.  Give labels for long links and names.
2003-07-05 07:00:54 +00:00
Paul Eggert
675c5a2f24 (we_are_root): Now bool, not int.
(check_time): Warn about implausibly old time stamps.
(set_stat): Use utimbuf, not stat_info.
(preprare_to_extract): New arg DIRECTORY.
(fill_in_sparse_array): Moved here from compare.c.
(extract_sparse_file): Now returns off_t, giving size left.
Truncate file at end.
(extract_archive): Use safer_name_suffix rather than rolling our own.
Use fill_in_sparse_array rather than rolling our own.
Strip trailing slashes more effectively.
Check for unsafe names.
2003-07-05 06:53:31 +00:00
Paul Eggert
ea202e1adf (relativize): Remove; replaced by safer_name_suffix.
All callers changed.
(start_header): Clear devmajor and devminor fields, too.
(finish_header): New arg block_ordinal.
(init_sparsearray): Now extern.  Set sp_array_size to
SPARSES_IN_OLDGNU_HEADER if it is zero.
(dump_file): Keep link table as a hash.
Do not count "file changed as we read it" as a failure.
2003-07-05 06:43:30 +00:00
Paul Eggert
664f2dbdd9 (print_total_written): Adjust to new human.h interface.
(child_open_for_compress): Do not increase size to BLOCKSIZE.
(open_archive): Open index file name.
Strip trailng slahes from file names.
(flush_write): Set size to 0 if not saving names.
(flush_write, flush_read): Use safer_name_suffix rather than
inline code.
2003-07-05 06:19:54 +00:00
Paul Eggert
15726fabad (AUTOMAKE_OPTIONS): Remove. 2003-07-05 01:04:08 +00:00
Paul Eggert
f2ad7d403e (EXTRA_DIST): Add alloca.m4, backupfile.m4, bison.m4, chown.m4,
dirname.m4, dos.m4, exclude.m4, fileblocks.m4, ftruncate.m4,
getdate.m4, getopt.m4, hash.m4, human.m4, intdiv0.m4, intmax_t.m4,
inttypes_h.m4, inttypes-pri.m4, isc-posix.m4, lcown.m4, lib-ld.m4,
lib-link.m4, lib-prefix.m4, memset.m4, mktime.m4, modechange.m4,
nls.m4, onceonly.m4, pathmax.m4, po.m4, quotearg.m4, quote.m4,
rmdir.m4, safe-read.m4, safe-write.m4, save-cwd.m4, savedir.m4,
ssize_t.m4, stdbool.m4, stdint_h.m4, strcase.m4, strtoimax.m4,
strtoll.m4, strtol.m4, strtoull.m4, strtoul.m4, strtoumax.m4,
tm_gmtoff.m4, uintmax_t.m4, unlocked-io.m4, xalloc.m4, xgetcwd.m4,
xstrtol.m4.  Remove c-bs-a.m4, ccstdc.m4, check-decl.m4, decl.m4,
jm-mktime.m4, prereq.m4, xstrtoimax.m4.
2003-07-05 00:59:16 +00:00
Paul Eggert
01d81c7f0f Switch to new method for doing copyright notices.
Use @acronym instead of @sc where appropriate.
Remove empty examples.  Give a few more examples.
2003-07-05 00:46:14 +00:00
Paul Eggert
e4a052cd21 Convert to UTF-8. 2003-07-04 23:35:57 +00:00
Paul Eggert
89662fe926 Convert to UTF-8. 2003-07-04 23:32:57 +00:00
Paul Eggert
d5100e76cf Convert to UTF-8. 2003-07-04 23:28:11 +00:00
Paul Eggert
622724a886 Convert to UTF-8. 2003-07-04 23:25:38 +00:00
Paul Eggert
b9be191da0 Suggest Autoconf 2.57, Automake 1.7.5, Bison 1.875, gettext 0.12.1. 2003-07-04 23:15:25 +00:00
Paul Eggert
121b4241d7 Suggest Autoconf 2.57, Automake 1.7.5, Bison 1.875. 2003-07-04 23:08:20 +00:00
Paul Eggert
39f69360f0 Add copyright notice. 2003-07-04 18:06:51 +00:00
Paul Eggert
f3364ac428 Initial revision 2003-06-28 21:17:38 +00:00
Paul Eggert
e547e855e9 import from gnulib 2003-06-04 23:35:46 +00:00
Paul Eggert
bdece51882 import from gnulib 2003-04-05 06:53:09 +00:00
Paul Eggert
fcb62b60d9 import from gnulib 2003-03-10 07:31:50 +00:00
Paul Eggert
dc861c7ab9 import from gnulib 2003-01-10 21:06:49 +00:00
Paul Eggert
7154feb583 import from gnulib 2003-01-08 18:42:38 +00:00
Paul Eggert
4f5e37c861 import from gnulib 2002-12-06 08:08:13 +00:00
Paul Eggert
504274b059 import from gnulib 2002-12-05 20:46:03 +00:00
Paul Eggert
4ff9279d9d import from gnulib 2002-11-22 16:25:53 +00:00
kaun
b94aa0bc5f (print_copyright)
- fix typo (use print_unicode_char, not print_unicode_success)
2002-08-02 00:04:07 +00:00
Paul Eggert
784a497c40 (strtoll): Depend on HAVE_LONG_LONG, not HAVE_UNSIGNED_LONG_LONG. 2002-07-09 17:40:33 +00:00
Paul Eggert
f2daf2e598 import from gnulib 2002-06-26 06:17:35 +00:00
Paul Eggert
859ba730d5 coreutils 5.0 version 2002-05-27 20:05:03 +00:00
Paul Eggert
d1c27c2308 Sync with fileutils 2002-02-11 14:28:35 +00:00
Paul Eggert
9ded0a0567 Sync with fileutils 2002-02-11 14:28:09 +00:00
Paul Eggert
4bfdfaa270 allow using unicode 2002-01-26 06:04:19 +00:00
Paul Eggert
ba32aa1147 From textutils 2.1 2002-01-22 07:43:55 +00:00
Paul Eggert
bb5b309581 Sync with fileutils. 2002-01-16 22:43:41 +00:00
Paul Eggert
f762709bb0 Sync with fileutils. 2001-12-19 15:05:33 +00:00
299 changed files with 48391 additions and 33741 deletions

31
.gitignore vendored Normal file
View File

@@ -0,0 +1,31 @@
*.a
*.la
*.lo
*.o
*.so
*~
.bootstrap
.deps
.emacs*
.libs
ABOUT-NLS
ChangeLog
INSTALL
Make.rules
Makefile
Makefile.in
aclocal.m4
autom4te.cache
build-aux
build-aux/
config.h
config.h.in
config.log
config.status
configure
gnu
gnulib
libtool
m4
paxutils
stamp-h1

35
AUTHORS
View File

@@ -1,28 +1,15 @@
Authors of GNU tar.
The following contributions warranted legal paper exchanges with the
Free Software Foundation. Also see files ChangeLog and THANKS.
Public domain tar was written by John Gilmore, with contributions from
Henry Spencer, Fred Fish, Ian Darwin, Geoff Collyer, Stan Barber, Guy
Harris, Dave Brower, Richard Todd, Michael Rendell, Stu Heiss, and
Rich Salz.
TAR Jay Fenlason
Assigns his changes.
The FSF version, named GNU tar, was derived from public domain tar by
Jay Fenlason and Joy Kendall. Amy Gorin and Melissa Weisshaus
contributed to the manual. GNU tar has been maintained in turn by
Thomas Bushnell BSG, François Pinard, Paul Eggert, and Sergey
Poznyakoff.
TAR Richard E Salz 1993-03-11
Disclaims changes to getdate.y.
TAR MANUAL (?) Amy Gorin (US 1963) 1995-01-10
Assigns the Tar Manual.
TAR Francois Pinard Canada 1949 1996-02-01
Assigns past and future changes.
TAR Melissa Weisshaus US 1966 1997-04-09
Assigns changes to the manual and future changes.
melissa@gnu.ai.mit.edu
TAR Thomas Michael Innis Bushnell US 1967 1997-04-09
Assigns changes.
thomas@gnu.ai.mit.edu
TAR Thomas Michael Innis Bushnell US 1967 1997-04-09
Assigns changes to manual.
thomas@gnu.ai.mit.edu
Many others have contributed to GNU tar; please see the files THANKS
and ChangeLog.

674
COPYING Normal file
View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

3571
ChangeLog

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

8833
ChangeLog.CVS Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,60 +1,38 @@
# Main Makefile for GNU tar.
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2003, 2007,
# 2009 Free Software Foundation, Inc.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3, or (at your option)
## any later version.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
AUTOMAKE_OPTIONS = gnits dist-shar
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301, USA.
BABYL = rmail/* admin/*/RMAIL
EXTRA_DIST = AC-PATCHES AM-PATCHES BI-PATCHES PORTS rebox.el
SUBDIRS = doc lib intl src scripts po tests
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = ChangeLog.1 Make.rules
SUBDIRS = doc gnu lib rmt src scripts po tests
all-local: $(CONFIG_HEADER)
dist-hook:
$(MAKE) changelog_dir=$(distdir) ChangeLog
-rm -f $(distdir).cpio
find $(distdir) | cpio -Hcrc -o | \
GZIP=$(GZIP_ENV) gzip -c > $(distdir).cpio.gz
id: ID
distclean-local:
-rm -f $(distdir).cpio.gz
ID:
cd lib && $(MAKE) $@
cd src && $(MAKE) $@
include Make.rules
dist-zoo: $(DISTFILES)
rm -rf $(distdir)
mkdir $(distdir)
distdir=`cd $(distdir) && pwd` \
&& cd $(srcdir) \
&& automake --include-deps --output-dir=$$distdir
@for file in $(DISTFILES); do \
test -f $(distdir)/$$file \
|| cp -p $(srcdir)/$$file $(distdir)/$$file; \
done
for subdir in $(SUBDIRS); do \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
chmod 777 $(distdir)/$$subdir; \
(cd $$subdir && $(MAKE) dist) || exit 1; \
done
@sublist="$(DIST_SUBDIRS)"; \
for dir in $$sublist; do \
echo copying directory $$dir; \
tar -chf - $$dir | (cd $(distdir) && tar -xBpf -); \
done
chmod -R a+r $(distdir)
find $(distdir) -type f | xargs dosfn
# find $(distdir) -type f | xargs recode :ibmpc
mv $(distdir) $(PACKAGE)
find $(PACKAGE) -type f | zoo ahIq $(PACKAGE).zoo
rm -rf $(PACKAGE)
gen_start_date = 2009-03-06
prev_change_log = ChangeLog.CVS
changelog_dir = .

View File

@@ -1,378 +0,0 @@
# Makefile.in generated automatically by automake 1.1n from Makefile.am
# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
# Main Makefile for GNU tar.
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
SHELL = /bin/sh
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
NORMAL_INSTALL = true
PRE_INSTALL = true
POST_INSTALL = true
NORMAL_UNINSTALL = true
PRE_UNINSTALL = true
POST_UNINSTALL = true
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
DATADIRNAME = @DATADIRNAME@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
GENCAT = @GENCAT@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
RANLIB = @RANLIB@
RMT = @RMT@
U = @U@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
YACC = @YACC@
AUTOMAKE_OPTIONS = gnits dist-shar
BABYL = rmail/* admin/*/RMAIL
EXTRA_DIST = AC-PATCHES AM-PATCHES BI-PATCHES PORTS rebox.el
SUBDIRS = doc lib intl src scripts po tests
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
CONFIG_HEADER_IN = config.h.in
CONFIG_HEADER_FULL = config.h
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
DIST_COMMON = README ABOUT-NLS AUTHORS BACKLOG COPYING ChangeLog \
INSTALL Makefile.am Makefile.in NEWS THANKS TODO acconfig.h \
acinclude.m4 aclocal.m4 config.h.in configure configure.in install-sh \
missing mkinstalldirs stamp-h.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP = --best
default: all
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnits Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
$(srcdir)/aclocal.m4: configure.in acinclude.m4
cd $(srcdir) && $(ACLOCAL)
config.status: configure
$(SHELL) ./config.status --recheck
$(srcdir)/configure: configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
$(CONFIG_HEADER): stamp-h
stamp-h: $(CONFIG_HEADER_IN) $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES= CONFIG_HEADERS=$(CONFIG_HEADER_FULL) \
$(SHELL) ./config.status
@echo timestamp > stamp-h
$(srcdir)/$(CONFIG_HEADER_IN): stamp-h.in
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
cd $(top_srcdir) && $(AUTOHEADER)
echo timestamp > $(srcdir)/stamp-h.in
mostlyclean-hdr:
clean-hdr:
distclean-hdr:
rm -f $(CONFIG_HEADER)
maintainer-clean-hdr:
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
@SET_MAKE@
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive \
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@for subdir in $(SUBDIRS); do \
target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
(cd $$subdir && $(MAKE) $$target) \
|| case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
(cd $$subdir && $(MAKE) tags); \
done
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
done; \
test -z "$(ETAGS_ARGS)config.h.in$(SOURCES)$(HEADERS)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $(SOURCES) $(HEADERS) -o $$here/TAGS)
mostlyclean-tags:
clean-tags:
distclean-tags:
rm -f TAGS ID
maintainer-clean-tags:
distdir = $(PACKAGE)-$(VERSION)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
rm -rf $(distdir)
GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz --mode=a+r
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
dc_install_base=`cd $(distdir)/=inst && pwd`; \
cd $(distdir)/=build \
&& ../configure --with-included-gettext --srcdir=.. --prefix=$$dc_install_base \
&& $(MAKE) \
&& $(MAKE) dvi \
&& $(MAKE) check \
&& $(MAKE) install \
&& $(MAKE) installcheck \
&& $(MAKE) dist
rm -rf $(distdir)
@echo "========================"; \
echo "$(distdir).tar.gz is ready for distribution"; \
echo "========================"
dist: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz --mode=a+r $(distdir)
rm -rf $(distdir)
dist-shar: distdir
-chmod -R a+r $(distdir)
rm -rf $(distdir)
dist-all: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz --mode=a+r $(distdir)
rm -rf $(distdir)
distdir: $(DISTFILES)
@if sed 15q $(srcdir)/NEWS | fgrep -e "$(VERSION)" > /dev/null; then :; else \
echo "NEWS not updated; not releasing" 1>&2; \
exit 1; \
fi
rm -rf $(distdir)
mkdir $(distdir)
-chmod 755 $(distdir)
@for file in $(DISTFILES); do \
d=$(srcdir); \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done
for subdir in $(SUBDIRS); do \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
chmod 755 $(distdir)/$$subdir; \
(cd $$subdir && $(MAKE) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
done
info: info-recursive
dvi: dvi-recursive
check: all-am
$(MAKE) check-recursive
installcheck: installcheck-recursive
all-recursive-am: $(CONFIG_HEADER)
$(MAKE) all-recursive
all-am: Makefile config.h all-local
install-exec: install-exec-recursive
@$(NORMAL_INSTALL)
install-data: install-data-recursive
@$(NORMAL_INSTALL)
install: install-recursive
@:
uninstall: uninstall-recursive
all: all-recursive-am all-am
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
installdirs: installdirs-recursive
mostlyclean-generic:
test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
rm -f Makefile $(DISTCLEANFILES)
rm -f config.cache config.log stamp-h
test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \
maintainer-clean-generic distclean-am
mostlyclean: mostlyclean-recursive mostlyclean-am
clean: clean-recursive clean-am
distclean: distclean-recursive distclean-am
rm -f config.status
maintainer-clean: maintainer-clean-recursive maintainer-clean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
rm -f config.status
.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
maintainer-clean-hdr install-data-recursive uninstall-data-recursive \
install-exec-recursive uninstall-exec-recursive installdirs-recursive \
uninstalldirs-recursive all-recursive check-recursive \
installcheck-recursive info-recursive dvi-recursive \
mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir info dvi \
installcheck all-recursive-am all-am install-exec install-data install \
uninstall all installdirs mostlyclean-generic distclean-generic \
clean-generic maintainer-clean-generic clean mostlyclean distclean \
maintainer-clean
all-local: $(CONFIG_HEADER)
id: ID
ID:
cd lib && $(MAKE) $@
cd src && $(MAKE) $@
dist-zoo: $(DISTFILES)
rm -rf $(distdir)
mkdir $(distdir)
distdir=`cd $(distdir) && pwd` \
&& cd $(srcdir) \
&& automake --include-deps --output-dir=$$distdir
@for file in $(DISTFILES); do \
test -f $(distdir)/$$file \
|| cp -p $(srcdir)/$$file $(distdir)/$$file; \
done
for subdir in $(SUBDIRS); do \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
chmod 777 $(distdir)/$$subdir; \
(cd $$subdir && $(MAKE) dist) || exit 1; \
done
@sublist="$(DIST_SUBDIRS)"; \
for dir in $$sublist; do \
echo copying directory $$dir; \
tar -chf - $$dir | (cd $(distdir) && tar -xBpf -); \
done
chmod -R a+r $(distdir)
find $(distdir) -type f | xargs dosfn
# find $(distdir) -type f | xargs recode :ibmpc
mv $(distdir) $(PACKAGE)
find $(PACKAGE) -type f | zoo ahIq $(PACKAGE).zoo
rm -rf $(PACKAGE)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

868
NEWS

File diff suppressed because it is too large Load Diff

131
PORTS
View File

@@ -1,131 +0,0 @@
* Ports of GNU tar and other micro-tars -*- outline -*-
Please write tar-bugs@gnu.ai.mit.edu if you are aware of various ports
of GNU tar to non-Unix systems not listed here, or for corrections.
Please provide the goal system, a complete and stable URL, the maintainer
name and address, the tar version used as a base, and your comments.
.* Amiga
. + ftp://ftp.wustl.edu/systems/amiga/aminet/util/arc/GNUtar-1.11.8.lha
maintained by Enrico Forestieri <enrico@com.unipr.it>
Based on tar 1.11.8.
. + ftp://ftp.ninemoons.com/pub/ade/current/amiga-bin/tar-1.11.8-bin.lha
maintained by the ADE group <fnf@fishpond.ninemoons.com>
Based on tar 1.11.8, needs ixemul.library.
. + ftp://ftp.wustl.edu/systems/amiga/aminet/util/arc/gnutar.lha
maintained by <mscheler@wuarchive.wustl.edu>
.* DEC alpha (NT)
. + ftp://ftp.cdrom.com/.20/windows/archiver/tar.zip
maintained by Drew Bliss & Geoff Voelker
.* DEC VAX (VMS)
. + http://www.lp.se/free/vmstar/
maintained by Richard Levitte <levitte@lp.se>
This is not GNU tar, but a separate implementation.
. + maintained by William Bader <william@nscs.fast.net>
For V4.7. Based on an old PDtar. Requires compatible shared libraries
to run V5 or V6 executables.
.* IBM/PC (DV/X)
. + ftp://qdeck.com/ (?)
maintained by David Ronis <ronis@gibbs.chem.mcgill.ca>
For Desqview/X. Everything works besides compression. Copy of hacked
sources available, some of DV/X's programmer's library also needed.
.* IBM/PC (MSDOS)
. + http://www.simtel.net/simtel.net/
http://www.leo.org/pub/comp/platforms/pc/gnuish (Germany)
ftp://ftp.simtel.net/simtelnet/gnu
ftp://ftp.leo.org/pub/comp/platforms/pc/gnuish
maintained by Darrel Hankerson <hankedr@mail.auburn.edu>
You get many GNU tools, not only `tar'. The GNUish project is described
in `gnuish_t.htm'.
. + The DJGPP development tools also include some `tar' utilities.
. + ftp://ftp.mcs.com/mcsnet.users/les/dos-gnutar/
maintained by Leslie Mikesell <les@mcs.net>
Based on tar 1.11.2. Support for SCSI (via ASPI) and network (rsh over
packet driver). No support for win95 long file names.
. + ftp://ftp.wu-wien.ac.at:pub/src/PCmisc/aspi-tar/*
maintained by Christoph Splittgerber <chris@orion.sdata.de>
Based on tar 1.10. Support for SCSI (via ASPI).
. + ftp://wuarchive (?)
Several DOS version based on PDtar. John Gilmore <gnu@toad.com> says
he has copies of several vintages saved.
. + ftp://ftp.cdrom.com/.14/languages/ada/toolkit/msdos/gtar/gtar.exe
ftp://ftp.cdrom.com/.14/languages/ada/toolkit/msdos/gtar/gtar.taz
ftp://ftp.cdrom.com/.14/languages/ada/toolkit/msdos/gtar/gtar.zip
. + ftp://ftp.cdrom.com/.4/os2/archiver/tar.zip
Based on PDtar.
. + ftp://ftp.cdrom.com/.20/windows/archiver/tar.zip
maintained by Drew Bliss & Geoff Voelker
GNU tar for NT (intel and Alpha platforms).
. + ftp://garbo.uwasa.fi/pc/unix/untgz095.zip
maintained by Tillmann Steinbrecher <tst@darmstadt.netsurf.de>
The `untgz' program is a fast .tar or .tar.gz (.tgz) extractor.
. + http://people.darmstadt.netsurf.de/tst/tar.htm
maintained by Tillmann Steinbrecher <tst@darmstadt.netsurf.de>
This is not a `tar' port, but an index of them.
.* IBM/PC (OS/2)
. + http://www.leo.org/pub/comp/os/os2/leo/gnu/archiver/gtar254.zip
http://www.leo.org/pub/comp/os/os2/leo/gnu/archiver/gtak254.zip
maintained by Andreas Kaiser <Andreas.Kaiser@stuttgart.netsurf.de>
Version 2.54. Based on tar 1.10. The second archive contains SCSI
drivers (DAT streamers notably) and rmt-type programs.
. + ftp://garbo.uwasa.fi/pc/unix/untgz095.zip
maintained by Tillmann Steinbrecher <tst@darmstadt.netsurf.de>
The `untgz' program is a fast .tar or .tar.gz (.tgz) extractor.
.* IBM/PC (Win32: Windows 95, NT 3.5 or NT 4.0)
. + ftp://ftp.cygnus.com:~ftp/pub/sac/win32/usersrc/*
maintained by Cygnus
GNU-Win32 B17.1 distribution. Download all files, `cat' them together,
and `untar' the result. You get many GNU tools, not only `tar'.
Based on tar 1.11.2.
. + ftp://ftp.cdrom.com/.20/windows/archiver/tar.zip
maintained by Drew Bliss & Geoff Voelker
GNU tar for NT (intel and Alpha platforms).
. + ftp://garbo.uwasa.fi/pc/unix/untgz095.zip
maintained by Tillmann Steinbrecher <tst@darmstadt.netsurf.de>
The `untgz' program is a fast .tar or .tar.gz (.tgz) extractor.
.* IBM/PC (Windows 3.1)
. + ftp://ftp.mcs.com/mcsnet.users/les/win-gnutar/
maintained by Leslie Mikesell <les@mcs.net>
Support for network (rsh over winsock). No support for win95 long
file names.
. + ftp://ftp.gamesdomain.ru/.1/os/windows/programr/tar.zip
Based on GNU tar 1.11.2.
.* Macintosh
. + There is a tar in Stuffit Expander which is available many places and
comes with MacOS. It creates some spurious files but works on average.
. + There is an excellent GNU tar bundled in Tenon MachTen, but it does not
seem to be available separately.

184
README
View File

@@ -1,25 +1,7 @@
README for GNU tar
See the end of file for copying conditions.
Copyright 1990, 1991, 1992, 1994, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This file is part of GNU tar.
GNU tar is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU tar is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with tar; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
* Introduction
Please glance through *all* sections of this
`README' file before starting configuration. Also make sure you read files
@@ -48,9 +30,15 @@ See file `THANKS' for a list of contributors.
Besides those configure options documented in files `INSTALL' and
`ABOUT-NLS', an extra option may be accepted after `./configure':
* `--disable-largefile' omits support for large files, even if the
operating system supports large files. Typically, large files are
those larger on 2 GB on a 32-bit host.
* Install
** Selecting the default archive format.
The default archive format is GNU, this can be overridden by
presetting DEFAULT_ARCHIVE_FORMAT while configuring. The allowed
values are GNU, V7, OLDGNU, USTAR and POSIX.
** Selecting the default archive device
The default archive device is now `stdin' on read and `stdout' on write.
The installer can still override this by presetting `DEFAULT_ARCHIVE'
@@ -58,34 +46,45 @@ in the environment before configuring (the behavior of `-[0-7]' or
`-[0-7]lmh' options in `tar' are then derived automatically). Similarly,
`DEFAULT_BLOCKING' can be preset to something else than 20.
For comprehensive modifications to GNU tar, you might need tools beyond
those used in simple installations. Fully install GNU m4 1.4 first,
and only then, Autoconf 2.13 or later. Install Perl, then Automake
1.4 or later. You might need Bison 1.28 or later, and GNU tar itself.
All are available on GNU archive sites, like in
ftp://ftp.gnu.org/pub/gnu/.
** Selecting full pathname of the "rmt" binary.
Send bug reports to `bug-tar@gnu.org'. (Beware, old-timers: it is
`@gnu', not `@prep'; and not `bug-gnu-utils' anymore.) A bug report is
an adequate description of the problem: your input, what you expected,
what you got, and why this is wrong. Diffs are welcome, but they only
describe a solution, from which the problem might be uneasy to infer.
If needed, submit actual data files with your report. Small data files
are preferred. Big files may sometimes be necessary, but do not send them
to the report address; rather take special arrangement with the maintainer.
Previous versions of tar always looked for "rmt" binary in the
directory "/etc/rmt". However, the "rmt" program included
in the distribution was installed under "$prefix/libexec/rmt".
To fix this discrepancy, tar now looks for "$prefix/libexec/rmt".
If you do not want this behavior, specify full path name of
"rmt" binary using DEFAULT_RMT_DIR variable, e.g.:
Your feedback will help us to make a better and more portable package.
Consider documentation errors as bugs, and report them as such. If you
develop anything pertaining to `tar' or have suggestions, let us know
and share your findings by writing to <bug-tar@gnu.org>.
./configure DEFAULT_RMT_DIR=/etc
If you already have a copy of "rmt" installed and wish to use it
instead of the version supplied with the distribution, use --with-rmt
option:
Installation hints
------------------
./configure --with-rmt=/etc/rmt
This will also disable building the included version of rmt.
** Installing backup scripts.
This version of tar is shipped with the shell scripts for producing
incremental backups (dumps) and restoring filesystems from them.
The name of the backup script is "backup". The name of the
restore script is "restore". They are installed in "$prefix/sbin"
directory.
Use option --enable-backup-scripts to compile and install these
scripts.
** `--disable-largefile' omits support for large files, even if the
operating system supports large files. Typically, large files are
those larger than 2 GB on a 32-bit host.
* Installation hints
Here are a few hints which might help installing `tar' on some systems.
* gzip and bzip2.
** gzip and bzip2.
GNU tar uses the gzip and bzip2 programs to read and write compressed
archives. If you don't have these programs already, you need to
@@ -106,7 +105,7 @@ in gzip test version 1.3, which as of this writing is available at
incompatibility by using a shell command like
`gzip -d <file.tar.gz | tar -xzf -'.
* Solaris issues.
** Solaris issues.
GNU tar exercises many features that can cause problems with older GCC
versions. In particular, GCC 2.8.1 (sparc, -O1 or -O2) is known to
@@ -117,7 +116,7 @@ Recent versions of Solaris tar sport a new -E option to generate
extended headers in an undocumented format. GNU tar does not
understand these headers.
* Static linking.
** Static linking.
Some platform will, by default, prepare a smaller `tar' executable
which depends on shared libraries. Since GNU `tar' may be used for
@@ -138,34 +137,32 @@ to a value from the table below, before configuration (see `INSTALL').
Solaris (vendor) -Bstatic
SunOS (vendor) -Bstatic
* Failed tests `ignfail.sh' or `incremen.sh'.
** Failed tests `ignfail.sh' or `incremen.sh'.
In an NFS environment, lack of synchronization between machine clocks
might create difficulties to any tool comparing dates and file time stamps,
like `tar' in incremental dumps. This has been a recurrent problem with
GNU Make for the last few years. We would like a general solution.
* BSD compatibility matters.
** BSD compatibility matters.
Set LIBS to `-lbsd' before configuration (see `INSTALL') if the linker
complains about `bsd_ioctl' (Slackware). Also set CPPFLAGS to
`-I/usr/include/bsd' if <sgtty.h> is not found (Slackware).
* OPENStep 4.2 swap files
** OPENStep 4.2 swap files
Tar cannot read the file /private/vm/swapfile.front (even as root).
This file is not a real file, but some kind of uncompressed view of
the real compressed swap file; there is no reason to back it up, so
the simplest workaround is to avoid tarring this file.
Special topics
--------------
* Special topics
Here are a few special matters about GNU `tar', not related to build
matters. See previous section for such.
* File attributes.
** File attributes.
About *security*, it is probable that future releases of `tar' will have
some behavior changed. There are many pending suggestions to choose from.
@@ -178,19 +175,76 @@ implement flavors of symbolic links showing different behavior and
properties. We did not successfully sorted all these out yet. Currently,
the `lchown' call will be used if available, but that's all.
* POSIX compliance.
** POSIX compliance.
GNU `tar' implements an early draft of the POSIX 1003.1 `ustar' standard
which is different from the final standard. This will be progressively
corrected over the incoming few years. Don't be mislead by the mere
existence of the --posix option. Later releases will become able to
read truly POSIX archives, and also to produce them under option. (Also,
if you look at the internals, don't take the GNU extensions you see for
granted, as they are planned to change.) GNU tar 2.0 will produce POSIX
archives by default, but there is a long way before we get there.
GNU `tar' is able to create archive in the following formats:
*** The format of UNIX version 7
*** POSIX.1-1988 format, also known as "ustar format"
*** POSIX.1-2001 format, also known as "pax format"
*** Old GNU format (described below)
In addition to those, GNU `tar' is also able to read archives
produced by `star' archiver.
A so called `Old GNU' format is based on an early draft of the
POSIX 1003.1 `ustar' standard which is different from the final
standard. It defines its extensions (such as incremental backups
and handling of the long file names) in a way incompatible with
any existing tar archive format, therefore the use of old GNU
format is strongly discouraged.
Please read the file NEWS for more information about POSIX compliance
and new `tar' features.
* What's next?
In the future we will try to release tar-1.14 as soon as possible and
start merging with paxutils afterwards. We'll also try to rewrite
some parts of the documentation after paxutils has been merged.
GNU tar will be merged into GNU paxutils: a project containing
several utilities related to creating and handling archives in
various formats. The project will include tar, cpio and pax
utilities.
* Bug reporting.
Send bug reports to <bug-tar@gnu.org>. A bug report should contain
an adequate description of the problem, your input, what you expected,
what you got, and why this is wrong. Diffs are welcome, but they only
describe a solution, from which the problem might be uneasy to infer.
If needed, submit actual data files with your report. Small data files
are preferred. Big files may sometimes be necessary, but do not send them
to the report address; rather take special arrangement with the maintainer.
Your feedback will help us to make a better and more portable package.
Consider documentation errors as bugs, and report them as such. If you
develop anything pertaining to `tar' or have suggestions, let us know
and share your findings by writing to <bug-tar@gnu.org>.
* Copying
Copyright (C) 1990, 1991, 1992, 1994, 1997, 1998, 1999, 2000,
2001, 2003, 2004, 2007 Free Software Foundation, Inc.
This file is part of GNU tar.
GNU tar is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU tar is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with tar; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
Local Variables:
mode: outline
paragraph-separate: "[ ]*$"
version-control: never
End:

View File

@@ -1,242 +1,82 @@
This is a test release of GNU tar.
This is GNU tar.
This is a *pre-release* version, and not ready for production use yet.
Please send comments and problem reports to <bug-tar@gnu.org>.
Copyright 2001 Free Software Foundation, Inc.
If you have taken the sources from CVS you will need the following
packages (or later) to build GNU tar. We don't make any extra effort
to accommodate older versions of these packages, so please make sure
that you have the latest stable version.
This file is part of GNU tar.
- Automake <http://www.gnu.org/software/automake/>
- Autoconf <http://www.gnu.org/software/autoconf/>
- Bison <http://www.gnu.org/software/bison/>
- Gettext <http://www.gnu.org/software/gettext/>
- Gzip <http://www.gnu.org/software/gzip/>
- M4 <http://www.gnu.org/software/m4/>
- Texinfo <http://www.gnu.org/software/texinfo>
- Wget <http://www.gnu.org/software/wget/>
GNU tar is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
As of this writing, the latest stable version of Gzip is 1.2.4 but we
suggest using test version 1.3.5 (or later, if one becomes available).
GNU tar is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Valgrind <http://valgrind.org/> is also highly recommended, if
Valgrind supports your architecture.
You should have received a copy of the GNU General Public License
along with tar; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Before building the package, run "bootstrap". It obtains various
additional files from the CVS repository and the Translation Project
site and prepares the source directory for building.
This release was built with GNU automake 1.5 patched as follows:
When run without arguments, bootstrap will try to obtain gnulib and
paxutils files from their corresponding CVS repositories on Savannah
using anonymous SSH access. Then, it will fetch the po files from tar
page at Translation Project, and, finally, it will start autoconfiguration
process. Simply running it without arguments should do in most cases.
Several options allow to control the behavior of bootstrap:
2001-09-24 Paul Eggert <eggert@twinsun.com>
--gnulib-srcdir=DIRNAME Specify the local directory where gnulib
sources reside. Use this if you already
have gnulib sources on your machine, and
do not want to waste your bandwidth dowloading
them again.
* m4/header.m4 (_AM_Config_Header_Index): Remove.
(AM_CONFIG_HEADER): Don't use it. It wasn't working, and was
causing needless rebuilds.
--paxutils-srcdir=DIRNAME Specify the local directory where paxutils
sources reside. Use this if you already
have paxutils sources on your machine, and
do not want to waste your bandwidth dowloading
them again.
2001-09-14 Paul Eggert <eggert@twinsun.com>
--cvs-auth=METHOD Set the CVS access method used for downloading
gnulib files. METHOD is one of the keywords
accepted by cvs -d option (see info cvs
repository).
* lib/am/distdir.am (REMOVE_DISTDIR):
New macro. Do not change permission of non-directories.
(distdir, dist, dist-bzip2, dist-tarZ, dist-shar, dist-zip, dist-all,
distcheck): Use it.
--cvs-user=USERNAME Set the CVS username to be used when accessing
the gnulib repository.
===================================================================
RCS file: lib/am/distdir.am,v
retrieving revision 1.5
retrieving revision 1.5.0.1
diff -pu -r1.5 -r1.5.0.1
--- lib/am/distdir.am 2001/07/14 20:12:52 1.5
+++ lib/am/distdir.am 2001/09/15 05:12:18 1.5.0.1
@@ -29,6 +29,11 @@ else !%?TOPDIR_P%
?DISTDIR?distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
endif !%?TOPDIR_P%
+REMOVE_DISTDIR = \
+ { test ! -d $(distdir) \
+ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr $(distdir); }; }
+
distdir: $(DISTFILES)
##
## For Gnits users, this is pretty handy. Look at 15 lines
@@ -47,7 +52,7 @@ endif %?TOPDIR_P%
## Only for the top dir.
##
if %?TOPDIR_P%
- -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
+ $(REMOVE_DISTDIR)
mkdir $(distdir)
endif %?TOPDIR_P%
##
@@ -168,13 +173,13 @@ GZIP_ENV = --best
.PHONY: dist
dist: distdir
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
+ $(REMOVE_DISTDIR)
if %?BZIP2%
.PHONY: dist-bzip2
dist-bzip2: distdir
$(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2
- -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
+ $(REMOVE_DISTDIR)
endif %?BZIP2%
@@ -182,7 +187,7 @@ if %?COMPRESS%
.PHONY: dist-tarZ
dist-tarZ: distdir
$(AMTAR) chof - $(distdir) | compress -c >$(distdir).tar.Z
- -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
+ $(REMOVE_DISTDIR)
endif %?COMPRESS%
@@ -190,7 +195,7 @@ if %?SHAR%
.PHONY: dist-shar
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
- -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
+ $(REMOVE_DISTDIR)
endif %?SHAR%
@@ -199,7 +204,7 @@ if %?ZIP%
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
- -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
+ $(REMOVE_DISTDIR)
endif %?ZIP%
endif %?TOPDIR_P%
@@ -223,7 +228,7 @@ dist-all: distdir
?SHAR? shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
?ZIP? -rm -f $(distdir).zip
?ZIP? zip -rq $(distdir).zip $(distdir)
- -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
+ $(REMOVE_DISTDIR)
endif %?TOPDIR_P%
@@ -239,8 +244,7 @@ if %?TOPDIR_P%
# tarfile.
.PHONY: distcheck
distcheck: dist
-## Make sure we can remove distdir before trying to remove it.
- -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
+ $(REMOVE_DISTDIR)
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
## Make the new source tree read-only. Distributions ought to work in
## this case. However, make the top-level directory writable so we
@@ -273,7 +277,7 @@ distcheck: dist
&& (test `find . -type f -print | wc -l` -eq 0 \
|| (echo "Error: files left after distclean" 1>&2; \
exit 1) )
- -chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
+ $(REMOVE_DISTDIR)
@echo "$(distdir).tar.gz is ready for distribution" | \
sed 'h;s/./=/g;p;x;p;x'
endif %?TOPDIR_P%
===================================================================
RCS file: m4/header.m4,v
retrieving revision 1.5
retrieving revision 1.5.0.1
diff -pu -r1.5 -r1.5.0.1
--- m4/header.m4 2001/07/21 05:27:26 1.5
+++ m4/header.m4 2001/09/24 18:29:30 1.5.0.1
@@ -11,18 +11,16 @@ AC_PREREQ([2.12])
AC_DEFUN([AM_CONFIG_HEADER],
[ifdef([AC_FOREACH],dnl
- [dnl init our file count if it isn't already
- m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0]))
+ [
dnl prepare to store our destination file list for use in config.status
AC_FOREACH([_AM_File], [$1],
[m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*]))
- m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index))
dnl and add it to the list of files AC keeps track of, along
dnl with our hook
AC_CONFIG_HEADERS(_AM_File,
dnl COMMANDS, [, INIT-CMDS]
[# update the timestamp
-echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index["
+echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h"
][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS
m4_popdef([_AM_Dest])])],dnl
[AC_CONFIG_HEADER([$1])
--no-po Do not download po files.
Notice also that when using CVS authentication method "ext", bootstrap
will set the variable CVS_RSH to "ssh", unless it is already set to
some other value.
and with GNU autoconf 2.52 patched as follows:
Copyright (C) 2001, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
2001-09-15 Paul Eggert <eggert@twinsun.com>
This file is part of GNU tar.
Fix bug reported by Paul Townsend on AIX 4.3.3.0 with
CFLAGS=-O4 or CFLAGS=-O5. In that case, the linker has a
relaxed view of fatal errors, and AC_CHECK_LIB causes it to
include libraries even when they don't exist.
GNU tar is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
* acheaders.m4 (AC_HEADER_DIRENT): Use AC_SEARCH_LIBS, not
AC_CHECK_LIB, so that we don't use -ldir or -lx if we don't
need it.
GNU tar is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
* acspecific.m4 (AC_ISC_POSIX): Replace the old, crufty
version with the version used by fileutils 4.1, except use
AC_SEARCH_LIBS, not AC_CHECK_LIB, so that we don't use
-lcposix if we don't need it.
===================================================================
RCS file: acheaders.m4,v
retrieving revision 2.52
retrieving revision 2.52.0.1
diff -pu -r2.52 -r2.52.0.1
--- acheaders.m4 2001/07/03 14:19:09 2.52
+++ acheaders.m4 2001/09/16 02:53:51 2.52.0.1
@@ -158,9 +158,9 @@ ac_header_dirent=$ac_hdr; break])
done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
- AC_CHECK_LIB(dir, opendir, LIBS="$LIBS -ldir")
+ AC_SEARCH_LIBS(opendir, dir)
else
- AC_CHECK_LIB(x, opendir, LIBS="$LIBS -lx")
+ AC_SEARCH_LIBS(opendir, x)
fi
])# AC_HEADER_DIRENT
===================================================================
RCS file: acspecific.m4,v
retrieving revision 2.52
retrieving revision 2.52.0.1
diff -pu -r2.52 -r2.52.0.1
--- acspecific.m4 2001/06/15 17:46:01 2.52
+++ acspecific.m4 2001/09/16 02:53:51 2.52.0.1
@@ -993,28 +993,7 @@ fi
# AC_ISC_POSIX
# ------------
AC_DEFUN([AC_ISC_POSIX],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
-AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
-AC_MSG_CHECKING([for POSIXized ISC])
-if test -d /etc/conf/kconfig.d &&
- grep _POSIX_VERSION [/usr/include/sys/unistd.h] >/dev/null 2>&1
-then
- AC_MSG_RESULT([yes])
- ISC=yes # If later tests want to check for ISC.
- AC_DEFINE(_POSIX_SOURCE, 1,
- [Define if you need to in order for stat and other things to
- work.])
- if test "$GCC" = yes; then
- CC="$CC -posix"
- else
- CC="$CC -Xp"
- fi
-else
- AC_MSG_RESULT([no])
- ISC=
-fi
-])# AC_ISC_POSIX
+[AC_SEARCH_LIBS(strerror, cposix)])
# AC_XENIX_DIR
You should have received a copy of the GNU General Public License
along with tar; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.

69
README-hacking Normal file
View File

@@ -0,0 +1,69 @@
These notes intend to help people working on the Git version of
this package.
* Requirements
You need the following packages to build the Git version of GNU
tar. We do not make any efforts to accommodate older versions of
these packages, so please make sure that you have the latest stable
version.
- Automake <http://www.gnu.org/software/automake/>
- Autoconf <http://www.gnu.org/software/autoconf/>
- M4 <http://www.gnu.org/software/m4/>
- Texinfo <http://www.gnu.org/software/texinfo>
- Gnulib <http://www.gnu.org/software/gnulib>
- Git <http://git.or.cz>
* Bootstrapping
Obviously, if you are reading these notes, you did manage to clone
tar from Git. The next step is to get other files needed to build,
which are extracted from other source packages:
1. Change to the source tree directory
cd tar
2. Run
./bootstrap
Once done, proceed as described in the file README (section
INSTALLATION).
Normally you will have to run bootstrap only once. However, if you
intend to hack on GNU tar, you might need to run it again later. In
this case, you will probably want to save some time and bandwidth by
avoiding downloading the same files again. If so, create in GNU tar
root directory the file named `.bootstrap' with the following
contents:
--gnulib-srcdir=$HOME/gnulib
Replace `$HOME/gnulib' with the actual directory where the Gnulib
sources reside.
For more information about `bootstrap', run `bootstrap --help'.
* Copyright information
Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
Permission is granted to anyone to make or distribute verbatim copies
of this document as received, in any medium, provided that the
copyright notice and this permission notice are preserved,
thus giving the recipient permission to redistribute in turn.
Permission is granted to distribute modified versions
of this document, or of portions of it,
under the above conditions, provided also that they
carry prominent notices stating who last changed them.
^L
Local Variables:
mode: outline
paragraph-separate: "[ ^L]*$"
version-control: never
End:

146
THANKS
View File

@@ -1,11 +1,14 @@
GNU tar THANKS file
GNU tar has originally been written by Graham Todd. Many people
further contributed to GNU tar by reporting problems, suggesting
various improvements or submitting actual code. Here is a list of
these people. Help me keep it complete and exempt of errors.
Please see the AUTHORS file for the list of principal authors.
Many people further contributed to GNU tar by reporting problems,
suggesting various improvements or submitting actual code. Here is a
list of these people. Help me keep it complete and exempt of errors.
See various ChangeLogs for a detailed description of contributions.
Aage Robeck aagero@ifi.uio.no
Adye, TJ (Tim) T.J.Adye@rl.ac.uk
Akiko Matsushita matusita@sra.co.jp
Alan Bawden Alan@lcs.mit.edu
Alan Cox alan@cymru.net
@@ -25,6 +28,7 @@ Andreas Haumer andreas@vlsivie.tuwien.ac.at
Andreas Jaeger aj@arthur.pfalz.de
Andreas Koppenhoefer koppenh@trick.informatik.uni-stuttgart.de
Andreas Reuter ar205@bonzo.geowiss.nat.tu-bs.de
Andreas Schuldei andreas@schuldei.org
Andreas Schwab schwab@issan.informatik.uni-dortmund.de
Andrew A. Ivanov ivanov@mics.msu.su
Andrew J. Schorr schorr@ead.dsa.com
@@ -34,7 +38,7 @@ Andy Gay andy@rdl.co.uk
Antonio Jose Coutinho ajc@di.uminho.pt
Ariel Faigon ariel@engr.sgi.com
Arne Wichmann aw@math.uni-sb.de
Arnold Robbins arnold@gnu.ai.mit.edu
Arnold Robbins arnold@gnu.org
Art Isbell aisbell@cubicsol.com
Axel Boldt boldt@math.ucsb.edu
Axel Habermann kiwi@belly.in-berlin.de
@@ -44,9 +48,11 @@ Bela Lubkin filbo@armory.com
Ben A. Mesander ben@piglet.cr.usgs.gov
Benedikt Stockebrand benedikt@devnull.ruhr.de
Bennett Todd bet@mordor.com
Benno Schulenberg benno@nietvergeten.nl
Benny Holmgren benny@hgs.se
Bernard Chen bern@cs.ucla.edu
Bernard Derval derval@iro.umontreal.ca
Bernhard Rosenkraenzer bero@redhat.de
Bo Nygaard Bai bai@iesd.auc.dk
Bob Kaehms kaehms@was.archive.org
Bob Mende Pie mende@piecomputer.rutgers.edu
@@ -57,21 +63,24 @@ Brian Perkins bperkins@netspace.org
Brian R. Smith brian@cygnus.com
Bruce Evans bde@runx.oz.au
Bruce Jerrick bruce@cse.ogi.edu
Bruno Haible haible@ma2s2.mathematik.uni-karlsruhe.de
Bruno Haible haible@ilog.fr
Bryan Ford baford@mit.edu
Bryant Fujimoto fujimoto@denali.chem.washington.edu
Burkhard Plache plache@krusty.optimax.ns.ca
Calvin Cliff cliff@trifid.astro.ucla.edu
Cameron Elliott cam@mvbms.mvbms.com
Carl Streeter streeter@cae.wisc.edu
Carl Worth cworth@cworth.org
Carsten Heyl heyl@nads.de
Catrin Urbanneck cur@gppc.de
Cesar Romani romani@ifm.uni-hamburg.de
Chad Hurwitz churritz@cts.com
Chance Reschke creschke@usra.edu
Charles Fu ccwf@klab.caltech.edu
Charles Lopes Charles.Lopes@infm.ulst.ac.uk
Charles M. Hannum mycroft@gnu.ai.mit.edu
Charles M. Hannum mycroft@gnu.org
Chip Salzenberg tct!chip
Chris Arthur csa@gnu.ai.mit.edu
Chris Arthur csa@gnu.org
Chris F.M. Verberne verberne@prl.philips.nl
Chris G. Demetriou cgd@sun-lamp.cs.berkeley.edu
Chris Hopps sycom.mi.org!ro-chp!chopps
@@ -79,10 +88,12 @@ Chris Metcalf metcalf@catfish.lcs.mit.edu
Chris Ransom chris@quests.com
Christian Callsen Christian.Callsen@eng.sun.com
Christian Kirsch ck@held.mind.de
Christian Laubscher christian.laubscher@tiscalinet.ch
Christian T. Dum ctd@mpe-garching.mpg.de
Christian von Roques roques@pond.sub.org
Christoph Litauer litauer@mailhost.uni-koblenz.de
Christophe Colle colle@krtkg1.rug.ac.be
Christophe Kalt Christophe.Kalt@kbcfp.com
Christopher T. Johnson cjohnson@camelot.com
Christopher Vickery vickery@ipc1.cs.qc.edu
Claude Scarpelli claude@genethon.fr
@@ -92,11 +103,13 @@ Clinton Carr clint@netcom.com
Conrad Hughes chughes@maths.tcd.ie
Constantin Belous const@cris.net
Coranth Gryphon gryphon@bur.visidyne.com
Cyril Strejc strejc@unicontrols.cz
Dale R. Worley worley@world.std.com
Dale Wiles wiles@geordi.calspan.com
Dan Bloch dan@transarc.com
Dan Drake dan@dandrake.org
Dan Reish dreish@izzy.net
Daniel Hagerty hag@gnu.ai.mit.edu
Daniel Hagerty hag@gnu.org
Daniel Quinlan quinlan@pathname.com
Daniel R. Guilderson d.guilderson@ma30.bull.com
Daniel S. Barclay daniel@compass-da.com
@@ -105,6 +118,7 @@ Danny R. Johnston danny@cs.weber.edu
Dave Barr barr@math.psu.edu
Dave Gentzel gentzel@nova.enet.dec.com
Dave Gregorich dtg@ipac.caltech.edu
David Brown davidb@davidb.org
David J. MacKenzie djm@uunet.uu.net
David Johnson David.W.Johnson@colorado.edu
David K. Drum ccdavid@mizzou1.missouri.edu
@@ -119,6 +133,7 @@ David Steiner dsteiner@ispa.uni-osnabrueck.de
David Taylor taylor@think.com
Dean Gaudet dgaudet@watdragon.uwaterloo.ca
Demizu Noritoshi nori-d@is.aist-nara.ac.jp
Denis Excoffier denis.excoffier@free.fr
Denis Fortin fortin@acm.org
Dennis Pixton dennis@math.binghamton.edu
Dick Streefland dicks@tasking.nl
@@ -127,21 +142,24 @@ Dimitri Bougoulias opus@hol.gr
Dimitris Fousekis dfousek@leon.nrcps.ariadne-t.gr
Dirk Herr-Hoyman hoymand@gate.net
Don Bennett dpb@netcom.com
Donald B Gordon dbgordon@gnu.ai.mit.edu
Donald B Gordon dbgordon@gnu.org
Donald H. Locker dhl@spuf1d83.lcp.chrysler.com
Douglas Scott doug@foxtrot.ccmrc.ucsb.edu
Drew Sullivan drew@sni.ca
Drew Trieger trieger@woodstock.abbott.com
Dunstan Vavasour dev@cegelecproj.co.uk
Ed Childs echilds@bgs.com
Ed Leaver ewleaver@comcast.net
Edgar Taube et@immd8.informatik.uni-erlangen.de
Eduardo Kortright eduardo@cs.ua.edu
Eduardo V. de Rivas eddie@asterion.com
Edward Welbourne eddy@gen.cam.ac.uk
Elmar Heeb heeb@itp.ethz.ch
Elmer Fittery elmerf@ptw.com
Enric Hernandez ehernandez@notariado.org
Eric Backus ericb@lsid.hp.com
Eric Benson eb@amazon.com
Eric Blake ebb9@byu.net
Eric M. Boehm Eric.M.Boehm@optimumtech.com
Eric Norum eric@ee.ualberta.ca
Erich Stefan Boleyn erich@uruk.org
@@ -150,13 +168,15 @@ Erik D. Frederick edf@deckard.mc.duke.edu
Esa Karell karell@cs.helsinki.fi
Ezra Peisach epeisach@mit.edu
Fabio d'Alessi cars@civ.bio.unipd.it
Frank Heckenbach frank@g-n-u.de
Frank Koenen koenfr@lidp.com
Franz-Werner Gergen gergen@edvulx.mpi-stuttgart.mpg.de
Fran<EFBFBD>ois Pinard pinard@iro.umontreal.ca
François Pinard pinard@iro.umontreal.ca
Fritz Elfert fritz@fsun.triltsch.de
George Chyu gschyu@ccgate.dp.beckman.com
Gerben Wierda gerben@rna.indiv.nluug.nl
Gerd Knorr kraxel@cs.tu-berlin.de
Gerhard Poul gpoul@gnu.org
Giorgio Signorini signo@chim.unifi.it
Graham Whitted gbw@sgrail.com
Grant McDorman grant@isgtec.com
@@ -165,21 +185,26 @@ Greg Chung gchung@caip.rutgers.edu
Greg Hudson ghudson@mit.edu
Greg Maples greg@clari.net
Greg McGary gkm@cstone.net
G<EFBFBD>ran Uddeborg gvran@uddeborg.pp.se
Greg Schafer gschafer@zip.com.au
Göran Uddeborg gvran@uddeborg.pp.se
Gürkan Karaman karaman@dssgmbh.de
Hans Guerth 100664.3101@compuserve.com
Harald K<>nig koenig@tat.physik.uni-tuebingen.de
Hansjörg Lipp hjlipp@web.de
Harald König koenig@tat.physik.uni-tuebingen.de
Harald Milz hm@seneca.ix.de
Heiko Schinke mdqac@biochemtech.uni-halle.de
Heiko Schlichting heiko@fu-berlin.de
Helmut Waitzmann Helmut.Waitzmann@web.de
Henrik Bakman hb@csd.uu.se
Hernan Prieto Schmidt hernan@pea.usp.br
Hiroyuki Bessho bsh@grotto.iijnet.or.jp
Holger Teutsch holger@hotbso.rhein-main.de
Hugh Secker-Walker hugh@ear.mit.edu
Hunyue Yau hunyue.yau@picksys.com
Ian Jackson ijackson@gnu.ai.mit.edu
Ian Jackson ijackson@gnu.org
Ian Lance Taylor ian@cygnus.com
Ian T. Zimmerman itz@crl.com
Ian Turner ian@zmanda.com
Indra Singhal indra@synoptics.com
J. Dean Brock brock@cs.unca.edu
J.J. Bailey jjb@jagware.bcc.com
@@ -196,11 +221,14 @@ Jan Djarv jan.djarv@mbox200.swipnet.se
Janice Burton r06a165@bcc25.kodak.com
Janne Snabb snabb@niksula.hut.fi
Jason R. Mastaler jason@webmaster.net
Jay Fenlason hack@gnu.ai.mit.edu
Jason Armistead Jason.Armistead@otis.com
Jay Fenlason hack@gnu.org
Jean-Louis Martineau martineau@zmanda.com
Jean-Michel Soenen soenen@lectra.fr
Jean-Ph. Martin-Flatin syj@ecmwf.int
Jean-loup Gailly jloup@chorus.fr
Jean-Loup Gailly jloup@chorus.fr
Jeff Moskow jeff@rtr.com
Jean-Ph. Martin-Flatin syj@ecmwf.int
Jean-Pierre Demailly Jean-Pierre.Demailly@ujf-grenoble.fr
Jeff Prothero jsp@betz.biostr.washington.edu
Jeff Siegel js@hornet.att.com
Jeff Sorensen sorenj@alumni.rpi.edu
@@ -224,13 +252,16 @@ John David Anglin dave@hiauly1.hia.nrc.ca
John Gilmore gnu@toad.com
John J. Szetela johns@angelo.amd.com
John L. Chmielewski jlc@attmail.com
John L. Males jlmales@yahoo.com
John Oleynick juo@klinzhai.rutgers.edu
John R. Vanderpool fish@daacdev1.stx.com
John Rouillard rouilj@cs.umb.edu
John Thomas McDole john.thomas.mcdole@nagra.com
Jon Lewis jlewis@inorganic5.fdt.net
Jonathan I. Kamens jik@cam.ov.com
Jonathan N. Sherman sysjns@etacrs1.safb.af.mil
Jonathan Thornburg thornbur@theory.physics.ubc.ca
Josef Bauer Josef.Bauer@mchp.siemens.de
Joseph E. Sacco jsacco@ssl.com
Joshua R. Poulson jrp@plaza.ds.adp.com
Joutsiniemi Tommi Il tj75064@cs.tut.fi
@@ -238,15 +269,18 @@ Joy Kendall jak8@world.std.com
Judy Ricker jricker@gdstech.grumman.com
Juha Sarlin juha@tds.kth.se
Jurgen Botz jbotz@orixa.mtholyoke.edu
J<EFBFBD>rgen L<>ters jlueters@t-online.de
J<EFBFBD>rgen Reiss reiss@psychologie.uni-wuerzburg.de
Jyh-Shyang Wang erik@vsp.ee.nctu.edu.tw
J<EFBFBD>rg Weule weule@cs.uni-duesseldorf.de
J<EFBFBD>rgen H<>gg Jorgen.Hagg@axis.se
Jörg Schilling schilling@fokus.fraunhofer.de
Jörg Weule weule@cs.uni-duesseldorf.de
Jörg Weilbier gnu@weilbier.net
Jörgen Hågg Jorgen.Hagg@axis.se
Jörgen Weigert jw@suse.de
Jürgen Lüters jlueters@t-online.de
Jürgen Reiss reiss@psychologie.uni-wuerzburg.de
Kai Petzke wpp@marie.physik.tu-berlin.de
Kai Schlichting kai@computel.com
Karl Berry karl@cs.umb.edu
Karl Heuer kwzh@gnu.ai.mit.edu
Karl Heuer kwzh@gnu.org
Karl Vogel vogelke@c-17igp.wpafb.af.mil
Karlos Z. Smith kazen@viptx.net
Karsten Thygesen karthy@kom.auc.dk
@@ -264,12 +298,16 @@ Konno Hiroharu konno@pac.co.jp
Kurt Jaeger pi@lf.net
Larry Creech lcreech@lonestar.rcclub.org
Larry Schwimmer rosebud@cyclone.stanford.edu
Lasse Collin lasse.collin@tukaani.org
Laurent Caillat-Vallet caillat@noe.lyon.cemagref.fr
Laurent Sainte-Marthe smarthe@genethon.fr
Leland Lucius llucius@tiny.net
Les Mikesell les@mcs.com
Loren J. Rittle rittle@comm.mot.com
Lo<EFBFBD>c Prylli Loic.Prylli@lip.ens-lyon.fr
Loïc Prylli Loic.Prylli@lip.ens-lyon.fr
Luke Mewburn lukem@connect.com.au
Machael Stone mstone@cs.loyola.edu
Mads Martin Joergensen mmj@suse.de
Manfred Weichel Manfred.Weichel@mch.sni.de
Manuel Munier Manuel.Munier@loria.fr
Marc Boucher marc@cam.org
@@ -283,8 +321,9 @@ Mark Kollert Mark.Kollert@oi42.kwu.siemens.de
Mark W. Eichin eichin@cygnus.com
Markus Kuhn mskuhn@cip.informatik.uni-erlangen.de
Martin Bellenberg sunsoft@ifm.uni-hamburg.de
Martin Goik goma0002@fh-karlsruhe.de
Martin Goik goik@HDM-Stuttgart.de
Martin Mares mj@k332.feld.cvut.cz
Martin Simmons ZYHYLCRMZPRP@spammotel.com
Marty Leisner leisner@eso.mc.xerox.com
Massimo Dal Zotto dz@cs.unitn.it
Mats Lofkvist d87-mal@nada.kth.se
@@ -293,7 +332,8 @@ Matthew J. D'Errico doc@deathstar.lis.cch.com
Matti Aarnio mea@utu.fi
Max Hailperin max@nic.gac.edu
Maxime Taksar mmt@redbrick.com
Melissa Weisshaus melissa@gnu.ai.mit.edu
Melissa O'Neill oneill@cs.sfu.ca
Melissa Weisshaus melissa@gnu.org
Michael Dietrich mdt@is.in-berlin.de
Michael Ellis bosun@aquarius.seaoar.uvic.ca
Michael Giddings giddings@whitewater.chem.wisc.edu
@@ -317,17 +357,19 @@ Mike Walker M.D.Walker@larc.nasa.gov
Milan Hodoscek milan@kihp6.ki.si
Minh Tran-Le tranle@intellicorp.com
Mitsuaki Masuhara masuhara@mcprv.mec.mei.co.jp
Nate Eldredge nate@cs.hmc.edu
Neil Faulks neil@dcs.kcl.ac.uk
Neil Jerram nj104@cus.cam.ac.uk
Nelson H.F. Beebe beebe@math.utah.edu
Nick Barron nikb@cix.compulink.co.uk
Noah Friedman friedman@prep.ai.mit.edu
Noah Friedman friedman@gnu.org
Noel Cragg noel@red-bean.com
Norbert Kiesel norbert@rwthi3.informatik.rwth-aachen.de
Olaf Schlueter olaf@toppoint.de
Olaf Wucknitz owucknitz@hs.uni-hamburg.de
Oliver Trepte oliver@fysik4.kth.se
Olivier Roussel roussel@lifl.fr
Ondřej Vašík ovasik@redhat.com
Oswald P. Backus IV backus@lks.csi.com
Pascal Meheut pascal@cnam.cnam.fr
Patrick Fulconis fulco@sig.uvsq.fr
@@ -349,13 +391,17 @@ Peter Fox fox@gec-mi-at.co.uk
Peter Kutschera peter@zditr1.arcs.ac.at
Peter Seebach seebs@taniemarie.solon.com
Phil Hands phil@hands.com
Phil Proudman phil@proudman51.freeserve.co.uk
Philippe Defert defert@cern.ch
Piercarlo Grandi piercarl@sabi.demon.co.uk
Pierce Cantrell cantrell@ee.tamu.edu
R. Kent Dybvig dyb@cadence.bloomington.in.us
R. Scott Butler butler@prism.es.dupont.com
Rainer Orth ro@thp.uni-koeln.de
Rainer Orth ro@TechFak.Uni-Bielefeld.DE
Ralf Wildenhues Ralf.Wildenhues@gmx.de
Ralf S. Engelschall rse@engelschall.com
Ralf Suckow suckow@contrib.de
Ralph Corderoy ralph@inputplus.co.uk
Ralph Schleicher rs@purple.ul.bawue.de
Randy Bias randyb@edge.edge.net
Ray Dassen jdassen@wi.leidenuniv.nl
@@ -363,11 +409,11 @@ Reuben J. Ravago reuben@asti.dost.gov.ph
Reuben Sumner rasumner@undergrad.math.uwaterloo.ca
Ricardo Marek ricky@ornet.co.il
Richard Deal deal@xi.cs.fsu.edu
Richard J. Kettlewell richard@elmail.co.uk
Richard J. Kettlewell rjk@greenend.org.uk
Richard Lloyd R.K.Lloyd@csc.liv.ac.uk
Richard O'Neill richard@nexus.vnus.bc.ca
Richard Sims rbs@acs.bu.edu
Richard Stallman rms@gnu.ai.mit.edu
Richard Stallman rms@gnu.org
Richard Westerik richardw@bssi.nl
Rick Emerson rick@ssg.com
Rob Parry rparry@hydrolab.arsusda.gov
@@ -386,18 +432,18 @@ Rod Buchanan rod.buchanan@kratos.co.uk
Rod Thompson rodt@synopsys.com
Roderich Schupp roderich@syntec.m.eunet.de
Rodney Brown RBrown@cocam.com.au
Roland McGrath roland@gnu.ai.mit.edu
Roland McGrath roland@gnu.org
Roland Schemers III schemers@vela.acs.oakland.edu
Rolf Niepraschk niepraschk@chbrb.berlin.ptb.de
Roman Gollent roman@portal.stwing.upenn.edu
Roman Czyborra czyborra@cs.tu-berlin.de
Roman Gollent roman@portal.stwing.upenn.edu
Ron Guilmette rfg@netcom.com
Roy Marantz marantz@nbcs.rutgers.edu
Russ Evans e_gs18@ub.nmh.ac.uk
Russell Cattelan cattelan@thebarn.com
Ryutaro Susukita susukita@pn.scphys.kyoto-u.ac.jp
Sam Richards sam@blueskyprod.com
Sakai Kiyotaka ksakai@netwk.ntt-at.co.jp
Sam Richards sam@blueskyprod.com
Santiago Vila Doncel sanvila@unex.es
Sarah Quady squady@warp10.keck.hawaii.edu
Saul Lubkin lubkin@cs.rochester.edu
@@ -410,9 +456,10 @@ Serge Granik serge@euler.berkeley.edu
Seth Robertson seth@ctr.columbia.edu
Sherwood Botsford sherwood@space.ualberta.ca
Simon Wright simon.j.wright@gecm.com
Sisira Jayasinghe sisira.jayasinghe@sdrc.com
Skip Montanaro skip@automatrix.com
Simon Wright simon@pogner.demon.co.uk
Sisira Jayasinghe sisira.jayasinghe@sdrc.com
Skip Montanaro skip@mojam.com http://www.musi-cal.com/~skip/
Solar Designer solar@openwall.com
Stefan Skoglund sp2stes1@ida.his.se
Steffen Stempel stempel@ira.uka.de
Stephen Gildea gildea@intouchsys.com
@@ -421,13 +468,14 @@ Stephen Saroff saroff@msc.edu
Stuart Kemp skemp@bmc.com
Stuart Poulin stuart@indsys.com
Sven Verdoolaege skimo@breughel.ufsia.ac.be
Sylvain ROUGIER un@grolier.fr
Sylvain Rougier un@grolier.fr
Tarang Kumar Patel mombasa@ptolemy.arc.nasa.gov
Ted Rule Ted_Rule@flextech.co.uk
The King elvis@gnu.ai.mit.edu
Thomas Bushnell n/BSG thomas@gnu.ai.mit.edu
Thomas K<EFBFBD>nig Thomas.Koenig@ciw.uni-karlsruhe.de
The King elvis@gnu.org
Thomas metaf4@users.askja.de
Thomas Bushnell n/BSG thomas@gnu.org
Thomas Krebs krebs@faps.uni-erlangen.de
Thomas König Thomas.Koenig@ciw.uni-karlsruhe.de
Thomas M. Browder Jr. browder@use1.eglin.af.mil
Thomas Priesner priesner@flo.sh.bosch.de
Thomas Waas waas@echild.aiss.de
@@ -440,37 +488,45 @@ Tim P. Starrin noid@cyborg.larc.nasa.gov
Tim Ramsey tar@ksu.ksu.edu
Tim Rylance tkr@puffball.demon.co.uk
Tim Towers tzt@uniplex.co.uk
Timothy J. Lee timlee@netcom.com
Timothy Fossum fossum@cs.uwp.edu
Timothy J. Lee timlee@netcom.com
Tito Flagella tito@di.unipi.it
Todd Vierling tv@duh.org
Tom Popovitch tpop@informix.com
Tom Quinn trq@astro.washington.edu
Tom Tromey tromey@drip.colorado.edu
Tor Lillqvist tml@hemuli.tte.vtt.fi
Torbjorn Granlund tege@sics.se
Torkel Hasle torkel@bibsyst.no
Torsten Lull tlupi@gppc.de
Toshiaki Nishi toshi@sss.osa.sharp.co.jp
Travis L. Priest T.L.Priest@larc.nasa.gov
Troy Rudolph rudtr01@cai.com
Tsutomu Yamada tsutomu@sra.co.jp
Ulrich Drepper drepper@gnu.ai.mit.edu
Ulrich Drepper drepper@gnu.org
Van Snyder vsnyder@math.jpl.nasa.gov
Vic Abell abe@cc.purdue.edu
Victor J. Griswold vgris@aironet.com
Ville Herva v@iki.fi
Vince Del Vecchio vdelvecc@inmet.com
W. Phillip Moore wpm@morgan.com
Warner Losh imp@boulder.parcplace.com
Warren Dodge warrend@sptekwv3.wv.tek.com
Wayne Christopher wayne@icemcfd.com
Werner Almesberger werner.almesberger@lrc.di.epfl.ch
William Bader wbader@pluto.csee.lehigh.edu
William Bader william@nscs.fast.net
William J. Eaton wje@hoffman.rstnu.bcm.tmc.edu
William Kucharski kucharsk@netcom.com
Wlodzimierz Jan Martin wjm@pg.gda.pl
Wojciech Polak polak@gnu.org
Wolfgang Rupprecht wolfgang@wsrcc.com
Wolfram Gloger Wolfram.Gloger@dent.med.uni-muenchen.de
Wolfram Kleff bugreport@wkleff.intergenia.de
Wolfram Wagner ww@mpi-sb.mpg.de
Yasushi Suzudo ysuzudo@mail.asiandevbank.org
Włodzimierz Jan Martin wjm@pg.gda.pl
Yasushi Suzudo SGR00413@niftyserve.or.jp
Yu-Min Liang min@taz.ho.att.com
maximum entropy entropy@zippy.bernstein.com
;;;; Local Variables:
;;;; mode: Fundamental
;;;; coding: utf-8
;;;; End:

74
TODO
View File

@@ -1,5 +1,71 @@
From: Roesinger Eric <ROESINGE@tce.com>
Date: Sat, 28 Jul 2001 18:43:43 -0500
Suggestions for improving GNU tar.
It would be useful to be able to use '--remove-files' with '--diff',
to remove all files that compare successfully, when verifying a backup.
* <45BEC0DB.8040903@unix-beratung.de>
* Incorporate fixes from major distributions, e.g., Debian GNU/Linux.
* Add support for restoring file time stamps to sub-second resolution,
if the file system supports this.
* Add support for restoring the attributes of symbolic links, for
OSes like FreeBSD that have the lutimes and lchmod functions.
* --append should bail out if the two archives are of different types.
* Add support for a 'pax' command that conforms to POSIX 1003.1-2001.
This would unify paxutils with tar.
* Interoperate better with Joerg Schilling's star implementation.
* Add an option to remove files that compare successfully.
From: Roesinger Eric <ROESINGE@tce.com>
Date: Sat, 28 Jul 2001 18:43:43 -0500
It would be useful to be able to use '--remove-files' with '--diff',
to remove all files that compare successfully, when verifying a backup.
* Add tests for the new functonality.
* Consider this:
From: Dennis Pund
Subject: TAR suggestion...
Date: Wed, 1 May 2002 18:26:36 -0500 (EST)
What I would like to do is:
foo my.tar.gz | tar -xzOf - | tar -cMf - -L 650000 - | bar
where 'foo' is a program that retrieves the archive and streams it
to stdout and bar is a program that streams the stdin to CDR.
(http://mail.gnu.org/archive/html/bug-gnu-utils/2002-05/msg00022.html)
* Copyright notice
Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
This file is part of GNU tar.
GNU tar is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU tar is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with tar; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
Local variables:
mode: outline
paragraph-separate: "[ ]*$"
end:

View File

@@ -1,88 +0,0 @@
/* Special definitions for GNU tar, processed by autoheader.
Copyright <20> 1994, 1997 Free Software Foundation, Inc.
Fran<61>ois Pinard <pinard@iro.umontreal.ca>, 1993.
*/
/* This is unconditionally defined for setting a GNU environment. */
#undef _GNU_SOURCE
/* Define to a string giving the full name of the default archive file. */
#undef DEFAULT_ARCHIVE
/* Define to a number giving the default blocking size for archives. */
#undef DEFAULT_BLOCKING
/* Define to 1 if density may be indicated by [lmh] at end of device. */
#undef DENSITY_LETTER
/* Define to a string giving the prefix of the default device, without the
part specifying the unit and density. */
#undef DEVICE_PREFIX
/* Define to 1 if you lack a 3-argument version of open, and want to
emulate it with system calls you do have. */
#undef EMUL_OPEN3
/* Define to 1 if NLS is requested. */
#undef ENABLE_NLS
/* Define as 1 if you have catgets and don't want to use GNU gettext. */
#undef HAVE_CATGETS
/* Define to 1 if you have getgrgid(3). */
#undef HAVE_GETGRGID
/* Define to 1 if you have getpwuid(3). */
#undef HAVE_GETPWUID
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
#undef HAVE_GETTEXT
/* Define if your locale.h file contains LC_MESSAGES. */
#undef HAVE_LC_MESSAGES
/* Define to 1 if you have the valloc function. */
#undef HAVE_VALLOC
/* Define to 1 if some rsh exists, or if you have <netdb.h>. */
#undef HAVE_RTAPELIB
/* Define to 1 if mknod function is available. */
#undef HAVE_MKNOD
/* Define to 1 if stpcpy function is available. */
#undef HAVE_STPCPY
/* Define if `union wait' is the type of the first arg to wait functions. */
#undef HAVE_UNION_WAIT
/* Define to 1 if utime.h exists and declares struct utimbuf. */
#undef HAVE_UTIME_H
/* Define to mt_model (v.g., for DG/UX), else to mt_type. */
#undef MTIO_CHECK_FIELD
/* Define to the name of the distribution. */
#undef PACKAGE
/* Define to 1 if ANSI function prototypes are usable. */
#undef PROTOTYPES
/* Define to the full path of your rsh, if any. */
#undef REMOTE_SHELL
/* Path to directory containing system wide message catalog sources. */
#undef STD_INC_PATH
/* Define to the version of the distribution. */
#undef VERSION
/* Define to 1 if using the `glocale' package for message catalogs. */
#undef WITH_CATALOGS
/* Define to 1 for better use of the debugging malloc library. See
site ftp.antaire.com in antaire/src, file dmalloc/dmalloc.tar.gz. */
#undef WITH_DMALLOC
/* Define to 1 if GNU regex should be used instead of GNU rx. */
#undef WITH_REGEX

View File

@@ -1,425 +1,26 @@
## ----------------------------------------- ##
## Find how to suppress newlines with echo. ##
## ----------------------------------------- ##
dnl Special Autoconf macros for GNU Tar -*- autoconf -*-
dnl Copyright (C) 2009 Free Software Foundation, Inc.
dnl
dnl GNU tar is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3, or (at your option)
dnl any later version.
dnl
dnl GNU tar is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License along
dnl with GNU tar. If not, see <http://www.gnu.org/licenses/>.
# Once this macro is called, you may output with no echo in a Makefile or
# script using: echo @ECHO_N@ "STRING_TO_OUTPUT@ECHO_C@".
AC_DEFUN(fp_PROG_ECHO,
[AC_MSG_CHECKING(how to suppress newlines using echo)
AC_CACHE_VAL(fp_cv_prog_echo_nonl,
[if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
fp_cv_prog_echo_nonl=no
else
fp_cv_prog_echo_nonl=option
fi
else
fp_cv_prog_echo_nonl=escape
fi
])
AC_MSG_RESULT($fp_cv_prog_echo_nonl)
case $fp_cv_prog_echo_nonl in
no) ECHO_N= ECHO_C= ;;
option) ECHO_N=-n ECHO_C= ;;
escape) ECHO_N= ECHO_C='\c' ;;
esac
AC_SUBST(ECHO_N)dnl
AC_SUBST(ECHO_C)dnl
])
## ------------------------------------------- ##
## Check if --with-included-malloc was given. ##
## From Franc,ois Pinard ##
## ------------------------------------------- ##
# In 1992, Michael Bushnell (now Thomas Bushnell <thomas@gnu.ai.mit.edu>)
# devised a test for avoiding HP/UX malloc and using GNU malloc instead.
# Bruno Haible <haible@ma2s2.mathematik.uni-karlsruhe.de> recycled this
# test for CLISP Common LISP and extended it to cover broken mallocs from
# Sun and SGI. I (<pinard@iro.umontreal.ca>) reworked it a little so
# it is independent of config.guess, and overridable by the installer.
# On IRIX 5.2, libc malloc is broken, but the -lmalloc one was usable.
# So in my packages, I once unconditionally used -lmalloc if it existed.
# This does not do anymore, because the -lmalloc malloc is broken on
# Solaris 2.4 to 2.5.1 (alignment is 4 bytes instead of 8 bytes, as
# reported by John Wells <john@bitsmart.com>).
# Bruno also notes: "HP-UX has two different malloc() implementations.
# Both are broken. When used with CLISP, the one in the default libc.a
# leads to a SIGSEGV, the one in libmalloc.a leads to a SIGBUS. The SunOS
# 4.1.1 malloc() breaks when used by CLISP's generational GC. The IRIX
# 5.2 malloc() breaks when used by CLISP's generational GC."
# If the installer does not give a preference, we use the included GNU
# malloc if we have the slightest doubt that malloc could be broken, this
# includes cross compilation, and *all* HP/UX, SunOS or IRIX systems.
# It is crude indeed, but I just do not have enough information for truly
# benchmarking malloc in all cases, but want safe packages nevertheless.
AC_DEFUN(fp_WITH_INCLUDED_MALLOC,
[AC_MSG_CHECKING(if included GNU malloc is wanted)
AC_ARG_WITH(included-malloc,
[ --with-included-malloc use the GNU malloc which is included here], ,
[if test $cross_compiling = yes; then
withval=yes
else
case `uname -s 2> /dev/null` in
HP-UX | SunOS | IRIX* ) withval=yes ;;
*) withval=no ;;
esac
fi])
test "$withval" = yes && LIBOBJS="$LIBOBJS gmalloc.o"
AC_MSG_RESULT($withval)
])
## -------------------- ##
## Macros from Ulrich. ##
## -------------------- ##
# Search path for a program which passes the given test.
# Ulrich Drepper <drepper@cygnus.com>, 1996.
# serial 1
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
AC_DEFUN(AM_PATH_PROG_WITH_TEST,
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
AC_CACHE_VAL(ac_cv_path_$1,
[case "[$]$1" in
/*)
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in ifelse([$5], , $PATH, [$5]); do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if [$3]; then
ac_cv_path_$1="$ac_dir/$ac_word"
break
fi
fi
done
IFS="$ac_save_ifs"
dnl If no 4th arg is given, leave the cache variable unset,
dnl so AC_PATH_PROGS will keep looking.
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
])dnl
;;
esac])dnl
$1="$ac_cv_path_$1"
if test -n "[$]$1"; then
AC_MSG_RESULT([$]$1)
else
AC_MSG_RESULT(no)
fi
AC_SUBST($1)dnl
])
# Check whether LC_MESSAGES is available in <locale.h>.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
# serial 1
AC_DEFUN(AM_LC_MESSAGES,
[if test $ac_cv_header_locale_h = yes; then
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
if test $am_cv_val_LC_MESSAGES = yes; then
AC_DEFINE(HAVE_LC_MESSAGES)
fi
fi])
# Macro to add for using GNU gettext.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
# serial 1
AC_DEFUN(AM_WITH_NLS,
[AC_MSG_CHECKING([whether NLS is requested])
dnl Default is enabled NLS
AC_ARG_ENABLE(nls,
[ --disable-nls do not use Native Language Support],
USE_NLS=$enableval, USE_NLS=yes)
AC_MSG_RESULT($USE_NLS)
AC_SUBST(USE_NLS)
USE_INCLUDED_LIBINTL=no
dnl If we use NLS figure out what method
if test "$USE_NLS" = "yes"; then
AC_DEFINE(ENABLE_NLS)
AC_MSG_CHECKING([whether included gettext is requested])
AC_ARG_WITH(included-gettext,
[ --with-included-gettext use the GNU gettext library included here],
nls_cv_force_use_gnu_gettext=$withval,
nls_cv_force_use_gnu_gettext=no)
AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
dnl User does not insist on using GNU NLS library. Figure out what
dnl to use. If gettext or catgets are available (in this order) we
dnl use this. Else we have to fall back to GNU NLS library.
dnl catgets is only used if permitted by option --with-catgets.
nls_cv_header_intl=
nls_cv_header_libgt=
CATOBJEXT=NONE
AC_CHECK_HEADER(libintl.h,
[AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
[AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
if test "$gt_cv_func_gettext_libc" != "yes"; then
AC_CHECK_LIB(intl, bindtextdomain,
[AC_CACHE_CHECK([for gettext in libintl],
gt_cv_func_gettext_libintl,
[AC_TRY_LINK([], [return (int) gettext ("")],
gt_cv_func_gettext_libintl=yes,
gt_cv_func_gettext_libintl=no)])])
fi
if test "$gt_cv_func_gettext_libc" = "yes" \
|| test "$gt_cv_func_gettext_libintl" = "yes"; then
AC_DEFINE(HAVE_GETTEXT)
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
if test "$MSGFMT" != "no"; then
AC_CHECK_FUNCS(dcgettext)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr],
[CATOBJEXT=.gmo
DATADIRNAME=share],
[CATOBJEXT=.mo
DATADIRNAME=lib])
INSTOBJEXT=.mo
fi
fi
])
if test "$CATOBJEXT" = "NONE"; then
AC_MSG_CHECKING([whether catgets can be used])
AC_ARG_WITH(catgets,
[ --with-catgets use catgets functions if available],
nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
AC_MSG_RESULT($nls_cv_use_catgets)
if test "$nls_cv_use_catgets" = "yes"; then
dnl No gettext in C library. Try catgets next.
AC_CHECK_LIB(i, main)
AC_CHECK_FUNC(catgets,
[AC_DEFINE(HAVE_CATGETS)
INTLOBJS="\$(CATOBJS)"
AC_PATH_PROG(GENCAT, gencat, no)dnl
if test "$GENCAT" != "no"; then
AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
if test "$GMSGFMT" = "no"; then
AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
fi
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
USE_INCLUDED_LIBINTL=yes
CATOBJEXT=.cat
INSTOBJEXT=.cat
DATADIRNAME=lib
INTLDEPS="../intl/libintl.a"
INTLLIBS=$INTLDEPS
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi])
fi
fi
if test "$CATOBJEXT" = "NONE"; then
dnl Neither gettext nor catgets in included in the C library.
dnl Fall back on GNU gettext library.
nls_cv_use_gnu_gettext=yes
fi
fi
if test "$nls_cv_use_gnu_gettext" = "yes"; then
dnl Mark actions used to generate GNU NLS library.
INTLOBJS="\$(GETTOBJS)"
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
AC_SUBST(MSGFMT)
USE_INCLUDED_LIBINTL=yes
CATOBJEXT=.gmo
INSTOBJEXT=.mo
DATADIRNAME=share
INTLDEPS="../intl/libintl.a"
INTLLIBS=$INTLDEPS
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi
dnl Test whether we really found GNU xgettext.
if test "$XGETTEXT" != ":"; then
dnl If it is no GNU xgettext we define it as : so that the
dnl Makefiles still can work.
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
: ;
else
AC_MSG_RESULT(
[found xgettext programs is not GNU xgettext; ignore it])
XGETTEXT=":"
fi
fi
# We need to process the po/ directory.
POSUB=po
else
DATADIRNAME=share
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi
# If this is used in GNU gettext we have to set USE_NLS to `yes'
# because some of the sources are only built for this goal.
if test "$PACKAGE" = gettext; then
USE_NLS=yes
USE_INCLUDED_LIBINTL=yes
fi
dnl These rules are solely for the distribution goal. While doing this
dnl we only have to keep exactly one list of the available catalogs
dnl in configure.in.
for lang in $ALL_LINGUAS; do
GMOFILES="$GMOFILES $lang.gmo"
POFILES="$POFILES $lang.po"
done
dnl Make all variables we use known to autoconf.
AC_SUBST(USE_INCLUDED_LIBINTL)
AC_SUBST(CATALOGS)
AC_SUBST(CATOBJEXT)
AC_SUBST(DATADIRNAME)
AC_SUBST(GMOFILES)
AC_SUBST(INSTOBJEXT)
AC_SUBST(INTLDEPS)
AC_SUBST(INTLLIBS)
AC_SUBST(INTLOBJS)
AC_SUBST(POFILES)
AC_SUBST(POSUB)
])
AC_DEFUN(AM_GNU_GETTEXT,
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_ISC_POSIX])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
AC_REQUIRE([AC_C_CONST])dnl
AC_REQUIRE([AC_C_INLINE])dnl
AC_REQUIRE([AC_TYPE_OFF_T])dnl
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
AC_REQUIRE([AC_FUNC_MMAP])dnl
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
unistd.h values.h])
AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
__argz_count __argz_stringify __argz_next])
if test "${ac_cv_func_stpcpy+set}" != "set"; then
AC_CHECK_FUNCS(stpcpy)
fi
if test "${ac_cv_func_stpcpy}" = "yes"; then
AC_DEFINE(HAVE_STPCPY)
fi
AM_LC_MESSAGES
AM_WITH_NLS
if test "x$CATOBJEXT" != "x"; then
if test "x$ALL_LINGUAS" = "x"; then
LINGUAS=
else
AC_MSG_CHECKING(for catalogs to be installed)
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
*$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
esac
done
LINGUAS=$NEW_LINGUAS
AC_MSG_RESULT($LINGUAS)
fi
dnl Construct list of names of catalog files to be constructed.
if test -n "$LINGUAS"; then
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
fi
fi
dnl Determine which catalog format we have (if any is needed)
dnl For now we know about two different formats:
dnl Linux libc-5 and the normal X/Open format
test -d intl || mkdir intl
if test "$CATOBJEXT" = ".cat"; then
AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
dnl Transform the SED scripts while copying because some dumb SEDs
dnl cannot handle comments.
sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
fi
dnl po2tbl.sed is always needed.
sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
$srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
dnl In the intl/Makefile.in we have a special dependency which makes
dnl only sense for gettext. We comment this out for non-gettext
dnl packages.
if test "$PACKAGE" = "gettext"; then
GT_NO="#NO#"
GT_YES=
else
GT_NO=
GT_YES="#YES#"
fi
AC_SUBST(GT_NO)
AC_SUBST(GT_YES)
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
dnl Try to locate is.
MKINSTALLDIRS=
if test $ac_aux_dir; then
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
fi
if test -z $MKINSTALLDIRS; then
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
fi
AC_SUBST(MKINSTALLDIRS)
dnl Generate list of files to be processed by xgettext which will
dnl be included in po/Makefile.
test -d po || mkdir po
if test "x$srcdir" != "x."; then
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
posrcprefix="$srcdir/"
else
posrcprefix="../$srcdir/"
fi
else
posrcprefix="../"
fi
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
< $srcdir/po/POTFILES.in > po/POTFILES
])
AC_DEFUN([TAR_COMPR_PROGRAM],[
m4_pushdef([tar_compr_define],translit($1,[a-z+-],[A-ZX_])[_PROGRAM])
m4_pushdef([tar_compr_var],[tar_cv_compressor_]translit($1,[+-],[x_]))
AC_ARG_WITH($1,
AC_HELP_STRING([--with-]$1[=PROG],
[use PROG as ]$1[ compressor program]),
[tar_compr_var=${withval}],
[tar_compr_var=m4_if($2,,$1,$2)])
AC_DEFINE_UNQUOTED(tar_compr_define, "$tar_compr_var",
[Define to the program name of ]$1[ compressor program])])

965
bootstrap Executable file
View File

@@ -0,0 +1,965 @@
#! /bin/sh
# Print a version string.
scriptversion=2010-10-24.18; # UTC
# Bootstrap this package from checked-out sources.
# Copyright (C) 2003-2010 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Originally written by Paul Eggert. The canonical version of this
# script is maintained as build-aux/bootstrap in gnulib, however, to
# be useful to your project, you should place a copy of it under
# version control in the top-level directory of your project. The
# intent is that all customization can be done with a bootstrap.conf
# file also maintained in your version control; gnulib comes with a
# template build-aux/bootstrap.conf to get you started.
# Please report bugs or propose patches to bug-gnulib@gnu.org.
nl='
'
# Ensure file names are sorted consistently across platforms.
LC_ALL=C
export LC_ALL
local_gl_dir=gl
# Temporary directory names.
bt='._bootmp'
bt_regex=`echo "$bt"| sed 's/\./[.]/g'`
bt2=${bt}2
usage() {
cat <<EOF
Usage: $0 [OPTION]...
Bootstrap this package from the checked-out sources.
Options:
--paxutils-srcdir=DIRNAME Specify the local directory where paxutils
sources reside. Use this if you already
have paxutils sources on your machine, and
do not want to waste your bandwidth dowloading
them again.
--gnulib-srcdir=DIRNAME Specify the local directory where gnulib
sources reside. Use this if you already
have gnulib sources on your machine, and
do not want to waste your bandwidth downloading
them again. Defaults to \$GNULIB_SRCDIR.
--copy Copy files instead of creating symbolic links.
--force Attempt to bootstrap even if the sources seem
not to have been checked out.
--skip-po Do not download po files.
If the file $0.conf exists in the same directory as this script, its
contents are read as shell variables to configure the bootstrap.
For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR
are honored.
Running without arguments will suffice in most cases.
EOF
}
# Configuration.
# Name of the Makefile.am
gnulib_mk=gnulib.mk
# List of gnulib modules needed.
gnulib_modules=
# Any gnulib files needed that are not in modules.
gnulib_files=
# A function to be called to edit gnulib.mk right after it's created.
# Override it via your own definition in bootstrap.conf.
gnulib_mk_hook() { :; }
# A function to be called after everything else in this script.
# Override it via your own definition in bootstrap.conf.
bootstrap_epilogue() { :; }
# The command to download all .po files for a specified domain into
# a specified directory. Fill in the first %s is the domain name, and
# the second with the destination directory. Use rsync's -L and -r
# options because the latest/%s directory and the .po files within are
# all symlinks.
po_download_command_format=\
"rsync --delete --exclude '*.s1' -Lrtvz \
'translationproject.org::tp/latest/%s/' '%s'"
extract_package_name='
/^AC_INIT(/{
/.*,.*,.*, */{
s///
s/[][]//g
s/)$//
p
q
}
s/AC_INIT(\[*//
s/]*,.*//
s/^GNU //
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
s/[^A-Za-z0-9_]/-/g
p
}
'
package=`sed -n "$extract_package_name" configure.ac` || exit
gnulib_name=lib$package
build_aux=build-aux
source_base=lib
m4_base=m4
doc_base=doc
tests_base=tests
# Extra files from gnulib, which override files from other sources.
gnulib_extra_files="
$build_aux/install-sh
$build_aux/missing
$build_aux/mdate-sh
$build_aux/texinfo.tex
$build_aux/depcomp
$build_aux/config.guess
$build_aux/config.sub
doc/INSTALL
"
# Additional gnulib-tool options to use. Use "\newline" to break lines.
gnulib_tool_option_extras=
# Other locale categories that need message catalogs.
EXTRA_LOCALE_CATEGORIES=
# Additional xgettext options to use. Use "\\\newline" to break lines.
XGETTEXT_OPTIONS='\\\
--flag=_:1:pass-c-format\\\
--flag=N_:1:pass-c-format\\\
--flag=error:3:c-format --flag=error_at_line:5:c-format\\\
'
# Package bug report address and copyright holder for gettext files
COPYRIGHT_HOLDER='Free Software Foundation, Inc.'
MSGID_BUGS_ADDRESS=bug-$package@gnu.org
# Files we don't want to import.
excluded_files=
# File that should exist in the top directory of a checked out hierarchy,
# but not in a distribution tarball.
checkout_only_file=README-hacking
# Whether to use copies instead of symlinks.
copy=false
# Set this to '.cvsignore .gitignore' in bootstrap.conf if you want
# those files to be generated in directories like lib/, m4/, and po/.
# Or set it to 'auto' to make this script select which to use based
# on which version control system (if any) is used in the source directory.
vc_ignore=auto
# find_tool ENVVAR NAMES...
# -------------------------
# Search for a required program. Use the value of ENVVAR, if set,
# otherwise find the first of the NAMES that can be run (i.e.,
# supports --version). If found, set ENVVAR to the program name,
# die otherwise.
find_tool ()
{
find_tool_envvar=$1
shift
find_tool_names=$@
eval "find_tool_res=\$$find_tool_envvar"
if test x"$find_tool_res" = x; then
for i
do
if ($i --version </dev/null) >/dev/null 2>&1; then
find_tool_res=$i
break
fi
done
else
find_tool_error_prefix="\$$find_tool_envvar: "
fi
if test x"$find_tool_res" = x; then
echo >&2 "$0: one of these is required: $find_tool_names"
exit 1
fi
($find_tool_res --version </dev/null) >/dev/null 2>&1 || {
echo >&2 "$0: ${find_tool_error_prefix}cannot run $find_tool_res --version"
exit 1
}
eval "$find_tool_envvar=\$find_tool_res"
eval "export $find_tool_envvar"
}
# Find sha1sum, named gsha1sum on MacPorts, and shasum on MacOS 10.6.
find_tool SHA1SUM sha1sum gsha1sum shasum
# Override the default configuration, if necessary.
# Make sure that bootstrap.conf is sourced from the current directory
# if we were invoked as "sh bootstrap".
case "$0" in
*/*) test -r "$0.conf" && . "$0.conf" ;;
*) test -r "$0.conf" && . ./"$0.conf" ;;
esac
if test "$vc_ignore" = auto; then
vc_ignore=
test -d .git && vc_ignore=.gitignore
test -d CVS && vc_ignore="$vc_ignore .cvsignore"
fi
# Translate configuration into internal form.
# Parse options.
for option
do
case $option in
--help)
usage
exit;;
--gnulib-srcdir=*)
GNULIB_SRCDIR=`expr "X$option" : 'X--gnulib-srcdir=\(.*\)'`;;
--paxutils-srcdir=*)
PAXUTILS_SRCDIR=`expr "$option" : '--paxutils-srcdir=\(.*\)'`;;
--skip-po)
SKIP_PO=t;;
--force)
checkout_only_file=;;
--copy)
copy=true;;
*)
echo >&2 "$0: $option: unknown option"
exit 1;;
esac
done
if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
echo "$0: Bootstrapping from a non-checked-out distribution is risky." >&2
exit 1
fi
# If $STR is not already on a line by itself in $FILE, insert it,
# sorting the new contents of the file and replacing $FILE with the result.
insert_sorted_if_absent() {
file=$1
str=$2
test -f $file || touch $file
echo "$str" | sort -u - $file | cmp - $file > /dev/null \
|| echo "$str" | sort -u - $file -o $file \
|| exit 1
}
# Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.
found_aux_dir=no
grep '^[ ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'\])' configure.ac \
>/dev/null && found_aux_dir=yes
grep '^[ ]*AC_CONFIG_AUX_DIR('"$build_aux"')' configure.ac \
>/dev/null && found_aux_dir=yes
if test $found_aux_dir = no; then
echo "$0: expected line not found in configure.ac. Add the following:" >&2
echo " AC_CONFIG_AUX_DIR([$build_aux])" >&2
exit 1
fi
# If $build_aux doesn't exist, create it now, otherwise some bits
# below will malfunction. If creating it, also mark it as ignored.
if test ! -d $build_aux; then
mkdir $build_aux
for dot_ig in x $vc_ignore; do
test $dot_ig = x && continue
insert_sorted_if_absent $dot_ig $build_aux
done
fi
# Note this deviates from the version comparison in automake
# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
# but this should suffice as we won't be specifying old
# version formats or redundant trailing .0 in bootstrap.conf.
# If we did want full compatibility then we should probably
# use m4_version_compare from autoconf.
sort_ver() { # sort -V is not generally available
ver1="$1"
ver2="$2"
# split on '.' and compare each component
i=1
while : ; do
p1=$(echo "$ver1" | cut -d. -f$i)
p2=$(echo "$ver2" | cut -d. -f$i)
if [ ! "$p1" ]; then
echo "$1 $2"
break
elif [ ! "$p2" ]; then
echo "$2 $1"
break
elif [ ! "$p1" = "$p2" ]; then
if [ "$p1" -gt "$p2" ] 2>/dev/null; then # numeric comparison
echo "$2 $1"
elif [ "$p2" -gt "$p1" ] 2>/dev/null; then # numeric comparison
echo "$1 $2"
else # numeric, then lexicographic comparison
lp=$(printf "$p1\n$p2\n" | LANG=C sort -n | tail -n1)
if [ "$lp" = "$p2" ]; then
echo "$1 $2"
else
echo "$2 $1"
fi
fi
break
fi
i=$(($i+1))
done
}
get_version() {
app=$1
$app --version >/dev/null 2>&1 || return 1
$app --version 2>&1 |
sed -n '# extract version within line
s/.*[v ]\{1,\}\([0-9]\{1,\}\.[.a-z0-9-]*\).*/\1/
t done
# extract version at start of line
s/^\([0-9]\{1,\}\.[.a-z0-9-]*\).*/\1/
t done
d
:done
#the following essentially does s/5.005/5.5/
s/\.0*\([1-9]\)/.\1/g
p
q'
}
check_versions() {
ret=0
while read app req_ver; do
# We only need libtoolize from the libtool package.
if test "$app" = libtool; then
app=libtoolize
fi
# Honor $APP variables ($TAR, $AUTOCONF, etc.)
appvar=`echo $app | tr '[a-z]-' '[A-Z]_'`
test "$appvar" = TAR && appvar=AMTAR
eval "app=\${$appvar-$app}"
inst_ver=$(get_version $app)
if [ ! "$inst_ver" ]; then
echo "Error: '$app' not found" >&2
ret=1
elif [ ! "$req_ver" = "-" ]; then
latest_ver=$(sort_ver $req_ver $inst_ver | cut -d' ' -f2)
if [ ! "$latest_ver" = "$inst_ver" ]; then
echo "Error: '$app' version == $inst_ver is too old" >&2
echo " '$app' version >= $req_ver is required" >&2
ret=1
fi
fi
done
return $ret
}
print_versions() {
echo "Program Min_version"
echo "----------------------"
printf %s "$buildreq"
echo "----------------------"
# can't depend on column -t
}
use_libtool=0
# We'd like to use grep -E, to see if any of LT_INIT,
# AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac,
# but that's not portable enough (e.g., for Solaris).
grep '^[ ]*A[CM]_PROG_LIBTOOL' configure.ac >/dev/null \
&& use_libtool=1
grep '^[ ]*LT_INIT' configure.ac >/dev/null \
&& use_libtool=1
if test $use_libtool = 1; then
find_tool LIBTOOLIZE glibtoolize libtoolize
fi
if ! printf "$buildreq" | check_versions; then
echo >&2
if test -f README-prereq; then
echo "See README-prereq for how to get the prerequisite programs" >&2
else
echo "Please install the prerequisite programs" >&2
fi
exit 1
fi
echo "$0: Bootstrapping from checked-out $package sources..."
# See if we can use gnulib's git-merge-changelog merge driver.
if test -d .git && (git --version) >/dev/null 2>/dev/null ; then
if git config merge.merge-changelog.driver >/dev/null ; then
:
elif (git-merge-changelog --version) >/dev/null 2>/dev/null ; then
echo "initializing git-merge-changelog driver"
git config merge.merge-changelog.name 'GNU-style ChangeLog merge driver'
git config merge.merge-changelog.driver 'git-merge-changelog %O %A %B'
else
echo "consider installing git-merge-changelog from gnulib"
fi
fi
cleanup() {
status=$?
rm -fr $1
exit $status
}
cleanup_gnulib() {
cleanup "$gnulib_path"
}
# Get paxutils files.
case ${PAXUTILS_SRCDIR--} in
-) if [ ! -d paxutils ]; then
echo "$0: getting paxutils files..."
trap "cleanup paxutils" 1 2 13 15
git clone --depth 1 git://git.sv.gnu.org/paxutils || cleanup paxutils
trap - 1 2 13 15
fi
PAXUTILS_SRCDIR=paxutils
;;
esac
if [ -r $PAXUTILS_SRCDIR/gnulib.modules ]; then
gnulib_modules=`
(echo "$gnulib_modules"; grep '^[^#]' $PAXUTILS_SRCDIR/gnulib.modules) |
sort -u
`
fi
git_modules_config () {
test -f .gitmodules && git config --file .gitmodules "$@"
}
gnulib_path=`git_modules_config submodule.gnulib.path`
: ${gnulib_path=gnulib}
# Get gnulib files.
case ${GNULIB_SRCDIR--} in
-)
if git_modules_config submodule.gnulib.url >/dev/null; then
echo "$0: getting gnulib files..."
git submodule init || exit $?
git submodule update || exit $?
elif [ ! -d "$gnulib_path" ]; then
echo "$0: getting gnulib files..."
trap cleanup_gnulib 1 2 13 15
shallow=
git clone -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2'
git clone $shallow git://git.sv.gnu.org/gnulib "$gnulib_path" ||
cleanup_gnulib
trap - 1 2 13 15
fi
GNULIB_SRCDIR=$gnulib_path
;;
*)
# Use GNULIB_SRCDIR as a reference.
if test -d "$GNULIB_SRCDIR"/.git && \
git_modules_config submodule.gnulib.url >/dev/null; then
echo "$0: getting gnulib files..."
if git submodule -h|grep -- --reference > /dev/null; then
# Prefer the one-liner available in git 1.6.4 or newer.
git submodule update --init --reference "$GNULIB_SRCDIR" \
"$gnulib_path" || exit $?
else
# This fallback allows at least git 1.5.5.
if test -f "$gnulib_path"/gnulib-tool; then
# Since file already exists, assume submodule init already complete.
git submodule update || exit $?
else
# Older git can't clone into an empty directory.
rmdir "$gnulib_path" 2>/dev/null
git clone --reference "$GNULIB_SRCDIR" \
"$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \
&& git submodule init && git submodule update \
|| exit $?
fi
fi
GNULIB_SRCDIR=$gnulib_path
fi
;;
esac
gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
<$gnulib_tool || exit
# Get translations.
download_po_files() {
subdir=$1
domain=$2
echo "$0: getting translations into $subdir for $domain..."
cmd=`printf "$po_download_command_format" "$domain" "$subdir"`
eval "$cmd"
}
# Mirror .po files to $po_dir/.reference and copy only the new
# or modified ones into $po_dir. Also update $po_dir/LINGUAS.
# Note po files that exist locally only are left in $po_dir but will
# not be included in LINGUAS and hence will not be distributed.
update_po_files() {
# Directory containing primary .po files.
# Overwrite them only when we're sure a .po file is new.
po_dir=$1
domain=$2
# Mirror *.po files into this dir.
# Usually contains *.s1 checksum files.
ref_po_dir="$po_dir/.reference"
test -d $ref_po_dir || mkdir $ref_po_dir || return
download_po_files $ref_po_dir $domain \
&& ls "$ref_po_dir"/*.po 2>/dev/null |
sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" || return
langs=`cd $ref_po_dir && echo *.po|sed 's/\.po//g'`
test "$langs" = '*' && langs=x
for po in $langs; do
case $po in x) continue;; esac
new_po="$ref_po_dir/$po.po"
cksum_file="$ref_po_dir/$po.s1"
if ! test -f "$cksum_file" ||
! test -f "$po_dir/$po.po" ||
! $SHA1SUM -c --status "$cksum_file" \
< "$new_po" > /dev/null; then
echo "updated $po_dir/$po.po..."
cp "$new_po" "$po_dir/$po.po" \
&& $SHA1SUM < "$new_po" > "$cksum_file"
fi
done
}
case $SKIP_PO in
'')
if test -d po; then
update_po_files po $package || exit
fi
if test -d runtime-po; then
update_po_files runtime-po $package-runtime || exit
fi;;
esac
symlink_to_dir()
{
src=$1/$2
dst=${3-$2}
test -f "$src" && {
# If the destination directory doesn't exist, create it.
# This is required at least for "lib/uniwidth/cjk.h".
dst_dir=`dirname "$dst"`
if ! test -d "$dst_dir"; then
mkdir -p "$dst_dir"
# If we've just created a directory like lib/uniwidth,
# tell version control system(s) it's ignorable.
# FIXME: for now, this does only one level
parent=`dirname "$dst_dir"`
for dot_ig in x $vc_ignore; do
test $dot_ig = x && continue
ig=$parent/$dot_ig
insert_sorted_if_absent $ig `echo "$dst_dir"|sed 's,.*/,,'`
done
fi
if $copy; then
{
test ! -h "$dst" || {
echo "$0: rm -f $dst" &&
rm -f "$dst"
}
} &&
test -f "$dst" &&
cmp -s "$src" "$dst" || {
echo "$0: cp -fp $src $dst" &&
cp -fp "$src" "$dst"
}
else
test -h "$dst" &&
src_ls=`ls -diL "$src" 2>/dev/null` && set $src_ls && src_i=$1 &&
dst_ls=`ls -diL "$dst" 2>/dev/null` && set $dst_ls && dst_i=$1 &&
test "$src_i" = "$dst_i" || {
dot_dots=
case $src in
/*) ;;
*)
case /$dst/ in
*//* | */../* | */./* | /*/*/*/*/*/)
echo >&2 "$0: invalid symlink calculation: $src -> $dst"
exit 1;;
/*/*/*/*/) dot_dots=../../../;;
/*/*/*/) dot_dots=../../;;
/*/*/) dot_dots=../;;
esac;;
esac
echo "$0: ln -fs $dot_dots$src $dst" &&
ln -fs "$dot_dots$src" "$dst"
}
fi
}
}
cp_mark_as_generated()
{
cp_src=$1
cp_dst=$2
if cmp -s "$cp_src" "$GNULIB_SRCDIR/$cp_dst"; then
symlink_to_dir "$GNULIB_SRCDIR" "$cp_dst"
elif cmp -s "$cp_src" "$local_gl_dir/$cp_dst"; then
symlink_to_dir $local_gl_dir "$cp_dst"
else
case $cp_dst in
*.[ch]) c1='/* '; c2=' */';;
*.texi) c1='@c '; c2= ;;
*.m4|*/Make*|Make*) c1='# ' ; c2= ;;
*) c1= ; c2= ;;
esac
# If the destination directory doesn't exist, create it.
# This is required at least for "lib/uniwidth/cjk.h".
dst_dir=`dirname "$cp_dst"`
test -d "$dst_dir" || mkdir -p "$dst_dir"
if test -z "$c1"; then
cmp -s "$cp_src" "$cp_dst" || {
# Copy the file first to get proper permissions if it
# doesn't already exist. Then overwrite the copy.
echo "$0: cp -f $cp_src $cp_dst" &&
rm -f "$cp_dst" &&
cp "$cp_src" "$cp_dst-t" &&
sed "s!$bt_regex/!!g" "$cp_src" > "$cp_dst-t" &&
mv -f "$cp_dst-t" "$cp_dst"
}
else
# Copy the file first to get proper permissions if it
# doesn't already exist. Then overwrite the copy.
cp "$cp_src" "$cp_dst-t" &&
(
echo "$c1-*- buffer-read-only: t -*- vi: set ro:$c2" &&
echo "${c1}DO NOT EDIT! GENERATED AUTOMATICALLY!$c2" &&
sed "s!$bt_regex/!!g" "$cp_src"
) > $cp_dst-t &&
if cmp -s "$cp_dst-t" "$cp_dst"; then
rm -f "$cp_dst-t"
else
echo "$0: cp $cp_src $cp_dst # with edits" &&
mv -f "$cp_dst-t" "$cp_dst"
fi
fi
fi
}
version_controlled_file() {
dir=$1
file=$2
found=no
if test -d CVS; then
grep -F "/$file/" $dir/CVS/Entries 2>/dev/null |
grep '^/[^/]*/[0-9]' > /dev/null && found=yes
elif test -d .git; then
git rm -n "$dir/$file" > /dev/null 2>&1 && found=yes
elif test -d .svn; then
svn log -r HEAD "$dir/$file" > /dev/null 2>&1 && found=yes
else
echo "$0: no version control for $dir/$file?" >&2
fi
test $found = yes
}
slurp() {
for dir in . `(cd $1 && find * -type d -print)`; do
copied=
sep=
for file in `ls -a $1/$dir`; do
case $file in
.|..) continue;;
# FIXME: should all file names starting with "." be ignored?
.*) continue;;
esac
test -d $1/$dir/$file && continue
for excluded_file in $excluded_files; do
test "$dir/$file" = "$excluded_file" && continue 2
done
if test $file = Makefile.am && test "X$gnulib_mk" != XMakefile.am; then
copied=$copied${sep}$gnulib_mk; sep=$nl
remove_intl='/^[^#].*\/intl/s/^/#/;'"s!$bt_regex/!!g"
sed "$remove_intl" $1/$dir/$file |
cmp - $dir/$gnulib_mk > /dev/null || {
echo "$0: Copying $1/$dir/$file to $dir/$gnulib_mk ..." &&
rm -f $dir/$gnulib_mk &&
sed "$remove_intl" $1/$dir/$file >$dir/$gnulib_mk &&
gnulib_mk_hook $dir/$gnulib_mk
}
elif { test "${2+set}" = set && test -r $2/$dir/$file; } ||
version_controlled_file $dir $file; then
echo "$0: $dir/$file overrides $1/$dir/$file"
else
copied=$copied$sep$file; sep=$nl
if test $file = gettext.m4; then
echo "$0: patching m4/gettext.m4 to remove need for intl/* ..."
rm -f $dir/$file
sed '
/^AC_DEFUN(\[AM_INTL_SUBDIR],/,/^]/c\
AC_DEFUN([AM_INTL_SUBDIR], [])
/^AC_DEFUN(\[gt_INTL_SUBDIR_CORE],/,/^]/c\
AC_DEFUN([gt_INTL_SUBDIR_CORE], [])
$a\
AC_DEFUN([gl_LOCK_EARLY], [])
' $1/$dir/$file >$dir/$file
else
cp_mark_as_generated $1/$dir/$file $dir/$file
fi
fi || exit
done
for dot_ig in x $vc_ignore; do
test $dot_ig = x && continue
ig=$dir/$dot_ig
if test -n "$copied"; then
insert_sorted_if_absent $ig "$copied"
# If an ignored file name ends with .in.h, then also add
# the name with just ".h". Many gnulib headers are generated,
# e.g., stdint.in.h -> stdint.h, dirent.in.h ->..., etc.
# Likewise for .gperf -> .h, .y -> .c, and .sin -> .sed
f=`echo "$copied" |
sed '
s/\.in\.h$/.h/
s/\.sin$/.sed/
s/\.y$/.c/
s/\.gperf$/.h/
'
`
insert_sorted_if_absent $ig "$f"
# For files like sys_stat.in.h and sys_time.in.h, record as
# ignorable the directory we might eventually create: sys/.
f=`echo "$copied"|sed 's/sys_.*\.in\.h$/sys/'`
insert_sorted_if_absent $ig "$f"
fi
done
done
}
# Create boot temporary directories to import from gnulib and gettext.
rm -fr $bt $bt2 &&
mkdir $bt $bt2 || exit
# Import from gnulib.
gnulib_tool_options="\
--import\
--no-changelog\
--aux-dir $bt/$build_aux\
--doc-base $bt/$doc_base\
--lib $gnulib_name\
--m4-base $bt/$m4_base/\
--source-base $bt/$source_base/\
--tests-base $bt/$tests_base\
--local-dir $local_gl_dir\
$gnulib_tool_option_extras\
"
if test $use_libtool = 1; then
case "$gnulib_tool_options " in
*' --libtool '*) ;;
*) gnulib_tool_options="$gnulib_tool_options --libtool" ;;
esac
fi
echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
$gnulib_tool $gnulib_tool_options --import $gnulib_modules &&
slurp $bt || exit
for file in $gnulib_files; do
symlink_to_dir "$GNULIB_SRCDIR" $file || exit
done
# Import from gettext.
with_gettext=yes
grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \
with_gettext=no
if test $with_gettext = yes; then
echo "$0: (cd $bt2; ${AUTOPOINT-autopoint}) ..."
cp configure.ac $bt2 &&
(cd $bt2 && ${AUTOPOINT-autopoint} && rm configure.ac) &&
slurp $bt2 $bt || exit
fi
rm -fr $bt $bt2 || exit
# Remove any dangling symlink matching "*.m4" or "*.[ch]" in some
# gnulib-populated directories. Such .m4 files would cause aclocal to fail.
# The following requires GNU find 4.2.3 or newer. Considering the usual
# portability constraints of this script, that may seem a very demanding
# requirement, but it should be ok. Ignore any failure, which is fine,
# since this is only a convenience to help developers avoid the relatively
# unusual case in which a symlinked-to .m4 file is git-removed from gnulib
# between successive runs of this script.
find "$m4_base" "$source_base" \
-depth \( -name '*.m4' -o -name '*.[ch]' \) \
-type l -xtype l -delete > /dev/null 2>&1
# Reconfigure, getting other files.
# copy_files srcdir dstdir
copy_files() {
for file in `cat $1/DISTFILES`
do
case $file in
"#*") continue;;
esac
dst=`echo $file | sed 's^.*/^^'`
if [ $# -eq 3 ]; then
case $dst in
${3}*) ;;
*) dst=${3}$dst;;
esac
fi
symlink_to_dir "$1" "$file" "$2/$dst" || exit
# FIXME ignorefile $2 $dst
done
}
# Import from paxutils
copy_files ${PAXUTILS_SRCDIR} .
copy_files ${PAXUTILS_SRCDIR}/am m4
echo "$0: Creating m4/paxutils.m4"
(echo "# This file is generated automatically. Please, do not edit."
echo "#"
echo "AC_DEFUN([${package}_PAXUTILS],["
cat ${PAXUTILS_SRCDIR}/am/DISTFILES | sed '/^#/d;s/\(.*\)\.m4/pu_\1/' | tr a-z A-Z
echo "])") > ./m4/paxutils.m4
#FIXME ignorefile m4 paxutils.m4
if [ -d rmt ]; then
:
else
mkdir rmt
fi
for dir in doc rmt lib tests
do
copy_files ${PAXUTILS_SRCDIR}/$dir $dir
done
copy_files ${PAXUTILS_SRCDIR}/paxlib lib pax
# Skip autoheader if it's not needed.
grep -E '^[ ]*AC_CONFIG_HEADERS?\>' configure.ac >/dev/null ||
AUTOHEADER=true
for command in \
libtool \
"${ACLOCAL-aclocal} --force -I m4 $ACLOCAL_FLAGS" \
"${AUTOCONF-autoconf} --force" \
"${AUTOHEADER-autoheader} --force" \
"${AUTOMAKE-automake} --add-missing --copy --force-missing"
do
if test "$command" = libtool; then
test $use_libtool = 0 \
&& continue
command="${LIBTOOLIZE-libtoolize} -c -f"
fi
echo "$0: $command ..."
$command || exit
done
# Get some extra files from gnulib, overriding existing files.
for file in $gnulib_extra_files; do
case $file in
*/INSTALL) dst=INSTALL;;
build-aux/*) dst=$build_aux/`expr "$file" : 'build-aux/\(.*\)'`;;
*) dst=$file;;
esac
symlink_to_dir "$GNULIB_SRCDIR" $file $dst || exit
done
if test $with_gettext = yes; then
# Create gettext configuration.
echo "$0: Creating po/Makevars from po/Makevars.template ..."
rm -f po/Makevars
sed '
/^EXTRA_LOCALE_CATEGORIES *=/s/=.*/= '"$EXTRA_LOCALE_CATEGORIES"'/
/^COPYRIGHT_HOLDER *=/s/=.*/= '"$COPYRIGHT_HOLDER"'/
/^MSGID_BUGS_ADDRESS *=/s|=.*|= '"$MSGID_BUGS_ADDRESS"'|
/^XGETTEXT_OPTIONS *=/{
s/$/ \\/
a\
'"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+}
}
' po/Makevars.template >po/Makevars || exit 1
if test -d runtime-po; then
# Similarly for runtime-po/Makevars, but not quite the same.
rm -f runtime-po/Makevars
sed '
/^DOMAIN *=.*/s/=.*/= '"$package"'-runtime/
/^subdir *=.*/s/=.*/= runtime-po/
/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-'"$package"'@gnu.org/
/^XGETTEXT_OPTIONS *=/{
s/$/ \\/
a\
'"$XGETTEXT_OPTIONS_RUNTIME"' $${end_of_xgettext_options+}
}
' po/Makevars.template >runtime-po/Makevars || exit 1
# Copy identical files from po to runtime-po.
(cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po)
fi
fi
bootstrap_epilogue
echo "$0: done. Now you can run './configure'."
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

74
bootstrap.conf Normal file
View File

@@ -0,0 +1,74 @@
# Bootstrap configuration for GNU tar.
# Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
source_base=gnu
gnulib_name=libgnu
gnulib_mk=Makefile.am
# We don't need these modules, even though gnulib-tool mistakenly
# includes them because of gettext dependencies.
avoided_gnulib_modules='
--avoid=lock
'
# gnulib modules used by this package.
gnulib_modules="$avoided_gnulib_modules
`grep '^[^#]' gnulib.modules`
"
# Additional xgettext options to use. Use "\\\newline" to break lines.
XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
--flag=_:1:pass-c-format\\\
--flag=N_:1:pass-c-format\\\
--flag=error:3:c-format --flag=error_at_line:5:c-format\\\
--flag=asnprintf:3:c-format --flag=vasnprintf:3:c-format\\\
--flag=argp_error:2:c-format\\\
--flag=__argp_error:2:c-format\\\
--flag=argp_failure:4:c-format\\\
--flag=__argp_failure:4:c-format\\\
--flag=argp_fmtstream_printf:2:c-format\\\
--flag=__argp_fmtstream_printf:2:c-format\\\
'
# Gettext supplies these files, but we don't need them since
# we don't have an intl subdirectory.
excluded_files='
m4/glibc2.m4
m4/intdiv0.m4
m4/lcmessage.m4
m4/lock.m4
m4/printf-posix.m4
m4/uintmax_t.m4
m4/ulonglong.m4
m4/visibility.m4
'
# Read local configuration file
if [ -r .bootstrap ]; then
echo "$0: Reading configuration file .bootstrap"
eval set -- "`sed 's/#.*$//;/^$/d' .bootstrap | tr '\n' ' '` $*"
fi
test -d m4 || mkdir m4
test -d $source_base || mkdir $source_base
cat > ChangeLog <<EOT
This file is a placeholder. It will be replaced with the actual ChangeLog
by make dist. Run make ChangeLog if you wish to create it earlier.
EOT

View File

@@ -1,153 +1,101 @@
# Configure template for GNU tar.
# Copyright (C) 1991, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
# Process this file with autoconf to produce a configure script.
# Configure template for GNU tar. -*- autoconf -*-
AC_INIT(src/tar.c)
AM_CONFIG_HEADER(config.h)
AC_PREREQ(2.12)
AM_INIT_AUTOMAKE(tar, 1.12)
AC_DEFINE(_GNU_SOURCE)
ALL_LINGUAS="de fr it ko nl no pl pt sl sv"
# Copyright (C) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
# Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
AC_INIT([GNU tar], [1.24], [bug-tar@gnu.org])
AC_CONFIG_SRCDIR([src/tar.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
AC_PREREQ([2.63])
AM_INIT_AUTOMAKE([1.11 gnits tar-ustar dist-bzip2 dist-xz dist-shar std-options silent-rules])
# Enable silent rules by default:
AM_SILENT_RULES([yes])
fp_PROG_ECHO
test $fp_cv_prog_echo_nonl = no \
&& echo 2>&1 "WARNING: \`echo' not powerful enough for \`make check'"
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
AC_AIX
AC_MINIX
AC_EXEEXT
AC_PROG_RANLIB
AC_PROG_YACC
gl_EARLY
AC_SYS_LARGEFILE
AC_ISC_POSIX
AM_C_PROTOTYPES
AC_C_CONST
AC_C_INLINE
AC_CHECK_SIZEOF(unsigned long, 4)
AC_CHECK_SIZEOF(long long, 0)
AC_CHECK_HEADERS(fcntl.h limits.h linux/fd.h memory.h net/errno.h poll.h \
sgtty.h string.h stropts.h \
sys/buf.h sys/device.h sys/gentape.h sys/inet.h sys/io/trioctl.h sys/ioccom.h \
sys/mtio.h sys/param.h sys/tprintf.h sys/tape.h sys/time.h sys/timeb.h \
sys/wait.h unistd.h)
AC_CHECK_HEADERS_ONCE(fcntl.h linux/fd.h memory.h net/errno.h \
sgtty.h string.h \
sys/param.h sys/device.h sys/gentape.h \
sys/inet.h sys/io/trioctl.h \
sys/mtio.h sys/time.h sys/tprintf.h sys/tape.h \
unistd.h locale.h)
# It seems that that many machines where <utime.h> seems to be
# broken just require something like -D_XXX_SOURCE, where XXX might
# be POSIX, POSIX_C, ALL, HPUX or whatever, depending on the machine.
AC_CHECK_HEADERS([sys/buf.h], [], [],
[#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif])
AC_CACHE_CHECK(for utime.h, tar_cv_header_utime_h,
[AC_TRY_COMPILE([
#include <sys/types.h>
#include <utime.h>], [struct utimbuf foo],
tar_cv_header_utime_h=yes, tar_cv_header_utime_h=no)])
test $tar_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H)
if test $ac_cv_header_sys_mtio_h = yes; then
AC_CACHE_CHECK(for remote tape header files, tar_cv_header_rmt,
[AC_TRY_CPP([
#if HAVE_SGTTY_H
# include <sgtty.h>
#endif
#include <sys/socket.h>],
tar_cv_header_rmt=yes, tar_cv_header_rmt=no)])
test $tar_cv_header_rmt = yes && RMT=rmt
AC_SUBST(RMT)
fi
AC_CACHE_CHECK(for getgrgid declaration, tar_cv_header_getgrgid,
[AC_EGREP_HEADER(getgrgid, grp.h,
tar_cv_header_getgrgid=yes, tar_cv_header_getgrgid=no)])
test $tar_cv_header_getgrgid = yes && AC_DEFINE(HAVE_GETGRGID)
AC_CACHE_CHECK(for getpwuid declaration, tar_cv_header_getpwuid,
[AC_EGREP_HEADER(getpwuid, pwd.h,
tar_cv_header_getpwuid=yes, tar_cv_header_getpwuid=no)])
test $tar_cv_header_getpwuid = yes && AC_DEFINE(HAVE_GETPWUID)
AC_CACHE_CHECK(which ioctl field to test for reversed bytes,
tar_cv_header_mtio_check_field,
[AC_EGREP_HEADER(mt_model, sys/mtio.h,
tar_cv_header_mtio_check_field=mt_model,
tar_cv_header_mtio_check_field=mt_type)])
AC_DEFINE_UNQUOTED(MTIO_CHECK_FIELD, $tar_cv_header_mtio_check_field)
AC_HEADER_SYS_WAIT
AC_HEADER_DIRENT
AC_HEADER_MAJOR
AC_HEADER_STAT
AC_HEADER_STDC
AC_HEADER_TIME
AC_STRUCT_ST_BLKSIZE
AC_STRUCT_ST_BLOCKS
AC_MSG_CHECKING([for st_fstype string in struct stat])
AC_CACHE_VAL(diff_cv_st_fstype_string,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/stat.h>], [struct stat s; s.st_fstype[0] = 'x';],
diff_cv_st_fstype_string=yes,
diff_cv_st_fstype_string=no)])
AC_MSG_RESULT($diff_cv_st_fstype_string)
if test $diff_cv_st_fstype_string = yes; then
AC_DEFINE(HAVE_ST_FSTYPE_STRING, 1,
[Define if struct stat has a char st_fstype[] member.])
fi
AC_TYPE_SIGNAL
AC_TYPE_MODE_T
AC_TYPE_PID_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_TYPE_UID_T
AC_CHECK_TYPE(major_t, , AC_DEFINE(major_t, int,
[Type of major device numbers.]))
AC_CHECK_TYPE(minor_t, , AC_DEFINE(minor_t, int,
[Type of minor device numbers.]))
AC_CHECK_TYPE(dev_t, unsigned)
AC_CHECK_TYPE(ino_t, unsigned)
AC_CHECK_FUNCS(fsync ftime getcwd isascii lchown mkfifo nap napms poll \
select strerror strstr usleep)
gt_TYPE_SSIZE_T
AC_CACHE_CHECK(for mknod, tar_cv_func_mknod,
[AC_TRY_LINK([
#include <sys/types.h>
#include <sys/stat.h>],
[mknod (0, 0, 0)],
tar_cv_func_mknod=yes, tar_cv_func_mknod=no)])
test $tar_cv_func_mknod = yes && AC_DEFINE(HAVE_MKNOD)
# gnulib modules
gl_INIT
# paxutils modules
tar_PAXUTILS
# Whenever both -lsocket and -lnsl are needed, it seems to be always the
# case that gethostbyname requires -lnsl. So, check -lnsl first, for it
# to be in LIBS before the setsockopt checks are performed. *However*,
# on SINIX-N 5.43, this is false, and gethostent seems to be a better
# candidate. So, let's use it below instead of gethostbyname, and see.
AC_CHECK_FUNCS_ONCE([fchmod fchown fsync lstat mkfifo readlink symlink])
AC_CHECK_DECLS([getgrgid],,, [#include <grp.h>])
AC_CHECK_DECLS([getpwuid],,, [#include <pwd.h>])
AC_CHECK_DECLS([time],,, [#include <time.h>])
AC_CHECK_FUNC(gethostent)
if test $ac_cv_func_gethostent = no; then
AC_CHECK_LIB(nsl, gethostent)
fi
AC_CHECK_FUNC(setsockopt)
if test $ac_cv_func_setsockopt = no; then
AC_CHECK_LIB(socket, setsockopt)
fi
AC_FUNC_ALLOCA
AC_FUNC_FNMATCH
test $ac_cv_func_fnmatch_works = yes || LIBOBJS="$LIBOBJS fnmatch.o"
AC_FUNC_VPRINTF
AC_REPLACE_FUNCS(basename dirname execlp ftruncate memset mkdir rename rmdir)
test "$ac_cv_func_strstr" = yes || LIBOBJS="$LIBOBJS strstr.o"
# The 3-argument open happens to go along with the O_* defines, which
# are easier to check for.
AC_CACHE_CHECK(for 3-argument open, tar_cv_func_open3,
[AC_TRY_COMPILE([
#if HAVE_FCNTL_H
# include <fcntl.h>
#else
# include <sys/file.h>
#endif],
[int x = O_RDONLY],
tar_cv_func_open3=yes, tar_cv_func_open3=no)])
if test $tar_cv_func_open3 = no; then
AC_DEFINE(EMUL_OPEN3)
fi
# `union wait' is preferrably avoided. We merely assume below
# that if `int pid;' fails, `union wait pid;' would have worked.
# Directly trying `union wait pid;' is seeking for trouble, as
# some POSIX systems are offering compatibility hacks generating
# ugly diagnostics. Also, on some systems, WEXITSTATUS exists,
# but fails when called on `union wait' variables.
AC_CACHE_CHECK(for union wait, tar_cv_header_union_wait,
[AC_TRY_COMPILE([
#include <sys/types.h>
#if HAVE_SYS_WAIT_H
# include <sys/wait.h>
#endif],
[int status; int pid; pid = wait (&status);],
tar_cv_header_union_wait=no, tar_cv_header_union_wait=yes)])
test $tar_cv_header_union_wait = yes && AC_DEFINE(HAVE_UNION_WAIT)
AC_REPLACE_FUNCS(waitpid)
AC_CACHE_CHECK(for remote shell, tar_cv_path_RSH,
[if test -n "$RSH"; then
@@ -155,22 +103,56 @@ AC_CACHE_CHECK(for remote shell, tar_cv_path_RSH,
else
tar_cv_path_RSH=no
for ac_file in /usr/ucb/rsh /usr/bin/remsh /usr/bin/rsh /usr/bsd/rsh \
/usr/bin/nsh /usr/bin/rcmd
/usr/bin/nsh /usr/bin/rcmd
do
# Prefer a non-symlink rsh to a symlink one, so that binaries built
# on AIX 4.1.4, where /usr/ucb/rsh is a symlink to /usr/bin/rsh
# will run on AIX 4.3.0, which has only /usr/bin/rsh.
if test -f $ac_file; then
tar_cv_path_RSH=$ac_file
break
if (test -h $ac_file) 2>/dev/null; then
test $tar_cv_path_RSH = no && tar_cv_path_RSH=$ac_file
else
tar_cv_path_RSH=$ac_file
break
fi
fi
done
fi])
if test $tar_cv_path_RSH = no; then
AC_CHECK_HEADERS(netdb.h)
else
AC_DEFINE_UNQUOTED(REMOTE_SHELL, "$tar_cv_path_RSH")
AC_DEFINE_UNQUOTED(REMOTE_SHELL, "$tar_cv_path_RSH",
[Define to the full path of your rsh, if any.])
fi
TAR_COMPR_PROGRAM(compress)
TAR_COMPR_PROGRAM(gzip)
TAR_COMPR_PROGRAM(bzip2)
TAR_COMPR_PROGRAM(lzip)
TAR_COMPR_PROGRAM(lzma)
TAR_COMPR_PROGRAM(lzop)
TAR_COMPR_PROGRAM(xz)
AC_MSG_CHECKING(for default archive format)
AC_ARG_VAR([DEFAULT_ARCHIVE_FORMAT],
[Set the default archive format. Allowed values are: V7, OLDGNU, USTAR, POSIX, GNU. Default is GNU])
if test -z "$DEFAULT_ARCHIVE_FORMAT"; then
DEFAULT_ARCHIVE_FORMAT="GNU"
fi
case $DEFAULT_ARCHIVE_FORMAT in
V7|OLDGNU|USTAR|POSIX|GNU) ;;
*) AC_MSG_ERROR(Invalid format name);;
esac
AC_DEFINE_UNQUOTED(DEFAULT_ARCHIVE_FORMAT, ${DEFAULT_ARCHIVE_FORMAT}_FORMAT,
[By default produce archives of this format])
AC_MSG_RESULT($DEFAULT_ARCHIVE_FORMAT)
AC_MSG_CHECKING(for default archive)
AC_ARG_VAR([DEFAULT_ARCHIVE],
[Set the name of the default archive (default: -)])
if test -z "$DEFAULT_ARCHIVE"; then
DEFAULT_ARCHIVE=-
else
@@ -181,35 +163,98 @@ else
# FIXME: Let DEVICE_PREFIX be configured from the environment.
# FIXME: Rearrange, here.
case $DEFAULT_ARCHIVE in
changequote(, )dnl
*[0-7][lmh])
*[[0-7][lmh]])
AC_DEFINE(DENSITY_LETTER, 1,
[Define to 1 if density may be indicated by [lmh] at end of device.])
device_prefix=`echo $DEFAULT_ARCHIVE | sed 's/[0-7][lmh]$//'`
changequote([, ])dnl
AC_DEFINE_UNQUOTED(DEVICE_PREFIX, "$device_prefix")
AC_DEFINE(DENSITY_LETTER)
;;
changequote(, )dnl
*[0-7])
*[[0-7]])
device_prefix=`echo $DEFAULT_ARCHIVE | sed 's/[0-7]$//'`
changequote([, ])dnl
AC_DEFINE_UNQUOTED(DEVICE_PREFIX, "$device_prefix")
;;
*)
device_prefix=
;;
esac
case "$device_prefix" in
?*)
AC_DEFINE_UNQUOTED(DEVICE_PREFIX, "$device_prefix",
[Define to a string giving the prefix of the default device, without the part specifying the unit and density.])
;;
esac
fi
AC_DEFINE_UNQUOTED(DEFAULT_ARCHIVE, "$DEFAULT_ARCHIVE")
AC_DEFINE_UNQUOTED(DEFAULT_ARCHIVE, "$DEFAULT_ARCHIVE",
[Define to a string giving the full name of the default archive file.])
AC_MSG_RESULT($DEFAULT_ARCHIVE)
AC_ARG_VAR([DEFAULT_BLOCKING],
[Define default blocking factor (default: 20)])
AC_MSG_CHECKING(for default blocking)
DEFAULT_BLOCKING=${DEFAULT_BLOCKING-20}
AC_DEFINE_UNQUOTED(DEFAULT_BLOCKING, $DEFAULT_BLOCKING)
AC_DEFINE_UNQUOTED(DEFAULT_BLOCKING, $DEFAULT_BLOCKING,
[Define to a number giving the default blocking size for archives.])
AC_MSG_RESULT($DEFAULT_BLOCKING)
fp_WITH_INCLUDED_MALLOC
AM_WITH_DMALLOC
AC_MSG_CHECKING(for default quoting style)
AM_GNU_GETTEXT
AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
m4_define([QUOTING_STYLES],dnl
[literal|shell|shell-always|c|escape|locale|clocale])
DEFAULT_QUOTING_STYLE="escape"
AC_ARG_VAR([DEFAULT_QUOTING_STYLE],
[Set the default quoting style. Allowed values are: ] m4_bpatsubst(QUOTING_STYLES,[|], [[, ]]) [. Default is "escape".])
AC_OUTPUT([Makefile doc/Makefile intl/Makefile lib/Makefile po/Makefile.in \
scripts/Makefile src/Makefile tests/Makefile tests/preset],
[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
case $DEFAULT_QUOTING_STYLE in
QUOTING_STYLES) ;;
*) AC_MSG_ERROR(Invalid quoting style);;
esac
AC_MSG_RESULT($DEFAULT_QUOTING_STYLE)
DEFAULT_QUOTING_STYLE=`echo ${DEFAULT_QUOTING_STYLE}|sed 's/-/_/g'`_quoting_style
AC_DEFINE_UNQUOTED(DEFAULT_QUOTING_STYLE, $DEFAULT_QUOTING_STYLE,
[Define to a default quoting style (see lib/quoteargs.c for the list)])
# Iconv
AM_ICONV
AC_CHECK_HEADERS(iconv.h)
AC_CHECK_TYPE(iconv_t,:,
AC_DEFINE(iconv_t, int,
[Conversion descriptor type]),
[
#ifdef HAVE_ICONV_H
# include <iconv.h>
#endif
])
# Gettext.
AM_GNU_GETTEXT([external], [need-formatstring-macros])
AM_GNU_GETTEXT_VERSION([0.16])
# Initialize the test suite.
AC_CONFIG_TESTDIR(tests)
AC_CONFIG_FILES([tests/Makefile tests/atlocal]) # FIXME: tests/preset?
AM_MISSING_PROG([AUTOM4TE], [autom4te])
AC_SUBST(BACKUP_LIBEXEC_SCRIPTS)
AC_SUBST(BACKUP_SBIN_SCRIPTS)
AC_ARG_ENABLE(backup-scripts,
AC_HELP_STRING([--enable-backup-scripts],
[Create and install backup and restore scripts]),
[case $enableval in
yes) BACKUP_LIBEXEC_SCRIPTS='$(BACKUP_LIBEXEC_SCRIPTS_LIST)'
BACKUP_SBIN_SCRIPTS='$(BACKUP_SBIN_SCRIPTS_LIST)'
;;
esac])
AC_SUBST(BACKUP_SED_COND)
if date +%Y-%m-%d 2>/dev/null >&2; then
BACKUP_SED_COND='/^\#ELSE_DATE_FORMAT_OK/,/^\#ENDIF_DATE_FORMAT_OK/d;/^\#IF_DATE_FORMAT_OK/d'
else
BACKUP_SED_COND='/^\#IF_DATE_FORMAT_OK/,/^\#ELSE_DATE_FORMAT_OK/d;/^\#ENDIF_DATE_FORMAT_OK/d'
fi
AC_OUTPUT([Makefile\
doc/Makefile\
gnu/Makefile\
lib/Makefile\
po/Makefile.in\
scripts/Makefile\
rmt/Makefile\
src/Makefile])

86
directory Normal file
View File

@@ -0,0 +1,86 @@
%%comments:
Copyright (C) 2004 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license is included in the file COPYING.
%%name: tar
%%short-description: Creates tar archives
%%full-description:
GNU tar is an archiver that creates and handles file archives in various
formats. You can use tar to create file archives, to extract files from
previously created archives, store additional files, or update or list
files which were already stored.
The program saves many files together into a single tape or disk
archive, and can restore individual files from the archive. It
includes multivolume support, the ability to archive sparse files,
automatic archive compression/decompression, remote archives and
special features that allow 'tar' to be used for incremental and full
backups.
The supported archive formats are: V7 tar, GNU, ustar and POSIX (also
known as pax interchange format). GNU tar is also able to read and
extract 'star' archives.
Tar can direct its output to available devices, files, or other
programs (using pipes); tar can even access remote devices or files
(as archives).
%%category: system, backup
%%license: GPL
%%maintainer: Sergey Poznyakoff <gray@Mirddin.farlep.net>,
Jeff Bailey <jbailey@nisa.net>,
Paul Eggert <eggert@CS.UCLA.EDU>
%%updated: 21 Dec 2004
%%keywords: archive, backup, tar, pax
%%interface: Command line
%%programs: tar, rmt
%%GNU: yes
%%web-page: http://www.gnu.org/software/tar
%%doc: English user reference included
%%doc: English user manual in Texinfo, Dvi, Postscript, HTML, Plaintext is available from http://www.gnu.org/software/tar/manual/tar.html
%%developers:
John Gilmore,
Thomas Bushnell,
Paul Eggert <eggert@twinsun.com>,
Sergey Poznyakoff <gray@Mirddin.farlep.net>
%%contributors: Jay Fenlason,
Joy Kendall,
Francois Pinard <pinard@iro.umontreal.ca>
%%source-tarball: ftp://ftp.gnu.org/pub/gnu/tar/tar-1.15.1.tar.gz
%%source-info: http://savannah.gnu.org/projects/tar
%%repository:
:pserver:anoncvs@subversions.gnu.org:/cvsroot/tar login,
:pserver:anoncvs@subversions.gnu.org:/cvsroot/tar co tar,
http://savannah.gnu.org/cvs/?group=tar,
http://savannah.gnu.org/cgi-bin/viewcvs/tar/tar,
%%source-language: C
%%related-programs: GNU cpio
%%version: 1.15.1 (stable) released on 21 Dec 2004
%%bug-list: bug-tar@gnu.org bug-tar@gnu.org http://mail.gnu.org/mailman/listinfo/bug-tar
%%entry-written-by: Sergey Poznyakoff <gray@gnu.org>

26
doc/.gitignore vendored Normal file
View File

@@ -0,0 +1,26 @@
genfile.texi
header.texi
manual
parse-datetime.texi
stamp-vti
tar.aux
tar.cp
tar.cps
tar.fl
tar.fn
tar.info
tar.info*
tar.info-*
tar.kw
tar.ky
tar.log
tar.mt
tar.op
tar.pdf
tar.pg
tar.pr
tar.t2d
tar.toc
tar.tp
tar.vr
version.texi

View File

@@ -1,53 +1,146 @@
# Makefile for GNU tar documentation.
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2003, 2006,
# 2007 Free Software Foundation, Inc.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3, or (at your option)
## any later version.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software Foundation,
## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
AUTOMAKE_OPTIONS = gnits
info_TEXINFOS = tar.texi
EXTRA_DIST = convtexi.pl getdate.texi header.texi
CLEANFILES = tmp-*
tar_TEXINFOS = \
dumpdir.texi\
tar-snapshot-edit.texi\
fdl.texi\
freemanuals.texi\
genfile.texi\
header.texi\
intern.texi\
parse-datetime.texi\
rendition.texi\
snapshot.texi\
sparse.texi\
value.texi
EXTRA_DIST = gendocs_template mastermenu.el texify.sed untabify.el
# The rendering level is anyone of PUBLISH, DISTRIB or PROOF.
# Just call `make dvi RENDITION=PROOF' if you want PROOF rendition.
# Just call `make RENDITION=PROOF [target]' if you want PROOF rendition.
RENDITION = DISTRIB
tar.info: tar.texi getdate.texi header.texi version.texi
@echo "WARNING: \`makeinfo' will not preprocess Texinfo input properly"
@echo " for expanding Texinfo macros, if it comes from a"
@echo " Texinfo distribution which is earlier than version 3.7."
cd $(srcdir) && $(MAKEINFO) -D$(RENDITION) tar.texi
tar.dvi: tar.texi getdate.texi header.texi version.texi
@echo "WARNING: \`makeinfo' will not preprocess Texinfo input properly"
@echo " for expanding Texinfo macros, if it comes from a"
@echo " Texinfo distribution which is earlier than version 3.7."
$(MAKEINFO) -D$(RENDITION) -Etmp-tar.tmp -otmp-tar.info \
-I$(srcdir) tar.texi
rm -f tmp-tar.sed tmp-tar.info*
test $(RENDITION) = DISTRIB \
|| echo >>tmp-tar.sed 's/^@set DISTRIB/@set $(RENDITION)/'
test $(RENDITION) = PUBLISH \
|| echo >>tmp-tar.sed '/^@smallbook/d'
sed -f tmp-tar.sed tmp-tar.tmp > tmp-tar.texi
rm -f tmp-tar.sed tmp-tar.tmp
TEXINPUTS=$(srcdir):$$TEXINPUTS $(TEXI2DVI) tmp-tar.texi
mv tmp-tar.dvi $@
MAKEINFOFLAGS=-D$(RENDITION)
header.texi: $(top_srcdir)/src/tar.h
sed -n '/Archive Format/,/End of Format/p' $(top_srcdir)/src/tar.h \
| expand | sed 's/\([{}]\)/@\1/g' > $(srcdir)/header.texi
sed -f $(srcdir)/texify.sed $(top_srcdir)/src/tar.h \
| expand >$@
master-menu: $(tar_TEXINFOS)
emacs -batch -l mastermenu.el -f make-master-menu $(info_TEXINFOS)
untabify:
emacs -batch -l untabify.el $(info_TEXINFOS) $(tar_TEXINFOS)
final: untabify master-menu
# Checking
check-format:
@if test -n "`cat $(info_TEXINFOS) $(tar_TEXINFOS) | tr -d -c '\t'`"; then \
echo "Sources contain tabs; run make untabify"; \
false; \
fi
check-options:
@ARGP_HELP_FMT='usage-indent=0,short-opt-col=0,long-opt-col=0,doc-opt-col=0,opt-doc-col=0,header-col=0,rmargin=1' \
$(top_builddir)/src/tar --usage | \
sed -n 's/^\[--\([^]\=\[]*\).*/\1/p' | sort | uniq > opts.$$$$;\
$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -E - \
$(info_TEXINFOS) | \
sed -n '/^@macro/,/^@end macro/d;s/@opindex *\([^@,]*\).*/\1/p' \
| sort | uniq > docs.$$$$;\
status=0;\
join -v1 opts.$$$$ docs.$$$$ > report.$$$$;\
if test -s report.$$$$; then \
echo 'Not documented options:'; \
cat report.$$$$; \
status=1; \
fi; \
join -v2 opts.$$$$ docs.$$$$ > report.$$$$;\
if test -s report.$$$$; then \
echo 'Non-existing options:';\
cat report.$$$$; \
status=1; \
fi; \
rm opts.$$$$ docs.$$$$ report.$$$$;\
test $$status -ne 0 && exit $$status
check-refs:
@for file in $(info_TEXINFOS) $(tar_TEXINFOS); \
do \
sed -e = $$file | \
sed -n 'N;/@FIXME-.*ref/{s/\(^[0-9][0-9]*\).*@FIXME-.*ref{\([^}]*\).*/'$$file':\1: \2/gp}'; \
done > $@-t; \
if [ -s $@-t ]; then \
echo "Unresolved cross-references:"; \
cat $@-t;\
rm $@-t; \
else \
rm -f $@-t; \
fi
check-fixmes:
@for file in $(info_TEXINFOS); \
do \
sed -e = $$file | \
sed -n 'N;/@FIXME{/{s/\(^[0-9][0-9]*\).*@FIXME{\([^}]*\).*/'$$file':\1: \2/gp}'; \
done > $@-t; \
if [ -s $@-t ]; then \
echo "Unresolved FIXMEs:"; \
cat $@-t; \
rm $@-t; \
false; \
else \
rm -f $@-t; \
fi
check-unrevised:
@grep -Hn @UNREVISED $(info_TEXINFOS) > $@-t; \
if [ -s $@-t ]; then \
echo "Unrevised nodes:"; \
cat $@-t; \
rm $@-t; \
false;\
else \
rm $@-t; \
fi
all-check-docs: check-format check-options check-refs check-fixmes check-unrevised
check-docs:
$(MAKE) -k all-check-docs
#
clean-local:
rm -rf manual
GENDOCS=gendocs.sh
TEXI2DVI=texi2dvi -t '@set $(RENDITION)' -E
# Make sure you set TEXINPUTS
# Usual value is:
# /usr/share/texmf/pdftex/plain/misc:/usr/share/texmf/pdftex/config
manual:
TEXINPUTS=$(srcdir):$(top_srcdir)/build-tex:$(TEXINPUTS) \
MAKEINFO="$(MAKEINFO) $(MAKEINFOFLAGS)" \
TEXI2DVI="$(TEXI2DVI) -t @finalout" \
$(GENDOCS) --texi2html tar 'GNU tar manual'

View File

@@ -1,118 +0,0 @@
#!/usr/local/bin/perl -- # -*-Perl-*-
eval "exec /usr/local/bin/perl -S $0 $*"
if 0;
# Copy a Texinfo file, replacing @value's, @FIXME's and other gooddies.
# Copyright <20> 1996 Free Software Foundation, Inc.
# Fran<61>ois Pinard <pinard@iro.umontreal.ca>, 1996.
$_ = <>;
while ($_)
{
if (/^\@c()$/ || /^\@c (.*)/ || /^\@(include .*)/)
{
if ($topseen)
{
print "\@format\n";
print "\@strong{\@\@c} $1\n";
$_ = <>;
while (/\@c (.*)/)
{
print "\@strong{\@\@c} $1\n";
$_ = <>;
}
print "\@end format\n";
}
else
{
$delay .= "\@format\n";
$delay .= "\@strong{\@\@c} $1\n";
$_ = <>;
while (/\@c (.*)/)
{
$delay .= "\@strong{\@\@c} $1\n";
$_ = <>;
}
$delay .= "\@end format\n";
}
}
elsif (/^\@chapter /)
{
print;
# print $delay;
$delay = '';
$topseen = 1;
$_ = <>;
}
elsif (/^\@macro /)
{
$_ = <> while ($_ && ! /^\@end macro/);
$_ = <>;
}
elsif (/^\@set ([^ ]+) (.*)/)
{
$set{$1} = $2;
$_ = <>;
}
elsif (/^\@UNREVISED/)
{
print "\@quotation\n";
print "\@emph{(This message will disappear, once this node is revised.)}\n";
print "\@end quotation\n";
$_ = <>;
}
else
{
while (/\@value{([^\}]*)}/)
{
if (defined $set{$1})
{
$_ = "$`$set{$1}$'";
}
else
{
$_ = "$`\@strong{<UNDEFINED>}$1\@strong{</UNDEFINED>}$'";
}
}
while (/\@FIXME-?([a-z]*)\{/)
{
$tag = $1 eq '' ? 'fixme' : $1;
$tag =~ y/a-z/A-Z/;
print "$`\@strong{<$tag>}";
$_ = $';
$level = 1;
while ($level > 0)
{
if (/([{}])/)
{
if ($1 eq '{')
{
$level++;
print "$`\{";
$_ = $';
}
elsif ($level > 1)
{
$level--;
print "$`\}";
$_ = $';
}
else
{
$level = 0;
print "$`\@strong{</$tag>}";
$_ = $';
}
}
else
{
print;
$_ = <>;
}
}
}
print;
$_ = <>;
}
}
exit 0;

132
doc/dumpdir.texi Normal file
View File

@@ -0,0 +1,132 @@
@c This is part of the paxutils manual.
@c Copyright (C) 2006, 2007 Free Software Foundation, Inc.
@c Written by Sergey Poznyakoff
@c This file is distributed under GFDL 1.1 or any later version
@c published by the Free Software Foundation.
Incremental archives keep information about contents of each
dumped directory in special data blocks called @dfn{dumpdirs}.
Dumpdir is a sequence of entries of the following form:
@smallexample
@var{C} @var{filename} \0
@end smallexample
@noindent
where @var{C} is one of the @dfn{control codes} described below,
@var{filename} is the name of the file @var{C} operates upon, and
@samp{\0} represents a nul character (ASCII 0). The white space
characters were added for readability, real dumpdirs do not contain
them.
Each dumpdir ends with a single nul character.
The following table describes control codes and their meanings:
@table @samp
@item Y
@var{filename} is contained in the archive.
@item N
@var{filename} was present in the directory at the time the archive
was made, yet it was not dumped to the archive, because it had not
changed since the last backup.
@item D
@var{filename} is a directory.
@item R
This code requests renaming of the @var{filename} to the name
specified with the @samp{T} command, that immediately follows it.
@item T
Specify target file name for @samp{R} command (see below).
@item X
Specify @dfn{temporary directory} name for a rename operation (see below).
@end table
Codes @samp{Y}, @samp{N} and @samp{D} require @var{filename} argument
to be a relative file name to the directory this dumpdir describes,
whereas codes @samp{R}, @samp{T} and @samp{X} require their argument
to be an absolute file name.
The three codes @samp{R}, @samp{T} and @samp{X} specify a
@dfn{renaming operation}. In the simplest case it is:
@smallexample
R@file{source}\0T@file{dest}\0
@end smallexample
@noindent
which means ``rename file @file{source} to file @file{dest}''.
However, there are cases that require using a @dfn{temporary
directory}. For example, consider the following scenario:
@enumerate 1
@item
Previous run dumped a directory @file{foo} which contained the
following three directories:
@smallexample
a
b
c
@end smallexample
@item
They were renamed @emph{cyclically}, so that:
@example
@file{a} became @file{b}
@file{b} became @file{c}
@file{c} became @file{a}
@end example
@item
New incremental dump was made.
@end enumerate
This case cannot be handled by three successive renames, since
renaming @file{a} to @file{b} will destroy the existing directory.
To correctly process it, @GNUTAR{} needs a temporary directory, so
it creates the following dumpdir (newlines have been added for
readability):
@smallexample
@group
Xfoo\0
Rfoo/a\0T\0
Rfoo/b\0Tfoo/c\0
Rfoo/c\0Tfoo/a\0
R\0Tfoo/a\0
@end group
@end smallexample
The first command, @samp{Xfoo\0}, instructs the extractor to create a
temporary directory in the directory @file{foo}. Second command,
@samp{Rfoo/aT\0}, says ``rename file @file{foo/a} to the temporary
directory that has just been created'' (empty file name after a
command means use temporary directory). Third and fourth commands
work as usual, and, finally, the last command, @samp{R\0Tfoo/a\0}
tells tar to rename the temporary directory to @file{foo/a}.
The exact placement of a dumpdir in the archive depends on the
archive format (@pxref{Formats}):
@itemize
@item PAX archives
In PAX archives, dumpdir is stored in the extended header of the
corresponding directory, in variable @code{GNU.dumpdir}.
@item GNU and old GNU archives
These formats implement special header type @samp{D}, which is similar
to ustar header @samp{5} (directory), except that it precedes a data
block containing the dumpdir.
@end itemize
@c End of dumpdir.texi

506
doc/fdl.texi Normal file
View File

@@ -0,0 +1,506 @@
@c The GNU Free Documentation License.
@center Version 1.3, 3 November 2008
@c This file is intended to be included within another document,
@c hence no sectioning command or @node.
@display
Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
@uref{http://fsf.org/}
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@end display
@enumerate 0
@item
PREAMBLE
The purpose of this License is to make a manual, textbook, or other
functional and useful document @dfn{free} in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
This License is a kind of ``copyleft'', which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
@item
APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License. Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein. The ``Document'', below,
refers to any such manual or work. Any member of the public is a
licensee, and is addressed as ``you''. You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
A ``Modified Version'' of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A ``Secondary Section'' is a named appendix or a front-matter section
of the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall
subject (or to related matters) and contains nothing that could fall
directly within that overall subject. (Thus, if the Document is in
part a textbook of mathematics, a Secondary Section may not explain
any mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The ``Invariant Sections'' are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant. The Document may contain zero
Invariant Sections. If the Document does not identify any Invariant
Sections then there are none.
The ``Cover Texts'' are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License. A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
A ``Transparent'' copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text. A copy that is not ``Transparent'' is called ``Opaque''.
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, La@TeX{} input
format, SGML or XML using a publicly available
DTD, and standard-conforming simple HTML,
PostScript or PDF designed for human modification. Examples
of transparent image formats include PNG, XCF and
JPG. Opaque formats include proprietary formats that can be
read and edited only by proprietary word processors, SGML or
XML for which the DTD and/or processing tools are
not generally available, and the machine-generated HTML,
PostScript or PDF produced by some word processors for
output purposes only.
The ``Title Page'' means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, ``Title Page'' means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
The ``publisher'' means any person or entity that distributes copies
of the Document to the public.
A section ``Entitled XYZ'' means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as ``Acknowledgements'',
``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
of such a section when you modify the Document means that it remains a
section ``Entitled XYZ'' according to this definition.
The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document. These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
@item
VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
@item
COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
@item
MODIFICATIONS
You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
@enumerate A
@item
Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
@item
List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
@item
State on the Title page the name of the publisher of the
Modified Version, as the publisher.
@item
Preserve all the copyright notices of the Document.
@item
Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
@item
Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
@item
Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
@item
Include an unaltered copy of this License.
@item
Preserve the section Entitled ``History'', Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section Entitled ``History'' in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
@item
Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the ``History'' section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
@item
For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
the Title of the section, and preserve in the section all the
substance and tone of each of the contributor acknowledgements and/or
dedications given therein.
@item
Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
@item
Delete any section Entitled ``Endorsements''. Such a section
may not be included in the Modified Version.
@item
Do not retitle any existing section to be Entitled ``Endorsements'' or
to conflict in title with any Invariant Section.
@item
Preserve any Warranty Disclaimers.
@end enumerate
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
You may add a section Entitled ``Endorsements'', provided it contains
nothing but endorsements of your Modified Version by various
parties---for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
@item
COMBINING DOCUMENTS
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled ``History''
in the various original documents, forming one section Entitled
``History''; likewise combine any sections Entitled ``Acknowledgements'',
and any sections Entitled ``Dedications''. You must delete all
sections Entitled ``Endorsements.''
@item
COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
@item
AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an ``aggregate'' if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.
@item
TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers. In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
If a section in the Document is Entitled ``Acknowledgements'',
``Dedications'', or ``History'', the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
@item
TERMINATION
You may not copy, modify, sublicense, or distribute the Document
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense, or distribute it is void, and
will automatically terminate your rights under this License.
However, if you cease all violation of this License, then your license
from a particular copyright holder is reinstated (a) provisionally,
unless and until the copyright holder explicitly and finally
terminates your license, and (b) permanently, if the copyright holder
fails to notify you of the violation by some reasonable means prior to
60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, receipt of a copy of some or all of the same material does
not give you any rights to use it.
@item
FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
@uref{http://www.gnu.org/copyleft/}.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License ``or any later version'' applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation. If the Document
specifies that a proxy can decide which future versions of this
License can be used, that proxy's public statement of acceptance of a
version permanently authorizes you to choose that version for the
Document.
@item
RELICENSING
``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any
World Wide Web server that publishes copyrightable works and also
provides prominent facilities for anybody to edit those works. A
public wiki that anybody can edit is an example of such a server. A
``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the
site means any set of copyrightable works thus published on the MMC
site.
``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0
license published by Creative Commons Corporation, a not-for-profit
corporation with a principal place of business in San Francisco,
California, as well as future copyleft versions of that license
published by that same organization.
``Incorporate'' means to publish or republish a Document, in whole or
in part, as part of another Document.
An MMC is ``eligible for relicensing'' if it is licensed under this
License, and if all works that were first published under this License
somewhere other than this MMC, and subsequently incorporated in whole
or in part into the MMC, (1) had no cover texts or invariant sections,
and (2) were thus incorporated prior to November 1, 2008.
The operator of an MMC Site may republish an MMC contained in the site
under CC-BY-SA on the same site at any time before August 1, 2009,
provided the MMC is eligible for relicensing.
@end enumerate
@page
@heading ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
@smallexample
@group
Copyright (C) @var{year} @var{your name}.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
@end group
@end smallexample
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the ``with@dots{}Texts.'' line with this:
@smallexample
@group
with the Invariant Sections being @var{list their titles}, with
the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
being @var{list}.
@end group
@end smallexample
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
@c Local Variables:
@c ispell-local-pdict: "ispell-dict"
@c End:

125
doc/gendocs_template Executable file
View File

@@ -0,0 +1,125 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- $Id: gendocs_template,v 1.5 2007/10/30 14:58:52 gray Exp $ -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>%%TITLE%% - GNU Project - Free Software Foundation (FSF)</title>
<meta http-equiv="content-type" content='text/html; charset=utf-8' />
<link rel="stylesheet" type="text/css" href="/gnu.css" />
<link rev="made" href="mailto:gray@gnu.org" />
<link rel="icon" type="image/png" href="/graphics/gnu-head-icon.png" />
</head>
<!-- This document is in XML, and xhtml 1.0 -->
<!-- Please make sure to properly nest your tags -->
<!-- and ensure that your final document validates -->
<!-- consistent with W3C xhtml 1.0 and CSS standards -->
<!-- See validator.w3.org -->
<body>
<h3>%%TITLE%%</h3>
<address>Free Software Foundation</address>
<address>last updated %%DATE%%</address>
<p>
<a href="/graphics/gnu-head.jpg">
<img src="/graphics/gnu-head-sm.jpg"
alt=" [image of the head of a GNU] "
width="129" height="122" />
</a>
</p>
<hr />
<p>The manual for %%PACKAGE%% is available in the following formats:</p>
<ul>
<li><a href="%%PACKAGE%%.html">HTML
(%%HTML_MONO_SIZE%%K bytes)</a> - entirely on one web page.</li>
<li><a href="html_node/index.html">HTML</a> - with one web page per
node.</li>
%%IF HTML_SECTION%%
<li><a href="html_section/index.html">HTML</a> - with one web page per
section.</li>
%%ENDIF HTML_SECTION%%
%%IF HTML_CHAPTER%%
<li><a href="html_chapter/index.html">HTML</a> - with one web page per
chapter.</li>
%%ENDIF HTML_CHAPTER%%
<li><a href="%%PACKAGE%%.html.gz">HTML compressed
(%%HTML_MONO_GZ_SIZE%%K gzipped characters)</a> - entirely on
one web page.</li>
<li><a href="%%PACKAGE%%.html_node.tar.gz">HTML compressed
(%%HTML_NODE_TGZ_SIZE%%K gzipped tar file)</a> -
with one web page per node.</li>
%%IF HTML_SECTION%%
<li><a href="%%PACKAGE%%.html_section.tar.gz">HTML compressed
(%%HTML_SECTION_TGZ_SIZE%%K gzipped tar file)</a> -
with one web page per section.</li>
%%ENDIF HTML_SECTION%%
%%IF HTML_CHAPTER%%
<li><a href="%%PACKAGE%%.html_chapter.tar.gz">HTML compressed
(%%HTML_CHAPTER_TGZ_SIZE%%K gzipped tar file)</a> -
with one web page per chapter.</li>
%%ENDIF HTML_CHAPTER%%
<li><a href="%%PACKAGE%%.info.tar.gz">Info document
(%%INFO_TGZ_SIZE%%K characters gzipped tar file)</a>.</li>
<li><a href="%%PACKAGE%%.txt">ASCII text
(%%ASCII_SIZE%%K characters)</a>.</li>
<li><a href="%%PACKAGE%%.txt.gz">ASCII text compressed
(%%ASCII_GZ_SIZE%%K gzipped characters)</a>.</li>
<li><a href="%%PACKAGE%%.dvi.gz">TeX dvi file
(%%DVI_GZ_SIZE%%K characters gzipped)</a>.</li>
<li><a href="%%PACKAGE%%.ps.gz">PostScript file
(%%PS_GZ_SIZE%%K characters gzipped)</a>.</li>
<li><a href="%%PACKAGE%%.pdf">PDF file
(%%PDF_SIZE%%K characters)</a>.</li>
<li><a href="%%PACKAGE%%.texi.tar.gz">Texinfo source
(%%TEXI_TGZ_SIZE%%K characters gzipped tar file)</a></li>
</ul>
<p>(This page generated by the <a
href="%%SCRIPTURL%%">%%SCRIPTNAME%%</a> script.)
</p>
<p>
<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0!" height="31" width="88" /></a>
</p>
<div class="copyright">
<p>
Return to the <a href="/home.html">GNU Project home page</a>.
</p>
<p>
Please send FSF &amp; GNU inquiries to
<a href="mailto:gnu@gnu.org"><em>gnu@gnu.org</em></a>.
There are also <a href="/home.html#ContactInfo">other ways to contact</a>
the FSF.
<br />
Please send broken links and other corrections (or suggestions) to
<a href="mailto:webmasters@gnu.org"><em>webmasters@gnu.org</em></a>.
</p>
<p>
Copyright (C) 2004 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02111, USA
<br />
Verbatim copying and distribution of this entire article is
permitted in any medium, provided this notice is preserved.
</p>
<p>
Updated:
<!-- timestamp start -->
$Date: 2007/10/30 14:58:52 $ $Author: gray $
<!-- timestamp end -->
</p>
</div>
</body>
</html>

View File

@@ -1,432 +0,0 @@
@node Date input formats
@chapter Date input formats
@c Copyright 1994, 1995, 1996, 1997, 1999, 2000, 2001 Free Software
@c Foundation, Inc.
@c Permission is granted to copy, distribute and/or modify this document
@c under the terms of the GNU Free Documentation License, Version 1.1
@c or any later version published by the Free Software Foundation;
@c with no Invariant Sections, with no
@c Front-Cover Texts, and with no Back-Cover Texts.
@c A copy of the license is included in the section entitled ``GNU
@c Free Documentation License''.
@cindex date input formats
@findex getdate
First, a quote:
@quotation
Our units of temporal measurement, from seconds on up to months, are so
complicated, asymmetrical and disjunctive so as to make coherent mental
reckoning in time all but impossible. Indeed, had some tyrannical god
contrived to enslave our minds to time, to make it all but impossible
for us to escape subjection to sodden routines and unpleasant surprises,
he could hardly have done better than handing down our present system.
It is like a set of trapezoidal building blocks, with no vertical or
horizontal surfaces, like a language in which the simplest thought
demands ornate constructions, useless particles and lengthy
circumlocutions. Unlike the more successful patterns of language and
science, which enable us to face experience boldly or at least
level-headedly, our system of temporal calculation silently and
persistently encourages our terror of time.
@dots{} It is as though architects had to measure length in feet, width
in meters and height in ells; as though basic instruction manuals
demanded a knowledge of five different languages. It is no wonder then
that we often look into our own immediate past or future, last Tuesday
or a week from Sunday, with feelings of helpless confusion. @dots{}
--- Robert Grudin, @cite{Time and the Art of Living}.
@end quotation
This section describes the textual date representations that @sc{gnu}
programs accept. These are the strings you, as a user, can supply as
arguments to the various programs. The C interface (via the
@code{getdate} function) is not described here.
@cindex beginning of time, for @sc{posix}
@cindex epoch, for @sc{posix}
Although the date syntax here can represent any possible time since the
year zero, computer integers often cannot represent such a wide range of
time. On @sc{posix} systems, the clock starts at 1970-01-01 00:00:00
@sc{utc}: @sc{posix} does not require support for times before the
@sc{posix} Epoch and times far in the future. Traditional Unix systems
have 32-bit signed @code{time_t} and can represent times from 1901-12-13
20:45:52 through 2038-01-19 03:14:07 @sc{utc}. Systems with 64-bit
signed @code{time_t} can represent all the times in the known
lifetime of the universe.
@menu
* General date syntax:: Common rules.
* Calendar date items:: 19 Dec 1994.
* Time of day items:: 9:20pm.
* Time zone items:: @sc{est}, @sc{pdt}, @sc{gmt}, ...
* Day of week items:: Monday and others.
* Relative items in date strings:: next tuesday, 2 years ago.
* Pure numbers in date strings:: 19931219, 1440.
* Authors of getdate:: Bellovin, Eggert, Salz, Berets, et al.
@end menu
@node General date syntax
@section General date syntax
@cindex general date syntax
@cindex items in date strings
A @dfn{date} is a string, possibly empty, containing many items
separated by whitespace. The whitespace may be omitted when no
ambiguity arises. The empty string means the beginning of today (i.e.,
midnight). Order of the items is immaterial. A date string may contain
many flavors of items:
@itemize @bullet
@item calendar date items
@item time of the day items
@item time zone items
@item day of the week items
@item relative items
@item pure numbers.
@end itemize
@noindent We describe each of these item types in turn, below.
@cindex numbers, written-out
@cindex ordinal numbers
@findex first @r{in date strings}
@findex next @r{in date strings}
@findex last @r{in date strings}
A few numbers may be written out in words in most contexts. This is
most useful for specifying day of the week items or relative items (see
below). Here is the list: @samp{first} for 1, @samp{next} for 2,
@samp{third} for 3, @samp{fourth} for 4, @samp{fifth} for 5,
@samp{sixth} for 6, @samp{seventh} for 7, @samp{eighth} for 8,
@samp{ninth} for 9, @samp{tenth} for 10, @samp{eleventh} for 11 and
@samp{twelfth} for 12. Also, @samp{last} means exactly @math{-1}.
@cindex months, written-out
When a month is written this way, it is still considered to be written
numerically, instead of being ``spelled in full''; this changes the
allowed strings.
@cindex language, in dates
In the current implementation, only English is supported for words and
abbreviations like @samp{AM}, @samp{DST}, @samp{EST}, @samp{first},
@samp{January}, @samp{Sunday}, @samp{tomorrow}, and @samp{year}.
@cindex language, in dates
@cindex time zone item
The output of @command{date} is not always acceptable as a date string,
not only because of the language problem, but also because there is no
standard meaning for time zone items like @samp{IST}. When using
@command{date} to generate a date string intended to be parsed later,
specify a date format that is independent of language and that does not
use time zone items other than @samp{UTC} and @samp{Z}. Here are some
ways to do this:
@example
$ LC_ALL=C TZ=UTC0 date
Fri Dec 15 19:48:05 UTC 2000
$ TZ=UTC0 date +"%Y-%m-%d %H:%M:%SZ"
2000-12-15 19:48:05Z
$ date --iso-8601=seconds # a GNU extension
2000-12-15T11:48:05-0800
$ date --rfc-822 # a GNU extension
Fri, 15 Dec 2000 11:48:05 -0800
$ date +"%Y-%m-%d %H:%M:%S %z" # %z is a GNU extension.
2000-12-15 11:48:05 -0800
@end example
@cindex case, ignored in dates
@cindex comments, in dates
Alphabetic case is completely ignored in dates. Comments may be introduced
between round parentheses, as long as included parentheses are properly
nested. Hyphens not followed by a digit are currently ignored. Leading
zeros on numbers are ignored.
@node Calendar date items
@section Calendar date items
@cindex calendar date item
A @dfn{calendar date item} specifies a day of the year. It is
specified differently, depending on whether the month is specified
numerically or literally. All these strings specify the same calendar date:
@example
1972-09-24 # @sc{iso} 8601.
72-9-24 # Assume 19xx for 69 through 99,
# 20xx for 00 through 68.
72-09-24 # Leading zeros are ignored.
9/24/72 # Common U.S. writing.
24 September 1972
24 Sept 72 # September has a special abbreviation.
24 Sep 72 # Three-letter abbreviations always allowed.
Sep 24, 1972
24-sep-72
24sep72
@end example
The year can also be omitted. In this case, the last specified year is
used, or the current year if none. For example:
@example
9/24
sep 24
@end example
Here are the rules.
@cindex @sc{iso} 8601 date format
@cindex date format, @sc{iso} 8601
For numeric months, the @sc{iso} 8601 format
@samp{@var{year}-@var{month}-@var{day}} is allowed, where @var{year} is
any positive number, @var{month} is a number between 01 and 12, and
@var{day} is a number between 01 and 31. A leading zero must be present
if a number is less than ten. If @var{year} is 68 or smaller, then 2000
is added to it; otherwise, if @var{year} is less than 100,
then 1900 is added to it. The construct
@samp{@var{month}/@var{day}/@var{year}}, popular in the United States,
is accepted. Also @samp{@var{month}/@var{day}}, omitting the year.
@cindex month names in date strings
@cindex abbreviations for months
Literal months may be spelled out in full: @samp{January},
@samp{February}, @samp{March}, @samp{April}, @samp{May}, @samp{June},
@samp{July}, @samp{August}, @samp{September}, @samp{October},
@samp{November} or @samp{December}. Literal months may be abbreviated
to their first three letters, possibly followed by an abbreviating dot.
It is also permitted to write @samp{Sept} instead of @samp{September}.
When months are written literally, the calendar date may be given as any
of the following:
@example
@var{day} @var{month} @var{year}
@var{day} @var{month}
@var{month} @var{day} @var{year}
@var{day}-@var{month}-@var{year}
@end example
Or, omitting the year:
@example
@var{month} @var{day}
@end example
@node Time of day items
@section Time of day items
@cindex time of day item
A @dfn{time of day item} in date strings specifies the time on a given
day. Here are some examples, all of which represent the same time:
@example
20:02:0
20:02
8:02pm
20:02-0500 # In @sc{est} (U.S. Eastern Standard Time).
@end example
More generally, the time of the day may be given as
@samp{@var{hour}:@var{minute}:@var{second}}, where @var{hour} is
a number between 0 and 23, @var{minute} is a number between 0 and
59, and @var{second} is a number between 0 and 59. Alternatively,
@samp{:@var{second}} can be omitted, in which case it is taken to
be zero.
@findex am @r{in date strings}
@findex pm @r{in date strings}
@findex midnight @r{in date strings}
@findex noon @r{in date strings}
If the time is followed by @samp{am} or @samp{pm} (or @samp{a.m.}
or @samp{p.m.}), @var{hour} is restricted to run from 1 to 12, and
@samp{:@var{minute}} may be omitted (taken to be zero). @samp{am}
indicates the first half of the day, @samp{pm} indicates the second
half of the day. In this notation, 12 is the predecessor of 1:
midnight is @samp{12am} while noon is @samp{12pm}.
(This is the zero-oriented interpretation of @samp{12am} and @samp{12pm},
as opposed to the old tradition derived from Latin
which uses @samp{12m} for noon and @samp{12pm} for midnight.)
@cindex time zone correction
@cindex minutes, time zone correction by
The time may alternatively be followed by a time zone correction,
expressed as @samp{@var{s}@var{hh}@var{mm}}, where @var{s} is @samp{+}
or @samp{-}, @var{hh} is a number of zone hours and @var{mm} is a number
of zone minutes. When a time zone correction is given this way, it
forces interpretation of the time relative to
Coordinated Universal Time (@sc{utc}), overriding any previous
specification for the time zone or the local time zone. The @var{minute}
part of the time of the day may not be elided when a time zone correction
is used. This is the best way to specify a time zone correction by
fractional parts of an hour.
Either @samp{am}/@samp{pm} or a time zone correction may be specified,
but not both.
@node Time zone items
@section Time zone items
@cindex time zone item
A @dfn{time zone item} specifies an international time zone, indicated
by a small set of letters, e.g., @samp{UTC} or @samp{Z}
for Coordinated Universal
Time. Any included periods are ignored. By following a
non-daylight-saving time zone by the string @samp{DST} in a separate
word (that is, separated by some white space), the corresponding
daylight saving time zone may be specified.
Time zone items other than @samp{UTC} and @samp{Z}
are obsolescent and are not recommended, because they
are ambiguous; for example, @samp{EST} has a different meaning in
Australia than in the United States. Instead, it's better to use
unambiguous numeric time zone corrections like @samp{-0500}, as
described in the previous section.
@node Day of week items
@section Day of week items
@cindex day of week item
The explicit mention of a day of the week will forward the date
(only if necessary) to reach that day of the week in the future.
Days of the week may be spelled out in full: @samp{Sunday},
@samp{Monday}, @samp{Tuesday}, @samp{Wednesday}, @samp{Thursday},
@samp{Friday} or @samp{Saturday}. Days may be abbreviated to their
first three letters, optionally followed by a period. The special
abbreviations @samp{Tues} for @samp{Tuesday}, @samp{Wednes} for
@samp{Wednesday} and @samp{Thur} or @samp{Thurs} for @samp{Thursday} are
also allowed.
@findex next @var{day}
@findex last @var{day}
A number may precede a day of the week item to move forward
supplementary weeks. It is best used in expression like @samp{third
monday}. In this context, @samp{last @var{day}} or @samp{next
@var{day}} is also acceptable; they move one week before or after
the day that @var{day} by itself would represent.
A comma following a day of the week item is ignored.
@node Relative items in date strings
@section Relative items in date strings
@cindex relative items in date strings
@cindex displacement of dates
@dfn{Relative items} adjust a date (or the current date if none) forward
or backward. The effects of relative items accumulate. Here are some
examples:
@example
1 year
1 year ago
3 years
2 days
@end example
@findex year @r{in date strings}
@findex month @r{in date strings}
@findex fortnight @r{in date strings}
@findex week @r{in date strings}
@findex day @r{in date strings}
@findex hour @r{in date strings}
@findex minute @r{in date strings}
The unit of time displacement may be selected by the string @samp{year}
or @samp{month} for moving by whole years or months. These are fuzzy
units, as years and months are not all of equal duration. More precise
units are @samp{fortnight} which is worth 14 days, @samp{week} worth 7
days, @samp{day} worth 24 hours, @samp{hour} worth 60 minutes,
@samp{minute} or @samp{min} worth 60 seconds, and @samp{second} or
@samp{sec} worth one second. An @samp{s} suffix on these units is
accepted and ignored.
@findex ago @r{in date strings}
The unit of time may be preceded by a multiplier, given as an optionally
signed number. Unsigned numbers are taken as positively signed. No
number at all implies 1 for a multiplier. Following a relative item by
the string @samp{ago} is equivalent to preceding the unit by a
multiplier with value @math{-1}.
@findex day @r{in date strings}
@findex tomorrow @r{in date strings}
@findex yesterday @r{in date strings}
The string @samp{tomorrow} is worth one day in the future (equivalent
to @samp{day}), the string @samp{yesterday} is worth
one day in the past (equivalent to @samp{day ago}).
@findex now @r{in date strings}
@findex today @r{in date strings}
@findex this @r{in date strings}
The strings @samp{now} or @samp{today} are relative items corresponding
to zero-valued time displacement, these strings come from the fact
a zero-valued time displacement represents the current time when not
otherwise changed by previous items. They may be used to stress other
items, like in @samp{12:00 today}. The string @samp{this} also has
the meaning of a zero-valued time displacement, but is preferred in
date strings like @samp{this thursday}.
When a relative item causes the resulting date to cross a boundary
where the clocks were adjusted, typically for daylight-saving time,
the resulting date and time are adjusted accordingly.
@node Pure numbers in date strings
@section Pure numbers in date strings
@cindex pure numbers in date strings
The precise interpretation of a pure decimal number depends
on the context in the date string.
If the decimal number is of the form @var{yyyy}@var{mm}@var{dd} and no
other calendar date item (@pxref{Calendar date items}) appears before it
in the date string, then @var{yyyy} is read as the year, @var{mm} as the
month number and @var{dd} as the day of the month, for the specified
calendar date.
If the decimal number is of the form @var{hh}@var{mm} and no other time
of day item appears before it in the date string, then @var{hh} is read
as the hour of the day and @var{mm} as the minute of the hour, for the
specified time of the day. @var{mm} can also be omitted.
If both a calendar date and a time of day appear to the left of a number
in the date string, but no relative item, then the number overrides the
year.
@node Authors of getdate
@section Authors of @code{getdate}
@cindex authors of @code{getdate}
@cindex Bellovin, Steven M.
@cindex Salz, Rich
@cindex Berets, Jim
@cindex MacKenzie, David
@cindex Meyering, Jim
@cindex Eggert, Paul
@code{getdate} was originally implemented by Steven M. Bellovin
(@email{smb@@research.att.com}) while at the University of North Carolina
at Chapel Hill. The code was later tweaked by a couple of people on
Usenet, then completely overhauled by Rich $alz (@email{rsalz@@bbn.com})
and Jim Berets (@email{jberets@@bbn.com}) in August, 1990. Various
revisions for the @sc{gnu} system were made by David MacKenzie, Jim Meyering,
Paul Eggert and others.
@cindex Pinard, F.
@cindex Berry, K.
This chapter was originally produced by Fran@,{c}ois Pinard
(@email{pinard@@iro.umontreal.ca}) from the @file{getdate.y} source code,
and then edited by K.@: Berry (@email{kb@@cs.umb.edu}).

332
doc/intern.texi Normal file
View File

@@ -0,0 +1,332 @@
@c This is part of the paxutils manual.
@c Copyright (C) 2006 Free Software Foundation, Inc.
@c This file is distributed under GFDL 1.1 or any later version
@c published by the Free Software Foundation.
@menu
* Standard:: Basic Tar Format
* Extensions:: @acronym{GNU} Extensions to the Archive Format
* Sparse Formats:: Storing Sparse Files
* Snapshot Files::
* Dumpdir::
@end menu
@node Standard
@unnumberedsec Basic Tar Format
@UNREVISED
While an archive may contain many files, the archive itself is a
single ordinary file. Like any other file, an archive file can be
written to a storage device such as a tape or disk, sent through a
pipe or over a network, saved on the active file system, or even
stored in another archive. An archive file is not easy to read or
manipulate without using the @command{tar} utility or Tar mode in
@acronym{GNU} Emacs.
Physically, an archive consists of a series of file entries terminated
by an end-of-archive entry, which consists of two 512 blocks of zero
bytes. A file
entry usually describes one of the files in the archive (an
@dfn{archive member}), and consists of a file header and the contents
of the file. File headers contain file names and statistics, checksum
information which @command{tar} uses to detect file corruption, and
information about file types.
Archives are permitted to have more than one member with the same
member name. One way this situation can occur is if more than one
version of a file has been stored in the archive. For information
about adding new versions of a file to an archive, see @ref{update}.
In addition to entries describing archive members, an archive may
contain entries which @command{tar} itself uses to store information.
@xref{label}, for an example of such an archive entry.
A @command{tar} archive file contains a series of blocks. Each block
contains @code{BLOCKSIZE} bytes. Although this format may be thought
of as being on magnetic tape, other media are often used.
Each file archived is represented by a header block which describes
the file, followed by zero or more blocks which give the contents
of the file. At the end of the archive file there are two 512-byte blocks
filled with binary zeros as an end-of-file marker. A reasonable system
should write such end-of-file marker at the end of an archive, but
must not assume that such a block exists when reading an archive. In
particular @GNUTAR{} always issues a warning if it does not encounter it.
The blocks may be @dfn{blocked} for physical I/O operations.
Each record of @var{n} blocks (where @var{n} is set by the
@option{--blocking-factor=@var{512-size}} (@option{-b @var{512-size}}) option to @command{tar}) is written with a single
@w{@samp{write ()}} operation. On magnetic tapes, the result of
such a write is a single record. When writing an archive,
the last record of blocks should be written at the full size, with
blocks after the zero block containing all zeros. When reading
an archive, a reasonable system should properly handle an archive
whose last record is shorter than the rest, or which contains garbage
records after a zero block.
The header block is defined in C as follows. In the @GNUTAR{}
distribution, this is part of file @file{src/tar.h}:
@smallexample
@include header.texi
@end smallexample
All characters in header blocks are represented by using 8-bit
characters in the local variant of ASCII. Each field within the
structure is contiguous; that is, there is no padding used within
the structure. Each character on the archive medium is stored
contiguously.
Bytes representing the contents of files (after the header block
of each file) are not translated in any way and are not constrained
to represent characters in any character set. The @command{tar} format
does not distinguish text files from binary files, and no translation
of file contents is performed.
The @code{name}, @code{linkname}, @code{magic}, @code{uname}, and
@code{gname} are null-terminated character strings. All other fields
are zero-filled octal numbers in ASCII. Each numeric field of width
@var{w} contains @var{w} minus 1 digits, and a null.
The @code{name} field is the file name of the file, with directory names
(if any) preceding the file name, separated by slashes.
@FIXME{how big a name before field overflows?}
The @code{mode} field provides nine bits specifying file permissions
and three bits to specify the Set @acronym{UID}, Set @acronym{GID}, and Save Text
(@dfn{sticky}) modes. Values for these bits are defined above.
When special permissions are required to create a file with a given
mode, and the user restoring files from the archive does not hold such
permissions, the mode bit(s) specifying those special permissions
are ignored. Modes which are not supported by the operating system
restoring files from the archive will be ignored. Unsupported modes
should be faked up when creating or updating an archive; e.g., the
group permission could be copied from the @emph{other} permission.
The @code{uid} and @code{gid} fields are the numeric user and group
@acronym{ID} of the file owners, respectively. If the operating system does
not support numeric user or group @acronym{ID}s, these fields should
be ignored.
The @code{size} field is the size of the file in bytes; linked files
are archived with this field specified as zero.
The @code{mtime} field is the data modification time of the file at
the time it was archived. It is the ASCII representation of the octal
value of the last time the file's contents were modified, represented
as an integer number of
seconds since January 1, 1970, 00:00 Coordinated Universal Time.
The @code{chksum} field is the ASCII representation of the octal value
of the simple sum of all bytes in the header block. Each 8-bit
byte in the header is added to an unsigned integer, initialized to
zero, the precision of which shall be no less than seventeen bits.
When calculating the checksum, the @code{chksum} field is treated as
if it were all blanks.
The @code{typeflag} field specifies the type of file archived. If a
particular implementation does not recognize or permit the specified
type, the file will be extracted as if it were a regular file. As this
action occurs, @command{tar} issues a warning to the standard error.
The @code{atime} and @code{ctime} fields are used in making incremental
backups; they store, respectively, the particular file's access and
status change times.
The @code{offset} is used by the @option{--multi-volume} (@option{-M}) option, when
making a multi-volume archive. The offset is number of bytes into
the file that we need to restart at to continue the file on the next
tape, i.e., where we store the location that a continued file is
continued at.
The following fields were added to deal with sparse files. A file
is @dfn{sparse} if it takes in unallocated blocks which end up being
represented as zeros, i.e., no useful data. A test to see if a file
is sparse is to look at the number blocks allocated for it versus the
number of characters in the file; if there are fewer blocks allocated
for the file than would normally be allocated for a file of that
size, then the file is sparse. This is the method @command{tar} uses to
detect a sparse file, and once such a file is detected, it is treated
differently from non-sparse files.
Sparse files are often @code{dbm} files, or other database-type files
which have data at some points and emptiness in the greater part of
the file. Such files can appear to be very large when an @samp{ls
-l} is done on them, when in truth, there may be a very small amount
of important data contained in the file. It is thus undesirable
to have @command{tar} think that it must back up this entire file, as
great quantities of room are wasted on empty blocks, which can lead
to running out of room on a tape far earlier than is necessary.
Thus, sparse files are dealt with so that these empty blocks are
not written to the tape. Instead, what is written to the tape is a
description, of sorts, of the sparse file: where the holes are, how
big the holes are, and how much data is found at the end of the hole.
This way, the file takes up potentially far less room on the tape,
and when the file is extracted later on, it will look exactly the way
it looked beforehand. The following is a description of the fields
used to handle a sparse file:
The @code{sp} is an array of @code{struct sparse}. Each @code{struct
sparse} contains two 12-character strings which represent an offset
into the file and a number of bytes to be written at that offset.
The offset is absolute, and not relative to the offset in preceding
array element.
The header can hold four of these @code{struct sparse} at the moment;
if more are needed, they are not stored in the header.
The @code{isextended} flag is set when an @code{extended_header}
is needed to deal with a file. Note that this means that this flag
can only be set when dealing with a sparse file, and it is only set
in the event that the description of the file will not fit in the
allotted room for sparse structures in the header. In other words,
an extended_header is needed.
The @code{extended_header} structure is used for sparse files which
need more sparse structures than can fit in the header. The header can
fit 4 such structures; if more are needed, the flag @code{isextended}
gets set and the next block is an @code{extended_header}.
Each @code{extended_header} structure contains an array of 21
sparse structures, along with a similar @code{isextended} flag
that the header had. There can be an indeterminate number of such
@code{extended_header}s to describe a sparse file.
@table @asis
@item @code{REGTYPE}
@itemx @code{AREGTYPE}
These flags represent a regular file. In order to be compatible
with older versions of @command{tar}, a @code{typeflag} value of
@code{AREGTYPE} should be silently recognized as a regular file.
New archives should be created using @code{REGTYPE}. Also, for
backward compatibility, @command{tar} treats a regular file whose name
ends with a slash as a directory.
@item @code{LNKTYPE}
This flag represents a file linked to another file, of any type,
previously archived. Such files are identified in Unix by each
file having the same device and inode number. The linked-to name is
specified in the @code{linkname} field with a trailing null.
@item @code{SYMTYPE}
This represents a symbolic link to another file. The linked-to name
is specified in the @code{linkname} field with a trailing null.
@item @code{CHRTYPE}
@itemx @code{BLKTYPE}
These represent character special files and block special files
respectively. In this case the @code{devmajor} and @code{devminor}
fields will contain the major and minor device numbers respectively.
Operating systems may map the device specifications to their own
local specification, or may ignore the entry.
@item @code{DIRTYPE}
This flag specifies a directory or sub-directory. The directory
name in the @code{name} field should end with a slash. On systems where
disk allocation is performed on a directory basis, the @code{size} field
will contain the maximum number of bytes (which may be rounded to
the nearest disk block allocation unit) which the directory may
hold. A @code{size} field of zero indicates no such limiting. Systems
which do not support limiting in this manner should ignore the
@code{size} field.
@item @code{FIFOTYPE}
This specifies a FIFO special file. Note that the archiving of a
FIFO file archives the existence of this file and not its contents.
@item @code{CONTTYPE}
This specifies a contiguous file, which is the same as a normal
file except that, in operating systems which support it, all its
space is allocated contiguously on the disk. Operating systems
which do not allow contiguous allocation should silently treat this
type as a normal file.
@item @code{A} @dots{} @code{Z}
These are reserved for custom implementations. Some of these are
used in the @acronym{GNU} modified format, as described below.
@end table
Other values are reserved for specification in future revisions of
the P1003 standard, and should not be used by any @command{tar} program.
The @code{magic} field indicates that this archive was output in
the P1003 archive format. If this field contains @code{TMAGIC},
the @code{uname} and @code{gname} fields will contain the ASCII
representation of the owner and group of the file respectively.
If found, the user and group @acronym{ID}s are used rather than the values in
the @code{uid} and @code{gid} fields.
For references, see ISO/IEC 9945-1:1990 or IEEE Std 1003.1-1990, pages
169-173 (section 10.1) for @cite{Archive/Interchange File Format}; and
IEEE Std 1003.2-1992, pages 380-388 (section 4.48) and pages 936-940
(section E.4.48) for @cite{pax - Portable archive interchange}.
@node Extensions
@unnumberedsec @acronym{GNU} Extensions to the Archive Format
@UNREVISED
The @acronym{GNU} format uses additional file types to describe new types of
files in an archive. These are listed below.
@table @code
@item GNUTYPE_DUMPDIR
@itemx 'D'
This represents a directory and a list of files created by the
@option{--incremental} (@option{-G}) option. The @code{size} field gives the total
size of the associated list of files. Each file name is preceded by
either a @samp{Y} (the file should be in this archive) or an @samp{N}.
(The file is a directory, or is not stored in the archive.) Each file
name is terminated by a null. There is an additional null after the
last file name.
@item GNUTYPE_MULTIVOL
@itemx 'M'
This represents a file continued from another volume of a multi-volume
archive created with the @option{--multi-volume} (@option{-M}) option. The original
type of the file is not given here. The @code{size} field gives the
maximum size of this piece of the file (assuming the volume does
not end before the file is written out). The @code{offset} field
gives the offset from the beginning of the file where this part of
the file begins. Thus @code{size} plus @code{offset} should equal
the original size of the file.
@item GNUTYPE_SPARSE
@itemx 'S'
This flag indicates that we are dealing with a sparse file. Note
that archiving a sparse file requires special operations to find
holes in the file, which mark the positions of these holes, along
with the number of bytes of data to be found after the hole.
@item GNUTYPE_VOLHDR
@itemx 'V'
This file type is used to mark the volume header that was given with
the @option{--label=@var{archive-label}} (@option{-V @var{archive-label}}) option when the archive was created. The @code{name}
field contains the @code{name} given after the @option{--label=@var{archive-label}} (@option{-V @var{archive-label}}) option.
The @code{size} field is zero. Only the first file in each volume
of an archive should have this type.
@end table
You may have trouble reading a @acronym{GNU} format archive on a
non-@acronym{GNU} system if the options @option{--incremental} (@option{-G}),
@option{--multi-volume} (@option{-M}), @option{--sparse} (@option{-S}), or @option{--label=@var{archive-label}} (@option{-V @var{archive-label}}) were
used when writing the archive. In general, if @command{tar} does not
use the @acronym{GNU}-added fields of the header, other versions of
@command{tar} should be able to read the archive. Otherwise, the
@command{tar} program will give an error, the most likely one being a
checksum error.
@node Sparse Formats
@unnumberedsec Storing Sparse Files
@include sparse.texi
@node Snapshot Files
@unnumberedsec Format of the Incremental Snapshot Files
@include snapshot.texi
@node Dumpdir
@unnumberedsec Dumpdir
@include dumpdir.texi

91
doc/mastermenu.el Normal file
View File

@@ -0,0 +1,91 @@
;;; mastermenu.el --- Redefinition of texinfo-master-menu-list
;; Copyright (C) 2006, 2007 Free Software Foundation, Inc.
;; Author: Sergey Poznyakoff
;; Maintainer: bug-tar@gnu.org
;; Keywords: maint, tex, docs
;; This file is part of GNU tar documentation suite
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, write to the Free Software Foundation,
;; Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
;;; Commentary:
;; This file redefines texinfo-master-menu-list so that it takes into
;; account included files.
;; Known bugs: @menu without previous sectioning command will inherit
;; documentation string from the previous menu. However, since such a
;; menu is illegal in a texinfo file, we can live with it.
(require 'texinfo)
(require 'texnfo-upd)
(defun texinfo-master-menu-list-recursive (title)
"Auxiliary function used by `texinfo-master-menu-list'."
(save-excursion
(let (master-menu-list)
(while (re-search-forward "\\(^@menu\\|^@include\\)" nil t)
(cond
((string= (match-string 0) "@include")
(skip-chars-forward " \t")
(let ((included-name (let ((start (point)))
(end-of-line)
(skip-chars-backward " \t")
(buffer-substring start (point)))))
(end-of-line)
(let ((prev-title (texinfo-copy-menu-title)))
(save-excursion
(set-buffer (find-file-noselect included-name))
(setq master-menu-list
(append (texinfo-master-menu-list-recursive prev-title)
master-menu-list))))))
(t
(setq master-menu-list
(cons (list
(texinfo-copy-menu)
(let ((menu-title (texinfo-copy-menu-title)))
(if (string= menu-title "")
title
menu-title)))
master-menu-list)))))
master-menu-list)))
(defun texinfo-master-menu-list ()
"Return a list of menu entries and header lines for the master menu,
recursing into included files.
Start with the menu for chapters and indices and then find each
following menu and the title of the node preceding that menu.
The master menu list has this form:
\(\(\(... \"entry-1-2\" \"entry-1\"\) \"title-1\"\)
\(\(... \"entry-2-2\" \"entry-2-1\"\) \"title-2\"\)
...\)
However, there does not need to be a title field."
(reverse (texinfo-master-menu-list-recursive "")))
(defun make-master-menu ()
"Create master menu in the first Emacs argument."
(find-file (car command-line-args-left))
(texinfo-master-menu nil)
(save-buffer))
;;; mastermenu.el ends here

99
doc/rendition.texi Normal file
View File

@@ -0,0 +1,99 @@
@c This is part of GNU tar manual.
@c Copyright (C) 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2001,
@c 2003, 2004, 2006 Free Software Foundation, Inc.
@c See file tar.texi for copying conditions.
@c This file contains support for 'renditions' by Fran@,{c}ois Pinard
@c I extended it by adding a FIXME_FOOTNOTE variable, which controls
@c whether FIXME information should be placed in footnotes or
@c inlined. --gray
@c ======================================================================
@c This document has three levels of rendition: PUBLISH, DISTRIB or PROOF,
@c as decided by @set symbols. The PUBLISH rendition does not show
@c notes or marks asking for revision. Most users will prefer having more
@c information, even if this information is not fully revised for adequacy,
@c so DISTRIB is the default for distributions. The PROOF rendition
@c show all marks to the point of ugliness, but is nevertheless useful to
@c those working on the manual itself.
@c ======================================================================
@c Set this symbol if you wish FIXMEs to appear in footnotes, instead
@c of being inserted into the text.
@c @set PROOF_FOOTNOTED
@ifclear PUBLISH
@ifclear DISTRIB
@ifclear PROOF
@set DISTRIB
@end ifclear
@end ifclear
@end ifclear
@ifset PUBLISH
@set RENDITION The book, version
@end ifset
@ifset DISTRIB
@set RENDITION FTP release, version
@end ifset
@ifset PROOF
@set RENDITION Proof reading version
@end ifset
@c Output marks for nodes needing revision, but not in PUBLISH rendition.
@macro UNREVISED
@ifclear PUBLISH
@quotation
@emph{(This message will disappear, once this node revised.)}
@end quotation
@end ifclear
@end macro
@c Output various FIXME information only in PROOF rendition.
@macro FIXME{string}
@ifset PROOF
@ifset PROOF_FOOTNOTED
@footnote{@strong{FIXME:} \string\}
@end ifset
@ifclear PROOF_FOOTNOTED
@cartouche
@strong{<FIXME>} \string\ @strong{</>}
@end cartouche
@end ifclear
@end ifset
@end macro
@macro FIXME-ref{string}
@ifset PROOF
@strong{<REF>} \string\ @strong{</>}
@end ifset
@ifclear PROOF
@cite{\string\}
@end ifclear
@end macro
@macro FIXME-pxref{string}
@ifset PROOF
See @strong{<PXREF>} \string\ @strong{</>}
@end ifset
@ifclear PROOF
See @cite{\string\}
@end ifclear
@end macro
@macro FIXME-xref{string}
@ifset PROOF
See @strong{<XREF>} \string\ @strong{</>}
@end ifset
@ifclear PROOF
See @cite{\string\}
@end ifclear
@end macro
@c End of rendition.texi

139
doc/snapshot.texi Normal file
View File

@@ -0,0 +1,139 @@
@c This is part of the paxutils manual.
@c Copyright (C) 2005, 2007 Free Software Foundation, Inc.
@c Written by Sergey Poznyakoff
@c This file is distributed under GFDL 1.1 or any later version
@c published by the Free Software Foundation.
A @dfn{snapshot file} (or @dfn{directory file}) is created during
incremental backups (@pxref{Incremental Dumps}). It
contains the status of the file system at the time of the dump and is
used to determine which files were modified since the last backup.
@GNUTAR{} version @value{VERSION} supports three snapshot file
formats. The first format, called @dfn{format 0}, is the one used by
@GNUTAR{} versions up to 1.15.1. The second format, called @dfn{format
1} is an extended version of this format, that contains more metadata
and allows for further extensions. It was used by version
1.15.1. Starting from version 1.16 and up to @value{VERSION}, the
@dfn{format 2} is used.
@GNUTAR{} is able to read all three formats, but will create
snapshots only in format 2.
This appendix describes all three formats in detail.
@enumerate 0
@cindex format 0, snapshot file
@cindex snapshot file, format 0
@item
@samp{Format 0} snapshot file begins with a line containing a
decimal number that represents a @acronym{UNIX} timestamp of the
beginning of the last archivation. This line is followed by directory
metadata descriptions, one per line. Each description has the
following format:
@smallexample
@var{nfs}@var{dev} @var{inode} @var{name}
@end smallexample
@noindent
where:
@table @var
@item nfs
A single plus character (@samp{+}), if this directory is located on
an @acronym{NFS}-mounted partition, or a single space otherwise;
@item dev
Device number of the directory;
@item inode
I-node number of the directory;
@item name
Name of the directory. Any special characters (white-space,
backslashes, etc.) are quoted.
@end table
@cindex format 1, snapshot file
@cindex snapshot file, format 1
@item
@samp{Format 1} snapshot file begins with a line specifying the
format of the file. This line has the following structure:
@smallexample
@samp{GNU tar-}@var{tar-version}@samp{-}@var{incr-format-version}
@end smallexample
@noindent
where @var{tar-version} is the version number of @GNUTAR{}
implementation that created this snapshot, and
@var{incr-format-version} is the version number of the snapshot format
(in this case @samp{1}).
Next line contains two decimal numbers, representing the
time of the last backup. First number is the number of seconds, the
second one is the number of nanoseconds, since the beginning of the
epoch.
Lines that follow contain directory metadata, one line per
directory. Each line is formatted as follows:
@smallexample
[@var{nfs}]@var{mtime-sec} @var{mtime-nsec} @var{dev} @var{inode} @var{name}
@end smallexample
@noindent
where @var{mtime-sec} and @var{mtime-nsec} represent last
modification time of this directory with nanosecond precision;
@var{nfs}, @var{dev}, @var{inode} and @var{name} have the same meaning
as with @samp{format 0}.
@cindex format 2, snapshot file
@cindex snapshot file, format 2
@FIXME{}
@item
@samp{Format 2} snapshot file begins with a format identifier, as described for
version 1, e.g.:
@smallexample
GNU tar-@value{VERSION}-2
@end smallexample
This line is followed by newline. Rest of file consists of
records, separated by null (@acronym{ASCII} 0)
characters. Thus, in contrast to the previous formats, format 2
snapshot is a binary file.
First two records are decimal numbers, representing the
time of the last backup. First number is the number of seconds, the
second one is the number of nanoseconds, since the beginning of the
epoch. These are followed by arbitrary number of directory records.
Each @dfn{directory record} contains a set of metadata describing a
particular directory. Parts of a directory record are delimited with
@acronym{ASCII} 0 characters. The following table describes each
part. The @dfn{Number} type in this table stands for a decimal number
in @acronym{ASCII} notation.
@multitable @columnfractions 0.2 0.2 0.6
@headitem Field @tab Type @tab Description
@item nfs @tab Character @tab @samp{1} if the directory is located on
an @acronym{NFS}-mounted partition, or @samp{0} otherwise;
@item mtime-sec @tab Number @tab Modification time, seconds;
@item mtime-nano @tab Number @tab Modification time, nanoseconds;
@item dev-no @tab Number @tab Device number;
@item i-no @tab Number @tab I-node number;
@item name @tab String @tab Directory name; in contrast to the
previous versions it is not quoted;
@item contents @tab Dumpdir @tab Contents of the directory;
@xref{Dumpdir}, for a description of its format.
@item
@end multitable
Dumpdirs stored in snapshot files contain only records of types
@samp{Y}, @samp{N} and @samp{D}.
@end enumerate
@c End of snapshot.texi

234
doc/sparse.texi Normal file
View File

@@ -0,0 +1,234 @@
@c This is part of the paxutils manual.
@c Copyright (C) 2006 Free Software Foundation, Inc.
@c This file is distributed under GFDL 1.1 or any later version
@c published by the Free Software Foundation.
@cindex sparse formats
@cindex sparse versions
The notion of sparse file, and the ways of handling it from the point
of view of @GNUTAR{} user have been described in detail in
@ref{sparse}. This chapter describes the internal format @GNUTAR{}
uses to store such files.
The support for sparse files in @GNUTAR{} has a long history. The
earliest version featuring this support that I was able to find was 1.09,
released in November, 1990. The format introduced back then is called
@dfn{old GNU} sparse format and in spite of the fact that its design
contained many flaws, it was the only format @GNUTAR{} supported
until version 1.14 (May, 2004), which introduced initial support for
sparse archives in @acronym{PAX} archives (@pxref{posix}). This
format was not free from design flaws, either and it was subsequently
improved in versions 1.15.2 (November, 2005) and 1.15.92 (June,
2006).
In addition to GNU sparse format, @GNUTAR{} is able to read and
extract sparse files archived by @command{star}.
The following subsections describe each format in detail.
@menu
* Old GNU Format::
* PAX 0:: PAX Format, Versions 0.0 and 0.1
* PAX 1:: PAX Format, Version 1.0
@end menu
@node Old GNU Format
@appendixsubsec Old GNU Format
@cindex sparse formats, Old GNU
@cindex Old GNU sparse format
The format introduced in November 1990 (v. 1.09) was
designed on top of standard @code{ustar} headers in such an
unfortunate way that some of its fields overwrote fields required by
POSIX.
An old GNU sparse header is designated by type @samp{S}
(@code{GNUTYPE_SPARSE}) and has the following layout:
@multitable @columnfractions 0.10 0.10 0.20 0.20 0.40
@headitem Offset @tab Size @tab Name @tab Data type @tab Contents
@item 0 @tab 345 @tab @tab N/A @tab Not used.
@item 345 @tab 12 @tab atime @tab Number @tab @code{atime} of the file.
@item 357 @tab 12 @tab ctime @tab Number @tab @code{ctime} of the file .
@item 369 @tab 12 @tab offset @tab Number @tab For
multivolume archives: the offset of the start of this volume.
@item 381 @tab 4 @tab @tab N/A @tab Not used.
@item 385 @tab 1 @tab @tab N/A @tab Not used.
@item 386 @tab 96 @tab sp @tab @code{sparse_header} @tab (4 entries) File map.
@item 482 @tab 1 @tab isextended @tab Bool @tab @code{1} if an
extension sparse header follows, @code{0} otherwise.
@item 483 @tab 12 @tab realsize @tab Number @tab Real size of the file.
@end multitable
Each of @code{sparse_header} object at offset 386 describes a single
data chunk. It has the following structure:
@multitable @columnfractions 0.10 0.10 0.20 0.60
@headitem Offset @tab Size @tab Data type @tab Contents
@item 0 @tab 12 @tab Number @tab Offset of the
beginning of the chunk.
@item 12 @tab 12 @tab Number @tab Size of the chunk.
@end multitable
If the member contains more than four chunks, the @code{isextended}
field of the header has the value @code{1} and the main header is
followed by one or more @dfn{extension headers}. Each such header has
the following structure:
@multitable @columnfractions 0.10 0.10 0.20 0.20 0.40
@headitem Offset @tab Size @tab Name @tab Data type @tab Contents
@item 0 @tab 21 @tab sp @tab @code{sparse_header} @tab
(21 entries) File map.
@item 504 @tab 1 @tab isextended @tab Bool @tab @code{1} if an
extension sparse header follows, or @code{0} otherwise.
@end multitable
A header with @code{isextended=0} ends the map.
@node PAX 0
@appendixsubsec PAX Format, Versions 0.0 and 0.1
@cindex sparse formats, v.0.0
There are two formats available in this branch. The version @code{0.0}
is the initial version of sparse format used by @command{tar}
versions 1.14--1.15.1. The sparse file map is kept in extended
(@code{x}) PAX header variables:
@table @code
@vrindex GNU.sparse.size, extended header variable
@item GNU.sparse.size
Real size of the stored file;
@item GNU.sparse.numblocks
@vrindex GNU.sparse.numblocks, extended header variable
Number of blocks in the sparse map;
@item GNU.sparse.offset
@vrindex GNU.sparse.offset, extended header variable
Offset of the data block;
@item GNU.sparse.numbytes
@vrindex GNU.sparse.numbytes, extended header variable
Size of the data block.
@end table
The latter two variables repeat for each data block, so the overall
structure is like this:
@smallexample
@group
GNU.sparse.size=@var{size}
GNU.sparse.numblocks=@var{numblocks}
repeat @var{numblocks} times
GNU.sparse.offset=@var{offset}
GNU.sparse.numbytes=@var{numbytes}
end repeat
@end group
@end smallexample
This format presented the following two problems:
@enumerate 1
@item
Whereas the POSIX specification allows a variable to appear multiple
times in a header, it requires that only the last occurrence be
meaningful. Thus, multiple occurrences of @code{GNU.sparse.offset} and
@code{GNU.sparse.numbytes} are conflicting with the POSIX specs.
@item
Attempting to extract such archives using a third-party's @command{tar}
results in extraction of sparse files in @emph{condensed form}. If
the @command{tar} implementation in question does not support POSIX
format, it will also extract a file containing extension header
attributes. This file can be used to expand the file to its original
state. However, posix-aware @command{tar}s will usually ignore the
unknown variables, which makes restoring the file more
difficult. @xref{extracting sparse v.0.x, Extraction of sparse
members in v.0.0 format}, for the detailed description of how to
restore such members using non-GNU @command{tar}s.
@end enumerate
@cindex sparse formats, v.0.1
@GNUTAR{} 1.15.2 introduced sparse format version @code{0.1}, which
attempted to solve these problems. As its predecessor, this format
stores sparse map in the extended POSIX header. It retains
@code{GNU.sparse.size} and @code{GNU.sparse.numblocks} variables, but
instead of @code{GNU.sparse.offset}/@code{GNU.sparse.numbytes} pairs
it uses a single variable:
@table @code
@item GNU.sparse.map
@vrindex GNU.sparse.map, extended header variable
Map of non-null data chunks. It is a string consisting of
comma-separated values "@var{offset},@var{size}[,@var{offset-1},@var{size-1}...]"
@end table
To address the 2nd problem, the @code{name} field in @code{ustar}
is replaced with a special name, constructed using the following pattern:
@smallexample
%d/GNUSparseFile.%p/%f
@end smallexample
@vrindex GNU.sparse.name, extended header variable
The real name of the sparse file is stored in the variable
@code{GNU.sparse.name}. Thus, those @command{tar} implementations
that are not aware of GNU extensions will at least extract the files
into separate directories, giving the user a possibility to expand it
afterwards. @xref{extracting sparse v.0.x, Extraction of sparse
members in v.0.1 format}, for the detailed description of how to
restore such members using non-GNU @command{tar}s.
The resulting @code{GNU.sparse.map} string can be @emph{very} long.
Although POSIX does not impose any limit on the length of a @code{x}
header variable, this possibly can confuse some @command{tar}s.
@node PAX 1
@appendixsubsec PAX Format, Version 1.0
@cindex sparse formats, v.1.0
The version @code{1.0} of sparse format was introduced with @GNUTAR{}
1.15.92. Its main objective was to make the resulting file
extractable with little effort even by non-posix aware @command{tar}
implementations. Starting from this version, the extended header
preceding a sparse member always contains the following variables that
identify the format being used:
@table @code
@item GNU.sparse.major
@vrindex GNU.sparse.major, extended header variable
Major version
@item GNU.sparse.minor
@vrindex GNU.sparse.minor, extended header variable
Minor version
@end table
The @code{name} field in @code{ustar} header contains a special name,
constructed using the following pattern:
@smallexample
%d/GNUSparseFile.%p/%f
@end smallexample
@vrindex GNU.sparse.name, extended header variable, in v.1.0
@vrindex GNU.sparse.realsize, extended header variable
The real name of the sparse file is stored in the variable
@code{GNU.sparse.name}. The real size of the file is stored in the
variable @code{GNU.sparse.realsize}.
The sparse map itself is stored in the file data block, preceding the actual
file data. It consists of a series of octal numbers of arbitrary length, delimited
by newlines. The map is padded with nulls to the nearest block boundary.
The first number gives the number of entries in the map. Following are map entries,
each one consisting of two numbers giving the offset and size of the
data block it describes.
The format is designed in such a way that non-posix aware @command{tar}s and @command{tar}s not
supporting @code{GNU.sparse.*} keywords will extract each sparse file
in its condensed form with the file map prepended and will place it
into a separate directory. Then, using a simple program it would be
possible to expand the file to its original form even without @GNUTAR{}.
@xref{Sparse Recovery}, for the detailed information on how to extract
sparse members without @GNUTAR{}.

View File

@@ -0,0 +1,57 @@
@c This is part of the paxutils manual.
@c Copyright (C) 2007 Free Software Foundation, Inc.
@c This file is distributed under GFDL 1.1 or any later version
@c published by the Free Software Foundation.
@cindex Device numbers, changing
@cindex snapshot files, editing
@cindex snapshot files, fixing device numbers
Sometimes device numbers can change after upgrading your kernel
version or reconfiguring the hardware. Reportedly this is the case with
some newer @i{Linux} kernels, when using @acronym{LVM}. In majority of
cases this change is unnoticed by the users. However, it influences
@command{tar} incremental backups: the device number is stored in tar
snapshot files (@pxref{Snapshot Files}) and is used to determine whether
the file has changed since the last backup. If the device numbers
change for some reason, the next backup you run will be a full backup.
@pindex tar-snapshot-edit
To minimize the impact in these cases, GNU @command{tar} comes with
the @command{tar-snapshot-edit} utility for inspecting and updating
device numbers in snapshot files. The utility, written by
Dustin J.@: Mitchell, is available from
@uref{http://www.gnu.org/@/software/@/tar/@/utils/@/tar-snapshot-edit.html,
@GNUTAR{} home page}.
To obtain the device numbers used in the snapshot file, run
@smallexample
$ @kbd{tar-snapshot-edit @var{snapfile}}
@end smallexample
@noindent
where @var{snapfile} is the name of the snapshot file (you can supply as many
files as you wish in a single command line).
To update all occurrences of the given device number in the file, use
@option{-r} option. It takes a single argument of the form
@samp{@var{olddev}-@var{newdev}}, where @var{olddev} is the device number
used in the snapshot file, and @var{newdev} is the corresponding new device
number. Both numbers may be specified in hex (e.g., @samp{0xfe01}),
decimal (e.g., @samp{65025}), or as a major:minor number pair (e.g.,
@samp{254:1}). To change several device numbers at once, specify them
in a single comma-separated list, as in
@option{-r 0x3060-0x4500,0x307-0x4600}.
Before updating the snapshot file, it is a good idea to create a backup
copy of it. This is accomplished by @samp{-b} option. The name of the
backup file is obtained by appending @samp{~} to the original file name.
An example session:
@smallexample
$ @kbd{tar-snapshot-edit /var/backup/snap.a}
file version 2
/tmp/snap: Device 0x0306 occurs 634 times.
$ @kbd{tar-snapshot-edit -b -r 0x0306-0x4500 /var/backup/snap.a}
file version 2
@end smallexample

11914
doc/tar.texi

File diff suppressed because it is too large Load Diff

26
doc/texify.sed Normal file
View File

@@ -0,0 +1,26 @@
# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
#
# GNU tar is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3, or (at
# your option) any later version.
#
# GNU tar is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU tar; if not, write to the Free Software
# Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1{s,/\*,@comment ,
b
}
2,/.*\*\//{s,\*/,,;s/^/@comment/
b
}
/\/* END \*\//,$d
s/\([{}]\)/@\1/g
s,/\*,&@r{,
s,\*/,}&,

13
doc/untabify.el Normal file
View File

@@ -0,0 +1,13 @@
;;;; Untabify the sources.
;;;; Usage: emacs -batch -l untabify.el [file ...]
(defun global-untabify (buflist)
(mapcar
(lambda (bufname)
(set-buffer (find-file bufname))
(untabify (point-min) (point-max))
(save-buffer)
(kill-buffer (current-buffer)))
buflist))
(global-untabify command-line-args-left)

20
doc/value.texi Normal file
View File

@@ -0,0 +1,20 @@
@c This is part of GNU tar manual.
@c Copyright (C) 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2001,
@c 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
@c See file tar.texi for copying conditions.
@macro GNUTAR
@acronym{GNU} @command{tar}
@end macro
@macro xopindex{option,text}
@opindex \option\@r{, \text\}
@end macro
@macro opsummary{option}
@ifclear ANCHOR--\option\
@set ANCHOR--\option\ 1
@anchor{--\option\}
@end ifclear
@xopindex{\option\, summary}
@end macro

70
gnulib.modules Normal file
View File

@@ -0,0 +1,70 @@
# List of gnulib modules needed for GNU tar.
# A module name per line. Empty lines and comments are ignored.
alloca
argmatch
argp
argp-version-etc
backupfile
closeout
configmake
dirname
error
exclude
exitfail
fdopendir
fdutimensat
fileblocks
fnmatch-gnu
fseeko
full-write
futimens
getline
getopt-gnu
getpagesize
gettext
gettime
gitlog-to-changelog
hash
human
inttostr
inttypes
lchown
linkat
localcharset
mkdtemp
mkfifoat
modechange
obstack
openat
parse-datetime
priv-set
progname
quote
quotearg
readlinkat
renameat
rpmatch
safe-read
savedir
setenv
snprintf
stat-time
stdbool
stdint
stpcpy
strdup-posix
strerror
strtol
strtoul
symlinkat
timespec
unlinkdir
unlocked-io
utimensat
version-etc-fsf
xalloc
xalloc-die
xgetcwd
xstrtoumax
xvasprintf

View File

@@ -1,45 +1,38 @@
# Makefile for GNU tar library.
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
# Makefile for GNU tar library. -*- Makefile -*-
# Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2003, 2004,
# 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
AUTOMAKE_OPTIONS = gnits
noinst_LIBRARIES = libtar.a
EXTRA_DIST = \
alloca.c fileblocks.c fnmatch.c ftruncate.c execlp.c gmalloc.c \
memset.c mkdir.c modechange.h rename.c rmdir.c stpcpy.c strstr.c
noinst_HEADERS = \
argmatch.h backupfile.h error.h fnmatch.h getopt.h getdate.h getpagesize.h \
pathmax.h
noinst_LIBRARIES=libtar.a
rmt-command.h : Makefile
$(AM_V_GEN)rm -f $@-t $@
$(AM_V_at)echo "#ifndef DEFAULT_RMT_COMMAND" >> $@-t
$(AM_V_at)echo "# define DEFAULT_RMT_COMMAND \"$(DEFAULT_RMT_DIR)/`echo rmt | sed '$(transform)'`$(EXEEXT)\"" >> $@-t
$(AM_V_at)echo "#endif" >> $@-t
$(AM_V_at)mv $@-t $@
BUILT_SOURCES = rmt-command.h
CLEANFILES = rmt-command.h rmt-command.h-t
INCLUDES = -I$(top_srcdir)/gnu -I../ -I../gnu
noinst_HEADERS = system.h system-ioctl.h rmt.h paxlib.h stdopen.h
libtar_a_SOURCES = \
argmatch.c backupfile.c error.c getdate.y getopt.c getopt1.c getversion.c \
modechange.c msleep.c xgetcwd.c xmalloc.c xstrdup.c
INCLUDES = -I.. -I$(srcdir) -I../intl
libtar_a_LIBADD = @ALLOCA@ @LIBOBJS@
libtar_a_DEPENDENCIES = $(libtar_a_LIBADD)
# Say $(srcdir), so GNU make does not report an ambiguity with the .y.c rule.
$(srcdir)/getdate.c: getdate.y
@echo Expect 13 shift/reduce conflicts...
cd $(srcdir) && \
$(YACC) $(YFLAGS) getdate.y; \
mv -f y.tab.c getdate.c
paxerror.c paxexit.c paxlib.h paxnames.c \
prepargs.c prepargs.h \
rtapelib.c \
rmt.h \
stdopen.c stdopen.h \
system.h system-ioctl.h

View File

@@ -1,504 +0,0 @@
/* alloca.c -- allocate automatically reclaimed memory
(Mostly) portable public-domain implementation -- D A Gwyn
This implementation of the PWB library alloca function,
which is used to allocate space off the run-time stack so
that it is automatically reclaimed upon procedure exit,
was inspired by discussions with J. Q. Johnson of Cornell.
J.Otto Tennant <jot@cray.com> contributed the Cray support.
There are some preprocessor constants that can
be defined when compiling for your specific system, for
improved efficiency; however, the defaults should be okay.
The general concept of this implementation is to keep
track of all alloca-allocated blocks, and reclaim any
that are found to be deeper in the stack than the current
invocation. This heuristic does not reclaim storage as
soon as it becomes invalid, but it will do so eventually.
As a special case, alloca(0) reclaims storage without
allocating any. It is a good idea to use alloca(0) in
your main control loop, etc. to force garbage collection. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#if HAVE_STRING_H
# include <string.h>
#endif
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#ifdef emacs
# include "blockinput.h"
#endif
/* If compiling with GCC 2, this file's not needed. */
#if !defined (__GNUC__) || __GNUC__ < 2
/* If someone has defined alloca as a macro,
there must be some other way alloca is supposed to work. */
# ifndef alloca
# ifdef emacs
# ifdef static
/* actually, only want this if static is defined as ""
-- this is for usg, in which emacs must undefine static
in order to make unexec workable
*/
# ifndef STACK_DIRECTION
you
lose
-- must know STACK_DIRECTION at compile-time
# endif /* STACK_DIRECTION undefined */
# endif /* static */
# endif /* emacs */
/* If your stack is a linked list of frames, you have to
provide an "address metric" ADDRESS_FUNCTION macro. */
# if defined (CRAY) && defined (CRAY_STACKSEG_END)
long i00afunc ();
# define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
# else
# define ADDRESS_FUNCTION(arg) &(arg)
# endif
# if __STDC__
typedef void *pointer;
# else
typedef char *pointer;
# endif
# ifndef NULL
# define NULL 0
# endif
/* Different portions of Emacs need to call different versions of
malloc. The Emacs executable needs alloca to call xmalloc, because
ordinary malloc isn't protected from input signals. On the other
hand, the utilities in lib-src need alloca to call malloc; some of
them are very simple, and don't have an xmalloc routine.
Non-Emacs programs expect this to call xmalloc.
Callers below should use malloc. */
# ifndef emacs
# undef malloc
# define malloc xmalloc
# endif
extern pointer malloc ();
/* Define STACK_DIRECTION if you know the direction of stack
growth for your system; otherwise it will be automatically
deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
# ifndef STACK_DIRECTION
# define STACK_DIRECTION 0 /* Direction unknown. */
# endif
# if STACK_DIRECTION != 0
# define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
# else /* STACK_DIRECTION == 0; need run-time code. */
static int stack_dir; /* 1 or -1 once known. */
# define STACK_DIR stack_dir
static void
find_stack_direction ()
{
static char *addr = NULL; /* Address of first `dummy', once known. */
auto char dummy; /* To get stack address. */
if (addr == NULL)
{ /* Initial entry. */
addr = ADDRESS_FUNCTION (dummy);
find_stack_direction (); /* Recurse once. */
}
else
{
/* Second entry. */
if (ADDRESS_FUNCTION (dummy) > addr)
stack_dir = 1; /* Stack grew upward. */
else
stack_dir = -1; /* Stack grew downward. */
}
}
# endif /* STACK_DIRECTION == 0 */
/* An "alloca header" is used to:
(a) chain together all alloca'ed blocks;
(b) keep track of stack depth.
It is very important that sizeof(header) agree with malloc
alignment chunk size. The following default should work okay. */
# ifndef ALIGN_SIZE
# define ALIGN_SIZE sizeof(double)
# endif
typedef union hdr
{
char align[ALIGN_SIZE]; /* To force sizeof(header). */
struct
{
union hdr *next; /* For chaining headers. */
char *deep; /* For stack depth measure. */
} h;
} header;
static header *last_alloca_header = NULL; /* -> last alloca header. */
/* Return a pointer to at least SIZE bytes of storage,
which will be automatically reclaimed upon exit from
the procedure that called alloca. Originally, this space
was supposed to be taken from the current stack frame of the
caller, but that method cannot be made to work for some
implementations of C, for example under Gould's UTX/32. */
pointer
alloca (size_t size)
{
auto char probe; /* Probes stack depth: */
register char *depth = ADDRESS_FUNCTION (probe);
# if STACK_DIRECTION == 0
if (STACK_DIR == 0) /* Unknown growth direction. */
find_stack_direction ();
# endif
/* Reclaim garbage, defined as all alloca'd storage that
was allocated from deeper in the stack than currently. */
{
register header *hp; /* Traverses linked list. */
# ifdef emacs
BLOCK_INPUT;
# endif
for (hp = last_alloca_header; hp != NULL;)
if ((STACK_DIR > 0 && hp->h.deep > depth)
|| (STACK_DIR < 0 && hp->h.deep < depth))
{
register header *np = hp->h.next;
free ((pointer) hp); /* Collect garbage. */
hp = np; /* -> next header. */
}
else
break; /* Rest are not deeper. */
last_alloca_header = hp; /* -> last valid storage. */
# ifdef emacs
UNBLOCK_INPUT;
# endif
}
if (size == 0)
return NULL; /* No allocation required. */
/* Allocate combined header + user data storage. */
{
register pointer new = malloc (sizeof (header) + size);
/* Address of header. */
if (new == 0)
abort();
((header *) new)->h.next = last_alloca_header;
((header *) new)->h.deep = depth;
last_alloca_header = (header *) new;
/* User storage begins just after header. */
return (pointer) ((char *) new + sizeof (header));
}
}
# if defined (CRAY) && defined (CRAY_STACKSEG_END)
# ifdef DEBUG_I00AFUNC
# include <stdio.h>
# endif
# ifndef CRAY_STACK
# define CRAY_STACK
# ifndef CRAY2
/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
struct stack_control_header
{
long shgrow:32; /* Number of times stack has grown. */
long shaseg:32; /* Size of increments to stack. */
long shhwm:32; /* High water mark of stack. */
long shsize:32; /* Current size of stack (all segments). */
};
/* The stack segment linkage control information occurs at
the high-address end of a stack segment. (The stack
grows from low addresses to high addresses.) The initial
part of the stack segment linkage control information is
0200 (octal) words. This provides for register storage
for the routine which overflows the stack. */
struct stack_segment_linkage
{
long ss[0200]; /* 0200 overflow words. */
long sssize:32; /* Number of words in this segment. */
long ssbase:32; /* Offset to stack base. */
long:32;
long sspseg:32; /* Offset to linkage control of previous
segment of stack. */
long:32;
long sstcpt:32; /* Pointer to task common address block. */
long sscsnm; /* Private control structure number for
microtasking. */
long ssusr1; /* Reserved for user. */
long ssusr2; /* Reserved for user. */
long sstpid; /* Process ID for pid based multi-tasking. */
long ssgvup; /* Pointer to multitasking thread giveup. */
long sscray[7]; /* Reserved for Cray Research. */
long ssa0;
long ssa1;
long ssa2;
long ssa3;
long ssa4;
long ssa5;
long ssa6;
long ssa7;
long sss0;
long sss1;
long sss2;
long sss3;
long sss4;
long sss5;
long sss6;
long sss7;
};
# else /* CRAY2 */
/* The following structure defines the vector of words
returned by the STKSTAT library routine. */
struct stk_stat
{
long now; /* Current total stack size. */
long maxc; /* Amount of contiguous space which would
be required to satisfy the maximum
stack demand to date. */
long high_water; /* Stack high-water mark. */
long overflows; /* Number of stack overflow ($STKOFEN) calls. */
long hits; /* Number of internal buffer hits. */
long extends; /* Number of block extensions. */
long stko_mallocs; /* Block allocations by $STKOFEN. */
long underflows; /* Number of stack underflow calls ($STKRETN). */
long stko_free; /* Number of deallocations by $STKRETN. */
long stkm_free; /* Number of deallocations by $STKMRET. */
long segments; /* Current number of stack segments. */
long maxs; /* Maximum number of stack segments so far. */
long pad_size; /* Stack pad size. */
long current_address; /* Current stack segment address. */
long current_size; /* Current stack segment size. This
number is actually corrupted by STKSTAT to
include the fifteen word trailer area. */
long initial_address; /* Address of initial segment. */
long initial_size; /* Size of initial segment. */
};
/* The following structure describes the data structure which trails
any stack segment. I think that the description in 'asdef' is
out of date. I only describe the parts that I am sure about. */
struct stk_trailer
{
long this_address; /* Address of this block. */
long this_size; /* Size of this block (does not include
this trailer). */
long unknown2;
long unknown3;
long link; /* Address of trailer block of previous
segment. */
long unknown5;
long unknown6;
long unknown7;
long unknown8;
long unknown9;
long unknown10;
long unknown11;
long unknown12;
long unknown13;
long unknown14;
};
# endif /* CRAY2 */
# endif /* not CRAY_STACK */
# ifdef CRAY2
/* Determine a "stack measure" for an arbitrary ADDRESS.
I doubt that "lint" will like this much. */
static long
i00afunc (long *address)
{
struct stk_stat status;
struct stk_trailer *trailer;
long *block, size;
long result = 0;
/* We want to iterate through all of the segments. The first
step is to get the stack status structure. We could do this
more quickly and more directly, perhaps, by referencing the
$LM00 common block, but I know that this works. */
STKSTAT (&status);
/* Set up the iteration. */
trailer = (struct stk_trailer *) (status.current_address
+ status.current_size
- 15);
/* There must be at least one stack segment. Therefore it is
a fatal error if "trailer" is null. */
if (trailer == 0)
abort ();
/* Discard segments that do not contain our argument address. */
while (trailer != 0)
{
block = (long *) trailer->this_address;
size = trailer->this_size;
if (block == 0 || size == 0)
abort ();
trailer = (struct stk_trailer *) trailer->link;
if ((block <= address) && (address < (block + size)))
break;
}
/* Set the result to the offset in this segment and add the sizes
of all predecessor segments. */
result = address - block;
if (trailer == 0)
{
return result;
}
do
{
if (trailer->this_size <= 0)
abort ();
result += trailer->this_size;
trailer = (struct stk_trailer *) trailer->link;
}
while (trailer != 0);
/* We are done. Note that if you present a bogus address (one
not in any segment), you will get a different number back, formed
from subtracting the address of the first block. This is probably
not what you want. */
return (result);
}
# else /* not CRAY2 */
/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
Determine the number of the cell within the stack,
given the address of the cell. The purpose of this
routine is to linearize, in some sense, stack addresses
for alloca. */
static long
i00afunc (long address)
{
long stkl = 0;
long size, pseg, this_segment, stack;
long result = 0;
struct stack_segment_linkage *ssptr;
/* Register B67 contains the address of the end of the
current stack segment. If you (as a subprogram) store
your registers on the stack and find that you are past
the contents of B67, you have overflowed the segment.
B67 also points to the stack segment linkage control
area, which is what we are really interested in. */
stkl = CRAY_STACKSEG_END ();
ssptr = (struct stack_segment_linkage *) stkl;
/* If one subtracts 'size' from the end of the segment,
one has the address of the first word of the segment.
If this is not the first segment, 'pseg' will be
nonzero. */
pseg = ssptr->sspseg;
size = ssptr->sssize;
this_segment = stkl - size;
/* It is possible that calling this routine itself caused
a stack overflow. Discard stack segments which do not
contain the target address. */
while (!(this_segment <= address && address <= stkl))
{
# ifdef DEBUG_I00AFUNC
fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
# endif
if (pseg == 0)
break;
stkl = stkl - pseg;
ssptr = (struct stack_segment_linkage *) stkl;
size = ssptr->sssize;
pseg = ssptr->sspseg;
this_segment = stkl - size;
}
result = address - this_segment;
/* If you subtract pseg from the current end of the stack,
you get the address of the previous stack segment's end.
This seems a little convoluted to me, but I'll bet you save
a cycle somewhere. */
while (pseg != 0)
{
# ifdef DEBUG_I00AFUNC
fprintf (stderr, "%011o %011o\n", pseg, size);
# endif
stkl = stkl - pseg;
ssptr = (struct stack_segment_linkage *) stkl;
size = ssptr->sssize;
pseg = ssptr->sspseg;
result += size;
}
return (result);
}
# endif /* not CRAY2 */
# endif /* CRAY */
# endif /* no alloca */
#endif /* not GCC version 2 */

View File

@@ -1,316 +0,0 @@
/* argmatch.c -- find a match for a string in an array
Copyright (C) 1990, 1998, 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by David MacKenzie <djm@ai.mit.edu>
Modified by Akim Demaille <demaille@inf.enst.fr> */
#include "argmatch.h"
#include <stdio.h>
#ifdef STDC_HEADERS
# include <string.h>
#endif
#if HAVE_LOCALE_H
# include <locale.h>
#endif
#if ENABLE_NLS
# include <libintl.h>
# define _(Text) gettext (Text)
#else
# define _(Text) Text
#endif
#include "error.h"
#include "quotearg.h"
/* When reporting an invalid argument, show nonprinting characters
by using the quoting style ARGMATCH_QUOTING_STYLE. Do not use
literal_quoting_style. */
#ifndef ARGMATCH_QUOTING_STYLE
# define ARGMATCH_QUOTING_STYLE escape_quoting_style
#endif
/* The following test is to work around the gross typo in
systems like Sony NEWS-OS Release 4.0C, whereby EXIT_FAILURE
is defined to 0, not 1. */
#if !EXIT_FAILURE
# undef EXIT_FAILURE
# define EXIT_FAILURE 1
#endif
/* Non failing version of argmatch call this function after failing. */
#ifndef ARGMATCH_DIE
# define ARGMATCH_DIE exit (EXIT_FAILURE)
#endif
#ifdef ARGMATCH_DIE_DECL
ARGMATCH_DIE_DECL;
#endif
static void
__argmatch_die (void)
{
ARGMATCH_DIE;
}
/* Used by XARGMATCH and XARGCASEMATCH. See description in argmatch.h.
Default to __argmatch_die, but allow caller to change this at run-time. */
argmatch_exit_fn argmatch_die = __argmatch_die;
/* If ARG is an unambiguous match for an element of the
null-terminated array ARGLIST, return the index in ARGLIST
of the matched element, else -1 if it does not match any element
or -2 if it is ambiguous (is a prefix of more than one element).
If SENSITIVE, comparison is case sensitive.
If VALLIST is none null, use it to resolve ambiguities limited to
synonyms, i.e., for
"yes", "yop" -> 0
"no", "nope" -> 1
"y" is a valid argument, for `0', and "n" for `1'. */
static int
__argmatch_internal (const char *arg, const char *const *arglist,
const char *vallist, size_t valsize,
int case_sensitive)
{
int i; /* Temporary index in ARGLIST. */
size_t arglen; /* Length of ARG. */
int matchind = -1; /* Index of first nonexact match. */
int ambiguous = 0; /* If nonzero, multiple nonexact match(es). */
arglen = strlen (arg);
/* Test all elements for either exact match or abbreviated matches. */
for (i = 0; arglist[i]; i++)
{
if (case_sensitive
? !strncmp (arglist[i], arg, arglen)
: !strncasecmp (arglist[i], arg, arglen))
{
if (strlen (arglist[i]) == arglen)
/* Exact match found. */
return i;
else if (matchind == -1)
/* First nonexact match found. */
matchind = i;
else
{
/* Second nonexact match found. */
if (vallist == NULL
|| memcmp (vallist + valsize * matchind,
vallist + valsize * i, valsize))
{
/* There is a real ambiguity, or we could not
disambiguate. */
ambiguous = 1;
}
}
}
}
if (ambiguous)
return -2;
else
return matchind;
}
/* argmatch - case sensitive version */
int
argmatch (const char *arg, const char *const *arglist,
const char *vallist, size_t valsize)
{
return __argmatch_internal (arg, arglist, vallist, valsize, 1);
}
/* argcasematch - case insensitive version */
int
argcasematch (const char *arg, const char *const *arglist,
const char *vallist, size_t valsize)
{
return __argmatch_internal (arg, arglist, vallist, valsize, 0);
}
/* Error reporting for argmatch.
CONTEXT is a description of the type of entity that was being matched.
VALUE is the invalid value that was given.
PROBLEM is the return value from argmatch. */
void
argmatch_invalid (const char *context, const char *value, int problem)
{
enum quoting_style saved_quoting_style;
char const *format;
/* Make sure to have a good quoting style to report errors.
literal is insane here. */
saved_quoting_style = get_quoting_style (NULL);
set_quoting_style (NULL, ARGMATCH_QUOTING_STYLE);
format = (problem == -1
? _("invalid argument `%s' for `%s'")
: _("ambiguous argument `%s' for `%s'"));
error (0, 0, format, quotearg (value), context);
set_quoting_style (NULL, saved_quoting_style);
}
/* List the valid arguments for argmatch.
ARGLIST is the same as in argmatch.
VALLIST is a pointer to an array of values.
VALSIZE is the size of the elements of VALLIST */
void
argmatch_valid (const char *const *arglist,
const char *vallist, size_t valsize)
{
int i;
const char *last_val = NULL;
/* We try to put synonyms on the same line. The assumption is that
synonyms follow each other */
fprintf (stderr, _("Valid arguments are:"));
for (i = 0; arglist[i]; i++)
if ((i == 0)
|| memcmp (last_val, vallist + valsize * i, valsize))
{
fprintf (stderr, "\n - `%s'", arglist[i]);
last_val = vallist + valsize * i;
}
else
{
fprintf (stderr, ", `%s'", arglist[i]);
}
putc ('\n', stderr);
}
/* Never failing versions of the previous functions.
CONTEXT is the context for which argmatch is called (e.g.,
"--version-control", or "$VERSION_CONTROL" etc.). Upon failure,
calls the (supposed never to return) function EXIT_FN. */
int
__xargmatch_internal (const char *context,
const char *arg, const char *const *arglist,
const char *vallist, size_t valsize,
int case_sensitive,
argmatch_exit_fn exit_fn)
{
int res = __argmatch_internal (arg, arglist,
vallist, valsize,
case_sensitive);
if (res >= 0)
/* Success. */
return res;
/* We failed. Explain why. */
argmatch_invalid (context, arg, res);
argmatch_valid (arglist, vallist, valsize);
(*exit_fn) ();
return -1; /* To please the compilers. */
}
/* Look for VALUE in VALLIST, an array of objects of size VALSIZE and
return the first corresponding argument in ARGLIST */
const char *
argmatch_to_argument (const char *value,
const char *const *arglist,
const char *vallist, size_t valsize)
{
int i;
for (i = 0; arglist[i]; i++)
if (!memcmp (value, vallist + valsize * i, valsize))
return arglist[i];
return NULL;
}
#ifdef TEST
/*
* Based on "getversion.c" by David MacKenzie <djm@gnu.ai.mit.edu>
*/
char *program_name;
extern const char *getenv ();
/* When to make backup files. */
enum backup_type
{
/* Never make backups. */
none,
/* Make simple backups of every file. */
simple,
/* Make numbered backups of files that already have numbered backups,
and simple backups of the others. */
numbered_existing,
/* Make numbered backups of every file. */
numbered
};
/* Two tables describing arguments (keys) and their corresponding
values */
static const char *const backup_args[] =
{
"no", "none", "off",
"simple", "never",
"existing", "nil",
"numbered", "t",
0
};
static const enum backup_type backup_vals[] =
{
none, none, none,
simple, simple,
numbered_existing, numbered_existing,
numbered, numbered
};
int
main (int argc, const char *const *argv)
{
const char *cp;
enum backup_type backup_type = none;
program_name = (char *) argv[0];
if (argc > 2)
{
fprintf (stderr, "Usage: %s [VERSION_CONTROL]\n", program_name);
exit (1);
}
if ((cp = getenv ("VERSION_CONTROL")))
backup_type = XARGCASEMATCH ("$VERSION_CONTROL", cp,
backup_args, backup_vals);
if (argc == 2)
backup_type = XARGCASEMATCH (program_name, argv[1],
backup_args, backup_vals);
printf ("The version control is `%s'\n",
ARGMATCH_TO_ARGUMENT (backup_type, backup_args, backup_vals));
return 0;
}
#endif

View File

@@ -1,9 +0,0 @@
#ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
#endif
char *base_name PARAMS ((char const *name));

View File

@@ -1,368 +0,0 @@
/* Error handler for noninteractive utilities
Copyright (C) 1990-1998, 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <libintl.h>
#ifdef _LIBC
# include <wchar.h>
# define mbsrtowcs __mbsrtowcs
#endif
#if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC
# if __STDC__
# include <stdarg.h>
# define VA_START(args, lastarg) va_start(args, lastarg)
# else
# include <varargs.h>
# define VA_START(args, lastarg) va_start(args)
# endif
#else
# define va_alist a1, a2, a3, a4, a5, a6, a7, a8
# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
#endif
#if STDC_HEADERS || _LIBC
# include <stdlib.h>
# include <string.h>
#else
void exit ();
#endif
#include "error.h"
#ifndef _
# define _(String) String
#endif
/* If NULL, error will flush stdout, then print on stderr the program
name, a colon and a space. Otherwise, error will call this
function without parameters instead. */
void (*error_print_progname) (
#if __STDC__ - 0
void
#endif
);
/* This variable is incremented each time `error' is called. */
unsigned int error_message_count;
#ifdef _LIBC
/* In the GNU C library, there is a predefined variable for this. */
# define program_name program_invocation_name
# include <errno.h>
/* In GNU libc we want do not want to use the common name `error' directly.
Instead make it a weak alias. */
extern void __error (int status, int errnum, const char *message, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
extern void __error_at_line (int status, int errnum, const char *file_name,
unsigned int line_number, const char *message,
...)
__attribute__ ((__format__ (__printf__, 5, 6)));;
# define error __error
# define error_at_line __error_at_line
# ifdef USE_IN_LIBIO
# include <libio/iolibio.h>
# define fflush(s) _IO_fflush (s)
# endif
#else /* not _LIBC */
/* The calling program should define program_name and set it to the
name of the executing program. */
extern char *program_name;
# ifdef HAVE_STRERROR_R
# define __strerror_r strerror_r
# else
# if HAVE_STRERROR
# ifndef strerror /* On some systems, strerror is a macro */
char *strerror ();
# endif
# else
static char *
private_strerror (errnum)
int errnum;
{
extern char *sys_errlist[];
extern int sys_nerr;
if (errnum > 0 && errnum <= sys_nerr)
return _(sys_errlist[errnum]);
return _("Unknown system error");
}
# define strerror private_strerror
# endif /* HAVE_STRERROR */
# endif /* HAVE_STRERROR_R */
#endif /* not _LIBC */
#ifdef VA_START
static void
error_tail (int status, int errnum, const char *message, va_list args)
{
# if HAVE_VPRINTF || _LIBC
# if _LIBC && USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
{
# define ALLOCA_LIMIT 2000
size_t len = strlen (message) + 1;
wchar_t *wmessage = NULL;
mbstate_t st;
size_t res;
const char *tmp;
do
{
if (len < ALLOCA_LIMIT)
wmessage = (wchar_t *) alloca (len * sizeof (wchar_t));
else
{
if (wmessage != NULL && len / 2 < ALLOCA_LIMIT)
wmessage = NULL;
wmessage = (wchar_t *) realloc (wmessage,
len * sizeof (wchar_t));
if (wmessage == NULL)
{
fputws_unlocked (L"out of memory\n", stderr);
return;
}
}
memset (&st, '\0', sizeof (st));
tmp =message;
}
while ((res = mbsrtowcs (wmessage, &tmp, len, &st)) == len);
if (res == (size_t) -1)
/* The string cannot be converted. */
wmessage = (wchar_t *) L"???";
__vfwprintf (stderr, wmessage, args);
}
else
# endif
vfprintf (stderr, message, args);
# else
_doprnt (message, args, stderr);
# endif
va_end (args);
++error_message_count;
if (errnum)
{
#if defined HAVE_STRERROR_R || _LIBC
char errbuf[1024];
char *s = __strerror_r (errnum, errbuf, sizeof errbuf);
# if _LIBC && USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L": %s", s);
else
# endif
fprintf (stderr, ": %s", s);
#else
fprintf (stderr, ": %s", strerror (errnum));
#endif
}
#if _LIBC && USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
putwc (L'\n', stderr);
else
#endif
putc ('\n', stderr);
fflush (stderr);
if (status)
exit (status);
}
#endif
/* Print the program name and error message MESSAGE, which is a printf-style
format string with optional args.
If ERRNUM is nonzero, print its corresponding system error message.
Exit with status STATUS if it is nonzero. */
/* VARARGS */
void
#if defined VA_START && __STDC__
error (int status, int errnum, const char *message, ...)
#else
error (status, errnum, message, va_alist)
int status;
int errnum;
char *message;
va_dcl
#endif
{
#ifdef VA_START
va_list args;
#endif
fflush (stdout);
#ifdef _LIBC
# ifdef USE_IN_LIBIO
_IO_flockfile (stderr);
# else
__flockfile (stderr);
# endif
#endif
if (error_print_progname)
(*error_print_progname) ();
else
{
#if _LIBC && USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s: ", program_name);
else
#endif
fprintf (stderr, "%s: ", program_name);
}
#ifdef VA_START
VA_START (args, message);
error_tail (status, errnum, message, args);
#else
fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8);
++error_message_count;
if (errnum)
fprintf (stderr, ": %s", strerror (errnum));
putc ('\n', stderr);
fflush (stderr);
if (status)
exit (status);
#endif
#ifdef _LIBC
# ifdef USE_IN_LIBIO
_IO_funlockfile (stderr);
# else
__funlockfile (stderr);
# endif
#endif
}
/* Sometimes we want to have at most one error per line. This
variable controls whether this mode is selected or not. */
int error_one_per_line;
void
#if defined VA_START && __STDC__
error_at_line (int status, int errnum, const char *file_name,
unsigned int line_number, const char *message, ...)
#else
error_at_line (status, errnum, file_name, line_number, message, va_alist)
int status;
int errnum;
const char *file_name;
unsigned int line_number;
char *message;
va_dcl
#endif
{
#ifdef VA_START
va_list args;
#endif
if (error_one_per_line)
{
static const char *old_file_name;
static unsigned int old_line_number;
if (old_line_number == line_number
&& (file_name == old_file_name
|| strcmp (old_file_name, file_name) == 0))
/* Simply return and print nothing. */
return;
old_file_name = file_name;
old_line_number = line_number;
}
fflush (stdout);
#ifdef _LIBC
# ifdef USE_IN_LIBIO
_IO_flockfile (stderr);
# else
__flockfile (stderr);
# endif
#endif
if (error_print_progname)
(*error_print_progname) ();
else
{
#if _LIBC && USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s: ", program_name);
else
#endif
fprintf (stderr, "%s:", program_name);
}
if (file_name != NULL)
{
#if _LIBC && USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s:%d: ", file_name, line_number);
else
#endif
fprintf (stderr, "%s:%d: ", file_name, line_number);
}
#ifdef VA_START
VA_START (args, message);
error_tail (status, errnum, message, args);
#else
fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8);
++error_message_count;
if (errnum)
fprintf (stderr, ": %s", strerror (errnum));
putc ('\n', stderr);
fflush (stderr);
if (status)
exit (status);
#endif
#ifdef _LIBC
# ifdef USE_IN_LIBIO
_IO_funlockfile (stderr);
# else
__funlockfile (stderr);
# endif
#endif
}
#ifdef _LIBC
/* Make the weak alias. */
# undef error
# undef error_at_line
weak_alias (__error, error)
weak_alias (__error_at_line, error_at_line)
#endif

View File

@@ -1,127 +0,0 @@
/* exclude.c -- exclude file names
Copyright 1992, 1993, 1994, 1997 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING.
If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by Paul Eggert <eggert@twinsun.com> */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <errno.h>
#ifndef errno
extern int errno;
#endif
#include <exclude.h>
#include <fnmatch.h>
#include <stdio.h>
#include <sys/types.h>
void *xmalloc PARAMS ((size_t));
void *xrealloc PARAMS ((void *, size_t));
/* Keep track of excluded file name patterns. */
struct exclude
{
char const **exclude;
int exclude_alloc;
int exclude_count;
};
struct exclude *
new_exclude (void)
{
struct exclude *ex = (struct exclude *) xmalloc (sizeof (struct exclude));
ex->exclude_count = 0;
ex->exclude_alloc = 64;
ex->exclude = (char const **) xmalloc (ex->exclude_alloc * sizeof (char *));
return ex;
}
int
excluded_filename (struct exclude const *ex, char const *f)
{
char const * const *exclude = ex->exclude;
int exclude_count = ex->exclude_count;
int i;
for (i = 0; i < exclude_count; i++)
if (fnmatch (exclude[i], f, 0) == 0)
return 1;
return 0;
}
void
add_exclude (struct exclude *ex, char const *pattern)
{
if (ex->exclude_alloc <= ex->exclude_count)
ex->exclude = (char const **) xrealloc (ex->exclude,
((ex->exclude_alloc *= 2)
* sizeof (char *)));
ex->exclude[ex->exclude_count++] = pattern;
}
int
add_exclude_file (struct exclude *ex, char const *filename, char line_end)
{
int use_stdin = filename[0] == '-' && !filename[1];
FILE *in;
char *buf;
char *p;
char const *pattern;
char const *lim;
size_t buf_alloc = 1024;
size_t buf_count = 0;
int c;
int e = 0;
if (use_stdin)
in = stdin;
else if (! (in = fopen (filename, "r")))
return -1;
buf = xmalloc (buf_alloc);
while ((c = getc (in)) != EOF)
{
buf[buf_count++] = c;
if (buf_count == buf_alloc)
buf = xrealloc (buf, buf_alloc *= 2);
}
buf = xrealloc (buf, buf_count + 1);
if (ferror (in))
e = errno;
if (!use_stdin && fclose (in) != 0)
e = errno;
for (pattern = p = buf, lim = buf + buf_count; p <= lim; p++)
if (p < lim ? *p == line_end : buf < p && p[-1])
{
*p = '\0';
add_exclude (ex, pattern);
pattern = p + 1;
}
errno = e;
return e ? -1 : 0;
}

View File

@@ -1,34 +0,0 @@
/* exclude.h -- declarations for excluding file names
Copyright 1992, 1993, 1994, 1997 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING.
If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by Paul Eggert <eggert@twinsun.com> */
#ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
#endif
struct exclude;
struct exclude *new_exclude PARAMS ((void));
void add_exclude PARAMS ((struct exclude *, char const *));
int add_exclude_file PARAMS ((struct exclude *, char const *, char));
int excluded_filename PARAMS ((struct exclude const *, char const *));

View File

@@ -1,230 +0,0 @@
/* Copyright 1991, 1992, 1993, 1996, 1997, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
/* Enable GNU extensions in fnmatch.h. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
#include <errno.h>
#include <fnmatch.h>
#include <ctype.h>
#if defined STDC_HEADERS || !defined isascii
# define IN_CTYPE_DOMAIN(c) 1
#else
# define IN_CTYPE_DOMAIN(c) isascii (c)
#endif
#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
#ifndef errno
extern int errno;
#endif
/* Match STRING against the filename pattern PATTERN, returning zero if
it matches, nonzero if not. */
int
fnmatch (const char *pattern, const char *string, int flags)
{
register const char *p = pattern, *n = string;
register char c;
/* Note that this evaluates C many times. */
#define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER ((unsigned char) (c)) \
? tolower ((unsigned char) (c)) \
: (c))
while ((c = *p++) != '\0')
{
c = FOLD (c);
switch (c)
{
case '?':
if (*n == '\0')
return FNM_NOMATCH;
else if ((flags & FNM_FILE_NAME) && *n == '/')
return FNM_NOMATCH;
else if ((flags & FNM_PERIOD) && *n == '.' &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
return FNM_NOMATCH;
break;
case '\\':
if (!(flags & FNM_NOESCAPE))
{
c = *p++;
if (c == '\0')
/* Trailing \ loses. */
return FNM_NOMATCH;
c = FOLD (c);
}
if (FOLD (*n) != c)
return FNM_NOMATCH;
break;
case '*':
if ((flags & FNM_PERIOD) && *n == '.' &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
return FNM_NOMATCH;
for (c = *p++; c == '?' || c == '*'; c = *p++)
{
if (c == '?')
{
/* A ? needs to match one character. */
if (*n == '\0' || (*n == '/' && (flags & FNM_FILE_NAME)))
/* There isn't another character; no match. */
return FNM_NOMATCH;
else
/* One character of the string is consumed in matching
this ? wildcard, so *??? won't match if there are
less than three characters. */
++n;
}
}
if (c == '\0')
{
if ((flags & (FNM_FILE_NAME | FNM_LEADING_DIR)) == FNM_FILE_NAME)
for (; *n != '\0'; n++)
if (*n == '/')
return FNM_NOMATCH;
return 0;
}
{
char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
c1 = FOLD (c1);
for (--p; *n != '\0'; ++n)
if ((c == '[' || FOLD (*n) == c1) &&
fnmatch (p, n, flags & ~FNM_PERIOD) == 0)
return 0;
else if (*n == '/' && (flags & FNM_FILE_NAME))
break;
return FNM_NOMATCH;
}
case '[':
{
/* Nonzero if the sense of the character class is inverted. */
register int not;
if (*n == '\0')
return FNM_NOMATCH;
if ((flags & FNM_PERIOD) && *n == '.' &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
return FNM_NOMATCH;
not = (*p == '!' || *p == '^');
if (not)
++p;
c = *p++;
for (;;)
{
register char cstart = c, cend = c;
if (!(flags & FNM_NOESCAPE) && c == '\\')
{
if (*p == '\0')
return FNM_NOMATCH;
cstart = cend = *p++;
}
cstart = cend = FOLD (cstart);
if (c == '\0')
/* [ (unterminated) loses. */
return FNM_NOMATCH;
c = *p++;
c = FOLD (c);
if ((flags & FNM_FILE_NAME) && c == '/')
/* [/] can never match. */
return FNM_NOMATCH;
if (c == '-' && *p != ']')
{
cend = *p++;
if (!(flags & FNM_NOESCAPE) && cend == '\\')
cend = *p++;
if (cend == '\0')
return FNM_NOMATCH;
cend = FOLD (cend);
c = *p++;
}
if (FOLD (*n) >= cstart && FOLD (*n) <= cend)
goto matched;
if (c == ']')
break;
}
if (!not)
return FNM_NOMATCH;
break;
matched:;
/* Skip the rest of the [...] that already matched. */
while (c != ']')
{
if (c == '\0')
/* [... (unterminated) loses. */
return FNM_NOMATCH;
c = *p++;
if (!(flags & FNM_NOESCAPE) && c == '\\')
{
if (*p == '\0')
return FNM_NOMATCH;
/* XXX 1003.2d11 is unclear if this is right. */
++p;
}
}
if (not)
return FNM_NOMATCH;
}
break;
default:
if (c != FOLD (*n))
return FNM_NOMATCH;
}
++n;
}
if (*n == '\0')
return 0;
if ((flags & FNM_LEADING_DIR) && *n == '/')
/* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */
return 0;
return FNM_NOMATCH;
#undef FOLD
}

View File

@@ -1,84 +0,0 @@
/* Copyright (C) 1991, 92, 93, 96, 97, 98 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _FNMATCH_H
#define _FNMATCH_H 1
#ifdef __cplusplus
extern "C" {
#endif
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
# if !defined __GLIBC__ || !defined __P
# undef __P
# define __P(protos) protos
# endif
#else /* Not C++ or ANSI C. */
# undef __P
# define __P(protos) ()
/* We can get away without defining `const' here only because in this file
it is used only inside the prototype for `fnmatch', which is elided in
non-ANSI C where `const' is problematical. */
#endif /* C++ or ANSI C. */
#ifndef const
# if (defined __STDC__ && __STDC__) || defined __cplusplus
# define __const const
# else
# define __const
# endif
#endif
/* We #undef these before defining them because some losing systems
(HP-UX A.08.07 for example) define these in <unistd.h>. */
#undef FNM_PATHNAME
#undef FNM_NOESCAPE
#undef FNM_PERIOD
/* Bits set in the FLAGS argument to `fnmatch'. */
#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
# define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
#endif
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
#define FNM_NOMATCH 1
/* This value is returned if the implementation does not support
`fnmatch'. Since this is not the case here it will never be
returned but the conformance test suites still require the symbol
to be defined. */
#ifdef _XOPEN_SOURCE
# define FNM_NOSYS (-1)
#endif
/* Match STRING against the filename pattern PATTERN,
returning zero if it matches, FNM_NOMATCH if not. */
extern int fnmatch __P ((__const char *__pattern, __const char *__string,
int __flags));
#ifdef __cplusplus
}
#endif
#endif /* fnmatch.h */

View File

@@ -1,474 +0,0 @@
/* Copyright (C) 1991-1993, 1996-1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Match STRING against the filename pattern PATTERN, returning zero if
it matches, nonzero if not. */
static int FCT (const CHAR *pattern, const CHAR *string,
int no_leading_period, int flags) internal_function;
static int
internal_function
FCT (pattern, string, no_leading_period, flags)
const CHAR *pattern;
const CHAR *string;
int no_leading_period;
int flags;
{
register const CHAR *p = pattern, *n = string;
register UCHAR c;
#ifdef _LIBC
const UCHAR *collseq = (const UCHAR *)
_NL_CURRENT(LC_COLLATE, CONCAT(_NL_COLLATE_COLLSEQ,SUFFIX));
# ifdef WIDE_CHAR_VERSION
const wint_t *names = (const wint_t *)
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_NAMES);
size_t size = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_HASH_SIZE);
size_t layers = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_HASH_LAYERS);
# endif
#endif
while ((c = *p++) != L('\0'))
{
c = FOLD (c);
switch (c)
{
case L('?'):
if (*n == L('\0'))
return FNM_NOMATCH;
else if (*n == L('/') && (flags & FNM_FILE_NAME))
return FNM_NOMATCH;
else if (*n == L('.') && no_leading_period
&& (n == string
|| (n[-1] == L('/') && (flags & FNM_FILE_NAME))))
return FNM_NOMATCH;
break;
case L('\\'):
if (!(flags & FNM_NOESCAPE))
{
c = *p++;
if (c == L('\0'))
/* Trailing \ loses. */
return FNM_NOMATCH;
c = FOLD (c);
}
if (FOLD ((UCHAR) *n) != c)
return FNM_NOMATCH;
break;
case L('*'):
if (*n == L('.') && no_leading_period
&& (n == string
|| (n[-1] == L('/') && (flags & FNM_FILE_NAME))))
return FNM_NOMATCH;
for (c = *p++; c == L('?') || c == L('*'); c = *p++)
{
if (*n == L('/') && (flags & FNM_FILE_NAME))
/* A slash does not match a wildcard under FNM_FILE_NAME. */
return FNM_NOMATCH;
else if (c == L('?'))
{
/* A ? needs to match one character. */
if (*n == L('\0'))
/* There isn't another character; no match. */
return FNM_NOMATCH;
else
/* One character of the string is consumed in matching
this ? wildcard, so *??? won't match if there are
less than three characters. */
++n;
}
}
if (c == L('\0'))
/* The wildcard(s) is/are the last element of the pattern.
If the name is a file name and contains another slash
this does mean it cannot match. If the FNM_LEADING_DIR
flag is set and exactly one slash is following, we have
a match. */
{
int result = (flags & FNM_FILE_NAME) == 0 ? 0 : FNM_NOMATCH;
if (flags & FNM_FILE_NAME)
{
const CHAR *slashp = STRCHR (n, L('/'));
if (flags & FNM_LEADING_DIR)
{
if (slashp != NULL
&& STRCHR (slashp + 1, L('/')) == NULL)
result = 0;
}
else
{
if (slashp == NULL)
result = 0;
}
}
return result;
}
else
{
const CHAR *endp;
endp = STRCHRNUL (n, (flags & FNM_FILE_NAME) ? L('/') : L('\0'));
if (c == L('['))
{
int flags2 = ((flags & FNM_FILE_NAME)
? flags : (flags & ~FNM_PERIOD));
for (--p; n < endp; ++n)
if (FCT (p, n, (no_leading_period
&& (n == string
|| (n[-1] == L('/')
&& (flags & FNM_FILE_NAME)))),
flags2) == 0)
return 0;
}
else if (c == L('/') && (flags & FNM_FILE_NAME))
{
while (*n != L('\0') && *n != L('/'))
++n;
if (*n == L('/')
&& (FCT (p, n + 1, flags & FNM_PERIOD, flags) == 0))
return 0;
}
else
{
int flags2 = ((flags & FNM_FILE_NAME)
? flags : (flags & ~FNM_PERIOD));
if (c == L('\\') && !(flags & FNM_NOESCAPE))
c = *p;
c = FOLD (c);
for (--p; n < endp; ++n)
if (FOLD ((UCHAR) *n) == c
&& (FCT (p, n, (no_leading_period
&& (n == string
|| (n[-1] == L('/')
&& (flags & FNM_FILE_NAME)))),
flags2) == 0))
return 0;
}
}
/* If we come here no match is possible with the wildcard. */
return FNM_NOMATCH;
case L('['):
{
/* Nonzero if the sense of the character class is inverted. */
static int posixly_correct;
register int not;
CHAR cold;
if (posixly_correct == 0)
posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1;
if (*n == L('\0'))
return FNM_NOMATCH;
if (*n == L('.') && no_leading_period
&& (n == string
|| (n[-1] == L('/') && (flags & FNM_FILE_NAME))))
return FNM_NOMATCH;
if (*n == L('/') && (flags & FNM_FILE_NAME))
/* `/' cannot be matched. */
return FNM_NOMATCH;
not = (*p == L('!') || (posixly_correct < 0 && *p == L('^')));
if (not)
++p;
c = *p++;
for (;;)
{
UCHAR fn = FOLD ((UCHAR) *n);
if (!(flags & FNM_NOESCAPE) && c == L('\\'))
{
if (*p == L('\0'))
return FNM_NOMATCH;
c = FOLD ((UCHAR) *p);
++p;
if (c == fn)
goto matched;
}
else if (c == L('[') && *p == L(':'))
{
/* Leave room for the null. */
CHAR str[CHAR_CLASS_MAX_LENGTH + 1];
size_t c1 = 0;
#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
wctype_t wt;
#endif
const CHAR *startp = p;
for (;;)
{
if (c1 == CHAR_CLASS_MAX_LENGTH)
/* The name is too long and therefore the pattern
is ill-formed. */
return FNM_NOMATCH;
c = *++p;
if (c == L(':') && p[1] == L(']'))
{
p += 2;
break;
}
if (c < L('a') || c >= L('z'))
{
/* This cannot possibly be a character class name.
Match it as a normal range. */
p = startp;
c = L('[');
goto normal_bracket;
}
str[c1++] = c;
}
str[c1] = L('\0');
#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
wt = IS_CHAR_CLASS (str);
if (wt == 0)
/* Invalid character class name. */
return FNM_NOMATCH;
if (ISWCTYPE (BTOWC ((UCHAR) *n), wt))
goto matched;
#else
if ((STREQ (str, L("alnum")) && ISALNUM ((UCHAR) *n))
|| (STREQ (str, L("alpha")) && ISALPHA ((UCHAR) *n))
|| (STREQ (str, L("blank")) && ISBLANK ((UCHAR) *n))
|| (STREQ (str, L("cntrl")) && ISCNTRL ((UCHAR) *n))
|| (STREQ (str, L("digit")) && ISDIGIT ((UCHAR) *n))
|| (STREQ (str, L("graph")) && ISGRAPH ((UCHAR) *n))
|| (STREQ (str, L("lower")) && ISLOWER ((UCHAR) *n))
|| (STREQ (str, L("print")) && ISPRINT ((UCHAR) *n))
|| (STREQ (str, L("punct")) && ISPUNCT ((UCHAR) *n))
|| (STREQ (str, L("space")) && ISSPACE ((UCHAR) *n))
|| (STREQ (str, L("upper")) && ISUPPER ((UCHAR) *n))
|| (STREQ (str, L("xdigit")) && ISXDIGIT ((UCHAR) *n)))
goto matched;
#endif
}
else if (c == L('\0'))
/* [ (unterminated) loses. */
return FNM_NOMATCH;
else
{
c = FOLD (c);
normal_bracket:
if (c == fn)
goto matched;
cold = c;
c = *p++;
if (c == L('-') && *p != L(']'))
{
#if _LIBC
/* We have to find the collation sequence
value for C. Collation sequence is nothing
we can regularly access. The sequence
value is defined by the order in which the
definitions of the collation values for the
various characters appear in the source
file. A strange concept, nowhere
documented. */
int32_t fseqidx;
int32_t lseqidx;
UCHAR cend = *p++;
# ifdef WIDE_CHAR_VERSION
size_t cnt;
# endif
if (!(flags & FNM_NOESCAPE) && cend == L('\\'))
cend = *p++;
if (cend == L('\0'))
return FNM_NOMATCH;
# ifdef WIDE_CHAR_VERSION
/* Search in the `names' array for the characters. */
fseqidx = fn % size;
cnt = 0;
while (names[fseqidx] != fn)
{
if (++cnt == layers)
/* XXX We don't know anything about
the character we are supposed to
match. This means we are failing. */
goto range_not_matched;
fseqidx += size;
}
lseqidx = cold % size;
cnt = 0;
while (names[lseqidx] != cold)
{
if (++cnt == layers)
{
lseqidx = -1;
break;
}
lseqidx += size;
}
# else
fseqidx = fn;
lseqidx = cold;
# endif
/* XXX It is not entirely clear to me how to handle
characters which are not mentioned in the
collation specification. */
if (
# ifdef WIDE_CHAR_VERSION
lseqidx == -1 ||
# endif
collseq[lseqidx] <= collseq[fseqidx])
{
/* We have to look at the upper bound. */
int32_t hseqidx;
cend = FOLD (cend);
# ifdef WIDE_CHAR_VERSION
hseqidx = cend % size;
cnt = 0;
while (names[hseqidx] != cend)
{
if (++cnt == layers)
{
/* Hum, no information about the upper
bound. The matching succeeds if the
lower bound is matched exactly. */
if (lseqidx == -1 || cold != fn)
goto range_not_matched;
goto matched;
}
}
# else
hseqidx = cend;
# endif
if (
# ifdef WIDE_CHAR_VERSION
(lseqidx == -1
&& collseq[fseqidx] == collseq[hseqidx]) ||
# endif
collseq[fseqidx] <= collseq[hseqidx])
goto matched;
}
# ifdef WIDE_CHAR_VERSION
range_not_matched:
# endif
#else
/* We use a boring value comparison of the character
values. This is better than comparing using
`strcoll' since the latter would have surprising
and sometimes fatal consequences. */
UCHAR cend = *p++;
if (!(flags & FNM_NOESCAPE) && cend == L('\\'))
cend = *p++;
if (cend == L('\0'))
return FNM_NOMATCH;
/* It is a range. */
if (cold <= fc && fc <= c)
goto matched;
#endif
c = *p++;
}
}
if (c == L(']'))
break;
}
if (!not)
return FNM_NOMATCH;
break;
matched:
/* Skip the rest of the [...] that already matched. */
while (c != L(']'))
{
if (c == L('\0'))
/* [... (unterminated) loses. */
return FNM_NOMATCH;
c = *p++;
if (!(flags & FNM_NOESCAPE) && c == L('\\'))
{
if (*p == L('\0'))
return FNM_NOMATCH;
/* XXX 1003.2d11 is unclear if this is right. */
++p;
}
else if (c == L('[') && *p == L(':'))
{
do
if (*++p == L('\0'))
return FNM_NOMATCH;
while (*p != L(':') || p[1] == L(']'));
p += 2;
c = *p;
}
}
if (not)
return FNM_NOMATCH;
}
break;
default:
if (c != FOLD ((UCHAR) *n))
return FNM_NOMATCH;
}
++n;
}
if (*n == '\0')
return 0;
if ((flags & FNM_LEADING_DIR) && *n == L('/'))
/* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */
return 0;
return FNM_NOMATCH;
}
#undef FOLD
#undef CHAR
#undef UCHAR
#undef FCT
#undef STRCHR
#undef STRCHRNUL
#undef STRCOLL
#undef L
#undef BTOWC
#undef SUFFIX

View File

@@ -1,50 +0,0 @@
/* full-read.c -- an interface to read that retries after interrupts
Copyright (C) 1993, 1994, 1997, 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <errno.h>
#ifndef errno
extern int errno;
#endif
/* Read LEN bytes at PTR from descriptor DESC, retrying if interrupted.
Return the actual number of bytes read, zero for EOF, or negative
for an error. */
ssize_t
full_read (int desc, char *ptr, size_t len)
{
for (;;)
{
ssize_t n = read (desc, ptr, len);
#ifdef EINTR
if (n < 0 && errno == EINTR)
continue;
#endif
return n;
}
}

View File

@@ -1,67 +0,0 @@
/* full-write.c -- an interface to write that retries after interrupts
Copyright 1993, 1994, 1997, 1998, 1999, 2000, 2001 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Written by Paul Eggert. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#include "full-write.h"
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <errno.h>
#ifndef errno
extern int errno;
#endif
/* Write LEN bytes at PTR to descriptor DESC, retrying if interrupted
or if partial writes occur. Return the number of bytes successfully
written, setting errno if that is less than LEN. */
size_t
full_write (int desc, const char *ptr, size_t len)
{
size_t total_written = 0;
while (len > 0)
{
ssize_t written = write (desc, ptr, len);
if (written <= 0)
{
/* Some buggy drivers return 0 when you fall off a device's end. */
if (written == 0)
errno = ENOSPC;
#ifdef EINTR
if (errno == EINTR)
continue;
#endif
break;
}
total_written += written;
ptr += written;
len -= written;
}
return total_written;
}

View File

@@ -1,9 +0,0 @@
#ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
#endif
size_t full_write PARAMS ((int, const char *, size_t));

File diff suppressed because it is too large Load Diff

View File

@@ -1,335 +0,0 @@
/* human.c -- print human readable file size
Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Originally contributed by lm@sgi.com;
--si, output block size selection, and large file support
added by eggert@twinsun.com. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#include <stdio.h>
#if HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
#endif
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#ifndef HAVE_DECL_GETENV
"this configure-time declaration test was not run"
#endif
#if !HAVE_DECL_GETENV
char *getenv ();
#endif
#if ENABLE_NLS
# include <libintl.h>
# define _(Text) gettext (Text)
#else
# define _(Text) Text
#endif
#include <argmatch.h>
#include <error.h>
#include <xstrtol.h>
#include "human.h"
static const char suffixes[] =
{
0, /* not used */
'k', /* kilo */
'M', /* Mega */
'G', /* Giga */
'T', /* Tera */
'P', /* Peta */
'E', /* Exa */
'Z', /* Zetta */
'Y' /* Yotta */
};
/* If INEXACT_STYLE is not human_round_to_even, and if easily
possible, adjust VALUE according to the style. */
static double
adjust_value (enum human_inexact_style inexact_style, double value)
{
/* Do not use the floor or ceil functions, as that would mean
linking with the standard math library, which is a porting pain.
So leave the value alone if it is too large to easily round. */
if (inexact_style != human_round_to_even && value < (uintmax_t) -1)
{
uintmax_t u = value;
value = u + (inexact_style == human_ceiling && u != value);
}
return value;
}
/* Like human_readable_inexact, except always round to even. */
char *
human_readable (uintmax_t n, char *buf,
int from_block_size, int output_block_size)
{
return human_readable_inexact (n, buf, from_block_size, output_block_size,
human_round_to_even);
}
/* Convert N to a human readable format in BUF.
N is expressed in units of FROM_BLOCK_SIZE. FROM_BLOCK_SIZE must
be nonnegative.
OUTPUT_BLOCK_SIZE must be nonzero. If it is positive, use units of
OUTPUT_BLOCK_SIZE in the output number.
Use INEXACT_STYLE to determine whether to take the ceiling or floor
of any result that cannot be expressed exactly.
If OUTPUT_BLOCK_SIZE is negative, use a format like "127k" if
possible, using powers of -OUTPUT_BLOCK_SIZE; otherwise, use
ordinary decimal format. Normally -OUTPUT_BLOCK_SIZE is either
1000 or 1024; it must be at least 2. Most people visually process
strings of 3-4 digits effectively, but longer strings of digits are
more prone to misinterpretation. Hence, converting to an
abbreviated form usually improves readability. Use a suffix
indicating which power is being used. For example, assuming
-OUTPUT_BLOCK_SIZE is 1024, 8500 would be converted to 8.3k,
133456345 to 127M, 56990456345 to 53G, and so on. Numbers smaller
than -OUTPUT_BLOCK_SIZE aren't modified. */
char *
human_readable_inexact (uintmax_t n, char *buf,
int from_block_size, int output_block_size,
enum human_inexact_style inexact_style)
{
uintmax_t amt;
int base;
int to_block_size;
int tenths = 0;
int power;
char *p;
/* 0 means adjusted N == AMT.TENTHS;
1 means AMT.TENTHS < adjusted N < AMT.TENTHS + 0.05;
2 means adjusted N == AMT.TENTHS + 0.05;
3 means AMT.TENTHS + 0.05 < adjusted N < AMT.TENTHS + 0.1. */
int rounding = 0;
if (output_block_size < 0)
{
base = -output_block_size;
to_block_size = 1;
}
else
{
base = 0;
to_block_size = output_block_size;
}
p = buf + LONGEST_HUMAN_READABLE;
*p = '\0';
#ifdef lint
/* Suppress `used before initialized' warning. */
power = 0;
#endif
/* Adjust AMT out of FROM_BLOCK_SIZE units and into TO_BLOCK_SIZE units. */
{
int multiplier;
int divisor;
int r2;
int r10;
if (to_block_size <= from_block_size
? (from_block_size % to_block_size != 0
|| (multiplier = from_block_size / to_block_size,
(amt = n * multiplier) / multiplier != n))
: (from_block_size == 0
|| to_block_size % from_block_size != 0
|| (divisor = to_block_size / from_block_size,
r10 = (n % divisor) * 10,
r2 = (r10 % divisor) * 2,
amt = n / divisor,
tenths = r10 / divisor,
rounding = r2 < divisor ? 0 < r2 : 2 + (divisor < r2),
0)))
{
/* Either the result cannot be computed easily using uintmax_t,
or from_block_size is zero. Fall back on floating point.
FIXME: This can yield answers that are slightly off. */
double damt = n * (from_block_size / (double) to_block_size);
if (! base)
sprintf (buf, "%.0f", adjust_value (inexact_style, damt));
else
{
double e = 1;
power = 0;
do
{
e *= base;
power++;
}
while (e * base <= damt && power < sizeof suffixes - 1);
damt /= e;
sprintf (buf, "%.1f%c", adjust_value (inexact_style, damt),
suffixes[power]);
if (4 < strlen (buf))
sprintf (buf, "%.0f%c",
adjust_value (inexact_style, damt * 10) / 10,
suffixes[power]);
}
return buf;
}
}
/* Use power of BASE notation if adjusted AMT is large enough. */
if (base && base <= amt)
{
power = 0;
do
{
int r10 = (amt % base) * 10 + tenths;
int r2 = (r10 % base) * 2 + (rounding >> 1);
amt /= base;
tenths = r10 / base;
rounding = (r2 < base
? 0 < r2 + rounding
: 2 + (base < r2 + rounding));
power++;
}
while (base <= amt && power < sizeof suffixes - 1);
*--p = suffixes[power];
if (amt < 10)
{
if (2 * (1 - (int) inexact_style)
< rounding + (tenths & (inexact_style == human_round_to_even)))
{
tenths++;
rounding = 0;
if (tenths == 10)
{
amt++;
tenths = 0;
}
}
if (amt < 10)
{
*--p = '0' + tenths;
*--p = '.';
tenths = rounding = 0;
}
}
}
if (inexact_style == human_ceiling
? 0 < tenths + rounding
: inexact_style == human_round_to_even
? 5 < tenths + (2 < rounding + (amt & 1))
: /* inexact_style == human_floor */ 0)
{
amt++;
if (amt == base && power < sizeof suffixes - 1)
{
*p = suffixes[power + 1];
*--p = '0';
*--p = '.';
amt = 1;
}
}
do
*--p = '0' + (int) (amt % 10);
while ((amt /= 10) != 0);
return p;
}
/* The default block size used for output. This number may change in
the future as disks get larger. */
#ifndef DEFAULT_BLOCK_SIZE
# define DEFAULT_BLOCK_SIZE 1024
#endif
static char const *const block_size_args[] = { "human-readable", "si", 0 };
static int const block_size_types[] = { -1024, -1000 };
static int
default_block_size (void)
{
return getenv ("POSIXLY_CORRECT") ? 512 : DEFAULT_BLOCK_SIZE;
}
static strtol_error
humblock (char const *spec, int *block_size)
{
int i;
if (! spec && ! (spec = getenv ("BLOCK_SIZE")))
*block_size = default_block_size ();
else if (0 <= (i = ARGMATCH (spec, block_size_args, block_size_types)))
*block_size = block_size_types[i];
else
{
char *ptr;
unsigned long val;
strtol_error e = xstrtoul (spec, &ptr, 0, &val, "eEgGkKmMpPtTyYzZ0");
if (e != LONGINT_OK)
return e;
if (*ptr)
return LONGINT_INVALID_SUFFIX_CHAR;
if ((int) val < 0 || val != (int) val)
return LONGINT_OVERFLOW;
*block_size = (int) val;
}
return LONGINT_OK;
}
void
human_block_size (char const *spec, int report_errors, int *block_size)
{
strtol_error e = humblock (spec, block_size);
if (*block_size == 0)
{
*block_size = default_block_size ();
e = LONGINT_INVALID;
}
if (e != LONGINT_OK && report_errors)
STRTOL_FATAL_ERROR (spec, _("block size"), e);
}

View File

@@ -1,46 +0,0 @@
#ifndef HUMAN_H_
# define HUMAN_H_ 1
# if HAVE_CONFIG_H
# include <config.h>
# endif
# if HAVE_INTTYPES_H
# include <inttypes.h>
# endif
# if HAVE_LIMITS_H
# include <limits.h>
# endif
# ifndef CHAR_BIT
# define CHAR_BIT 8
# endif
/* A conservative bound on the maximum length of a human-readable string.
The output can be the product of the largest uintmax_t and the largest int,
so add their sizes before converting to a bound on digits. */
# define LONGEST_HUMAN_READABLE ((sizeof (uintmax_t) + sizeof (int)) \
* CHAR_BIT / 3)
# ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
# endif
enum human_inexact_style
{
human_floor = -1,
human_round_to_even = 0,
human_ceiling = 1
};
char *human_readable PARAMS ((uintmax_t, char *, int, int));
char *human_readable_inexact PARAMS ((uintmax_t, char *, int, int,
enum human_inexact_style));
void human_block_size PARAMS ((char const *, int, int *));
#endif /* HUMAN_H_ */

View File

@@ -1,9 +0,0 @@
/* Some systems don't have ENOSYS. */
#ifndef ENOSYS
# ifdef ENOTSUP
# define ENOSYS ENOTSUP
# else
/* Some systems don't have ENOTSUP either. */
# define ENOSYS ENOMSG
# endif
#endif

View File

@@ -1,445 +0,0 @@
/* modechange.c -- file mode manipulation
Copyright (C) 1989, 1990, 1997, 1998, 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by David MacKenzie <djm@ai.mit.edu> */
/* The ASCII mode string is compiled into a linked list of `struct
modechange', which can then be applied to each file to be changed.
We do this instead of re-parsing the ASCII string for each file
because the compiled form requires less computation to use; when
changing the mode of many files, this probably results in a
performance gain. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include "modechange.h"
#include <sys/stat.h>
#include "xstrtol.h"
#if STDC_HEADERS
# include <stdlib.h>
#else
char *malloc ();
#endif
#ifndef NULL
# define NULL 0
#endif
#if STAT_MACROS_BROKEN
# undef S_ISDIR
#endif
#if !defined(S_ISDIR) && defined(S_IFDIR)
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
#ifndef S_ISUID
# define S_ISUID 04000
#endif
#ifndef S_ISGID
# define S_ISGID 04000
#endif
#ifndef S_ISVTX
# define S_ISVTX 01000
#endif
#ifndef S_IRUSR
# define S_IRUSR 0400
#endif
#ifndef S_IWUSR
# define S_IWUSR 0200
#endif
#ifndef S_IXUSR
# define S_IXUSR 0100
#endif
#ifndef S_IRGRP
# define S_IRGRP 0040
#endif
#ifndef S_IWGRP
# define S_IWGRP 0020
#endif
#ifndef S_IXGRP
# define S_IXGRP 0010
#endif
#ifndef S_IROTH
# define S_IROTH 0004
#endif
#ifndef S_IWOTH
# define S_IWOTH 0002
#endif
#ifndef S_IXOTH
# define S_IXOTH 0001
#endif
#ifndef S_IRWXU
# define S_IRWXU 0700
#endif
#ifndef S_IRWXG
# define S_IRWXG 0070
#endif
#ifndef S_IRWXO
# define S_IRWXO 0007
#endif
/* All the mode bits that can be affected by chmod. */
#define CHMOD_MODE_BITS \
(S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO)
/* Return newly allocated memory to hold one element of type TYPE. */
#define talloc(type) ((type *) malloc (sizeof (type)))
/* Create a mode_change entry with the specified `=ddd'-style
mode change operation, where NEW_MODE is `ddd'. Return the
new entry, or NULL upon failure. */
static struct mode_change *
make_node_op_equals (mode_t new_mode)
{
struct mode_change *p;
p = talloc (struct mode_change);
if (p == NULL)
return p;
p->next = NULL;
p->op = '=';
p->flags = 0;
p->value = new_mode;
p->affected = CHMOD_MODE_BITS; /* Affect all permissions. */
return p;
}
/* Append entry E to the end of the link list with the specified
HEAD and TAIL. */
static void
mode_append_entry (struct mode_change **head,
struct mode_change **tail,
struct mode_change *e)
{
if (*head == NULL)
*head = *tail = e;
else
{
(*tail)->next = e;
*tail = e;
}
}
/* Return a linked list of file mode change operations created from
MODE_STRING, an ASCII string that contains either an octal number
specifying an absolute mode, or symbolic mode change operations with
the form:
[ugoa...][[+-=][rwxXstugo...]...][,...]
MASKED_OPS is a bitmask indicating which symbolic mode operators (=+-)
should not affect bits set in the umask when no users are given.
Operators not selected in MASKED_OPS ignore the umask.
Return MODE_INVALID if `mode_string' does not contain a valid
representation of file mode change operations;
return MODE_MEMORY_EXHAUSTED if there is insufficient memory. */
struct mode_change *
mode_compile (const char *mode_string, unsigned int masked_ops)
{
struct mode_change *head; /* First element of the linked list. */
struct mode_change *tail; /* An element of the linked list. */
uintmax_t mode_value; /* The mode value, if octal. */
char *string_end; /* Pointer to end of parsed value. */
mode_t umask_value; /* The umask value (surprise). */
head = NULL;
#ifdef lint
tail = NULL;
#endif
if (xstrtoumax (mode_string, &string_end, 8, &mode_value, "") == LONGINT_OK)
{
struct mode_change *p;
if (mode_value != (mode_value & CHMOD_MODE_BITS))
return MODE_INVALID;
p = make_node_op_equals ((mode_t) mode_value);
if (p == NULL)
return MODE_MEMORY_EXHAUSTED;
mode_append_entry (&head, &tail, p);
return head;
}
umask_value = umask (0);
umask (umask_value); /* Restore the old value. */
--mode_string;
/* One loop iteration for each "ugoa...=+-rwxXstugo...[=+-rwxXstugo...]". */
do
{
/* Which bits in the mode are operated on. */
mode_t affected_bits = 0;
/* `affected_bits' modified by umask. */
mode_t affected_masked;
/* Operators to actually use umask on. */
unsigned ops_to_mask = 0;
int who_specified_p;
affected_bits = 0;
ops_to_mask = 0;
/* Turn on all the bits in `affected_bits' for each group given. */
for (++mode_string;; ++mode_string)
switch (*mode_string)
{
case 'u':
affected_bits |= S_ISUID | S_IRWXU;
break;
case 'g':
affected_bits |= S_ISGID | S_IRWXG;
break;
case 'o':
affected_bits |= S_ISVTX | S_IRWXO;
break;
case 'a':
affected_bits |= CHMOD_MODE_BITS;
break;
default:
goto no_more_affected;
}
no_more_affected:
/* If none specified, affect all bits, except perhaps those
set in the umask. */
if (affected_bits)
who_specified_p = 1;
else
{
who_specified_p = 0;
affected_bits = CHMOD_MODE_BITS;
ops_to_mask = masked_ops;
}
while (*mode_string == '=' || *mode_string == '+' || *mode_string == '-')
{
struct mode_change *change = talloc (struct mode_change);
if (change == NULL)
{
mode_free (head);
return MODE_MEMORY_EXHAUSTED;
}
change->next = NULL;
change->op = *mode_string; /* One of "=+-". */
affected_masked = affected_bits;
/* Per the Single Unix Spec, if `who' is not specified and the
`=' operator is used, then clear all the bits first. */
if (!who_specified_p &&
ops_to_mask & (*mode_string == '=' ? MODE_MASK_EQUALS : 0))
{
struct mode_change *p = make_node_op_equals (0);
if (p == NULL)
return MODE_MEMORY_EXHAUSTED;
mode_append_entry (&head, &tail, p);
}
if (ops_to_mask & (*mode_string == '=' ? MODE_MASK_EQUALS
: *mode_string == '+' ? MODE_MASK_PLUS
: MODE_MASK_MINUS))
affected_masked &= ~umask_value;
change->affected = affected_masked;
change->value = 0;
change->flags = 0;
/* Add the element to the tail of the list, so the operations
are performed in the correct order. */
mode_append_entry (&head, &tail, change);
/* Set `value' according to the bits set in `affected_masked'. */
for (++mode_string;; ++mode_string)
switch (*mode_string)
{
case 'r':
change->value |= ((S_IRUSR | S_IRGRP | S_IROTH)
& affected_masked);
break;
case 'w':
change->value |= ((S_IWUSR | S_IWGRP | S_IWOTH)
& affected_masked);
break;
case 'X':
change->flags |= MODE_X_IF_ANY_X;
/* Fall through. */
case 'x':
change->value |= ((S_IXUSR | S_IXGRP | S_IXOTH)
& affected_masked);
break;
case 's':
/* Set the setuid/gid bits if `u' or `g' is selected. */
change->value |= (S_ISUID | S_ISGID) & affected_masked;
break;
case 't':
/* Set the "save text image" bit if `o' is selected. */
change->value |= S_ISVTX & affected_masked;
break;
case 'u':
/* Set the affected bits to the value of the `u' bits
on the same file. */
if (change->value)
goto invalid;
change->value = S_IRWXU;
change->flags |= MODE_COPY_EXISTING;
break;
case 'g':
/* Set the affected bits to the value of the `g' bits
on the same file. */
if (change->value)
goto invalid;
change->value = S_IRWXG;
change->flags |= MODE_COPY_EXISTING;
break;
case 'o':
/* Set the affected bits to the value of the `o' bits
on the same file. */
if (change->value)
goto invalid;
change->value = S_IRWXO;
change->flags |= MODE_COPY_EXISTING;
break;
default:
goto no_more_values;
}
no_more_values:;
}
} while (*mode_string == ',');
if (*mode_string == 0)
return head;
invalid:
mode_free (head);
return MODE_INVALID;
}
/* Return a file mode change operation that sets permissions to match those
of REF_FILE. Return MODE_BAD_REFERENCE if REF_FILE can't be accessed. */
struct mode_change *
mode_create_from_ref (const char *ref_file)
{
struct mode_change *change; /* the only change element */
struct stat ref_stats;
if (stat (ref_file, &ref_stats))
return MODE_BAD_REFERENCE;
change = talloc (struct mode_change);
if (change == NULL)
return MODE_MEMORY_EXHAUSTED;
change->op = '=';
change->flags = 0;
change->affected = CHMOD_MODE_BITS;
change->value = ref_stats.st_mode;
change->next = NULL;
return change;
}
/* Return file mode OLDMODE, adjusted as indicated by the list of change
operations CHANGES. If OLDMODE is a directory, the type `X'
change affects it even if no execute bits were set in OLDMODE.
The returned value has the S_IFMT bits cleared. */
mode_t
mode_adjust (mode_t oldmode, const struct mode_change *changes)
{
mode_t newmode; /* The adjusted mode and one operand. */
mode_t value; /* The other operand. */
newmode = oldmode & CHMOD_MODE_BITS;
for (; changes; changes = changes->next)
{
if (changes->flags & MODE_COPY_EXISTING)
{
/* Isolate in `value' the bits in `newmode' to copy, given in
the mask `changes->value'. */
value = newmode & changes->value;
if (changes->value & S_IRWXU)
/* Copy `u' permissions onto `g' and `o'. */
value |= ((value & S_IRUSR ? S_IRGRP | S_IROTH : 0)
| (value & S_IWUSR ? S_IWGRP | S_IROTH : 0)
| (value & S_IXUSR ? S_IXGRP | S_IXOTH : 0));
else if (changes->value & S_IRWXG)
/* Copy `g' permissions onto `u' and `o'. */
value |= ((value & S_IRGRP ? S_IRUSR | S_IROTH : 0)
| (value & S_IWGRP ? S_IWUSR | S_IROTH : 0)
| (value & S_IXGRP ? S_IXUSR | S_IXOTH : 0));
else
/* Copy `o' permissions onto `u' and `g'. */
value |= ((value & S_IROTH ? S_IRUSR | S_IRGRP : 0)
| (value & S_IWOTH ? S_IWUSR | S_IRGRP : 0)
| (value & S_IXOTH ? S_IXUSR | S_IXGRP : 0));
/* In order to change only `u', `g', or `o' permissions,
or some combination thereof, clear unselected bits.
This can not be done in mode_compile because the value
to which the `changes->affected' mask is applied depends
on the old mode of each file. */
value &= changes->affected;
}
else
{
value = changes->value;
/* If `X', do not affect the execute bits if the file is not a
directory and no execute bits are already set. */
if ((changes->flags & MODE_X_IF_ANY_X)
&& !S_ISDIR (oldmode)
&& (newmode & (S_IXUSR | S_IXGRP | S_IXOTH)) == 0)
/* Clear the execute bits. */
value &= ~ (S_IXUSR | S_IXGRP | S_IXOTH);
}
switch (changes->op)
{
case '=':
/* Preserve the previous values in `newmode' of bits that are
not affected by this change operation. */
newmode = (newmode & ~changes->affected) | value;
break;
case '+':
newmode |= value;
break;
case '-':
newmode &= ~value;
break;
}
}
return newmode;
}
/* Free the memory used by the list of file mode change operations
CHANGES. */
void
mode_free (register struct mode_change *changes)
{
register struct mode_change *next;
while (changes)
{
next = changes->next;
free (changes);
changes = next;
}
}

View File

@@ -1,9 +1,9 @@
/* Parse arguments from a string and prepend them to an argv.
Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
Copyright 1999, 2000, 2001, 2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
the Free Software Foundation; either version 3, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
@@ -13,8 +13,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */
/* Written by Paul Eggert <eggert@twinsun.com>. */

View File

@@ -1,52 +0,0 @@
/* Print a copyright notice suitable for the current locale.
Copyright (C) 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by Paul Eggert. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include "unicodeio.h"
#include "print-copyr.h"
#include <stdio.h>
#define COPYRIGHT_SIGN 0x00A9
/* Print "(C)". */
static int
print_parenthesized_c (unsigned int code, void *callback_arg)
{
FILE *stream = callback_arg;
return fputs ("(C)", stream);
}
/* Print "Copyright (C) " followed by NOTICE and then a newline,
transliterating "(C)" to an actual copyright sign (C-in-a-circle)
if possible. */
void
print_copyright (char const *notice)
{
fputs ("Copyright ", stdout);
unicode_to_mb (COPYRIGHT_SIGN, print_unicode_success, print_parenthesized_c,
stdout);
fputc (' ', stdout);
puts (notice);
}

View File

@@ -1,9 +0,0 @@
# ifndef PARAMS
# if PROTOTYPES || (defined (__STDC__) && __STDC__)
# define PARAMS(args) args
# else
# define PARAMS(args) ()
# endif
# endif
void print_copyright PARAMS((char const *));

View File

@@ -1,367 +0,0 @@
/* quotearg.c - quote arguments for output
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by Paul Eggert <eggert@twinsun.com> */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#include <quotearg.h>
#include <xalloc.h>
#include <ctype.h>
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
# define ISASCII(c) 1
#else
# define ISASCII(c) isascii (c)
#endif
#ifdef isgraph
# define ISGRAPH(c) (ISASCII (c) && isgraph (c))
#else
# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
#endif
#if HAVE_LIMITS_H
# include <limits.h>
#endif
#ifndef CHAR_BIT
# define CHAR_BIT 8
#endif
#ifndef UCHAR_MAX
# define UCHAR_MAX ((unsigned char) -1)
#endif
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#if HAVE_STRING_H
# include <string.h>
#endif
#define INT_BITS (sizeof (int) * CHAR_BIT)
struct quoting_options
{
/* Basic quoting style. */
enum quoting_style style;
/* Quote the chararacters indicated by this bit vector even if the
quoting style would not normally require them to be quoted. */
int quote_these_too[((UCHAR_MAX + 1) / INT_BITS
+ ((UCHAR_MAX + 1) % INT_BITS != 0))];
};
/* Names of quoting styles. */
char const *const quoting_style_args[] =
{
"literal",
"shell",
"shell-always",
"c",
"escape",
0
};
/* Correspondances to quoting style names. */
enum quoting_style const quoting_style_vals[] =
{
literal_quoting_style,
shell_quoting_style,
shell_always_quoting_style,
c_quoting_style,
escape_quoting_style
};
/* The default quoting options. */
static struct quoting_options default_quoting_options;
/* Allocate a new set of quoting options, with contents initially identical
to O if O is not null, or to the default if O is null.
It is the caller's responsibility to free the result. */
struct quoting_options *
clone_quoting_options (struct quoting_options *o)
{
struct quoting_options *p
= (struct quoting_options *) xmalloc (sizeof (struct quoting_options));
*p = *(o ? o : &default_quoting_options);
return p;
}
/* Get the value of O's quoting style. If O is null, use the default. */
enum quoting_style
get_quoting_style (struct quoting_options *o)
{
return (o ? o : &default_quoting_options)->style;
}
/* In O (or in the default if O is null),
set the value of the quoting style to S. */
void
set_quoting_style (struct quoting_options *o, enum quoting_style s)
{
(o ? o : &default_quoting_options)->style = s;
}
/* In O (or in the default if O is null),
set the value of the quoting options for character C to I.
Return the old value. Currently, the only values defined for I are
0 (the default) and 1 (which means to quote the character even if
it would not otherwise be quoted). */
int
set_char_quoting (struct quoting_options *o, char c, int i)
{
unsigned char uc = c;
int *p = (o ? o : &default_quoting_options)->quote_these_too + uc / INT_BITS;
int shift = uc % INT_BITS;
int r = (*p >> shift) & 1;
*p ^= ((i & 1) ^ r) << shift;
return r;
}
/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
argument ARG (of size ARGSIZE), using O to control quoting.
If O is null, use the default.
Terminate the output with a null character, and return the written
size of the output, not counting the terminating null.
If BUFFERSIZE is too small to store the output string, return the
value that would have been returned had BUFFERSIZE been large enough.
If ARGSIZE is -1, use the string length of the argument for ARGSIZE. */
size_t
quotearg_buffer (char *buffer, size_t buffersize,
char const *arg, size_t argsize,
struct quoting_options const *o)
{
unsigned char c;
size_t i;
size_t len;
int quote_mark;
struct quoting_options const *p = o ? o : &default_quoting_options;
enum quoting_style quoting_style = p->style;
#define STORE(c) \
do \
{ \
if (len < buffersize) \
buffer[len] = (c); \
len++; \
} \
while (0)
switch (quoting_style)
{
case shell_quoting_style:
if (! (argsize == (size_t) -1 ? arg[0] == '\0' : argsize == 0))
{
switch (arg[0])
{
case '#': case '~':
break;
default:
len = 0;
for (i = 0; ; i++)
{
if (argsize == (size_t) -1 ? arg[i] == '\0' : i == argsize)
goto done;
c = arg[i];
switch (c)
{
case '\t': case '\n': case ' ':
case '!': /* special in csh */
case '"': case '$': case '&': case '\'':
case '(': case ')': case '*': case ';':
case '<': case '>': case '?': case '[': case '\\':
case '^': /* special in old /bin/sh, e.g. SunOS 4.1.4 */
case '`': case '|':
goto needs_quoting;
}
if (p->quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS)))
goto needs_quoting;
STORE (c);
}
needs_quoting:;
break;
}
}
/* Fall through. */
case shell_always_quoting_style:
quote_mark = '\'';
break;
case c_quoting_style:
quote_mark = '"';
break;
default:
quote_mark = 0;
break;
}
len = 0;
if (quote_mark)
STORE (quote_mark);
for (i = 0; ! (argsize == (size_t) -1 ? arg[i] == '\0' : i == argsize); i++)
{
c = arg[i];
switch (quoting_style)
{
case literal_quoting_style:
break;
case shell_quoting_style:
case shell_always_quoting_style:
if (c == '\'')
{
STORE ('\'');
STORE ('\\');
STORE ('\'');
}
break;
case c_quoting_style:
case escape_quoting_style:
switch (c)
{
case '?': /* Do not generate trigraphs. */
case '\\': goto store_escape;
/* Not all C compilers know what \a means. */
case 7 : c = 'a'; goto store_escape;
case '\b': c = 'b'; goto store_escape;
case '\f': c = 'f'; goto store_escape;
case '\n': c = 'n'; goto store_escape;
case '\r': c = 'r'; goto store_escape;
case '\t': c = 't'; goto store_escape;
case '\v': c = 'v'; goto store_escape;
case '"':
if (quoting_style == c_quoting_style)
goto store_escape;
break;
default:
if (!ISGRAPH (c))
{
STORE ('\\');
STORE ('0' + (c >> 6));
STORE ('0' + ((c >> 3) & 7));
c = '0' + (c & 7);
goto store_c;
}
break;
}
if (! (p->quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS))))
goto store_c;
store_escape:
STORE ('\\');
}
store_c:
STORE (c);
}
if (quote_mark)
STORE (quote_mark);
done:
if (len < buffersize)
buffer[len] = '\0';
return len;
}
/* Use storage slot N to return a quoted version of the string ARG.
OPTIONS specifies the quoting options.
The returned value points to static storage that can be
reused by the next call to this function with the same value of N.
N must be nonnegative. N is deliberately declared with type `int'
to allow for future extensions (using negative values). */
static char *
quotearg_n_options (int n, char const *arg,
struct quoting_options const *options)
{
static unsigned int nslots;
static struct slotvec
{
size_t size;
char *val;
} *slotvec;
if (nslots <= n)
{
int n1 = n + 1;
size_t s = n1 * sizeof (struct slotvec);
if (! (0 < n1 && n1 == s / sizeof (struct slotvec)))
abort ();
slotvec = (struct slotvec *) xrealloc (slotvec, s);
memset (slotvec + nslots, 0, (n1 - nslots) * sizeof (struct slotvec));
nslots = n;
}
{
size_t size = slotvec[n].size;
char *val = slotvec[n].val;
size_t qsize = quotearg_buffer (val, size, arg, (size_t) -1, options);
if (size <= qsize)
{
slotvec[n].size = size = qsize + 1;
slotvec[n].val = val = xrealloc (val, size);
quotearg_buffer (val, size, arg, (size_t) -1, options);
}
return val;
}
}
char *
quotearg_n (unsigned int n, char const *arg)
{
return quotearg_n_options (n, arg, &default_quoting_options);
}
char *
quotearg (char const *arg)
{
return quotearg_n (0, arg);
}
char *
quotearg_char (char const *arg, char ch)
{
struct quoting_options options;
options = default_quoting_options;
set_char_quoting (&options, ch, 1);
return quotearg_n_options (0, arg, &options);
}
char *
quotearg_colon (char const *arg)
{
return quotearg_char (arg, ':');
}

View File

@@ -1,100 +0,0 @@
/* quotearg.h - quote arguments for output
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by Paul Eggert <eggert@twinsun.com> */
/* Basic quoting styles. */
enum quoting_style
{
literal_quoting_style, /* --quoting-style=literal */
shell_quoting_style, /* --quoting-style=shell */
shell_always_quoting_style, /* --quoting-style=shell-always */
c_quoting_style, /* --quoting-style=c */
escape_quoting_style /* --quoting-style=escape */
};
/* For now, --quoting-style=literal is the default, but
this is planned to change to --quoting-style=shell in the future. */
#ifndef DEFAULT_QUOTING_STYLE
# define DEFAULT_QUOTING_STYLE literal_quoting_style
#endif
/* Names of quoting styles and their corresponding values. */
extern char const *const quoting_style_args[];
extern enum quoting_style const quoting_style_vals[];
struct quoting_options;
#ifndef PARAMS
# if defined PROTOTYPES || defined __STDC__
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
#endif
/* The functions listed below set and use a hidden variable
that contains the default quoting style options. */
/* Allocate a new set of quoting options, with contents initially identical
to O if O is not null, or to the default if O is null.
It is the caller's responsibility to free the result. */
struct quoting_options *clone_quoting_options
PARAMS ((struct quoting_options *o));
/* Get the value of O's quoting style. If O is null, use the default. */
enum quoting_style get_quoting_style PARAMS ((struct quoting_options *o));
/* In O (or in the default if O is null),
set the value of the quoting style to S. */
void set_quoting_style PARAMS ((struct quoting_options *o,
enum quoting_style s));
/* In O (or in the default if O is null),
set the value of the quoting options for character C to I.
Return the old value. Currently, the only values defined for I are
0 (the default) and 1 (which means to quote the character even if
it would not otherwise be quoted). */
int set_char_quoting PARAMS ((struct quoting_options *o, char c, int i));
/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
argument ARG (of size ARGSIZE), using O to control quoting.
If O is null, use the default.
Terminate the output with a null character, and return the written
size of the output, not counting the terminating null.
If BUFFERSIZE is too small to store the output string, return the
value that would have been returned had BUFFERSIZE been large enough.
If ARGSIZE is -1, use the string length of the argument for ARGSIZE. */
size_t quotearg_buffer PARAMS ((char *buffer, size_t buffersize,
char const *arg, size_t argsize,
struct quoting_options const *o));
/* Use storage slot N to return a quoted version of the string ARG.
Use the default quoting options.
The returned value points to static storage that can be
reused by the next call to this function with the same value of N.
N must be nonnegative. */
char *quotearg_n PARAMS ((unsigned int n, char const *arg));
/* Equivalent to quotearg_n (0, ARG). */
char *quotearg PARAMS ((char const *arg));
/* Like quotearg (ARG), except also quote any instances of CH. */
char *quotearg_char PARAMS ((char const *arg, char ch));
/* Equivalent to quotearg_char (ARG, ':'). */
char *quotearg_colon PARAMS ((char const *arg));

View File

@@ -1,10 +0,0 @@
#ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
#endif
ssize_t full_write PARAMS ((int desc, const char *ptr, size_t len));
ssize_t safe_read PARAMS ((int desc, void *ptr, size_t len));

View File

@@ -1,129 +0,0 @@
/* savedir.c -- save the list of files in a directory in a string
Copyright 1990, 1997, 1998, 1999, 2000, 2001 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#include <errno.h>
#ifndef errno
extern int errno;
#endif
#if HAVE_DIRENT_H
# include <dirent.h>
#else
# define dirent direct
# if HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif
# if HAVE_SYS_DIR_H
# include <sys/dir.h>
# endif
# if HAVE_NDIR_H
# include <ndir.h>
# endif
#endif
#ifdef CLOSEDIR_VOID
/* Fake a return value. */
# define CLOSEDIR(d) (closedir (d), 0)
#else
# define CLOSEDIR(d) closedir (d)
#endif
#ifdef STDC_HEADERS
# include <stdlib.h>
# include <string.h>
#endif
#ifndef NULL
# define NULL 0
#endif
#include "savedir.h"
#include "xalloc.h"
/* Return a freshly allocated string containing the filenames
in directory DIR, separated by '\0' characters;
the end is marked by two '\0' characters in a row.
Return NULL (setting errno) if DIR cannot be opened, read, or closed. */
#ifndef NAME_SIZE_DEFAULT
# define NAME_SIZE_DEFAULT 512
#endif
char *
savedir (const char *dir)
{
DIR *dirp;
struct dirent *dp;
char *name_space;
size_t allocated = NAME_SIZE_DEFAULT;
size_t used = 0;
int save_errno;
dirp = opendir (dir);
if (dirp == NULL)
return NULL;
name_space = xmalloc (allocated);
errno = 0;
while ((dp = readdir (dirp)) != NULL)
{
/* Skip "", ".", and "..". "" is returned by at least one buggy
implementation: Solaris 2.4 readdir on NFS filesystems. */
char const *entry = dp->d_name;
if (entry[entry[0] != '.' ? 0 : entry[1] != '.' ? 1 : 2] != '\0')
{
size_t entry_size = strlen (entry) + 1;
if (used + entry_size < used)
xalloc_die ();
if (allocated <= used + entry_size)
{
do
{
if (2 * allocated < allocated)
xalloc_die ();
allocated *= 2;
}
while (allocated <= used + entry_size);
name_space = xrealloc (name_space, allocated);
}
memcpy (name_space + used, entry, entry_size);
used += entry_size;
}
}
name_space[used] = '\0';
save_errno = errno;
if (CLOSEDIR (dirp) != 0)
save_errno = errno;
if (save_errno != 0)
{
free (name_space);
errno = save_errno;
return NULL;
}
return name_space;
}

View File

@@ -1,14 +0,0 @@
#if !defined SAVEDIR_H_
# define SAVEDIR_H_
# ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
# endif
char *savedir PARAMS ((const char *dir));
#endif

77
lib/stdopen.c Normal file
View File

@@ -0,0 +1,77 @@
/* stdopen.c - ensure that the three standard file descriptors are in use
Copyright (C) 2005, 2007 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Written by Paul Eggert and Jim Meyering. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "stdopen.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
/* Try to ensure that all of the standard file numbers (0, 1, 2)
are in use. Without this, each application would have to guard
every call to open, dup, fopen, etc. with tests to ensure they
don't use one of the special file numbers when opening a file.
Return false if at least one of the file descriptors is initially
closed and an attempt to reopen it fails. Otherwise, return true. */
bool
stdopen (void)
{
int fd;
bool ok = true;
for (fd = 0; fd <= 2; fd++)
{
if (fcntl (fd, F_GETFD) < 0)
{
if (errno != EBADF)
ok = false;
else
{
static const int contrary_mode[]
= { O_WRONLY, O_RDONLY, O_RDONLY };
int mode = contrary_mode[fd];
int new_fd;
/* Open /dev/null with the contrary mode so that the typical
read (stdin) or write (stdout, stderr) operation will fail.
With descriptor 0, we can do even better on systems that
have /dev/full, by opening that write-only instead of
/dev/null. The only drawback is that a write-provoked
failure comes with a misleading errno value, ENOSPC. */
if (mode == O_RDONLY
|| (new_fd = open ("/dev/full", mode) != fd))
new_fd = open ("/dev/null", mode);
if (new_fd != fd)
{
if (0 <= new_fd)
close (new_fd);
ok = false;
}
}
}
}
return ok;
}

16
lib/stdopen.h Normal file
View File

@@ -0,0 +1,16 @@
#ifndef STDOPEN_H
# define STDOPEN_H 1
# include <stdbool.h>
# ifdef __cplusplus
extern "C" {
# endif
bool stdopen (void);
# ifdef __cplusplus
}
# endif
#endif

View File

@@ -1,100 +0,0 @@
/* Convert string representation of a number into an intmax_t value.
Copyright 1999, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by Paul Eggert. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#ifndef PARAMS
# if defined PROTOTYPES || defined __STDC__
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
#endif
/* Verify a requirement at compile-time (unlike assert, which is runtime). */
#define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; }
#ifdef UNSIGNED
# ifndef HAVE_DECL_STRTOUL
"this configure-time declaration test was not run"
# endif
# if !HAVE_DECL_STRTOUL
unsigned long strtoul PARAMS ((char const *, char **, int));
# endif
# ifndef HAVE_DECL_STRTOULL
"this configure-time declaration test was not run"
# endif
# if !HAVE_DECL_STRTOULL && HAVE_UNSIGNED_LONG_LONG
unsigned long long strtoull PARAMS ((char const *, char **, int));
# endif
#else
# ifndef HAVE_DECL_STRTOL
"this configure-time declaration test was not run"
# endif
# if !HAVE_DECL_STRTOL
long strtol PARAMS ((char const *, char **, int));
# endif
# ifndef HAVE_DECL_STRTOLL
"this configure-time declaration test was not run"
# endif
# if !HAVE_DECL_STRTOLL && HAVE_UNSIGNED_LONG_LONG
long long strtoll PARAMS ((char const *, char **, int));
# endif
#endif
#ifdef UNSIGNED
# undef HAVE_LONG_LONG
# define HAVE_LONG_LONG HAVE_UNSIGNED_LONG_LONG
# define INT uintmax_t
# define strtoimax strtoumax
# define strtol strtoul
# define strtoll strtoull
#else
# define INT intmax_t
#endif
INT
strtoimax (char const *ptr, char **endptr, int base)
{
#if HAVE_LONG_LONG
verify (size_is_that_of_long_or_long_long,
(sizeof (INT) == sizeof (long)
|| sizeof (INT) == sizeof (long long)));
if (sizeof (INT) != sizeof (long))
return strtoll (ptr, endptr, base);
#else
verify (size_is_that_of_long,
sizeof (INT) == sizeof (long));
#endif
return strtol (ptr, endptr, base);
}

View File

@@ -1,2 +0,0 @@
#define UNSIGNED 1
#include "strtoimax.c"

View File

@@ -1,259 +0,0 @@
/* Unicode character output to streams with locale dependent encoding.
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by Bruno Haible <haible@clisp.cons.org>. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#if HAVE_STDDEF_H
# include <stddef.h>
#endif
#include <stdio.h>
#if HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
#endif
#include <errno.h>
#ifndef errno
extern int errno;
#endif
#if HAVE_ICONV
# include <iconv.h>
#endif
/* Some systems, like SunOS 4, don't have EILSEQ. On these systems,
define EILSEQ to some value other than EINVAL, because our invokers
may want to distinguish EINVAL from EILSEQ. */
#ifndef EILSEQ
# define EILSEQ ENOENT
#endif
#ifndef ENOTSUP
# define ENOTSUP EINVAL
#endif
#if HAVE_LANGINFO_CODESET && ! USE_INCLUDED_LIBINTL
# include <langinfo.h>
#endif
#include "unicodeio.h"
/* When we pass a Unicode character to iconv(), we must pass it in a
suitable encoding. The standardized Unicode encodings are
UTF-8, UCS-2, UCS-4, UTF-16, UTF-16BE, UTF-16LE, UTF-7.
UCS-2 supports only characters up to \U0000FFFF.
UTF-16 and variants support only characters up to \U0010FFFF.
UTF-7 is way too complex and not supported by glibc-2.1.
UCS-4 specification leaves doubts about endianness and byte order
mark. glibc currently interprets it as big endian without byte order
mark, but this is not backed by an RFC.
So we use UTF-8. It supports characters up to \U7FFFFFFF and is
unambiguously defined. */
/* Stores the UTF-8 representation of the Unicode character wc in r[0..5].
Returns the number of bytes stored, or -1 if wc is out of range. */
static int
utf8_wctomb (unsigned char *r, unsigned int wc)
{
int count;
if (wc < 0x80)
count = 1;
else if (wc < 0x800)
count = 2;
else if (wc < 0x10000)
count = 3;
else if (wc < 0x200000)
count = 4;
else if (wc < 0x4000000)
count = 5;
else if (wc <= 0x7fffffff)
count = 6;
else
return -1;
switch (count)
{
/* Note: code falls through cases! */
case 6: r[5] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0x4000000;
case 5: r[4] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0x200000;
case 4: r[3] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0x10000;
case 3: r[2] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0x800;
case 2: r[1] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0xc0;
case 1: r[0] = wc;
}
return count;
}
/* Luckily, the encoding's name is platform independent. */
#define UTF8_NAME "UTF-8"
/* Converts the Unicode character CODE to its multibyte representation
in the current locale and calls SUCCESS on the resulting byte
sequence. If an error occurs, invoke FAILURE instead,
passing it CODE with errno set appropriately.
Assumes that the locale doesn't change between two calls.
Return whatever the SUCCESS or FAILURE returns. */
int
unicode_to_mb (unsigned int code,
int (*success) PARAMS((const char *buf, size_t buflen,
void *callback_arg)),
int (*failure) PARAMS((unsigned int code,
void *callback_arg)),
void *callback_arg)
{
static int initialized;
static int is_utf8;
#if HAVE_ICONV
static iconv_t utf8_to_local;
#endif
char inbuf[6];
int count;
if (!initialized)
{
const char *charset;
#if USE_INCLUDED_LIBINTL
extern const char *locale_charset PARAMS ((void));
charset = locale_charset ();
#else
# if HAVE_LANGINFO_CODESET
charset = nl_langinfo (CODESET);
# else
charset = "";
# endif
#endif
is_utf8 = !strcmp (charset, UTF8_NAME);
#if HAVE_ICONV
if (!is_utf8)
{
utf8_to_local = iconv_open (charset, UTF8_NAME);
if (utf8_to_local == (iconv_t)(-1))
{
/* For an unknown encoding, assume ASCII. */
utf8_to_local = iconv_open ("ASCII", UTF8_NAME);
if (utf8_to_local == (iconv_t)(-1))
return failure (code, callback_arg);
}
}
#endif
initialized = 1;
}
/* Convert the character to UTF-8. */
count = utf8_wctomb ((unsigned char *) inbuf, code);
if (count < 0)
{
errno = EILSEQ;
return failure (code, callback_arg);
}
if (is_utf8)
{
return success (inbuf, count, callback_arg);
}
else
{
#if HAVE_ICONV
char outbuf[25];
const char *inptr;
size_t inbytesleft;
char *outptr;
size_t outbytesleft;
size_t res;
inptr = inbuf;
inbytesleft = count;
outptr = outbuf;
outbytesleft = sizeof (outbuf);
/* Convert the character from UTF-8 to the locale's charset. */
res = iconv (utf8_to_local,
(ICONV_CONST char **)&inptr, &inbytesleft,
&outptr, &outbytesleft);
if (inbytesleft > 0 || res == (size_t)(-1)
/* Irix iconv() inserts a NUL byte if it cannot convert. */
# if !defined _LIBICONV_VERSION && (defined sgi || defined __sgi)
|| (res > 0 && code != 0 && outptr - outbuf == 1 && *outbuf == '\0')
# endif
)
{
if (res != (size_t)(-1))
errno = EILSEQ;
return failure (code, callback_arg);
}
/* Avoid glibc-2.1 bug and Solaris 2.7 bug. */
# if defined _LIBICONV_VERSION \
|| !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun)
/* Get back to the initial shift state. */
res = iconv (utf8_to_local, NULL, NULL, &outptr, &outbytesleft);
if (res == (size_t)(-1))
return failure (code, callback_arg);
# endif
return success (outbuf, outptr - outbuf, callback_arg);
#else
errno = ENOTSUP;
return failure (code, callback_arg);
#endif
}
}
/* Simple success callback that outputs the converted string.
The STREAM is passed as callback_arg. */
int
print_unicode_success (const char *buf, size_t buflen, void *callback_arg)
{
FILE *stream = (FILE *) callback_arg;
return fwrite (buf, 1, buflen, stream) == 0 ? -1 : 0;
}
/* Simple failure callback that prints an ASCII representation, using
the same notation as C99 strings. */
int
print_unicode_failure (unsigned int code, void *callback_arg)
{
int e = errno;
FILE *stream = callback_arg;
fprintf (stream, code < 0x10000 ? "\\u%04X" : "\\U%08X", code);
errno = e;
return -1;
}
/* Outputs the Unicode character CODE to the output stream STREAM.
Returns zero if successful, -1 (setting errno) otherwise.
Assumes that the locale doesn't change between two calls. */
int
print_unicode_char (FILE *stream, unsigned int code)
{
return unicode_to_mb (code, print_unicode_success, print_unicode_failure,
stream);
}

View File

@@ -1,57 +0,0 @@
/* Unicode character output to streams with locale dependent encoding.
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef UNICODEIO_H
# define UNICODEIO_H
# include <stdio.h>
# ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
# endif
/* Converts the Unicode character CODE to its multibyte representation
in the current locale and calls the CALLBACK on the resulting byte
sequence. If an error occurs, invokes ERROR_CALLBACK instead,
passing it CODE with errno set appropriately. Returns whatever the
callback returns. */
extern int unicode_to_mb
PARAMS ((unsigned int code,
int (*callback) PARAMS ((const char *buf, size_t buflen,
void *callback_arg)),
int (*error_callback) PARAMS ((unsigned int code,
void * callback_arg)),
void *callback_arg));
/* Success callback that outputs the conversion of the character. */
extern int print_unicode_success PARAMS((const char *buf, size_t buflen,
void *callback_arg));
/* Failure callback that outputs an ASCII representation. */
extern int print_unicode_failure PARAMS((unsigned int code,
void *callback_arg));
/* Outputs the Unicode character CODE to the output stream STREAM.
Returns -1 (setting errno) if unsuccessful. */
extern int print_unicode_char PARAMS((FILE *stream, unsigned int code));
#endif

View File

@@ -1,72 +0,0 @@
/* Emulate waitpid on systems that just have wait.
Copyright 1994, 1995, 1998, 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING.
If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <errno.h>
#ifndef errno
extern int errno;
#endif
#define WAITPID_CHILDREN 8
static pid_t waited_pid[WAITPID_CHILDREN];
static int waited_status[WAITPID_CHILDREN];
pid_t
waitpid (pid_t pid, int *stat_loc, int options)
{
int i;
pid_t p;
if (!options && (pid == -1 || 0 < pid))
{
/* If we have already waited for this child, return it immediately. */
for (i = 0; i < WAITPID_CHILDREN; i++)
{
p = waited_pid[i];
if (p && (p == pid || pid == -1))
{
waited_pid[i] = 0;
goto success;
}
}
/* The child has not returned yet; wait for it, accumulating status. */
for (i = 0; i < WAITPID_CHILDREN; i++)
if (! waited_pid[i])
{
p = wait (&waited_status[i]);
if (p < 0)
return p;
if (p == pid || pid == -1)
goto success;
waited_pid[i] = p;
}
}
/* We cannot emulate this wait call, e.g. because of too many children. */
errno = EINVAL;
return -1;
success:
if (stat_loc)
*stat_loc = waited_status[i];
return p;
}

View File

@@ -1,87 +0,0 @@
/* xalloc.h -- malloc with out-of-memory checking
Copyright (C) 1990-1998, 1999, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef XALLOC_H_
# define XALLOC_H_
# ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
# endif
# ifndef __attribute__
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
# define __attribute__(x)
# endif
# endif
# ifndef ATTRIBUTE_NORETURN
# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
# endif
/* Exit value when the requested amount of memory is not available.
It is initialized to EXIT_FAILURE, but the caller may set it to
some other value. */
extern int xalloc_exit_failure;
/* If this pointer is non-zero, run the specified function upon each
allocation failure. It is initialized to zero. */
extern void (*xalloc_fail_func) PARAMS ((void));
/* If XALLOC_FAIL_FUNC is undefined or a function that returns, this
message is output. It is translated via gettext.
Its value is "memory exhausted". */
extern char const xalloc_msg_memory_exhausted[];
/* This function is always triggered when memory is exhausted. It is
in charge of honoring the three previous items. This is the
function to call when one wants the program to die because of a
memory allocation failure. */
extern void xalloc_die PARAMS ((void)) ATTRIBUTE_NORETURN;
void *xmalloc PARAMS ((size_t n));
void *xcalloc PARAMS ((size_t n, size_t s));
void *xrealloc PARAMS ((void *p, size_t n));
char *xstrdup PARAMS ((const char *str));
# define XMALLOC(Type, N_items) ((Type *) xmalloc (sizeof (Type) * (N_items)))
# define XCALLOC(Type, N_items) ((Type *) xcalloc (sizeof (Type), (N_items)))
# define XREALLOC(Ptr, Type, N_items) \
((Type *) xrealloc ((void *) (Ptr), sizeof (Type) * (N_items)))
/* Declare and alloc memory for VAR of type TYPE. */
# define NEW(Type, Var) Type *(Var) = XMALLOC (Type, 1)
/* Free VAR only if non NULL. */
# define XFREE(Var) \
do { \
if (Var) \
free (Var); \
} while (0)
/* Return a pointer to a malloc'ed copy of the array SRC of NUM elements. */
# define CCLONE(Src, Num) \
(memcpy (xmalloc (sizeof (*Src) * (Num)), (Src), sizeof (*Src) * (Num)))
/* Return a malloc'ed copy of SRC. */
# define CLONE(Src) CCLONE (Src, 1)
#endif /* !XALLOC_H_ */

View File

@@ -1,79 +0,0 @@
/* xgetcwd.c -- return current directory with unlimited length
Copyright (C) 1992, 1996, 2000, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <errno.h>
#ifndef errno
extern int errno;
#endif
#include <sys/types.h>
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#if HAVE_GETCWD
char *getcwd ();
#else
char *getwd ();
# define getcwd(Buf, Max) getwd (Buf)
#endif
#include "xalloc.h"
/* Return the current directory, newly allocated, arbitrarily long.
Return NULL and set errno on error. */
char *
xgetcwd ()
{
#if defined __GLIBC__ && __GLIBC__ >= 2
return getcwd (NULL, 0);
#else
size_t buf_size = 128; /* must be a power of 2 */
char *buf = NULL;
while (1)
{
char *cwd;
buf = (char *) xrealloc (buf, buf_size);
cwd = getcwd (buf, buf_size);
if (cwd != NULL)
return cwd;
if (errno != ERANGE)
{
free (buf);
return NULL;
}
buf_size *= 2;
if (buf_size == 0)
xalloc_die ();
}
#endif
}

View File

@@ -1,116 +0,0 @@
/* xmalloc.c -- malloc with out of memory checking
Copyright (C) 1990-1999, 2000 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#if STDC_HEADERS
# include <stdlib.h>
#else
void *calloc ();
void *malloc ();
void *realloc ();
void free ();
#endif
#if ENABLE_NLS
# include <libintl.h>
# define _(Text) gettext (Text)
#else
# define textdomain(Domain)
# define _(Text) Text
#endif
#define N_(Text) Text
#include "error.h"
#include "xalloc.h"
#ifndef EXIT_FAILURE
# define EXIT_FAILURE 1
#endif
#ifndef HAVE_DONE_WORKING_MALLOC_CHECK
"you must run the autoconf test for a properly working malloc -- see malloc.m4"
#endif
#ifndef HAVE_DONE_WORKING_REALLOC_CHECK
"you must run the autoconf test for a properly working realloc --see realloc.m4"
#endif
/* Exit value when the requested amount of memory is not available.
The caller may set it to some other value. */
int xalloc_exit_failure = EXIT_FAILURE;
/* If non NULL, call this function when memory is exhausted. */
void (*xalloc_fail_func) PARAMS ((void)) = 0;
/* If XALLOC_FAIL_FUNC is NULL, or does return, display this message
before exiting when memory is exhausted. Goes through gettext. */
char const xalloc_msg_memory_exhausted[] = N_("memory exhausted");
void
xalloc_die (void)
{
if (xalloc_fail_func)
(*xalloc_fail_func) ();
error (xalloc_exit_failure, 0, "%s", _(xalloc_msg_memory_exhausted));
/* The `noreturn' cannot be given to error, since it may return if
its first argument is 0. To help compilers understand the
xalloc_die does terminate, call exit. */
exit (EXIT_FAILURE);
}
/* Allocate N bytes of memory dynamically, with error checking. */
void *
xmalloc (size_t n)
{
void *p;
p = malloc (n);
if (p == 0)
xalloc_die ();
return p;
}
/* Change the size of an allocated block of memory P to N bytes,
with error checking. */
void *
xrealloc (void *p, size_t n)
{
p = realloc (p, n);
if (p == 0)
xalloc_die ();
return p;
}
/* Allocate memory for N elements of S bytes, with error checking. */
void *
xcalloc (size_t n, size_t s)
{
void *p;
p = calloc (n, s);
if (p == 0)
xalloc_die ();
return p;
}

View File

@@ -1,288 +0,0 @@
/* A more useful interface to strtol.
Copyright (C) 1995, 1996, 1998-2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by Jim Meyering. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#ifndef __strtol
# define __strtol strtol
# define __strtol_t long int
# define __xstrtol xstrtol
#endif
/* Some pre-ANSI implementations (e.g. SunOS 4)
need stderr defined if assertion checking is enabled. */
#include <stdio.h>
#if STDC_HEADERS
# include <stdlib.h>
#endif
#if HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
# ifndef strchr
# define strchr index
# endif
#endif
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#ifndef errno
extern int errno;
#endif
#if HAVE_LIMITS_H
# include <limits.h>
#endif
#ifndef CHAR_BIT
# define CHAR_BIT 8
#endif
/* The extra casts work around common compiler bugs. */
#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
/* The outer cast is needed to work around a bug in Cray C 5.0.3.0.
It is necessary at least when t == time_t. */
#define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \
? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0))
#define TYPE_MAXIMUM(t) (~ (t) 0 - TYPE_MINIMUM (t))
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
# define IN_CTYPE_DOMAIN(c) 1
#else
# define IN_CTYPE_DOMAIN(c) isascii(c)
#endif
#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c))
#include "xstrtol.h"
#if !HAVE_DECL_STRTOL && !defined strtol
long int strtol ();
#endif
#if !HAVE_DECL_STRTOUL && !defined strtoul
unsigned long int strtoul ();
#endif
#if !HAVE_DECL_STRTOIMAX && !defined strtoimax
intmax_t strtoimax ();
#endif
#if !HAVE_DECL_STRTOUMAX && !defined strtoumax
uintmax_t strtoumax ();
#endif
static int
bkm_scale (__strtol_t *x, int scale_factor)
{
__strtol_t product = *x * scale_factor;
if (*x != product / scale_factor)
return 1;
*x = product;
return 0;
}
static int
bkm_scale_by_power (__strtol_t *x, int base, int power)
{
while (power--)
if (bkm_scale (x, base))
return 1;
return 0;
}
/* FIXME: comment. */
strtol_error
__xstrtol (const char *s, char **ptr, int strtol_base,
__strtol_t *val, const char *valid_suffixes)
{
char *t_ptr;
char **p;
__strtol_t tmp;
assert (0 <= strtol_base && strtol_base <= 36);
p = (ptr ? ptr : &t_ptr);
if (! TYPE_SIGNED (__strtol_t))
{
const char *q = s;
while (ISSPACE ((unsigned char) *q))
++q;
if (*q == '-')
return LONGINT_INVALID;
}
errno = 0;
tmp = __strtol (s, p, strtol_base);
if (errno != 0)
return LONGINT_OVERFLOW;
if (*p == s)
return LONGINT_INVALID;
/* Let valid_suffixes == NULL mean `allow any suffix'. */
/* FIXME: update all callers except the ones that allow suffixes
after the number, changing last parameter NULL to `""'. */
if (!valid_suffixes)
{
*val = tmp;
return LONGINT_OK;
}
if (**p != '\0')
{
int base = 1024;
int suffixes = 1;
int overflow;
if (!strchr (valid_suffixes, **p))
{
*val = tmp;
return LONGINT_INVALID_SUFFIX_CHAR;
}
if (strchr (valid_suffixes, '0'))
{
/* The ``valid suffix'' '0' is a special flag meaning that
an optional second suffix is allowed, which can change
the base, e.g. "100MD" for 100 megabytes decimal. */
switch (p[0][1])
{
case 'B':
suffixes++;
break;
case 'D':
base = 1000;
suffixes++;
break;
}
}
switch (**p)
{
case 'b':
overflow = bkm_scale (&tmp, 512);
break;
case 'B':
overflow = bkm_scale (&tmp, 1024);
break;
case 'c':
overflow = 0;
break;
case 'E': /* Exa */
overflow = bkm_scale_by_power (&tmp, base, 6);
break;
case 'G': /* Giga */
case 'g': /* 'g' is undocumented; for compatibility only */
overflow = bkm_scale_by_power (&tmp, base, 3);
break;
case 'k': /* kilo */
overflow = bkm_scale_by_power (&tmp, base, 1);
break;
case 'M': /* Mega */
case 'm': /* 'm' is undocumented; for compatibility only */
overflow = bkm_scale_by_power (&tmp, base, 2);
break;
case 'P': /* Peta */
overflow = bkm_scale_by_power (&tmp, base, 5);
break;
case 'T': /* Tera */
case 't': /* 't' is undocumented; for compatibility only */
overflow = bkm_scale_by_power (&tmp, base, 4);
break;
case 'w':
overflow = bkm_scale (&tmp, 2);
break;
case 'Y': /* Yotta */
overflow = bkm_scale_by_power (&tmp, base, 8);
break;
case 'Z': /* Zetta */
overflow = bkm_scale_by_power (&tmp, base, 7);
break;
default:
*val = tmp;
return LONGINT_INVALID_SUFFIX_CHAR;
break;
}
if (overflow)
return LONGINT_OVERFLOW;
(*p) += suffixes;
}
*val = tmp;
return LONGINT_OK;
}
#ifdef TESTING_XSTRTO
# include <stdio.h>
# include "error.h"
char *program_name;
int
main (int argc, char** argv)
{
strtol_error s_err;
int i;
program_name = argv[0];
for (i=1; i<argc; i++)
{
char *p;
__strtol_t val;
s_err = __xstrtol (argv[i], &p, 0, &val, "bckmw");
if (s_err == LONGINT_OK)
{
printf ("%s->%lu (%s)\n", argv[i], val, p);
}
else
{
STRTOL_FATAL_ERROR (argv[i], "arg", s_err);
}
}
exit (0);
}
#endif /* TESTING_XSTRTO */

View File

@@ -1,82 +0,0 @@
/* A more useful interface to strtol.
Copyright 1995, 1996, 1998, 1999, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef XSTRTOL_H_
# define XSTRTOL_H_ 1
# if HAVE_INTTYPES_H
# include <inttypes.h> /* for uintmax_t */
# endif
# ifndef PARAMS
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
# endif
# ifndef _STRTOL_ERROR
enum strtol_error
{
LONGINT_OK, LONGINT_INVALID, LONGINT_INVALID_SUFFIX_CHAR, LONGINT_OVERFLOW
};
typedef enum strtol_error strtol_error;
# endif
# define _DECLARE_XSTRTOL(name, type) \
strtol_error \
name PARAMS ((const char *s, char **ptr, int base, \
type *val, const char *valid_suffixes));
_DECLARE_XSTRTOL (xstrtol, long int)
_DECLARE_XSTRTOL (xstrtoul, unsigned long int)
_DECLARE_XSTRTOL (xstrtoimax, intmax_t)
_DECLARE_XSTRTOL (xstrtoumax, uintmax_t)
# define _STRTOL_ERROR(Exit_code, Str, Argument_type_string, Err) \
do \
{ \
switch ((Err)) \
{ \
case LONGINT_OK: \
abort (); \
\
case LONGINT_INVALID: \
error ((Exit_code), 0, "invalid %s `%s'", \
(Argument_type_string), (Str)); \
break; \
\
case LONGINT_INVALID_SUFFIX_CHAR: \
error ((Exit_code), 0, "invalid character following %s in `%s'", \
(Argument_type_string), (Str)); \
break; \
\
case LONGINT_OVERFLOW: \
error ((Exit_code), 0, "%s `%s' too large", \
(Argument_type_string), (Str)); \
break; \
} \
} \
while (0)
# define STRTOL_FATAL_ERROR(Str, Argument_type_string, Err) \
_STRTOL_ERROR (2, Str, Argument_type_string, Err)
# define STRTOL_FAIL_WARN(Str, Argument_type_string, Err) \
_STRTOL_ERROR (0, Str, Argument_type_string, Err)
#endif /* not XSTRTOL_H_ */

View File

@@ -1,33 +0,0 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-
EXTRA_DIST = \
c-bs-a.m4 \
ccstdc.m4 \
check-decl.m4 \
codeset.m4 \
d-ino.m4 \
decl.m4 \
error.m4 \
fnmatch.m4 \
getcwd.m4 \
getline.m4 \
gettext.m4 \
glibc21.m4 \
iconv.m4 \
inttypes.m4 \
jm-mktime.m4 \
lcmessage.m4 \
longlong.m4 \
malloc.m4 \
mbrtowc.m4 \
mbstate_t.m4 \
prereq.m4 \
progtest.m4 \
realloc.m4 \
strerror_r.m4 \
ulonglong.m4 \
utimbuf.m4 \
utime.m4 \
utimes.m4 \
xstrtoimax.m4 \
xstrtoumax.m4

View File

@@ -1,23 +0,0 @@
#serial 4
dnl From Paul Eggert.
AC_DEFUN([AC_C_BACKSLASH_A],
[
AC_CACHE_CHECK([whether backslash-a works in strings], ac_cv_c_backslash_a,
[AC_TRY_COMPILE([],
[
#if '\a' == 'a'
syntax error;
#endif
char buf['\a' == 'a' ? -1 : 1];
buf[0] = '\a';
return buf[0] != "\a"[0];
],
ac_cv_c_backslash_a=yes,
ac_cv_c_backslash_a=no)])
if test $ac_cv_c_backslash_a = yes; then
AC_DEFINE(HAVE_C_BACKSLASH_A, 1,
[Define if backslash-a works in C strings.])
fi
])

View File

@@ -1,95 +0,0 @@
# The following is taken from automake 1.4,
# except that it prefers the compiler option -Ae to "-Aa -D_HPUX_SOURCE"
# because only the former supports 64-bit integral types on HP-UX 10.20.
## ----------------------------------------- ##
## ANSIfy the C compiler whenever possible. ##
## From Franc,ois Pinard ##
## ----------------------------------------- ##
# serial 2
# @defmac AC_PROG_CC_STDC
# @maindex PROG_CC_STDC
# @ovindex CC
# If the C compiler in not in ANSI C mode by default, try to add an option
# to output variable @code{CC} to make it so. This macro tries various
# options that select ANSI C on some system or another. It considers the
# compiler to be in ANSI C mode if it handles function prototypes correctly.
#
# If you use this macro, you should check after calling it whether the C
# compiler has been set to accept ANSI C; if not, the shell variable
# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
# code in ANSI C, you can make an un-ANSIfied copy of it by using the
# program @code{ansi2knr}, which comes with Ghostscript.
# @end defmac
AC_DEFUN(AM_PROG_CC_STDC,
[AC_REQUIRE([AC_PROG_CC])
AC_BEFORE([$0], [AC_C_INLINE])
AC_BEFORE([$0], [AC_C_CONST])
dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
dnl a magic option to avoid problems with ANSI preprocessor commands
dnl like #elif.
dnl FIXME: can't do this because then AC_AIX won't work due to a
dnl circular dependency.
dnl AC_BEFORE([$0], [AC_PROG_CPP])
AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
AC_CACHE_VAL(am_cv_prog_cc_stdc,
[am_cv_prog_cc_stdc=no
ac_save_CC="$CC"
# Don't try gcc -ansi; that turns off useful extensions and
# breaks some systems' header files.
# AIX -qlanglvl=ansi
# Ultrix and OSF/1 -std1
# HP-UX -Aa -D_HPUX_SOURCE
# SVR4 -Xc -D__EXTENSIONS__
for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
AC_TRY_COMPILE(
[#include <stdarg.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (p, i)
char **p;
int i;
{
return p[i];
}
static char *f (char * (*g) (char **, int), char **p, ...)
{
char *s;
va_list v;
va_start (v,p);
s = g (p, va_arg (v,int));
va_end (v);
return s;
}
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
], [
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
],
[am_cv_prog_cc_stdc="$ac_arg"; break])
done
CC="$ac_save_CC"
])
if test -z "$am_cv_prog_cc_stdc"; then
AC_MSG_RESULT([none needed])
else
AC_MSG_RESULT($am_cv_prog_cc_stdc)
fi
case "x$am_cv_prog_cc_stdc" in
x|xno) ;;
*) CC="$CC $am_cv_prog_cc_stdc" ;;
esac
])

View File

@@ -1,37 +0,0 @@
#serial 5
AC_DEFUN(jm_CHECK_DECLARATION,
[
AC_MSG_CHECKING([whether $1 is declared])
AC_CACHE_VAL(jm_cv_func_decl_$1,
[AC_TRY_COMPILE($2,
[
#ifndef $1
char *(*pfn) = (char *(*)) $1
#endif
],
eval "jm_cv_func_decl_$1=yes",
eval "jm_cv_func_decl_$1=no")])
if eval "test \"`echo '$jm_cv_func_decl_'$1`\" = yes"; then
AC_MSG_RESULT(yes)
ifelse([$3], , :, [$3])
else
AC_MSG_RESULT(no)
ifelse([$4], , , [$4
])dnl
fi
])dnl
dnl jm_CHECK_DECLARATIONS(INCLUDES, FUNCTION... [, ACTION-IF-DECLARED
dnl [, ACTION-IF-NOT-DECLARED]])
AC_DEFUN(jm_CHECK_DECLARATIONS,
[
for jm_func in $2
do
jm_CHECK_DECLARATION($jm_func, $1,
[
jm_tr_func=HAVE_DECL_`echo $jm_func | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
AC_DEFINE_UNQUOTED($jm_tr_func) $3], $4)dnl
done
])

View File

@@ -1,12 +0,0 @@
#serial 3
dnl FIXME: put these prerequisite-only *.m4 files in a separate
dnl directory -- otherwise, they'll conflict with existing files.
dnl These are the prerequisite macros for GNU's error.c file.
AC_DEFUN([jm_PREREQ_ERROR],
[
AC_CHECK_FUNCS(strerror strerror_r vprintf doprnt)
AC_FUNC_STRERROR_R
AC_HEADER_STDC
])

View File

@@ -1,24 +0,0 @@
dnl This is a copy of autoconf 2.13, except we also check that
dnl FNM_FILE_NAME | FNM_LEADING_DIR works.
dnl
undefine([AC_FUNC_FNMATCH])
AC_DEFUN(AC_FUNC_FNMATCH,
[AC_CACHE_CHECK(for working GNU-style fnmatch, ac_cv_func_fnmatch_works,
# Some versions of Solaris, SCO, and the GNU C Library
# have a broken or incompatible fnmatch.
# So we run a test program. If we are cross-compiling, take no chance.
# Thanks to John Oleynick, Franc,ois Pinard, and Paul Eggert for this test.
[AC_TRY_RUN([#include <fnmatch.h>
main() {
exit (fnmatch ("a*", "abc", 0) != 0
|| fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) != FNM_NOMATCH
|| fnmatch("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR) != 0
|| fnmatch("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR) != 0
|| fnmatch("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR) != 0);
}],
ac_cv_func_fnmatch_works=yes, ac_cv_func_fnmatch_works=no,
ac_cv_func_fnmatch_works=no)])
if test $ac_cv_func_fnmatch_works = yes; then
AC_DEFINE(HAVE_FNMATCH)
fi
])

View File

@@ -1,53 +0,0 @@
# getcwd.m4 - check whether getcwd (NULL, 0) allocates memory for result
# Copyright 2001 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# Written by Paul Eggert.
AC_DEFUN([AC_FUNC_GETCWD_NULL],
[AC_CHECK_HEADERS(stdlib.h unistd.h)
AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result],
[ac_cv_func_getcwd_null],
[AC_TRY_RUN(
[
# ifdef HAVE_STDLIB_H
# include <stdlib.h>
# endif
# ifdef HAVE_UNISTD_H
# include <unistd.h>
# endif
# ifndef getcwd
char *getcwd ();
# endif
int
main ()
{
if (chdir ("/") != 0)
exit (1);
else
{
char *f = getcwd (NULL, 0);
exit (! (f && f[0] == '/' && !f[1]));
}
}],
[ac_cv_func_getcwd_null=yes],
[ac_cv_func_getcwd_null=no],
[ac_cv_func_getcwd_null=no])])
if test $ac_cv_func_getcwd_null = yes; then
AC_DEFINE(HAVE_GETCWD_NULL, 1,
[Define if getcwd (NULL, 0) allocates memory for result.])
fi])

View File

@@ -1,368 +0,0 @@
# Macro to add for using GNU gettext.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU General Public
# License but which still want to provide support for the GNU gettext
# functionality.
# Please note that the actual code of GNU gettext is covered by the GNU
# General Public License and is *not* in the public domain.
# serial 10
dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
dnl depending on --{enable,disable}-{shared,static} and on the presence of
dnl AM-DISABLE-SHARED). Otherwise, a static library
dnl $(top_builddir)/intl/libintl.a will be created.
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
dnl implementations (in libc or libintl) without the ngettext() function
dnl will be ignored.
dnl LIBDIR is used to find the intl libraries. If empty,
dnl the value `$(top_builddir)/intl/' is used.
dnl
dnl The result of the configuration is one of three cases:
dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
dnl and used.
dnl Catalog format: GNU --> install in $(datadir)
dnl Catalog extension: .mo after installation, .gmo in source tree
dnl 2) GNU gettext has been found in the system's C library.
dnl Catalog format: GNU --> install in $(datadir)
dnl Catalog extension: .mo after installation, .gmo in source tree
dnl 3) No internationalization, always use English msgid.
dnl Catalog format: none
dnl Catalog extension: none
dnl The use of .gmo is historical (it was needed to avoid overwriting the
dnl GNU format catalogs when building on a platform with an X/Open gettext),
dnl but we keep it in order not to force irrelevant filename changes on the
dnl maintainers.
dnl
AC_DEFUN([AM_WITH_NLS],
[AC_MSG_CHECKING([whether NLS is requested])
dnl Default is enabled NLS
AC_ARG_ENABLE(nls,
[ --disable-nls do not use Native Language Support],
USE_NLS=$enableval, USE_NLS=yes)
AC_MSG_RESULT($USE_NLS)
AC_SUBST(USE_NLS)
BUILD_INCLUDED_LIBINTL=no
USE_INCLUDED_LIBINTL=no
INTLLIBS=
dnl If we use NLS figure out what method
if test "$USE_NLS" = "yes"; then
AC_DEFINE(ENABLE_NLS, 1,
[Define to 1 if translation of program messages to the user's native language
is requested.])
AC_MSG_CHECKING([whether included gettext is requested])
AC_ARG_WITH(included-gettext,
[ --with-included-gettext use the GNU gettext library included here],
nls_cv_force_use_gnu_gettext=$withval,
nls_cv_force_use_gnu_gettext=no)
AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
dnl User does not insist on using GNU NLS library. Figure out what
dnl to use. If GNU gettext is available we use this. Else we have
dnl to fall back to GNU NLS library.
CATOBJEXT=NONE
dnl Add a version number to the cache macros.
define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
AC_CHECK_HEADER(libintl.h,
[AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
[AC_TRY_LINK([#include <libintl.h>
extern int _nl_msg_cat_cntr;],
[bindtextdomain ("", "");
return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
gt_cv_func_gnugettext_libc=yes,
gt_cv_func_gnugettext_libc=no)])
if test "$gt_cv_func_gnugettext_libc" != "yes"; then
AC_CACHE_CHECK([for GNU gettext in libintl],
gt_cv_func_gnugettext_libintl,
[gt_save_LIBS="$LIBS"
LIBS="$LIBS -lintl $LIBICONV"
AC_TRY_LINK([#include <libintl.h>
extern int _nl_msg_cat_cntr;],
[bindtextdomain ("", "");
return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
gt_cv_func_gnugettext_libintl=yes,
gt_cv_func_gnugettext_libintl=no)
LIBS="$gt_save_LIBS"])
fi
dnl If an already present or preinstalled GNU gettext() is found,
dnl use it. But if this macro is used in GNU gettext, and GNU
dnl gettext is already preinstalled in libintl, we update this
dnl libintl. (Cf. the install rule in intl/Makefile.in.)
if test "$gt_cv_func_gnugettext_libc" = "yes" \
|| { test "$gt_cv_func_gnugettext_libintl" = "yes" \
&& test "$PACKAGE" != gettext; }; then
AC_DEFINE(HAVE_GETTEXT, 1,
[Define if the GNU gettext() function is already present or preinstalled.])
if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
dnl If iconv() is in a separate libiconv library, then anyone
dnl linking with libintl{.a,.so} also needs to link with
dnl libiconv.
INTLLIBS="-lintl $LIBICONV"
fi
gt_save_LIBS="$LIBS"
LIBS="$LIBS $INTLLIBS"
AC_CHECK_FUNCS(dcgettext)
LIBS="$gt_save_LIBS"
dnl Search for GNU msgfmt in the PATH.
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
dnl Search for GNU xgettext in the PATH.
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
CATOBJEXT=.gmo
fi
])
if test "$CATOBJEXT" = "NONE"; then
dnl GNU gettext is not found in the C library.
dnl Fall back on GNU gettext library.
nls_cv_use_gnu_gettext=yes
fi
fi
if test "$nls_cv_use_gnu_gettext" = "yes"; then
dnl Mark actions used to generate GNU NLS library.
INTLOBJS="\$(GETTOBJS)"
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
AC_SUBST(MSGFMT)
BUILD_INCLUDED_LIBINTL=yes
USE_INCLUDED_LIBINTL=yes
CATOBJEXT=.gmo
INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
fi
dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
dnl Test whether we really found GNU msgfmt.
if test "$GMSGFMT" != ":"; then
dnl If it is no GNU msgfmt we define it as : so that the
dnl Makefiles still can work.
if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
: ;
else
AC_MSG_RESULT(
[found msgfmt program is not GNU msgfmt; ignore it])
GMSGFMT=":"
fi
fi
dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
dnl Test whether we really found GNU xgettext.
if test "$XGETTEXT" != ":"; then
dnl If it is no GNU xgettext we define it as : so that the
dnl Makefiles still can work.
if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
: ;
else
AC_MSG_RESULT(
[found xgettext program is not GNU xgettext; ignore it])
XGETTEXT=":"
fi
fi
dnl We need to process the po/ directory.
POSUB=po
fi
AC_OUTPUT_COMMANDS(
[for ac_file in $CONFIG_FILES; do
# Support "outfile[:infile[:infile...]]"
case "$ac_file" in
*:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
esac
# PO directories have a Makefile.in generated from Makefile.in.in.
case "$ac_file" in */Makefile.in)
# Adjust a relative srcdir.
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
# In autoconf-2.13 it is called $ac_given_srcdir.
# In autoconf-2.50 it is called $srcdir.
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
case "$ac_given_srcdir" in
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
/*) top_srcdir="$ac_given_srcdir" ;;
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
esac
if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
rm -f "$ac_dir/POTFILES"
test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
fi
;;
esac
done])
dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
dnl to 'yes' because some of the testsuite requires it.
if test "$PACKAGE" = gettext; then
BUILD_INCLUDED_LIBINTL=yes
fi
dnl intl/plural.c is generated from intl/plural.y. It requires bison,
dnl because plural.y uses bison specific features. It requires at least
dnl bison-1.26 because earlier versions generate a plural.c that doesn't
dnl compile.
dnl bison is only needed for the maintainer (who touches plural.y). But in
dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
dnl the rule in general Makefile. Now, some people carelessly touch the
dnl files or have a broken "make" program, hence the plural.c rule will
dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
dnl present or too old.
AC_CHECK_PROGS([INTLBISON], [bison])
if test -z "$INTLBISON"; then
ac_verc_fail=yes
else
dnl Found it, now check the version.
AC_MSG_CHECKING([version of bison])
changequote(<<,>>)dnl
ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison .* \([0-9]*\.[0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
changequote([,])dnl
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
esac
AC_MSG_RESULT([$ac_prog_version])
fi
if test $ac_verc_fail = yes; then
INTLBISON=:
fi
dnl These rules are solely for the distribution goal. While doing this
dnl we only have to keep exactly one list of the available catalogs
dnl in configure.in.
for lang in $ALL_LINGUAS; do
GMOFILES="$GMOFILES $lang.gmo"
POFILES="$POFILES $lang.po"
done
dnl Make all variables we use known to autoconf.
AC_SUBST(BUILD_INCLUDED_LIBINTL)
AC_SUBST(USE_INCLUDED_LIBINTL)
AC_SUBST(CATALOGS)
AC_SUBST(CATOBJEXT)
AC_SUBST(GMOFILES)
AC_SUBST(INTLLIBS)
AC_SUBST(INTLOBJS)
AC_SUBST(POFILES)
AC_SUBST(POSUB)
dnl For backward compatibility. Some configure.ins may be using this.
nls_cv_header_intl=
nls_cv_header_libgt=
dnl For backward compatibility. Some Makefiles may be using this.
DATADIRNAME=share
AC_SUBST(DATADIRNAME)
dnl For backward compatibility. Some Makefiles may be using this.
INSTOBJEXT=.mo
AC_SUBST(INSTOBJEXT)
dnl For backward compatibility. Some Makefiles may be using this.
GENCAT=gencat
AC_SUBST(GENCAT)
])
dnl Usage: Just like AM_WITH_NLS, which see.
AC_DEFUN([AM_GNU_GETTEXT],
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_ISC_POSIX])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
AC_REQUIRE([AC_C_CONST])dnl
AC_REQUIRE([AC_C_INLINE])dnl
AC_REQUIRE([AC_TYPE_OFF_T])dnl
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
AC_REQUIRE([AC_FUNC_MMAP])dnl
AC_REQUIRE([jm_GLIBC21])dnl
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
stdlib.h string.h unistd.h sys/param.h])
AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
AM_ICONV
AM_LANGINFO_CODESET
AM_LC_MESSAGES
AM_WITH_NLS([$1],[$2],[$3])
if test "x$CATOBJEXT" != "x"; then
if test "x$ALL_LINGUAS" = "x"; then
LINGUAS=
else
AC_MSG_CHECKING(for catalogs to be installed)
NEW_LINGUAS=
for presentlang in $ALL_LINGUAS; do
useit=no
for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
# Use the presentlang catalog if desiredlang is
# a. equal to presentlang, or
# b. a variant of presentlang (because in this case,
# presentlang can be used as a fallback for messages
# which are not translated in the desiredlang catalog).
case "$desiredlang" in
"$presentlang"*) useit=yes;;
esac
done
if test $useit = yes; then
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
fi
done
LINGUAS=$NEW_LINGUAS
AC_MSG_RESULT($LINGUAS)
fi
dnl Construct list of names of catalog files to be constructed.
if test -n "$LINGUAS"; then
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
fi
fi
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
dnl Try to locate is.
MKINSTALLDIRS=
if test -n "$ac_aux_dir"; then
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
fi
if test -z "$MKINSTALLDIRS"; then
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
fi
AC_SUBST(MKINSTALLDIRS)
dnl Enable libtool support if the surrounding package wishes it.
INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
])

View File

@@ -1,32 +0,0 @@
#serial 6
dnl From Paul Eggert.
AC_PREREQ(2.52)
# Define intmax_t to long or long long if <inttypes.h> doesn't define.
AC_DEFUN([jm_AC_TYPE_INTMAX_T],
[
AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
AC_CHECK_TYPE(intmax_t, ,
[test $ac_cv_type_long_long = yes \
&& ac_type='long long' \
|| ac_type='long'
AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
[Define to widest signed type if <inttypes.h> doesn't define.])])
])
# Define uintmax_t to unsigned long or unsigned long long
# if <inttypes.h> doesn't define.
AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
[
AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
AC_CHECK_TYPE(uintmax_t, ,
[test $ac_cv_type_unsigned_long_long = yes \
&& ac_type='unsigned long long' \
|| ac_type='unsigned long'
AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
[Define to widest unsigned type if <inttypes.h> doesn't define.])])
])

View File

@@ -1,19 +0,0 @@
#serial 1
dnl From Paul Eggert
AC_DEFUN(jm_FUNC_MBRTOWC,
[
AC_MSG_CHECKING([whether mbrtowc and mbstate_t are properly declared])
AC_CACHE_VAL(jm_cv_func_mbrtowc,
[AC_TRY_LINK(
[#include <wchar.h>],
[mbstate_t state; return ! (sizeof state && mbrtowc);],
[jm_cv_func_mbrtowc=yes],
[jm_cv_func_mbrtowc=no])])
if test $jm_cv_func_mbrtowc = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MBRTOWC, 1,
[Define to 1 if mbrtowc and mbstate_t are properly declared.])
fi
])

View File

@@ -1,29 +0,0 @@
# serial 9
# From Paul Eggert.
# BeOS 5 has <wchar.h> but does not define mbstate_t,
# so you can't declare an object of that type.
# Check for this incompatibility with Standard C.
# Include stdlib.h first, because otherwise this test would fail on Linux
# (at least glibc-2.1.3) because the "_XOPEN_SOURCE 500" definition elicits
# a syntax error in wchar.h due to the use of undefined __int32_t.
AC_DEFUN([AC_MBSTATE_T],
[
AC_CHECK_HEADERS(stdlib.h)
AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
[AC_TRY_COMPILE([
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#include <wchar.h>],
[mbstate_t x; return sizeof x;],
ac_cv_type_mbstate_t=yes,
ac_cv_type_mbstate_t=no)])
if test $ac_cv_type_mbstate_t = no; then
AC_DEFINE(mbstate_t, int,
[Define to a type if <wchar.h> does not define.])
fi])

View File

@@ -1,141 +0,0 @@
#serial 21
dnl These are the prerequisite macros for files in the lib/
dnl directories of the fileutils, sh-utils, and textutils packages.
AC_DEFUN([jm_PREREQ],
[
jm_PREREQ_ADDEXT
jm_PREREQ_CANON_HOST
jm_PREREQ_DIRNAME
jm_PREREQ_ERROR
jm_PREREQ_EXCLUDE
jm_PREREQ_GETPAGESIZE
jm_PREREQ_HASH
jm_PREREQ_HUMAN
jm_PREREQ_MBSWIDTH
jm_PREREQ_MEMCHR
jm_PREREQ_QUOTEARG
jm_PREREQ_READUTMP
jm_PREREQ_REGEX
jm_PREREQ_TEMPNAME # called by mkstemp
])
AC_DEFUN([jm_PREREQ_ADDEXT],
[
dnl For addext.c.
AC_SYS_LONG_FILE_NAMES
AC_CHECK_FUNCS(pathconf)
AC_CHECK_HEADERS(limits.h string.h unistd.h)
])
AC_DEFUN([jm_PREREQ_CANON_HOST],
[
dnl Add any libraries as early as possible.
dnl In particular, inet_ntoa needs -lnsl at least on Solaris5.5.1,
dnl so we have to add -lnsl to LIBS before checking for that function.
AC_SEARCH_LIBS(gethostbyname, [inet nsl])
dnl These come from -lnsl on Solaris5.5.1.
AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
AC_CHECK_HEADERS(unistd.h string.h netdb.h sys/socket.h \
netinet/in.h arpa/inet.h)
])
AC_DEFUN([jm_PREREQ_DIRNAME],
[
AC_HEADER_STDC
AC_CHECK_HEADERS(string.h)
])
AC_DEFUN([jm_PREREQ_EXCLUDE],
[
jm_FUNC_FNMATCH
AC_CHECK_HEADERS(stdbool.h)
])
AC_DEFUN([jm_PREREQ_GETPAGESIZE],
[
AC_CHECK_FUNCS(getpagesize)
AC_CHECK_HEADERS(OS.h unistd.h)
])
AC_DEFUN([jm_PREREQ_HASH],
[
AC_CHECK_HEADERS(stdlib.h stdbool.h)
AC_REQUIRE([jm_CHECK_DECLS])
])
# If you use human.c, you need the following files:
# inttypes.m4 ulonglong.m4
AC_DEFUN([jm_PREREQ_HUMAN],
[
AC_CHECK_HEADERS(limits.h stdlib.h string.h)
AC_CHECK_DECLS([getenv])
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
])
AC_DEFUN([jm_PREREQ_MEMCHR],
[
AC_CHECK_HEADERS(limits.h stdlib.h bp-sym.h)
])
AC_DEFUN([jm_PREREQ_QUOTEARG],
[
AC_CHECK_FUNCS(isascii iswprint)
jm_FUNC_MBRTOWC
AC_CHECK_HEADERS(limits.h stddef.h stdlib.h string.h wchar.h wctype.h)
AC_HEADER_STDC
AC_C_BACKSLASH_A
AC_MBSTATE_T
AM_C_PROTOTYPES
])
AC_DEFUN([jm_PREREQ_READUTMP],
[
AC_HEADER_STDC
AC_CHECK_HEADERS(string.h utmp.h utmpx.h sys/param.h)
AC_CHECK_FUNCS(utmpname)
AC_CHECK_FUNCS(utmpxname)
AM_C_PROTOTYPES
if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
utmp_includes="\
$ac_includes_default
#ifdef HAVE_UTMPX_H
# include <utmpx.h>
#endif
#ifdef HAVE_UTMP_H
# include <utmp.h>
#endif
"
AC_CHECK_MEMBERS([struct utmpx.ut_user],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmp.ut_user],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmpx.ut_name],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmp.ut_name],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmpx.ut_type],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmp.ut_type],,,[$utmp_includes])
AC_LIBOBJ(readutmp)
fi
])
AC_DEFUN([jm_PREREQ_REGEX],
[
dnl FIXME: Maybe provide a btowc replacement someday: solaris-2.5.1 lacks it.
dnl FIXME: Check for wctype and iswctype, and and add -lw if necessary
dnl to get them.
AC_CHECK_FUNCS(bzero bcopy isascii btowc)
AC_CHECK_HEADERS(alloca.h libintl.h wctype.h wchar.h)
AC_HEADER_STDC
AC_FUNC_ALLOCA
])
AC_DEFUN([jm_PREREQ_TEMPNAME],
[
AC_HEADER_STDC
AC_HEADER_STAT
AC_CHECK_HEADERS(fcntl.h sys/time.h stdint.h unistd.h)
AC_CHECK_FUNCS(__secure_getenv gettimeofday)
])

View File

@@ -1,66 +0,0 @@
#serial 1002
# Experimental replacement for the function in the latest CVS autoconf.
# If the compile-test says strerror_r doesn't work, then resort to a
# `run'-test that works on BeOS and segfaults on DEC Unix.
# Use with the error.c file in ../lib.
undefine([AC_FUNC_STRERROR_R])
# AC_FUNC_STRERROR_R
# ------------------
AC_DEFUN([AC_FUNC_STRERROR_R],
[AC_CHECK_DECLS([strerror_r])
AC_CHECK_FUNCS([strerror_r])
if test $ac_cv_func_strerror_r = yes; then
AC_CHECK_HEADERS(string.h)
AC_CACHE_CHECK([for working strerror_r],
ac_cv_func_strerror_r_works,
[
AC_TRY_COMPILE(
[
# include <stdio.h>
# if HAVE_STRING_H
# include <string.h>
# endif
],
[
char buf[100];
char x = *strerror_r (0, buf, sizeof buf);
],
ac_cv_func_strerror_r_works=yes,
ac_cv_func_strerror_r_works=no
)
if test $ac_cv_func_strerror_r_works = no; then
# strerror_r seems not to work, but now we have to choose between
# systems that have relatively inaccessible declarations for the
# function. BeOS and DEC UNIX 4.0 fall in this category, but the
# former has a strerror_r that returns char*, while the latter
# has a strerror_r that returns `int'.
# This test should segfault on the DEC system.
AC_TRY_RUN(
[
# include <stdio.h>
# include <string.h>
# include <ctype.h>
extern char *strerror_r ();
int
main ()
{
char buf[100];
char x = *strerror_r (0, buf, sizeof buf);
exit (!isalpha (x));
}
],
ac_cv_func_strerror_r_works=yes,
ac_cv_func_strerror_r_works=no,
ac_cv_func_strerror_r_works=no)
fi
])
if test $ac_cv_func_strerror_r_works = yes; then
AC_DEFINE(HAVE_WORKING_STRERROR_R, 1,
[Define to 1 if `strerror_r' returns a string.])
fi
fi
])# AC_FUNC_STRERROR_R

View File

@@ -1,19 +0,0 @@
#serial 6
dnl From Paul Eggert.
AC_PREREQ(2.50)
# Define uintmax_t to `unsigned long' or `unsigned long long'
# if <inttypes.h> does not exist.
AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
[
AC_CHECK_TYPE(uintmax_t, ,
[AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
test $ac_cv_type_unsigned_long_long = yes \
&& ac_type='unsigned long long' \
|| ac_type='unsigned long'
AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
[Define to the widest unsigned type if standard headers do not declare.])])
])

View File

@@ -1,41 +0,0 @@
#serial 2
dnl Cloned from xstrtoumax.m4. Keep these files in sync.
# autoconf tests required for use of xstrtoimax.c
AC_DEFUN([jm_AC_PREREQ_XSTRTOIMAX],
[
AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
AC_CHECK_DECLS([strtol, strtoul, strtoll, strtoimax, strtoumax])
AC_CHECK_HEADERS(limits.h stdlib.h inttypes.h)
AC_CACHE_CHECK([whether <inttypes.h> defines strtoimax as a macro],
jm_cv_func_strtoimax_macro,
AC_EGREP_CPP([inttypes_h_defines_strtoimax], [#include <inttypes.h>
#ifdef strtoimax
inttypes_h_defines_strtoimax
#endif],
jm_cv_func_strtoimax_macro=yes,
jm_cv_func_strtoimax_macro=no))
if test "$jm_cv_func_strtoimax_macro" != yes; then
AC_REPLACE_FUNCS(strtoimax)
fi
dnl Only the replacement strtoimax invokes strtol and strtoll,
dnl so we need the replacements only if strtoimax does not exist.
case "$jm_cv_func_strtoimax_macro,$ac_cv_func_strtoimax" in
no,no)
AC_REPLACE_FUNCS(strtol)
dnl We don't need (and can't compile) the replacement strtoll
dnl unless the type `long long' exists.
if test "$ac_cv_type_long_long" = yes; then
AC_REPLACE_FUNCS(strtoll)
fi
;;
esac
])

View File

@@ -1,40 +0,0 @@
#serial 4
# autoconf tests required for use of xstrtoumax.c
AC_DEFUN([jm_AC_PREREQ_XSTRTOUMAX],
[
AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
AC_CHECK_DECLS([strtol, strtoul, strtoull, strtoimax, strtoumax])
AC_CHECK_HEADERS(limits.h stdlib.h inttypes.h)
AC_CACHE_CHECK([whether <inttypes.h> defines strtoumax as a macro],
jm_cv_func_strtoumax_macro,
AC_EGREP_CPP([inttypes_h_defines_strtoumax], [#include <inttypes.h>
#ifdef strtoumax
inttypes_h_defines_strtoumax
#endif],
jm_cv_func_strtoumax_macro=yes,
jm_cv_func_strtoumax_macro=no))
if test "$jm_cv_func_strtoumax_macro" != yes; then
AC_REPLACE_FUNCS(strtoumax)
fi
dnl Only the replacement strtoumax invokes strtoul and strtoull,
dnl so we need the replacements only if strtoumax does not exist.
case "$jm_cv_func_strtoumax_macro,$ac_cv_func_strtoumax" in
no,no)
AC_REPLACE_FUNCS(strtoul)
dnl We don't need (and can't compile) the replacement strtoull
dnl unless the type `unsigned long long' exists.
if test "$ac_cv_type_unsigned_long_long" = yes; then
AC_REPLACE_FUNCS(strtoull)
fi
;;
esac
])

22
po/.gitignore vendored Normal file
View File

@@ -0,0 +1,22 @@
*.gmo
*.mo
*.po
.reference
LINGUAS
Makefile
Makefile.in
Makefile.in.in
Makevars
Makevars.template
POTFILES
Rules-quot
boldquot.sed
en@boldquot.header
en@quot.header
insert-header.sed
insert-header.sin
quot.sed
remove-potcdate.sed
remove-potcdate.sin
stamp-po
tar.pot

View File

@@ -1,196 +0,0 @@
# Makefile for program source directory in GNU NLS utilities package.
# Copyright (C) 1995-1997, 2000, 2001 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
PACKAGE = @PACKAGE@
VERSION = @VERSION@
# These two variables depend on the location of this directory.
subdir = po
top_builddir = ..
SHELL = /bin/sh
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
datadir = @datadir@
localedir = $(datadir)/locale
gettextsrcdir = $(datadir)/gettext/po
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
MKINSTALLDIRS = @MKINSTALLDIRS@
mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
CC = @CC@
GMSGFMT = @GMSGFMT@
MSGFMT = @MSGFMT@
XGETTEXT = @XGETTEXT@
MSGMERGE = msgmerge
DEFS = @DEFS@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
INCLUDES = -I.. -I$(top_srcdir)/intl
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
POFILES = @POFILES@
GMOFILES = @GMOFILES@
DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
$(POFILES) $(GMOFILES)
POTFILES = \
CATALOGS = @CATALOGS@
.SUFFIXES:
.SUFFIXES: .c .o .po .pox .gmo .mo
.c.o:
$(COMPILE) $<
.po.pox:
$(MAKE) $(PACKAGE).pot
$(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
.po.mo:
$(MSGFMT) -o $@ $<
.po.gmo:
file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
&& rm -f $$file && $(GMSGFMT) --statistics -o $$file $<
all: all-@USE_NLS@
all-yes: $(CATALOGS)
all-no:
# Note: Target 'all' must not depend on target '$(srcdir)/$(PACKAGE).pot',
# otherwise packages like GCC can not be built if only parts of the source
# have been downloaded.
$(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in
$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
--add-comments --keyword=_ --keyword=N_ \
--files-from=$(srcdir)/POTFILES.in \
&& test ! -f $(PACKAGE).po \
|| ( rm -f $(srcdir)/$(PACKAGE).pot \
&& mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
install: install-exec install-data
install-exec:
install-data: install-data-@USE_NLS@
if test "$(PACKAGE)" = "gettext"; then \
$(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \
$(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
else \
: ; \
fi
install-data-no: all
install-data-yes: all
$(mkinstalldirs) $(DESTDIR)$(datadir)
@catalogs='$(CATALOGS)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
lang=`echo $$cat | sed 's/\.gmo$$//'`; \
dir=$(localedir)/$$lang/LC_MESSAGES; \
$(mkinstalldirs) $(DESTDIR)$$dir; \
if test -r $$cat; then \
$(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
echo "installing $$cat as $(DESTDIR)$$dir/$(PACKAGE).mo"; \
else \
$(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
echo "installing $(srcdir)/$$cat as" \
"$(DESTDIR)$$dir/$(PACKAGE).mo"; \
fi; \
done
# Define this as empty until I found a useful application.
installcheck:
uninstall:
catalogs='$(CATALOGS)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
lang=`echo $$cat | sed 's/\.gmo$$//'`; \
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
done
if test "$(PACKAGE)" = "gettext"; then \
rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
else \
: ; \
fi
check: all
dvi info tags TAGS ID:
mostlyclean:
rm -f core core.* *.pox $(PACKAGE).po *.new.po
rm -fr *.o
clean: mostlyclean
distclean: clean
rm -f Makefile Makefile.in POTFILES *.mo
maintainer-clean: distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
rm -f $(GMOFILES)
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
dist distdir:
$(MAKE) update-po
@$(MAKE) dist2
# This is a separate target because 'update-po' must be executed before.
dist2: $(DISTFILES)
dists="$(DISTFILES)"; \
for file in $$dists; do \
if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
cp -p $$dir/$$file $(distdir); \
done
update-po: Makefile
$(MAKE) $(PACKAGE).pot
if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
cd $(srcdir); \
catalogs='$(GMOFILES)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
lang=`echo $$cat | sed 's/\.gmo$$//'`; \
echo "$$lang:"; \
if $(MSGMERGE) $$lang.po $(PACKAGE).pot -o $$lang.new.po; then \
mv -f $$lang.new.po $$lang.po; \
else \
echo "msgmerge for $$cat failed!"; \
rm -f $$lang.new.po; \
fi; \
done
$(MAKE) update-gmo
update-gmo: Makefile $(GMOFILES)
@:
Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
$(SHELL) ./config.status
# Tell versions [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@@ -1,14 +1,49 @@
# List of files which contain translatable strings.
# Copyright 1996, 1999 Free Software Foundation, Inc.
# Copyright (C) 1996, 1999, 2000, 2003, 2004, 2005, 2007 Free Software
# Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# Library files
lib/argmatch.c
lib/error.c
lib/getopt.c
lib/xmalloc.c
gnu/argmatch.c
gnu/argp-help.c
gnu/argp-parse.c
gnu/closeout.c
gnu/error.c
gnu/getopt.c
gnu/obstack.c
gnu/human.c
gnu/obstack.c
gnu/openat-die.c
gnu/quotearg.c
gnu/rpmatch.c
gnu/xalloc-die.c
gnu/xmalloc.c
gnu/version-etc.c
gnu/xalloc-die.c
lib/paxerror.c
lib/paxexit.c
lib/paxnames.c
lib/rtapelib.c
rmt/rmt.c
# Package source files
src/arith.c
src/buffer.c
src/common.h
src/compare.c
@@ -17,13 +52,12 @@ src/delete.c
src/extract.c
src/incremen.c
src/list.c
src/mangle.c
src/misc.c
src/names.c
src/rmt.c
src/rtapelib.c
src/tar.c
src/update.c
src/xheader.c
src/checkpoint.c
# Checking tools
# Testsuite
tests/genfile.c

852
rebox.el
View File

@@ -1,852 +0,0 @@
;;; Handling of comment boxes.
;;; Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
;;; Fran<61>ois Pinard <pinard@iro.umontreal.ca>, April 1991.
;;; I first observed rounded corners, as in style 223 boxes, in code from
;;; Warren Tucker <wht@n4hgf.mt-park.ga.us>, a previous shar maintainer.
;;; Refilling paragraphs inside comments, stretching or shrinking the
;;; surrounding box as needed, is a pain to do "by hand". This GNU Emacs
;;; LISP code eases my life on this and I find it fair, giving all sources
;;; for a package, to also give the means for nicely modifying comments.
;;; The function rebox-comment discovers the extent of the boxed comments
;;; near the cursor, possibly refills the text, then adjusts the comment
;;; box style. The function rebox-region does the same, except that it
;;; takes the current region as a boxed comment. Numeric prefixes are
;;; used to add or remove a box, change its style (language, quality or
;;; type), or to prevent refilling of its text. A minus sign alone as
;;; prefix asks for interactive style selection.
;;; For most Emacs language editing modes, refilling does not make sense
;;; outside comments, so you may redefine the M-q command and link it to
;;; this file. For example, I use this in my .emacs file:
;;; (setq c-mode-hook
;;; '(lambda ()
;;; (define-key c-mode-map "\M-q" 'rebox-comment)))
;;; (autoload 'rebox-comment "rebox" nil t)
;;; (autoload 'rebox-region "rebox" nil t)
;;; The cursor should be within a comment before any of these commands,
;;; or else it should be between two comments, in which case the command
;;; applies to the next comment. When the command is given without prefix,
;;; the current comment box style is recognized from the comment itself
;;; as far as possible, and preserved. A prefix may be used to force
;;; a particular box style. A style is made up of three attributes: a
;;; language (the hundreds digit), a quality (the tens digit) and a type
;;; (the units digit). A zero or negative flag value changes the default
;;; box style to its absolute value. Zero digits in default style,
;;; when not overriden in flag, asks for recognition of corresponding
;;; attributes from the current box. `C-u' avoids refilling the text,
;;; using the default box style. `C-u -' defines the style interactively.
;;; Box language is associated with comment delimiters. Values are 100
;;; for none or unknown, 200 for `/*' and `*/' as in plain C, 300 for
;;; '//' as in C++, 400 for `#' as in most scripting languages, 500 for
;;; `;' as in LISP or assembler and 600 for `%' as in TeX or PostScript.
;;; Box quality differs according to language. For unknown languages (100)
;;; or for the C language (200), values are 10 for simple, 20 or 30 for
;;; rounded, and 40 for starred. For all others, box quality indicates
;;; the thickness in characters of the left and right sides of the box:
;;; values are 10, 20, 30 or 40 for 1, 2, 3 or 4 characters wide. C++
;;; quality 10 is always promoted to 20. Roughly said, simple quality
;;; boxes (10) use comment delimiters to left and right of each comment
;;; line, and also for the top or bottom line when applicable. Rounded
;;; quality boxes (20 or 30) try to suggest rounded corners in boxes.
;;; Starred quality boxes (40) mostly use a left margin of asterisks or
;;; X'es, and use them also in box surroundings. Experiment a little to
;;; see what happens.
;;; Box type values are 1 for fully opened boxes for which boxing is done
;;; only for the left and right but not for top or bottom, 2 for half
;;; single lined boxes for which boxing is done on all sides except top,
;;; 3 for fully single lined boxes for which boxing is done on all sides,
;;; 4 for half double lined boxes which is like type 2 but more bold,
;;; or 5 for fully double lined boxes which is like type 3 but more bold.
;;; The special style 221 or 231 is worth a note, because it is fairly
;;; common: the whole C comment stays between a single opening `/*'
;;; and a single closing `*/'. The special style 111 deletes a box.
;;; The initial default style is 023 so, unless overriden, comments are
;;; put in single lined boxes, C comments are of rounded quality.
(defvar rebox-default-style 0 "*Preferred style for box comments.")
;;; Help strings for prompting or error messages.
(defconst REBOX_HELP_FOR_LANGUAGE
"Box language is 100-none, 200-/*, 300-//, 400-#, 500-;, 600-%%")
(defconst REBOX_LANGUAGE_NONE 100)
(defconst REBOX_LANGUAGE_C 200)
(defconst REBOX_LANGUAGE_C++ 300)
(defconst REBOX_LANGUAGE_AWK 400)
(defconst REBOX_LANGUAGE_LISP 500)
(defconst REBOX_LANGUAGE_TEX 600)
(defun rebox-help-string-for-language (language)
(cond ((= language 0) "default language")
((= language REBOX_LANGUAGE_NONE) "no language")
((= language REBOX_LANGUAGE_C) "plain C")
((= language REBOX_LANGUAGE_C++) "C++")
((= language REBOX_LANGUAGE_AWK) "sh/Perl/make")
((= language REBOX_LANGUAGE_LISP) "LISP/assembler")
((= language REBOX_LANGUAGE_TEX) "TeX/PostScript")
(t "<Unknown Language>")))
(defconst REBOX_HELP_FOR_QUALITY
"Box quality/width is 10-simple, 20-rounded, 30-rounded or 40-starred")
(defconst REBOX_QUALITY_SIMPLE_ONE 10)
(defconst REBOX_QUALITY_ROUNDED_TWO 20)
(defconst REBOX_QUALITY_ROUNDED_THREE 30)
(defconst REBOX_QUALITY_STARRED_FOUR 40)
(defun rebox-help-string-for-quality (quality)
(cond ((= quality 0) "default quality")
((= quality REBOX_QUALITY_SIMPLE_ONE) "square or 1-wide")
((= quality REBOX_QUALITY_ROUNDED_TWO) "rounded or 2-wide")
((= quality REBOX_QUALITY_ROUNDED_THREE) "rounded or 3-wide")
((= quality REBOX_QUALITY_STARRED_FOUR) "starred or 4-wide")
(t "<Unknown Quality>")))
(defconst REBOX_HELP_FOR_TYPE
"Box type is 1-open, 2-half-single, 3-single, 4-half-double or 5-double")
(defconst REBOX_TYPE_OPEN 1)
(defconst REBOX_TYPE_HALF_SINGLE 2)
(defconst REBOX_TYPE_SINGLE 3)
(defconst REBOX_TYPE_HALF_DOUBLE 4)
(defconst REBOX_TYPE_DOUBLE 5)
(defun rebox-help-string-for-type (type)
(cond ((= type 0) "default type")
((= type REBOX_TYPE_OPEN) "opened box")
((= type REBOX_TYPE_HALF_SINGLE) "half normal")
((= type REBOX_TYPE_SINGLE) "full normal")
((= type REBOX_TYPE_HALF_DOUBLE) "half bold")
((= type REBOX_TYPE_DOUBLE) "full bold")
(t "<Unknown Type>")))
(defconst REBOX_MAX_LANGUAGE 6)
(defconst REBOX_MAX_QUALITY 4)
(defconst REBOX_MAX_TYPE 5)
;;; Request the style interactively, using the minibuffer.
(defun rebox-ask-for-style ()
(let (key language quality type)
(while (not language)
(message REBOX_HELP_FOR_LANGUAGE)
(setq key (read-char))
(if (and (>= key ?0) (<= key (+ ?0 REBOX_MAX_LANGUAGE)))
(setq language (- key ?0))))
(while (not quality)
(message REBOX_HELP_FOR_QUALITY)
(setq key (read-char))
(if (and (>= key ?0) (<= key (+ ?0 REBOX_MAX_QUALITY)))
(setq quality (- key ?0))))
(while (not type)
(message REBOX_HELP_FOR_TYPE)
(setq key (read-char))
(if (and (>= key ?0) (<= key (+ ?0 REBOX_MAX_TYPE)))
(setq type (- key ?0))))
(+ (* 100 language) (* 10 quality) type)))
;;; Write some TEXT followed by an edited STYLE value into the minibuffer.
(defun rebox-show-style (text style)
(message
(concat text (format " (%03d)" style)
": " (rebox-help-string-for-language (* (/ style 100) 100))
", " (rebox-help-string-for-quality (* (% (/ style 10) 10) 10))
", " (rebox-help-string-for-type (% style 10)))))
;;; Validate FLAG and usually return t if not interrupted by errors.
;;; But if FLAG is zero or negative, then change default box style and
;;; return nil.
(defun rebox-validate-flag (flag)
;; Validate flag.
(if (numberp flag)
(let ((value (if (< flag 0) (- flag) flag)))
(if (> (/ value 100) REBOX_MAX_LANGUAGE)
(error REBOX_HELP_FOR_LANGUAGE))
(if (> (% (/ value 10) 10) REBOX_MAX_QUALITY)
(error REBOX_HELP_FOR_QUALITY))
(if (> (% value 10) REBOX_MAX_TYPE)
(error REBOX_HELP_FOR_TYPE))))
;; Change default box style if requested.
(if (and (numberp flag) (<= flag 0))
(progn
(setq flag (- flag))
(if (not (zerop (/ flag 100)))
(setq rebox-default-style
(+ (* (/ flag 100) 100)
(% rebox-default-style 100))))
(if (not (zerop (% (/ flag 10) 10)))
(setq rebox-default-style
(+ (* (/ rebox-default-style 100) 100)
(* (% (/ flag 10) 10) 10)
(% rebox-default-style 10))))
(if (not (zerop (% flag 10)))
(setq rebox-default-style
(+ (* (/ rebox-default-style 10) 10)
(% flag 10))))
(rebox-show-style "Default style" rebox-default-style)
nil)
t))
;;; Return the minimum value of the left margin of all lines, or -1 if
;;; all lines are empty.
(defun rebox-left-margin ()
(let ((margin -1))
(goto-char (point-min))
(while (not (eobp))
(skip-chars-forward " \t")
(if (not (looking-at "\n"))
(setq margin
(if (< margin 0)
(current-column)
(min margin (current-column)))))
(forward-line 1))
margin))
;;; Return the maximum value of the right margin of all lines. Any
;;; sentence ending a line has a space guaranteed before the margin.
(defun rebox-right-margin ()
(let ((margin 0) period)
(goto-char (point-min))
(while (not (eobp))
(end-of-line)
(if (bobp)
(setq period 0)
(backward-char 1)
(setq period (if (looking-at "[.?!]") 1 0))
(forward-char 1))
(setq margin (max margin (+ (current-column) period)))
(forward-char 1))
margin))
;;; Return a regexp to match the start or end of a comment for some
;;; LANGUAGE, leaving the comment marks themselves available in \1.
;; FIXME: Recognize style 1** boxes.
(defun rebox-regexp-start (language)
(cond ((= language 0) "^[ \t]*\\(/\\*\\|//+\\|#+\\|;+\\|%+\\)")
((= language REBOX_LANGUAGE_NONE) "^\\(\\)")
((= language REBOX_LANGUAGE_C) "^[ \t]*\\(/\\*\\)")
((= language REBOX_LANGUAGE_C++) "^[ \t]*\\(//+\\)")
((= language REBOX_LANGUAGE_AWK) "^[ \t]*\\(#+\\)")
((= language REBOX_LANGUAGE_LISP) "^[ \t]*\\(;+\\)")
((= language REBOX_LANGUAGE_TEX) "^[ \t]*\\(%+\\)")))
(defun rebox-regexp-end (language)
(cond ((= language 0) "\\(\\*/\\|//+\\|#+\\|;+\\|%+\\)[ \t]*$")
((= language REBOX_LANGUAGE_NONE) "\\(\\)$")
((= language REBOX_LANGUAGE_C) "\\(\\*/\\)[ \t]*$")
((= language REBOX_LANGUAGE_C++) "\\(//+\\)[ \t]*$")
((= language REBOX_LANGUAGE_AWK) "\\(#+\\)[ \t]*$")
((= language REBOX_LANGUAGE_LISP) "\\(;+\\)[ \t]*$")
((= language REBOX_LANGUAGE_TEX) "\\(%+\\)[ \t]*$")))
;;; By looking at the text starting at the cursor position, guess the
;;; language in use, and return it.
(defun rebox-guess-language ()
(let ((language REBOX_LANGUAGE_NONE)
(value (* 100 REBOX_MAX_LANGUAGE)))
(while (not (zerop value))
(if (looking-at (rebox-regexp-start value))
(progn
(setq language value)
(setq value 0))
(setq value (- value 100))))
language))
;;; Find the limits of the block of comments following or enclosing
;;; the cursor, or return an error if the cursor is not within such a
;;; block of comments. Extend it as far as possible in both
;;; directions, then narrow the buffer around it.
(defun rebox-find-and-narrow ()
(save-excursion
(let (start end temp language)
;; Find the start of the current or immediately following comment.
(beginning-of-line)
(skip-chars-forward " \t\n")
(beginning-of-line)
(if (not (looking-at (rebox-regexp-start 0)))
(progn
(setq temp (point))
(if (re-search-forward "\\*/" nil t)
(progn
(re-search-backward "/\\*")
(if (> (point) temp)
(error "outside any comment block"))
(setq temp (point))
(beginning-of-line)
(skip-chars-forward " \t")
(if (not (= (point) temp))
(error "text before start of comment"))
(beginning-of-line))
(error "outside any comment block"))))
(setq start (point))
(setq language (rebox-guess-language))
;; - find the end of this comment
(if (= language REBOX_LANGUAGE_C)
(progn
(search-forward "*/")
(if (not (looking-at "[ \t]*$"))
(error "text after end of comment"))))
(end-of-line)
(if (eobp)
(insert "\n")
(forward-char 1))
(setq end (point))
;; - try to extend the comment block backwards
(goto-char start)
(while (and (not (bobp))
(if (= language REBOX_LANGUAGE_C)
(progn
(skip-chars-backward " \t\n")
(if (and (looking-at "[ \t]*\n[ \t]*/\\*")
(> (point) 2))
(progn
(backward-char 2)
(if (looking-at "\\*/")
(progn
(re-search-backward "/\\*")
(setq temp (point))
(beginning-of-line)
(skip-chars-forward " \t")
(if (= (point) temp)
(progn (beginning-of-line) t)))))))
(previous-line 1)
(looking-at (rebox-regexp-start language))))
(setq start (point)))
;; - try to extend the comment block forward
(goto-char end)
(while (looking-at (rebox-regexp-start language))
(if (= language REBOX_LANGUAGE_C)
(progn
(re-search-forward "[ \t]*/\\*")
(re-search-forward "\\*/")
(if (looking-at "[ \t]*$")
(progn
(beginning-of-line)
(forward-line 1)
(setq end (point)))))
(forward-line 1)
(setq end (point))))
;; - narrow to the whole block of comments
(narrow-to-region start end))))
;;; After refilling it if REFILL is not nil, while respecting a left
;;; MARGIN, put the narrowed buffer back into a boxed LANGUAGE comment
;;; box of a given QUALITY and TYPE.
(defun rebox-reconstruct (refill margin language quality type)
(rebox-show-style "Style" (+ language quality type))
(let (right-margin nw nn ne ww ee sw ss se x xx)
;; - decide the elements of the box being produced
(cond ((= language REBOX_LANGUAGE_NONE)
;; - planify a comment for no language in particular
(cond ((= quality REBOX_QUALITY_SIMPLE_ONE)
;; - planify a simple box
(cond ((= type REBOX_TYPE_OPEN)
(setq nw "") (setq sw "")
(setq ww "") (setq ee ""))
((= type REBOX_TYPE_HALF_SINGLE)
(setq nw "")
(setq ww "| ") (setq ee " |")
(setq sw "+-") (setq ss ?-) (setq se "-+"))
((= type REBOX_TYPE_SINGLE)
(setq nw "+-") (setq nn ?-) (setq ne "-+")
(setq ww "| ") (setq ee " |")
(setq sw "+-") (setq ss ?-) (setq se "-+"))
((= type REBOX_TYPE_HALF_DOUBLE)
(setq nw "")
(setq ww "| ") (setq ee " |")
(setq sw "*=") (setq ss ?=) (setq se "=*"))
((= type REBOX_TYPE_DOUBLE)
(setq nw "*=") (setq nn ?=) (setq ne "=*")
(setq ww "| ") (setq ee " |")
(setq sw "*=") (setq ss ?=) (setq se "=*"))))
((or (= quality REBOX_QUALITY_ROUNDED_TWO)
(= quality REBOX_QUALITY_ROUNDED_THREE))
;; - planify a rounded box
(cond ((= type REBOX_TYPE_OPEN)
(setq nw "") (setq sw "")
(setq ww "| ") (setq ee " |"))
((= type REBOX_TYPE_HALF_SINGLE)
(setq nw "")
(setq ww "| ") (setq ee " |")
(setq sw "`-") (setq ss ?-) (setq se "-'"))
((= type REBOX_TYPE_SINGLE)
(setq nw ".-") (setq nn ?-) (setq ne "-.")
(setq ww "| ") (setq ee " |")
(setq sw "`-") (setq ss ?-) (setq se "-'"))
((= type REBOX_TYPE_HALF_DOUBLE)
(setq nw "")
(setq ww "| " ) (setq ee " |" )
(setq sw "\\=") (setq ss ?=) (setq se "=/" ))
((= type REBOX_TYPE_DOUBLE)
(setq nw "/=" ) (setq nn ?=) (setq ne "=\\")
(setq ww "| " ) (setq ee " |" )
(setq sw "\\=") (setq ss ?=) (setq se "=/" ))))
((= quality REBOX_QUALITY_STARRED_FOUR)
;; - planify a starred box
(cond ((= type REBOX_TYPE_OPEN)
(setq nw "") (setq sw "")
(setq ww "| ") (setq ee ""))
((= type REBOX_TYPE_HALF_SINGLE)
(setq nw "")
(setq ww "* ") (setq ee " *")
(setq sw "**") (setq ss ?*) (setq se "**"))
((= type REBOX_TYPE_SINGLE)
(setq nw "**") (setq nn ?*) (setq ne "**")
(setq ww "* ") (setq ee " *")
(setq sw "**") (setq ss ?*) (setq se "**"))
((= type REBOX_TYPE_HALF_DOUBLE)
(setq nw "")
(setq ww "X ") (setq ee " X")
(setq sw "XX") (setq ss ?X) (setq se "XX"))
((= type REBOX_TYPE_DOUBLE)
(setq nw "XX") (setq nn ?X) (setq ne "XX")
(setq ww "X ") (setq ee " X")
(setq sw "XX") (setq ss ?X) (setq se "XX"))))))
((= language REBOX_LANGUAGE_C)
;; - planify a comment for C
(cond ((= quality REBOX_QUALITY_SIMPLE_ONE)
;; - planify a simple C comment
(cond ((= type REBOX_TYPE_OPEN)
(setq nw "") (setq sw "")
(setq ww "/* ") (setq ee " */"))
((= type REBOX_TYPE_HALF_SINGLE)
(setq nw "")
(setq ww "/* ") (setq ee " */")
(setq sw "/* ") (setq ss ?-) (setq se " */"))
((= type REBOX_TYPE_SINGLE)
(setq nw "/* ") (setq nn ?-) (setq ne " */")
(setq ww "/* ") (setq ee " */")
(setq sw "/* ") (setq ss ?-) (setq se " */"))
((= type REBOX_TYPE_HALF_DOUBLE)
(setq nw "")
(setq ww "/* ") (setq ee " */")
(setq sw "/* ") (setq ss ?=) (setq se " */"))
((= type REBOX_TYPE_DOUBLE)
(setq nw "/* ") (setq nn ?=) (setq ne " */")
(setq ww "/* ") (setq ee " */")
(setq sw "/* ") (setq ss ?=) (setq se " */"))))
((or (= quality REBOX_QUALITY_ROUNDED_TWO)
(= quality REBOX_QUALITY_ROUNDED_THREE))
;; - planify a rounded C comment
(cond ((= type REBOX_TYPE_OPEN)
;; ``open rounded'' is a special case
(setq nw "") (setq sw "")
(setq ww " ") (setq ee ""))
((= type REBOX_TYPE_HALF_SINGLE)
(setq nw "/*") (setq nn ? ) (setq ne " .")
(setq ww "| ") (setq ee " |")
(setq sw "`-") (setq ss ?-) (setq se "*/"))
((= type REBOX_TYPE_SINGLE)
(setq nw "/*") (setq nn ?-) (setq ne "-.")
(setq ww "| ") (setq ee " |")
(setq sw "`-") (setq ss ?-) (setq se "*/"))
((= type REBOX_TYPE_HALF_DOUBLE)
(setq nw "/*" ) (setq nn ? ) (setq ne " \\")
(setq ww "| " ) (setq ee " |" )
(setq sw "\\=") (setq ss ?=) (setq se "*/" ))
((= type REBOX_TYPE_DOUBLE)
(setq nw "/*" ) (setq nn ?=) (setq ne "=\\")
(setq ww "| " ) (setq ee " |" )
(setq sw "\\=") (setq ss ?=) (setq se "*/" ))))
((= quality REBOX_QUALITY_STARRED_FOUR)
;; - planify a starred C comment
(cond ((= type REBOX_TYPE_OPEN)
(setq nw "/* ") (setq nn ? ) (setq ne "")
(setq ww " * ") (setq ee "")
(setq sw " */") (setq ss ? ) (setq se ""))
((= type REBOX_TYPE_HALF_SINGLE)
(setq nw "/* ") (setq nn ? ) (setq ne " *")
(setq ww " * ") (setq ee " *")
(setq sw " **") (setq ss ?*) (setq se "**/"))
((= type REBOX_TYPE_SINGLE)
(setq nw "/**") (setq nn ?*) (setq ne "**")
(setq ww " * ") (setq ee " *")
(setq sw " **") (setq ss ?*) (setq se "**/"))
((= type REBOX_TYPE_HALF_DOUBLE)
(setq nw "/* " ) (setq nn ? ) (setq ne " *\\")
(setq ww "|* " ) (setq ee " *|" )
(setq sw "\\**") (setq ss ?*) (setq se "**/" ))
((= type REBOX_TYPE_DOUBLE)
(setq nw "/**" ) (setq nn ?*) (setq ne "**\\")
(setq ww "|* " ) (setq ee " *|" )
(setq sw "\\**") (setq ss ?*) (setq se "**/" ))))))
(t
;; - planify a comment for all other things
(if (and (= language REBOX_LANGUAGE_C++)
(= quality REBOX_QUALITY_SIMPLE_ONE))
(setq quality REBOX_QUALITY_ROUNDED_TWO))
(setq x (cond ((= language REBOX_LANGUAGE_C++) ?/)
((= language REBOX_LANGUAGE_AWK) ?#)
((= language REBOX_LANGUAGE_LISP) ?\;)
((= language REBOX_LANGUAGE_TEX) ?%)))
(setq xx (make-string (/ quality 10) x))
(setq ww (concat xx " "))
(cond ((= type REBOX_TYPE_OPEN)
(setq nw "") (setq sw "") (setq ee ""))
((= type REBOX_TYPE_HALF_SINGLE)
(setq ee (concat " " xx))
(setq nw "")
(setq sw ww) (setq ss ?-) (setq se ee))
((= type REBOX_TYPE_SINGLE)
(setq ee (concat " " xx))
(setq nw ww) (setq nn ?-) (setq ne ee)
(setq sw ww) (setq ss ?-) (setq se ee))
((= type REBOX_TYPE_HALF_DOUBLE)
(setq ee (concat " " xx))
(setq xx (make-string (1+ (/ quality 10)) x))
(setq nw "")
(setq sw xx) (setq ss x) (setq se xx))
((= type REBOX_TYPE_DOUBLE)
(setq ee (concat " " xx))
(setq xx (make-string (1+ (/ quality 10)) x))
(setq nw xx) (setq nn x) (setq ne xx)
(setq sw xx) (setq ss x) (setq se xx)))))
;; - possibly refill, and adjust margins to account for left inserts
(if (not (and flag (listp flag)))
(let ((fill-prefix (make-string margin ? ))
(fill-column (- fill-column (+ (length ww) (length ee)))))
(fill-region (point-min) (point-max))))
(setq right-margin (+ (rebox-right-margin) (length ww)))
;; - construct the box comment, from top to bottom
(goto-char (point-min))
(if (and (= language REBOX_LANGUAGE_C)
(or (= quality REBOX_QUALITY_ROUNDED_TWO)
(= quality REBOX_QUALITY_ROUNDED_THREE))
(= type REBOX_TYPE_OPEN))
(progn
;; - construct an 33 style comment
(skip-chars-forward " " (+ (point) margin))
(insert (make-string (- margin (current-column)) ? )
"/* ")
(end-of-line)
(forward-char 1)
(while (not (eobp))
(skip-chars-forward " " (+ (point) margin))
(insert (make-string (- margin (current-column)) ? )
ww)
(beginning-of-line)
(forward-line 1))
(backward-char 1)
(insert " */"))
;; - construct all other comment styles
;; construct one top line
(if (not (zerop (length nw)))
(progn
(indent-to margin)
(insert nw)
(if (or (not (eq nn ? )) (not (zerop (length ne))))
(insert (make-string (- right-margin (current-column)) nn)
ne))
(insert "\n")))
;; construct one middle line
(while (not (eobp))
(skip-chars-forward " " (+ (point) margin))
(insert (make-string (- margin (current-column)) ? )
ww)
(end-of-line)
(if (not (zerop (length ee)))
(progn
(indent-to right-margin)
(insert ee)))
(beginning-of-line)
(forward-line 1))
;; construct one bottom line
(if (not (zerop (length sw)))
(progn
(indent-to margin)
(insert sw)
(if (or (not (eq ss ? )) (not (zerop (length se))))
(insert (make-string (- right-margin (current-column)) ss)
se "\n")))))))
;;; Add, delete or adjust a comment box in the narrowed buffer.
;;; Various FLAG values are explained at beginning of this file.
(defun rebox-engine (flag)
(let ((undo-list buffer-undo-list)
(marked-point (point-marker))
(language (progn (goto-char (point-min)) (rebox-guess-language)))
(quality 0)
(type 0))
(untabify (point-min) (point-max))
;; Remove all the comment marks, and move all the text rigidly to the
;; left for insuring that the left margin stays at the same place.
;; At the same time, try recognizing the box style, saving its quality
;; in QUALITY and its type in TYPE. (LANGUAGE is already guessed.)
(let ((indent-tabs-mode nil)
(previous-margin (rebox-left-margin))
actual-margin)
;; FIXME: Cleanup style 1** boxes.
;; FIXME: Recognize really all cases of type and quality.
;; - remove all comment marks
(if (= language REBOX_LANGUAGE_NONE)
nil
(goto-char (point-min))
(while (re-search-forward (rebox-regexp-start language) nil t)
(goto-char (match-beginning 1))
(delete-region (point) (match-end 1))
(insert (make-string (- (match-end 1) (point)) ? )))
(goto-char (point-min))
(while (re-search-forward (rebox-regexp-end language) nil t)
(replace-match "" t t)))
(if (= language REBOX_LANGUAGE_C)
(progn
(goto-char (point-min))
(while (re-search-forward "\\*/ */\\*" nil t)
(replace-match " " t t))
(goto-char (point-min))
(while (re-search-forward "^\\( *\\)|\\*\\(.*\\)\\*| *$" nil t)
(setq quality REBOX_QUALITY_STARRED_FOUR)
(setq type REBOX_TYPE_DOUBLE)
(replace-match "\\1 \\2" t))
(goto-char (point-min))
(while (re-search-forward "^\\( *\\)\\*\\(.*\\)\\* *$" nil t)
(setq quality REBOX_QUALITY_STARRED_FOUR)
(setq type REBOX_TYPE_SINGLE)
(replace-match "\\1 \\2" t))
(goto-char (point-min))
(while (re-search-forward "^\\( *\\)|\\(.*\\)| *$" nil t)
(setq quality REBOX_QUALITY_ROUNDED_TWO)
(replace-match "\\1 \\2" t))
(goto-char (point-min))
(if (zerop quality)
(while (re-search-forward "^\\( +\\)\\* " nil t)
(setq quality REBOX_QUALITY_STARRED_FOUR)
(setq type REBOX_TYPE_OPEN)
(replace-match "\\1 " t)))))
;; - remove the first dashed or starred line
(goto-char (point-min))
(if (looking-at "^ *\\(--+\\|\\*\\*+\\)[.\+\\]? *\n")
(progn
(setq type REBOX_TYPE_SINGLE)
(replace-match "" t t))
(if (looking-at "^ *\\(==\\|XX+\\|##+\\|;;+\\)[.\+\\]? *\n")
(progn
(setq type REBOX_TYPE_DOUBLE)
(replace-match "" t t))))
;; - remove the last dashed or starred line
(goto-char (point-max))
(previous-line 1)
(if (looking-at "^ *[`\+\\]?*--+ *\n")
(progn
(if (= type REBOX_TYPE_OPEN)
(setq type REBOX_TYPE_HALF_SINGLE))
(replace-match "" t t))
(if (looking-at "^ *[`\+\\]?*\\(==+\\|##+\\|;;+\\) *\n")
(progn
(if (= type REBOX_TYPE_OPEN)
(setq type REBOX_TYPE_HALF_DOUBLE))
(replace-match "" t t))
(if (looking-at "^ *\\*\\*+[.\+\\]? *\n")
(progn
(setq quality REBOX_QUALITY_STARRED_FOUR)
(setq type REBOX_TYPE_HALF_SINGLE)
(replace-match "" t t))
(if (looking-at "^ *XX+[.\+\\]? *\n")
(progn
(setq quality REBOX_QUALITY_STARRED_FOUR)
(setq type REBOX_TYPE_HALF_DOUBLE)
(replace-match "" t t))))))
;; - remove all spurious whitespace
(goto-char (point-min))
(while (re-search-forward " +$" nil t)
(replace-match "" t t))
(goto-char (point-min))
(if (looking-at "\n+")
(replace-match "" t t))
(goto-char (point-max))
(skip-chars-backward "\n")
(if (looking-at "\n\n+")
(replace-match "\n" t t))
(goto-char (point-min))
(while (re-search-forward "\n\n\n+" nil t)
(replace-match "\n\n" t t))
;; - move the text left is adequate
(setq actual-margin (rebox-left-margin))
(if (not (= previous-margin actual-margin))
(indent-rigidly (point-min) (point-max)
(- previous-margin actual-margin))))
;; Override box style according to FLAG or chosen default style.
;; Else, use either recognized style elements or built-in defaults.
(cond ((and (numberp flag) (not (zerop (/ flag 100))))
(setq language (* (/ flag 100) 100)))
((not (zerop (/ rebox-default-style 100)))
(setq language (* (/ rebox-default-style 100) 100))))
(cond ((and (numberp flag) (not (zerop (% (/ flag 10) 10))))
(setq quality (* (% (/ flag 10) 10) 10)))
((not (zerop (% (/ rebox-default-style 10) 10)))
(setq quality (* (% (/ rebox-default-style 10) 10) 10)))
((zerop quality)
(setq quality REBOX_QUALITY_ROUNDED_TWO)))
(cond ((and (numberp flag) (not (zerop (% flag 10))))
(setq type (% flag 10)))
((not (zerop (% rebox-default-style 10)))
(setq type (% rebox-default-style 10)))
((zerop type)
(setq type 1)))
;; Possibly refill, then reconstruct the comment box.
(let ((indent-tabs-mode nil))
(rebox-reconstruct (not (and flag (listp flag)))
(rebox-left-margin)
language quality type))
;; Retabify to the left only (adapted from tabify.el).
(if indent-tabs-mode
(progn
(goto-char (point-min))
(while (re-search-forward "^[ \t][ \t]+" nil t)
(let ((column (current-column)))
(delete-region (match-beginning 0) (point))
(indent-to column)))))
;; Restore the point position.
(goto-char (marker-position marked-point))
;; Remove all intermediate boundaries from the undo list.
(if (not (eq buffer-undo-list undo-list))
(let ((cursor buffer-undo-list))
(while (not (eq (cdr cursor) undo-list))
(if (car (cdr cursor))
(setq cursor (cdr cursor))
(rplacd cursor (cdr (cdr cursor)))))))))
;;; Set or reset the Taarna team's own way for a C style. You do not
;;; really want to know about this.
(defvar c-mode-taarna-style nil "*Non-nil for Taarna team C-style.")
(defun taarna-mode ()
(interactive)
(if c-mode-taarna-style
(progn
(setq c-mode-taarna-style nil)
(setq c-indent-level 2)
(setq c-continued-statement-offset 2)
(setq c-brace-offset 0)
(setq c-argdecl-indent 5)
(setq c-label-offset -2)
(setq c-tab-always-indent t)
(setq rebox-default-style REBOX_QUALITY_ROUNDED_TWO)
(message "C mode: GNU style"))
(setq c-mode-taarna-style t)
(setq c-indent-level 4)
(setq c-continued-statement-offset 4)
(setq c-brace-offset -4)
(setq c-argdecl-indent 4)
(setq c-label-offset -4)
(setq c-tab-always-indent t)
(setq rebox-default-style
(+ REBOX_QUALITY_SIMPLE_ONE REBOX_TYPE_HALF_SINGLE))
(message "C mode: Taarna style")))
;;; Rebox the current region.
(defun rebox-region (flag)
(interactive "P")
(if (eq flag '-) (setq flag (rebox-ask-for-style)))
(if (rebox-validate-flag flag)
(save-restriction
(narrow-to-region (region-beginning) (region-end))
(rebox-engine flag))))
;;; Rebox the surrounding comment.
(defun rebox-comment (flag)
(interactive "P")
(if (eq flag '-) (setq flag (rebox-ask-for-style)))
(if (rebox-validate-flag flag)
(save-restriction
(rebox-find-and-narrow)
(rebox-engine flag))))

View File

@@ -1,9 +1,8 @@
# Makefile for GNU tar scripts.
# Copyright (C) 1994 Free Software Foundation, Inc.
# Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc.
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2, or (at your option)
## the Free Software Foundation; either version 3, or (at your option)
## any later version.
## This program is distributed in the hope that it will be useful,
@@ -12,9 +11,39 @@
## GNU General Public License for more details.
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software Foundation,
## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301, USA.
AUTOMAKE_OPTIONS = gnits
BACKUP_LIBEXEC_SCRIPTS_LIST=backup.sh dump-remind
BACKUP_SBIN_SCRIPTS_LIST=backup restore
libexec_SCRIPTS=@BACKUP_LIBEXEC_SCRIPTS@
AM_INSTALLCHECK_STD_OPTIONS_EXEMPT=backup.sh dump-remind
sbin_SCRIPTS=@BACKUP_SBIN_SCRIPTS@
EXTRA_SCRIPTS=tarcat
EXTRA_DIST=\
backup.sh.in\
backup.in\
restore.in\
dump-remind.in\
backup-specs
CLEANFILES=backup.sh backup restore dump-remind
EXTRA_DIST = WARNING backup-specs dump-remind level-0 level-1 weekly.new
SED_CMD="s,\@libexecdir\@,$(libexecdir),;\
s,\@sysconfdir\@,$(sysconfdir),;\
s,\@PACKAGE_NAME\@,$(PACKAGE_NAME),;\
s,\@VERSION\@,$(VERSION),;\
s,\@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),;\
s,\@DATE_FORMAT_OK\@,$(DATE_FORMAT_OK),;@BACKUP_SED_COND@"
backup.sh: $(srcdir)/backup.sh.in
sed $(SED_CMD) $? > $@
backup: $(srcdir)/backup.in
sed $(SED_CMD) $? > $@
restore: $(srcdir)/restore.in
sed $(SED_CMD) $? > $@
dump-remind: $(srcdir)/dump-remind.in
sed $(SED_CMD) $? > $@

View File

@@ -1,3 +0,0 @@
GNU tar scripts have not been updated in a long while. make will
not not install them. Please consider the contents of this directory
are provided as indicative for the time being.

View File

@@ -1,82 +1,100 @@
# site-specific parameters for file system backup.
# This is a sample configuration file for GNU tar backup script.
# See end of file for copying conditions
# User name of administrator of backups.
ADMINISTRATOR=backup-reports
# User name or email address of the administrator of backups. A report
# will be sent to this address when the backup terminates
ADMINISTRATOR="root@localhost"
# Hour at which backups are normally done.
# This should be a number from 0 to 23.
BACKUP_HOUR=1
# (Optional) Path to tar binary.
TAR=/bin/tar
# Location of GNU tar. This must be the same for all hosts.
TAR=/usr/local/gnubin/tar
# (Optional) Path to rsh binary or its equivalent. You may wish to
# set it to ssh as shown in the example below, to improve security.
# In this case you will have to use public key authentication.
RSH=/usr/local/bin/ssh
# (Optional) Path to rsh binary on remote mashines. This will be
# passed via --rsh-command option to the remote invocation of
# tar
RSH_COMMAND=/usr/local/bin/ssh
# Name of temporary file to hold volume numbers. This needs to be accessible
# by all the machines which have filesystems to be dumped.
VOLNO_FILE=/root/volume
# Device to use for dumping. It should be on the host
# on which the dump scripts are run.
TAPE_FILE=/dev/nrsmt0
# Command to obtain status of tape drive, including error count.
# On some tape drives there may not be such a command;
# then simply use `TAPE_STATUS=false'.
#
# Might also consider
# TAPE_STATUS="mt -f ${TAPE_FILE} status"
# if `mts' is missing, though this alternative is rather verbose.
TAPE_STATUS="mts -t ${TAPE_FILE}"
TAPE_FILE=/dev/rmt0
# Blocking factor to use for writing the dump.
BLOCKING=124
# Name of temporary file to hold volume numbers. This needs to be accessible
# by all the machines which have filesystems to be dumped.
VOLNO_FILE=/home/gd2/dump/volnofile
# Script to be run when it's time to insert a new tape in for the next
# volume. Administrators may want to tailor this script for their site.
# If this variable isn't set, tar will use some default behavior which is
# probably defined in the manual.
#DUMP_REMIND_SCRIPT='rsh apple-gunkies /home/gd2/dump/dump-remind'
# List of file systems to be dumped.
# Actually, any directory may be used, but if it has subdirectories on
# other file systems, they are not included.
# The host name specifies which host to run tar on.
# It should normally be the host that actually has the file system.
# If GNU tar is not installed on that machine, then you can specify some
# other host which can access the file system through NFS.
# Although these are arranged one per line, that is not mandatory.
# It does not work to use # for comments within the string.
BACKUP_DIRS='
albert:/fs/fsf
sugar-bombs:/fs/gd
albert:/fs/gd2
churchy:/fs/gd3
nutrimat:/fs/gp
nutrimat:/fs/gp2
albert:/fs/mailer
placebo:/archive
nutrimat:/fs/dist
albert:/
albert:/usr
nutrimat:/
placebo:/
ernst:/usr1
'
# List of file systems to be dumped. If prefixed with a HOST:
# the filesystem is accessed on the given HOST, unless it
# coincides with the local machine name.
# If a file system starts with a slash, it is handled as a local
# one.
BACKUP_DIRS='remote1:/etc remote1:/var/spool/crontab'
# Alternatively, you may leave this variable unassigned, and
# keep the list of filesystems to be dumped in file
# $SYSCONFDIR/backup/dirs, one filesystem per line. Empty
# lines and shell comments are allowed in this file. The location
# of this file may be overridden using DIRLIST variable, e.g.:
# DIRLIST=/etc/my-backup/dirlist
# List of individual files to be dumped.
# These should be accesible from the machine on which the dump is run.
BACKUP_FILES=''
# This list may also be kept in file $SYSCONFDIR/backup/files, the
# format of which is the same as described above. The location of
# this file may be overridden by setting FILELIST variable:
# FILELIST=/etc/my-backup/filelist
# Name of 'exclude file list'. It is searched under $SYSCONFDIR/tar-backup
# on remote machines
XLIST=exclude_files
# Default directory for storing incremental listings on remote
# machines is $SYSCONFDIR/tar-backup. It can be overridden using
# REMOTEBACKUPDIR variable
# Default directory for storing backup logs is $SYSCONFDIR/backup/log.
# It can also be overridden via LOGPATH variable.
# Time to sleep between dumps of any two successive filesystems
SLEEP_TIME=15
# Script to be run when it's time to insert a new tape in for the next
# volume. Administrators may want to tailor this script for their site.
# If this variable isn't set, tar will use some default behavior which is
# probably defined in the manual.
#DUMP_REMIND_SCRIPT='rsh apple-gunkies /home/gd2/dump/dump-remind'
# Message to display on the terminal while waiting for dump time. Usually
# this will just be some literal text, preferably something more
# entertaining than this. The awk script here saves some redundant
# repetition, but is not really all that desirable.
SLEEP_MESSAGE="`awk '
BEGIN {
BEGIN {
for (i = 0; i < 30; i++)
print \" \" \
\"D O N O T T O U C H T H I S T E R M I N A L !!!!!\"
}' /dev/null`"
# Copyright (C) 2004, 2007 Free Software Foundation, Inc.
# eof
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3, or (at your option)
## any later version.
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301, USA.

Some files were not shown because too many files have changed in this diff Show More