summaryrefslogtreecommitdiffstats
path: root/usr.bin/tar/bsdtar.c
Commit message (Collapse)AuthorAgeFilesLines
* A number of fixes to the autoconf-generated build system. Inkientzle2005-04-171-1/+0
| | | | | | | | particular, acl support is no longer enabled on FreeBSD 4, acl support should be correctly enabled on Linux, dirent.d_namlen should be correctly detected on platforms that support it. Thanks to: Greg Lewis, Juergen Lock, and Jaakko Heinonen
* Support path-rewriting options (including --strip-components) for bothkientzle2005-04-171-2/+2
| | | | | | extraction and creation. While I'm here, fix a bug reported by Garrett Wollman: when stripping the leading '/' from the path "/", don't produce an entry with an empty name; produce "." instead.
* A handful of minor portability and style improvements.kientzle2005-03-141-1/+1
|
* Add --newer-ctime, --newer-mtime, --newer-ctime-than, and --newer-mtime-thankientzle2005-03-131-16/+59
| | | | | | | switches to support selecting files by time of modification. Special thanks to: Steven M. Bellovin, Rich $alz, and Jim Berets, authors of the public-domain getdate.y date-parsing code.
* Add --strip-components option, per bin/77666.kientzle2005-03-131-1/+6
| | | | Thanks to: Sangwoo Shim
* GC an unused #includekientzle2004-12-221-1/+0
|
* Fix -W long option handling.kientzle2004-12-221-5/+15
| | | | | | | | | | | In particular: -W excl=text fails because "excl" is a prefix of both "exclude" and "exclude-from". But, -W exclude=text is okay because it matches "exclude" exactly. Thanks to: Jose F Nieves MFC after: 7 days
* getopt(3) prints an "unrecognized option" warning for me, so Ikientzle2004-10-171-1/+0
| | | | | | shouldn't print another. MFC after: 15 days
* Support -t -O as in gtar. Perversely enough, -O means "send to stderr"kientzle2004-08-271-1/+1
| | | | | | | when used with -t, "send to stdout" when used with -x. Thanks to: Ryan Hamilton for pointing out this odd beast MFC after: 3 days
* Permit -P to be combined with -t. (It's a no-op then, just as in gtar.)kientzle2004-08-261-2/+0
|
* Tell getopt to accept the (already-implemented) -I option.kientzle2004-08-261-1/+1
|
* Make -I and --files-from be synonyms for -Tkientzle2004-08-131-0/+4
|
* gtar uses -F for another purpose, so bsdtar no longer treats it as akientzle2004-08-081-3/+4
| | | | | | 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.
* Move the smart chdir logic into a couple of utility functions in util.c.kientzle2004-08-081-2/+1
| | | | | Then use them to provide consistent -C support throughout the program. Thanks to: Christoph Mallon
* It shouldn't be an error to specify the same mode twice: allow -cc but not -ct.kientzle2004-08-081-50/+37
| | | | | Thanks to: Christoph Mallon (whose proposed patch was actually simpler than what I ended up with)
* Add --totals option. Unlike gtar, this reports the bytes actuallykientzle2004-08-071-2/+7
| | | | | written to the archive, not the ones written to the compressor. For uncompressed archives, these numbers are the same, of course.
* Linux port corrections:kientzle2004-08-071-1/+4
| | | | | | * 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)
* Add "make distfile" capabilities to bsdtar, including informationalkientzle2004-08-071-4/+31
| | | | COPYING file and some conditional compilation cleanups.
* GNU and POSIX disagree about -o and -l.kientzle2004-08-031-20/+52
| | | | | | | | | | | | 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)
* Add a --version option to bsdtar that prints the versions ofkientzle2004-07-261-4/+19
| | | | | both bsdtar and libarchive. Of course, this requires that bsdtar have a version number. Let's call this 1.00, shall we? ;-)
* A bunch of style and security fixes (error checking return values, etc),kientzle2004-07-251-5/+13
| | | | mostly from: Tim J Robbins
* A bunch of stuff from Christoph Mellon:kientzle2004-07-241-49/+40
| | | | | | | | * Whitespace fixes * Check some malloc calls * Simplify long_help formatting * Spell "LINUX" -> "linux" * A few other miscellaneous style improvements
* Guard against argv[0] being NULL.kientzle2004-07-191-6/+11
| | | | Thanks to: Tim J Robbins
* Remove unused user_uname variable.kientzle2004-07-171-15/+8
| | | | | | Add range-checking to argument of -b. Thanks to: Tim J Robbins
* Validate -o usage. Strictly speaking, -o only makes sense with -x,kientzle2004-07-171-0/+7
| | | | | | 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.
* Make the day/month ordering dependent on the current locale bykientzle2004-07-151-0/+6
| | | | | testing the locale at program startup and setting a flag, then using that flag to determine appropriate strftime() arguments.
* Fix tab/space screwup in long_help()kientzle2004-07-121-1/+1
|
* Pass the pointy hat, please:kientzle2004-07-041-2/+2
| | | | All of --help should go to stdout, not some to stdout and some to stderr.
* Add yet another synonym for -n.kientzle2004-06-281-0/+1
|
* Update -p:kientzle2004-06-271-1/+2
| | | | | | | * 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).
* Augment the -T handling:kientzle2004-06-271-16/+16
| | | | | | | | | | | | * 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.
* Rename C=dir to -C dir, which is what people expect.kientzle2004-06-261-34/+103
| | | | | | | 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.
* Update some internal comments about the --no-same-permissions option.kientzle2004-06-151-1/+6
| | | | Thanks to: Kris Kennaway for doing some gtar research for me.
* As near as I can tell, --no-same-permissions is a no-op inkientzle2004-06-151-0/+7
| | | | | | | gtar, so that makes it easy to implement. Required by: audio/timidity port Thanks to: Kris Kennaway
* Oops. bsdtar's old -X option didn't take an argument; the newkientzle2004-06-151-1/+1
| | | | (gtar-compatible) one does require an argument.
* Add gtar-compatible -X/--exclude-fromkientzle2004-06-151-0/+4
|
* Fix build.kientzle2004-06-151-1/+1
|
* Rename -X to --one-file-system, as GNU tar uses -X forkientzle2004-06-151-5/+9
| | | | | something else. I would really like a short option for this, but all of the obvious ones conflict with something else.
* Clean up usage message(s):kientzle2004-06-151-9/+29
| | | | | | | | | | | | | | | * 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
* Oops: gtar's --dereference should be a synonym for bsdtar's -L, not -H.kientzle2004-06-111-1/+1
| | | | | Pointed out by: devel/nspr port Thanks to: Kris Kennaway
* The --include='pattern' option is the natural counterpart tokientzle2004-06-071-0/+7
| | | | | | | | | --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
* If -b is specified, then force full padding for the last block.kientzle2004-06-071-2/+0
|
* Improve help handling:kientzle2004-06-021-0/+13
| | | | | | * --help produces long help message on systems with getopt_long * -h with no other options also produces long help message (If a mode is specified, -h has its usual meaning.)
* Correction: -h should be a synonym for -L, not -H.kientzle2004-05-311-2/+2
| | | | (as specified by Linux Standards Base, GNU tar, and 4.4BSD documentation)
* Permit (but ignore) -Z with -x or -t, now that libarchivekientzle2004-05-301-2/+9
| | | | recognizes and decompresses .Z format.
* Provide framework for exiting with non-zero value on non-critical errors.kientzle2004-05-271-1/+1
|
* Add --no-same-owner as a synonym for -o.kientzle2004-05-221-0/+1
| | | | | | | Note that bsdtar's -o (which follows SUSv2) is not the same as GNU tar's -o. In GNU tar, -o and --no-same-owner are not synonyms. Pointed out by: Kris Kennaway (required by xpenguins port)
* Add --dereference as a synonym for -Hkientzle2004-05-211-0/+1
| | | | Pointed out by: Kris Kennaway (unbreaks nspr port build)
* Default is to restore timestamps, even when operating as root. <sigh>kientzle2004-05-191-1/+1
|
* Accept (but ignore) GNU tar's -B option. bsdtar neverkientzle2004-05-181-2/+8
| | | | needs it, but it does no harm for people to specify it.
OpenPOWER on IntegriCloud