aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/tar
Commit message (Collapse)AuthorAgeFilesLines
* Fix --fast-read by decrementing the remaining patterns to be matched,Tim Kientzle2008-03-182-2/+2
| | | | | | | | | | | instead of incrementing. Pointy hat: me Thanks to: Tomasz Przygoda MFC after: 3 days Notes: svn path=/head/; revision=177341
* style(9) fix to add whitespace around an '=' sign and restoreTim Kientzle2008-03-151-1/+2
| | | | | | | a comment that got accidentally dropped. Notes: svn path=/head/; revision=177214
* Support NetBSD's --insecure as a synonym for -P.Tim Kientzle2008-03-151-0/+1
| | | | Notes: svn path=/head/; revision=177211
* Document --chroot.Tim Kientzle2008-03-151-0/+6
| | | | Notes: svn path=/head/; revision=177210
* Support -q (from NetBSD) as a synonym for --fast-read (the old FreeBSDTim Kientzle2008-03-152-14/+13
| | | | | | | | | extension to GNU tar). Thanks to: Joerg Sonnenberger Notes: svn path=/head/; revision=177208
* Also accept --uncompress as a synonym for -Z.Tim Kientzle2008-03-151-0/+1
| | | | | | | Thanks to: Joerg Sonnenberger Notes: svn path=/head/; revision=177207
* --chroot implementation thanks to Joerg Sonnenberger.Tim Kientzle2008-03-154-0/+18
| | | | Notes: svn path=/head/; revision=177206
* Support --compress as a synonym for -Z.Tim Kientzle2008-03-151-0/+1
| | | | Notes: svn path=/head/; revision=177205
* Enable and document the -Z option for selecting "compress" compression,Tim Kientzle2008-03-153-5/+13
| | | | | | | now that libarchive supports it. Notes: svn path=/head/; revision=177204
* Allow appending to archives on block devices as well asTim Kientzle2008-02-191-1/+1
| | | | | | | | | archives in regular files, since both are seekable. Thanks to: Reinoud Zandijk (@netbsd.org) Notes: svn path=/head/; revision=176395
* Make -l always have the SUSv2 meaning of "check links."Tim Kientzle2008-01-222-30/+11
| | | | | | | | | | | GNU tar changed -l to match SUSv2 a couple of years ago, so bsdtar no longer needs to pander to this particular GNUism. Thanks to: Debian maintainers MFC after: 7 days Notes: svn path=/head/; revision=175558
* Remove the old bsdtar test scripts; something muchTim Kientzle2008-01-028-859/+0
| | | | | | | better is almost ready to commit. Notes: svn path=/head/; revision=175052
* A couple of miscellaneous fixes:Tim Kientzle2008-01-023-4/+18
| | | | | | | | | | | * prototypes for optarg/optind on platforms that don't already have them * Disambiguate version number macros * Remove unnecessary PACKAGE_NAME macro * Hook for forthcoming bsdtar test suite * Sync version number up with the portable distribution Notes: svn path=/head/; revision=175051
* Fill in the approximate date when tar(1) first appeared.Tim Kientzle2008-01-021-1/+1
| | | | Notes: svn path=/head/; revision=175050
* Include a suitable stub definition of __FBSDID() for non-FreeBSD platforms.Tim Kientzle2008-01-021-1/+2
| | | | Notes: svn path=/head/; revision=175049
* Use archive_entry_strmode() instead of a local bsdtar_strmode().Tim Kientzle2008-01-023-53/+3
| | | | | | | | | (This does a couple of things that the standard library's strmode() doesn't; it proved useful in bsdcpio as well, so I pushed it down into libarchive.) Notes: svn path=/head/; revision=175048
* Include Guido's copyright for the fnmatch() code I cribbed from.Tim Kientzle2008-01-021-1/+36
| | | | | | | (It's in the C source, just wasn't in the COPYING file until now.) Notes: svn path=/head/; revision=175047
* Add --posix as a synonym for --format=pax, for GNUTim Kientzle2007-09-091-0/+5
| | | | | | | | | tar compatibility. Approved by: re (bmah) Notes: svn path=/head/; revision=172095
* Fix for PR bin/115033. This corrects a crash when long optionsTim Kientzle2007-08-011-0/+4
| | | | | | | | | | are specified with the "-W option=arg" syntax and the '=' is omitted. MFC after: 3 days Approved by: re (rwatson) Notes: svn path=/head/; revision=171679
* Fill in some casts that are needed (according to GCC 4.1)Tim Kientzle2007-07-201-6/+6
| | | | | | | | | Thanks to: Joerg Sonnenberger Approved by: re (hrs) MFC after: 3 days Notes: svn path=/head/; revision=171511
* Don't exit immediately on libarchive warnings, justTim Kientzle2007-07-202-4/+4
| | | | | | | | | | set the delayed return value and keep going. Approved by: re (hrs) MFC after: 7 days Notes: svn path=/head/; revision=171510
* bsdtar 2.2.3:Tim Kientzle2007-05-296-20/+39
| | | | | | | | | | | | * 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
* Mention the formats supported by bsdtar; include anTim Kientzle2007-05-201-0/+6
| | | | | | | example that shows how to work with an ISO 9660 image. Notes: svn path=/head/; revision=169801
* Set the program return value non-zero if we enounterTim Kientzle2007-05-081-0/+1
| | | | | | | | | | | an error while skipping the body of an entry during "tar -t" processing. Thanks to: Spencer Minear PR: misc/112521 Notes: svn path=/head/; revision=169379
* If lstat(2) fails, have bsdtar return a non-zero exit code if theColin Percival2007-05-031-0/+10
| | | | | | | | | | | | | | | | failed path is one which was specified on the command line. This is a compromise between the situation prior to revision 1.57 (where a race between tar(1) and rm(1) could cause tar(1) to spuriously report an error) and the situation after revision 1.57 (where "tar -c /no/such/path" prints a warning but returns with an exit code of zero). Inspired by: rafan MFC after: 1 week Notes: svn path=/head/; revision=169226
* Ignore trailing '/' when comparing pathnames, so thatTim Kientzle2007-04-181-3/+26
| | | | | | | | "tar -u" works again. Otherwise, "tar -u" wants to treat every dir as new and re-adds it. Notes: svn path=/head/; revision=168830
* When testing basic functionality, strip trailing '/' fromTim Kientzle2007-04-181-3/+3
| | | | | | | dir names, so they match the names generated by 'find'. Notes: svn path=/head/; revision=168829
* In libarchive: Downgrade ARCHIVE_FATAL and ARCHIVE_FAILED errors whichColin Percival2007-04-161-9/+8
| | | | | | | | | | | | | | | | | | | occur on the write side of extracting a file to ARCHIVE_WARN errors when returning them from archive_read_extract. In bsdtar: Use the return code from archive_read_data_into_fd and archive_read_extract to determine whether we should continue trying to extract an archive after one of the entries fails. This commit makes extracting a truncated tarball complain once about the archive being truncated, instead of complaining twice (once when trying to extract an entry, and once when trying to seek to the next entry). Discussed with: kientzle Notes: svn path=/head/; revision=168771
* Portability.Tim Kientzle2007-04-131-0/+2
| | | | | | | Thanks to: Martin Koeppe for testing on Interix Notes: svn path=/head/; revision=168692
* Make it easier to support more platforms.Tim Kientzle2007-04-122-8/+7
| | | | | | | Thanks to: Joerg Sonnenberger for pointing out the need and the technique. Notes: svn path=/head/; revision=168649
* Clean up error handling in archive_append to match how errors areColin Percival2007-04-091-19/+39
| | | | | | | | | handled in write_hierarchy. Approved by: kientzle Notes: svn path=/head/; revision=168529
* Simplify the logic for handling header readTim Kientzle2007-04-071-7/+5
| | | | | | | errors. Notes: svn path=/head/; revision=168454
* Add test to confirm that piping a tar archive created by bsdtar throughColin Percival2007-04-041-0/+5
| | | | | | | 'bsdtar -cf- @-' doesn't alter it. Notes: svn path=/head/; revision=168343
* Add tests for "bsdtar -t". These are useful primarily because they testColin Percival2007-03-311-0/+16
| | | | | | | the archive_read_data_skip code. Notes: svn path=/head/; revision=168176
* Split the append_archive function (used for processing @<archive> directives)Colin Percival2007-03-311-13/+28
| | | | | | | | | | | | | | | into separate append_archive and append_archive_filename functions; the first takes a "struct archive *" as input, while the second takes a filename, opens the archive, and calls the first. There should be no changes in behaviour as a result of this commit; it simply reorganizes code to make more sense. At some point in the future it may be possible to share code between append_archive and read_archive, but not yet. Discussed with: kientzle Notes: svn path=/head/; revision=168121
* Issue a warning if there's a non-zero exit value.Tim Kientzle2007-03-242-1/+4
| | | | Notes: svn path=/head/; revision=167861
* Remove pathlen argument from write_entry function. It has never been used.Colin Percival2007-03-171-5/+2
| | | | | | | | Approved by: kientzle MFC after: 3 days Notes: svn path=/head/; revision=167666
* Fix logic bug; we want to do_chdir if arg doesn't start with / _and_ itColin Percival2007-03-171-1/+1
| | | | | | | | | | | doesn't start with @/ either. This unbreaks "tar -c -C /no/such/directory @/path/to/archive". MFC after: 3 days Notes: svn path=/head/; revision=167661
* Don't consider an lstat(2) failure to be an error (in the sense ofColin Percival2007-03-151-1/+0
| | | | | | | | | | | | | | | affecting the return value from bsdtar), since (a) it usually occurs due to a perfectly innocent (and unavoidable) race condition where a user deletes a file in the window between bsdtar reading a directory and attempting to read the file; and (b) aside from printing a warning message, bsdtar behaves exactly as if the file had been deleted prior to bsdtar reading its parent directory. Reviewed by: kientzle MFC after: 6 days Notes: svn path=/head/; revision=167596
* Reduce the risk of inducing heart attacks, by printing the right path whenColin Percival2007-03-141-1/+1
| | | | | | | | | | | complaining about lstat(2) failing. It's a bit scary to find the message tar: /: Cannot stat: No such file or directory printed while doing a backup. MFC after: 1 week Notes: svn path=/head/; revision=167532
* Clarify the test comments in test-basic.sh. Have config.sh do aTim Kientzle2007-03-112-34/+47
| | | | | | | | | | better job searching for the bsdtar binary to test and the gtar binary to use for inter-operability testing. It should now find the built (but not installed) binary if there is one, then search for an installed binary in a number of standard locations. Notes: svn path=/head/; revision=167458
* bsdtar 2.0.23:Tim Kientzle2007-03-1119-228/+1139
| | | | | | | | | | | | | * 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
* Argh. Support for reading ACLs off of disk was inadvertently disabledTim Kientzle2007-03-081-0/+1
| | | | | | | | | | | | as part of an old configuration shuffle. As a result, although ACL restore has been working, ACLs haven't been written into archives for some time. <sigh> Pointy hat: You know. MFC after: 3 days Notes: svn path=/head/; revision=167323
* Make the file tests robust against broken symlinks and otherTim Kientzle2007-03-031-3/+17
| | | | | | | sources of stat()/lstat() failure. Notes: svn path=/head/; revision=167187
* If we already have stat() data, we might be able toTim Kientzle2007-02-211-21/+29
| | | | | | | | | determine if this is a physical dir without an lstat(). While I'm in here, try to clarify the comments around the _is_dir() and _is_physical_dir() tests. Notes: svn path=/head/; revision=166859
* Andrew and Colin each pointed out to me that truncating the backupTim Kientzle2007-02-181-2/+0
| | | | | | | | | | | of a growing file should not be considered a "bad thing." PR: bin/108990 MFC after: 7 days Pointy hat: /me Notes: svn path=/head/; revision=166809
* Correctly handle writes beyond the end of the archive entryTim Kientzle2007-02-141-1/+9
| | | | | | | | | | (as determined by the initial size given to the header). Libarchive recently changed to correctly return the amount of data actually consumed in this case, which revealed this bug in bsdtar. Notes: svn path=/head/; revision=166702
* Update -r handling:Tim Kientzle2007-02-081-12/+40
| | | | | | | | | | * Create file if it doesn't exist. * If archive is "empty", then append to it with pax restricted * If user specified a format, use that if it's compatible with the existing format. Notes: svn path=/head/; revision=166563
* Correct the copyright messages: Make this a standard vanillaTim Kientzle2007-01-0911-34/+21
| | | | | | | 2-clause BSD license, update the year to 2007. Notes: svn path=/head/; revision=165913
* If append_archive fails while writing an archive header, output the errorColin Percival2007-01-051-1/+1
| | | | | | | | | | message from the archive being written (not the message from the archive being read, where no error has occurred). MFC after: 3 days Notes: svn path=/head/; revision=165807