summaryrefslogtreecommitdiff
path: root/usr.bin/tar/bsdtar.c
Commit message (Collapse)AuthorAgeFilesLines
* bsdtar 2.2.3:Tim Kientzle2007-05-291-0/+6
| | | | | | | | | | | | * Implement --use-compress-program using new libarchive feature. * Minor portability improvement by adjusting casts used to print out uids, gids, and device numbers. Thanks to: Joerg Sonnenberger for the --use-compress-program implementation. MFC after: 15 days Notes: svn path=/head/; revision=170084
* Issue a warning if there's a non-zero exit value.Tim Kientzle2007-03-241-0/+3
| | | | Notes: svn path=/head/; revision=167861
* bsdtar 2.0.23:Tim Kientzle2007-03-111-14/+93
| | | | | | | | | | | | | * New test scripts exercise some basic functionality * Most header inclusions are now protected (portability) * read.c now relies on security checks in libarchive instead of trying to do its own (optimization) * -p now enabled by default for root, add --no-same-permissions to disable it * Comments, minor style fixes. Notes: svn path=/head/; revision=167450
* Correct the copyright messages: Make this a standard vanillaTim Kientzle2007-01-091-3/+2
| | | | | | | 2-clause BSD license, update the year to 2007. Notes: svn path=/head/; revision=165913
* Fic typo in previous commit.Colin Percival2006-12-231-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=165484
* Add two checks for inappropriate options: -U only makes sense in "x"Colin Percival2006-12-231-0/+4
| | | | | | | | | mode, and --strip-components only makes sense in "x" and "t" modes. MFC after: 3 days Notes: svn path=/head/; revision=165482
* Correct the names of some options.Colin Percival2006-12-231-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=165481
* Remove -F option from getopts string -- this option has never doneColin Percival2006-12-201-1/+1
| | | | | | | | | | | anything apart from invoking usage(), and apparently slipped in by accident. Approved by: kientzle MFC after: 3 days Notes: svn path=/head/; revision=165374
* Extended attribute support on write for Linux; FreeBSD hooks areTim Kientzle2006-03-211-2/+1
| | | | | | | | | | | | | forthcoming. This commit also has a number of style(9) fixes and minor corrections so the code works better with the build system being used for non-FreeBSD builds. Many thanks to: Jaakko Heinonen, who proposed a mechanism for extended attribute support and implemented both the machine-independent portion and the Linux-specific portion. Notes: svn path=/head/; revision=156962
* Change the output of --version to match GNU "gnits" standards.Tim Kientzle2006-03-071-5/+2
| | | | | | | | | | | (I'm not using GPL, but I still think there are good ideas in the GNU projects. ;-) Among other things, this should make it easier for clients of bsdtar to recognize it automatically: bsdtar --version | grep bsdtar Notes: svn path=/head/; revision=156380
* Spell "--format" correctly in error message. (It hasn't beenTim Kientzle2005-11-011-1/+1
| | | | | | | | | | | called "-F" for a very long time.) PR: bin/86915 Thanks to: Gary W. Swearingen MFC after: 3 days Notes: svn path=/head/; revision=151919
* The bsdtar_warnc() reporting function requires the program name to beTim Kientzle2005-08-021-10/+12
| | | | | | | | | | | | set up before it is called, so move the progname initialization before the first possible call to bsdtar_warnc(). Thanks to: Stanislav Sedov PR: bin/83366 MFC after: 7 days Notes: svn path=/head/; revision=148632
* A number of fixes to the autoconf-generated build system. InTim Kientzle2005-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 Notes: svn path=/head/; revision=145206
* Support path-rewriting options (including --strip-components) for bothTim Kientzle2005-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. Notes: svn path=/head/; revision=145199
* A handful of minor portability and style improvements.Tim Kientzle2005-03-141-1/+1
| | | | Notes: svn path=/head/; revision=143545
* Add --newer-ctime, --newer-mtime, --newer-ctime-than, and --newer-mtime-thanTim Kientzle2005-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. Notes: svn path=/head/; revision=143528
* Add --strip-components option, per bin/77666.Tim Kientzle2005-03-131-1/+6
| | | | | | | Thanks to: Sangwoo Shim Notes: svn path=/head/; revision=143486
* GC an unused #includeTim Kientzle2004-12-221-1/+0
| | | | Notes: svn path=/head/; revision=139160
* Fix -W long option handling.Tim 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 Notes: svn path=/head/; revision=139158
* getopt(3) prints an "unrecognized option" warning for me, so ITim Kientzle2004-10-171-1/+0
| | | | | | | | | shouldn't print another. MFC after: 15 days Notes: svn path=/head/; revision=136637
* Support -t -O as in gtar. Perversely enough, -O means "send to stderr"Tim 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 Notes: svn path=/head/; revision=134369
* Permit -P to be combined with -t. (It's a no-op then, just as in gtar.)Tim Kientzle2004-08-261-2/+0
| | | | Notes: svn path=/head/; revision=134334
* Tell getopt to accept the (already-implemented) -I option.Tim Kientzle2004-08-261-1/+1
| | | | Notes: svn path=/head/; revision=134324
* Make -I and --files-from be synonyms for -TTim Kientzle2004-08-131-0/+4
| | | | Notes: svn path=/head/; revision=133633
* gtar uses -F for another purpose, so bsdtar no longer treats it as aTim Kientzle2004-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. Notes: svn path=/head/; revision=133331
* Move the smart chdir logic into a couple of utility functions in util.c.Tim Kientzle2004-08-081-2/+1
| | | | | | | | Then use them to provide consistent -C support throughout the program. Thanks to: Christoph Mallon Notes: svn path=/head/; revision=133310
* It shouldn't be an error to specify the same mode twice: allow -cc but not -ct.Tim Kientzle2004-08-081-50/+37
| | | | | | | | Thanks to: Christoph Mallon (whose proposed patch was actually simpler than what I ended up with) Notes: svn path=/head/; revision=133308
* Add --totals option. Unlike gtar, this reports the bytes actuallyTim Kientzle2004-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. Notes: svn path=/head/; revision=133278
* Linux port corrections:Tim 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) Notes: svn path=/head/; revision=133273
* Add "make distfile" capabilities to bsdtar, including informationalTim Kientzle2004-08-071-4/+31
| | | | | | | COPYING file and some conditional compilation cleanups. Notes: svn path=/head/; revision=133245
* GNU and POSIX disagree about -o and -l.Tim 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) Notes: svn path=/head/; revision=133053
* Add a --version option to bsdtar that prints the versions ofTim Kientzle2004-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? ;-) Notes: svn path=/head/; revision=132648
* A bunch of style and security fixes (error checking return values, etc),Tim Kientzle2004-07-251-5/+13
| | | | | | | mostly from: Tim J Robbins Notes: svn path=/head/; revision=132623
* A bunch of stuff from Christoph Mellon:Tim Kientzle2004-07-241-49/+40
| | | | | | | | | | | * Whitespace fixes * Check some malloc calls * Simplify long_help formatting * Spell "LINUX" -> "linux" * A few other miscellaneous style improvements Notes: svn path=/head/; revision=132616
* Guard against argv[0] being NULL.Tim Kientzle2004-07-191-6/+11
| | | | | | | Thanks to: Tim J Robbins Notes: svn path=/head/; revision=132406
* Remove unused user_uname variable.Tim Kientzle2004-07-171-15/+8
| | | | | | | | | Add range-checking to argument of -b. Thanks to: Tim J Robbins Notes: svn path=/head/; revision=132305
* Validate -o usage. Strictly speaking, -o only makes sense with -x,Tim 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. Notes: svn path=/head/; revision=132279
* Make the day/month ordering dependent on the current locale byTim Kientzle2004-07-151-0/+6
| | | | | | | | testing the locale at program startup and setting a flag, then using that flag to determine appropriate strftime() arguments. Notes: svn path=/head/; revision=132169
* Fix tab/space screwup in long_help()Tim Kientzle2004-07-121-1/+1
| | | | Notes: svn path=/head/; revision=132035
* Pass the pointy hat, please:Tim Kientzle2004-07-041-2/+2
| | | | | | | All of --help should go to stdout, not some to stdout and some to stderr. Notes: svn path=/head/; revision=131584
* Add yet another synonym for -n.Tim Kientzle2004-06-281-0/+1
| | | | Notes: svn path=/head/; revision=131239
* Update -p:Tim 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). Notes: svn path=/head/; revision=131213
* Augment the -T handling:Tim 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. Notes: svn path=/head/; revision=131176
* Rename C=dir to -C dir, which is what people expect.Tim 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. Notes: svn path=/head/; revision=131156
* Update some internal comments about the --no-same-permissions option.Tim Kientzle2004-06-151-1/+6
| | | | | | | Thanks to: Kris Kennaway for doing some gtar research for me. Notes: svn path=/head/; revision=130519
* As near as I can tell, --no-same-permissions is a no-op inTim Kientzle2004-06-151-0/+7
| | | | | | | | | | gtar, so that makes it easy to implement. Required by: audio/timidity port Thanks to: Kris Kennaway Notes: svn path=/head/; revision=130517
* Oops. bsdtar's old -X option didn't take an argument; the newTim Kientzle2004-06-151-1/+1
| | | | | | | (gtar-compatible) one does require an argument. Notes: svn path=/head/; revision=130516
* Add gtar-compatible -X/--exclude-fromTim Kientzle2004-06-151-0/+4
| | | | Notes: svn path=/head/; revision=130515
* Fix build.Tim Kientzle2004-06-151-1/+1
| | | | Notes: svn path=/head/; revision=130509
* Rename -X to --one-file-system, as GNU tar uses -X forTim Kientzle2004-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. Notes: svn path=/head/; revision=130499