Commit Graph

99 Commits

Author SHA1 Message Date
kientzle
74f9ad184e gtar uses -F for another purpose, so bsdtar no longer treats it as a
synonym for --format.  Update the man page to reflect this.  While
I'm here, change the man page to document "tar" rather than "bsdtar,"
update some comments about -l compatibility and fix a few grammar nits.
2004-08-08 17:20:23 +00:00
kientzle
0a68c3721e Better low-memory handling: If the link cache runs out of memory, just
throw out the whole thing and stop tracking links entirely.  That will
break all remaining hardlinks, but should free up enough memory to
let everything finish.
2004-08-08 06:36:03 +00:00
kientzle
03cc09682b Move the smart chdir logic into a couple of utility functions in util.c.
Then use them to provide consistent -C support throughout the program.
Thanks to: Christoph Mallon
2004-08-08 05:50:10 +00:00
kientzle
0a58439922 It shouldn't be an error to specify the same mode twice: allow -cc but not -ct.
Thanks to: Christoph Mallon (whose proposed patch was actually
   simpler than what I ended up with)
2004-08-08 05:10:10 +00:00
kientzle
b2443d940f Another pointy-hat problem: PACKAGE_VERSION macro is set in
CFLAGS, it shouldn't be in bsdtar_platform.h.
Thanks to: Andrey Chernov for looking over my shoulder so much lately.
2004-08-08 04:36:32 +00:00
kientzle
92956ea0cd Minor portability fixes. bsdtar now compiles on Win32/cygwin, though
it doesn't yet seem to work entirely correctly.
2004-08-08 01:30:30 +00:00
kientzle
0457e08c65 Add --totals option. Unlike gtar, this reports the bytes actually
written to the archive, not the ones written to the compressor.
For uncompressed archives, these numbers are the same, of course.
2004-08-07 19:25:34 +00:00
kientzle
e9c1fd002b Linux port corrections:
* Add a more reasonable default device for linux
   * Add an autoconf check for the FNM_LEADING_DIR extension
     (which isn't yet obeyed in the code)
2004-08-07 17:17:11 +00:00
kientzle
a34feb1b97 Add "make distfile" capabilities to bsdtar, including informational
COPYING file and some conditional compilation cleanups.
2004-08-07 03:24:49 +00:00
kientzle
147536f641 Ensure that there's always a space between the user name and
group name in -tv output format.
2004-08-05 05:46:22 +00:00
kientzle
1a1471049f GNU and POSIX disagree about -o and -l.
For -l, upset everyone by breaking it.  Specifically, -l now produces
a lengthy error message that suggests --check-links (POSIX -l) or
--one-file-system (GNU -l) instead.  However, if POSIXLY_CORRECT is set,
use the POSIX interpretation.

For -o, please everyone by making it work both ways:
  * -xo uses POSIX behavior
  * -co uses "almost GNU" behavior (as close as we can get until
    libarchive implements a true V7 tar format)
2004-08-03 06:19:08 +00:00
kientzle
7e43cdbd1b Correct the explanation of the -X option.
Thanks to: Pav Lucistnik
2004-08-01 20:09:08 +00:00
kientzle
0f5c530857 Improve portability to FreeBSD 4.
Thanks to: Barry Bouwsma
2004-07-30 02:59:58 +00:00
kientzle
a3e93910b1 Fix comment.
Thanks to: Johan Karlsson
2004-07-30 02:46:12 +00:00
kientzle
1bb05b6e53 Add a --version option to bsdtar that prints the versions of
both bsdtar and libarchive.  Of course, this requires that bsdtar
have a version number.  Let's call this 1.00, shall we? ;-)
2004-07-26 03:21:41 +00:00
kientzle
c2fb7a1b2d A bunch of style and security fixes (error checking return values, etc),
mostly from: Tim J Robbins
2004-07-25 04:15:50 +00:00
kientzle
da493b4820 Of course, I meant POSIX.1-1996, not 1997.
Thanks to: Andrey Chernov
2004-07-25 00:31:24 +00:00
kientzle
4eaecd41f3 A bunch of stuff from Christoph Mellon:
* Whitespace fixes
  * Check some malloc calls
  * Simplify long_help formatting
  * Spell "LINUX" -> "linux"
  * A few other miscellaneous style improvements
2004-07-24 22:13:44 +00:00
kientzle
88f0f4dce8 My bad: /dev/sa0, no 'r'
Thanks (and many apologies) to: Cristoph Mallon
2004-07-21 06:43:10 +00:00
kientzle
adcf12a12b Guard against argv[0] being NULL.
Thanks to: Tim J Robbins
2004-07-19 14:54:38 +00:00
kientzle
f05f002393 Fix some misspellings, document the TAPE environment
variable and the default tape device.
2004-07-19 05:24:41 +00:00
kientzle
8b3e9f1e03 Remove unused user_uname variable.
Add range-checking to argument of -b.

Thanks to: Tim J Robbins
2004-07-17 18:21:00 +00:00
kientzle
c25602666f Make bsdtar the default system tar. This makes /usr/bin/tar a symlink
pointing to /usr/bin/bsdtar by default.  To make it point to /usr/bin/gtar,
you can define WITH_GTAR.
2004-07-17 06:03:47 +00:00
kientzle
7f77b9d9fb Validate -o usage. Strictly speaking, -o only makes sense with -x,
of course, but I make an effort to accomodate GNU tar scripts that
use -o with -c (with a meaning that totally contradicts SUSv2) by
only issuing a benign warning message in that case.
2004-07-17 04:17:50 +00:00
kientzle
429d9c9041 Make the day/month ordering dependent on the current locale by
testing the locale at program startup and setting a flag, then
using that flag to determine appropriate strftime() arguments.
2004-07-15 03:14:46 +00:00
kientzle
5961a5ef84 Mimic ls(1) by putting an extra space before the year in old dates 2004-07-12 13:15:13 +00:00
kientzle
2e69e93b3c Fix tab/space screwup in long_help() 2004-07-12 13:13:42 +00:00
ru
3832f1d915 Fixed cross-references in SEE ALSO.
Emininated double space and hard sentence breaks.
2004-07-04 21:15:37 +00:00
kientzle
7bcd416f50 Pass the pointy hat, please:
All of --help should go to stdout, not some to stdout and some to stderr.
2004-07-04 18:13:01 +00:00
ru
fb1d8b3724 Mechanically kill hard sentence breaks. 2004-07-02 22:22:35 +00:00
kientzle
b7e4060b9b Add yet another synonym for -n. 2004-06-28 14:02:22 +00:00
kientzle
4965bc7e55 Update -p:
* Don't change the umask; the library now ignores the umask if
    you set EXTRACT_PERM
  * Set the EXTRACT_ACL and EXTRACT_FFLAGS bits (used to be
    controlled by EXTRACT_PERM).
2004-06-27 23:29:44 +00:00
kientzle
34ed55636f Warn about stripping leading '/' when creating archives. 2004-06-27 18:32:14 +00:00
kientzle
2e75ccba07 Augment the -T handling:
* Add --null option (sort #defines here)
 * Add process_lines function to util.c that reads newline-terminated
   or null-terminated lines (with self-sizing buffers, etc) and iteratively
   invokes a provided function.  Use this to dramatically simplify:
   -T handling for -c, --exclude-from-file, and --include-from-file.
 * Add -T handling to -x (via include_from_file)

Hopefully, this will fix the openoffice port and a couple of
others that rely on -T and --null.
2004-06-27 06:29:03 +00:00
kientzle
6d1f3e3cef Fix "@-" which has apparently been broken for some time. <sigh>
While I'm here, add in a lot more error-checking around append_archive.
2004-06-27 03:28:13 +00:00
kientzle
4731df16a2 Don't abort immediately on directory change errors.
Instead, display a warning, clean up, and let main() return the error.
In particular, this means that chdir() problems won't leave broken
archives, though they will prompt an error exit value.
2004-06-27 01:08:54 +00:00
kientzle
168c978957 Document the -W convention for accessing long options.
Also correct an old error: there was no tar command in Sixth Edition.
2004-06-26 22:58:29 +00:00
kientzle
b217b2ee33 Rename C=dir to -C dir, which is what people expect.
This requires some non-trivial surgery to the options parsing.

While here, let people who only have getopt() access long options
through the -W longopt=value convention.
2004-06-26 22:49:51 +00:00
kientzle
60240199d8 Update some internal comments about the --no-same-permissions option.
Thanks to: Kris Kennaway for doing some gtar research for me.
2004-06-15 07:16:44 +00:00
kientzle
c1c16931aa As near as I can tell, --no-same-permissions is a no-op in
gtar, so that makes it easy to implement.

Required by: audio/timidity port
Thanks to: Kris Kennaway
2004-06-15 06:44:41 +00:00
kientzle
da30afcf78 Oops. bsdtar's old -X option didn't take an argument; the new
(gtar-compatible) one does require an argument.
2004-06-15 06:24:54 +00:00
kientzle
5ace8b9fe9 Add gtar-compatible -X/--exclude-from 2004-06-15 05:55:41 +00:00
kientzle
e4e2071ab4 Fix build. 2004-06-15 01:51:45 +00:00
kientzle
09f8eaea14 Rename -X to --one-file-system, as GNU tar uses -X for
something else.  I would really like a short option for
this, but all of the obvious ones conflict with something else.
2004-06-15 00:28:34 +00:00
kientzle
1b46d4f7ae Clean up usage message(s):
* Usage goes to stderr, not stdout
  * Use correct argument markup
  * bsdtar --help  no longer exits with an error return code
  * ensure that the word "bsdtar" appears in the first
    line output from "bsdtar --help" (even if the program is
    invoked as "tar")

In particular, scripts can now test for the presence of bsdtar.
For example, in /bin/sh:

if (tar --help 2>&1 | grep bsdtar >/dev/null 2>&1) then \
          echo bsdtar; else echo not bsdtar; fi
2004-06-15 00:07:23 +00:00
kientzle
4125920b23 Oops: gtar's --dereference should be a synonym for bsdtar's -L, not -H.
Pointed out by: devel/nspr port
Thanks to: Kris Kennaway
2004-06-11 01:35:56 +00:00
kientzle
6404643ce9 Set program exit value to 1 if there are any of various errors when
creating an archive.

Pointed out by: Failure to complain when building certain broken packages
(Thanks again to Kris Kennaway for finding this!)
2004-06-07 07:19:04 +00:00
kientzle
0769b9f0d6 Fix the symlink-detection code. Don't squawk if we're just replacing
an existing symlink (as might happen if you extract an archive twice).
Also, if we remove the offending link, then we've removed the problem
and can safely go forward with the extraction.

Pointed out by: print/adobe-cmaps port (whose distfile has
	duplicate entries for the same symlinks)
Thanks to: Kris Kennaway (for using ports as a testbed for bsdtar)
2004-06-07 04:10:43 +00:00
kientzle
42e3d5a649 The --include='pattern' option is the natural counterpart to
--exclude='pattern'.

I should have added this a long time ago, since it's so useful for testing.
In particular, it allows me to select a few entries from a troublesome
archive so that I can easily focus my debugging efforts:
   bsdtar -czf new.tgz --include='*foo*' @old.tgz
2004-06-07 03:49:48 +00:00
kientzle
270635f958 Ooops! Previous commit added an over-zealous error check.
It is, in fact, perfectly legal to not specify a compression when
writing an archive. <sigh>
2004-06-07 03:38:17 +00:00