aboutsummaryrefslogtreecommitdiff
path: root/lib/libarchive/archive_read_support_compression_bzip2.c
Commit message (Collapse)AuthorAgeFilesLines
* Use contrib sources for building libarchive, tar and cpio.Martin Matuska2011-12-221-353/+0
| | | | | | | | | Make "make test" fully operational. MFC after: 2 weeks Notes: svn path=/head/; revision=228797
* Update libarchive, tar and cpio to version 2.8.5Martin Matuska2011-12-201-1/+1
| | | | | | | | | | | | | The following additional vendor revisions are applied: Revision 3740: Use archive_clear_error() to clear the error markers. Obtained from: http://code.google.com/p/libarchive MFC after: 2 weeks Notes: svn path=/head/; revision=228745
* - Update libarchive to 2.8.4Martin Matuska2011-07-171-3/+3
| | | | | | | | | | | - Add support for extracting xar and rpm archives - Add libarchive_fe subdir (common code for tar and cpio) Approved by: kientzle MFC after: 2 weeks Notes: svn path=/head/; revision=224152
* Fix some unused variables and dead assignments.Tim Kientzle2009-12-281-3/+2
| | | | Notes: svn path=/head/; revision=201108
* Implement command-line fallbacks for gzip and bzip2 decompression as well.Tim Kientzle2009-04-171-3/+14
| | | | | | | | | Not an issue for FreeBSD, since the base system has the necessary libraries. Since all decompressors are always available now, we can unconditionally enable them in archive_read_support_compression_all(). Notes: svn path=/head/; revision=191173
* Merge r591 from libarchive.googlecode.com: signed/unsigned fixes.Tim Kientzle2009-03-071-4/+4
| | | | Notes: svn path=/head/; revision=189475
* Merge r491,493,500,507,510,530,543 from libarchive.googlecode.com:Tim Kientzle2009-03-061-0/+1
| | | | | | | | This implements the new generic options framework that provides a way to override format- and compression-specific parameters. Notes: svn path=/head/; revision=189438
* Argh. r189389 was supposed to include r539 from libarchive.googlecode.comTim Kientzle2009-03-051-2/+2
| | | | | | | but those compile fixes somehow got lost. This should fix the build. Notes: svn path=/head/; revision=189392
* Merge r364, r378, r379, r393, and r539 from libarchive.googlecode.com:Tim Kientzle2009-03-051-115/+60
| | | | | | | | | | | | | | | | | | | This is the last phase of the "big decompression refactor" that puts a lazy reblocking layer between each pair of read filters. I've also changed the terminology for this area---the two kinds of objects are now called "read filters" and "read filter bidders"---and moved ownership of these objects to the archive_read core. This greatly simplifies implementing new read filters, which can now use peek/consume I/O semantics both for bidding (arbitrary look-ahead!) and for reading streams (look-ahead simplifies handling concatenated streams, for instance). The first merge here is the overhaul proper; the remainder are small fixes to correct errors in the initial implementation. Notes: svn path=/head/; revision=189389
* MfP4: Big read filter refactoring.Tim Kientzle2008-12-061-218/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | This is an attempt to eliminate a lot of redundant code from the read ("decompression") filters by changing them to juggle arbitrary-sized blocks and consolidate reblocking code at a single point in archive_read.c. Along the way, I've changed the internal read/consume API used by the format handlers to a slightly different style originally suggested by des@. It does seem to simplify a lot of common cases. The most dramatic change is, of course, to archive_read_support_compression_none(), which has just evaporated into a no-op as the blocking code this used to hold has all been moved up a level. There's at least one more big round of refactoring yet to come before the individual filters are as straightforward as I think they should be... Notes: svn path=/head/; revision=185679
* MFp4: libarchive 2.5.4b. (Still 'b' until I get a bit moreTim Kientzle2008-05-261-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | feedback, but the 2.5 branch is shaping up nicely.) In addition to many small bug fixes and code improvements: * Another iteration of versioning; I think I've got it right now. * Portability: A lot of progress on Windows support (though I'm not committing all of the Windows support files to FreeBSD CVS) * Explicit tracking of MBS, WCS, and UTF-8 versions of strings in archive_entry; the archive_entry routines now correctly return NULL only when something is unset, setting NULL properly clears string values. Most charset conversions have been pushed down to archive_string. * Better handling of charset conversion failure when writing or reading UTF-8 headers in pax archives * archive_entry_linkify() provides multiple strategies for hardlink matching to suit different format expectations * More accurate bzip2 format detection * Joerg Sonnenberger's extensive improvements to mtree support * Rough support for self-extracting ZIP archives. Not an ideal approach, but it works for the archives I've tried. * New "sparsify" option in archive_write_disk converts blocks of nulls into seeks. * Better default behavior for the test harness; it now reports all failures by default instead of coredumping at the first one. Notes: svn path=/head/; revision=179321
* Correct a compile error when libbz2/zlib are unavailable.Tim Kientzle2008-02-191-1/+1
| | | | Notes: svn path=/head/; revision=176398
* libarchive 2.2.3Tim Kientzle2007-05-291-19/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * "compression_program" support uses an external program * Portability: no longer uses "struct stat" as a primary data interchange structure internally * Part of the above: refactor archive_entry to separate out copy_stat() and stat() functions * More complete tests for archive_entry * Finish archive_entry_clone() * Isolate major()/minor()/makedev() in archive_entry; remove these from everywhere else. * Bug fix: properly handle decompression look-ahead at end-of-data * Bug fixes to 'ar' support * Fix memory leak in ZIP reader * Portability: better timegm() emulation in iso9660 reader * New write_disk flags to suppress auto dir creation and not overwrite newer files (for future cpio front-end) * Simplify trailing-'/' fixup when writing tar and pax * Test enhancements: fix various compiler warnings, improve portability, add lots of new tests. * Documentation: document new functions, first draft of libarchive_internals.3 MFC after: 14 days Thanks to: Joerg Sonnenberger (compression_program) Thanks to: Kai Wang (ar) Thanks to: Colin Percival (many small fixes) Thanks to: Many others who sent me various patches and problem reports. Notes: svn path=/head/; revision=170079
* From Joerg Sonnenberger: Fix a number of style gaffes,Tim Kientzle2007-04-051-7/+11
| | | | | | | including type puns and avoidable casts. Notes: svn path=/head/; revision=168379
* Fix compile error when libbz2 is unavailable.Tim Kientzle2007-03-241-1/+1
| | | | Notes: svn path=/head/; revision=167860
* libarchive 2.0Tim Kientzle2007-03-031-33/+37
| | | | | | | | | | | | | | | | | | | | | | * libarchive_test program exercises many of the core features * Refactored old "read_extract" into new "archive_write_disk", which uses archive_write methods to put entries onto disk. In particular, you can now use archive_write_disk to create objects on disk without having an archive available. * Pushed some security checks from bsdtar down into libarchive, where they can be better optimized. * Rearchitected the logic for creating objects on disk to reduce the number of system calls. Several common cases now use a minimum number of system calls. * Virtualized some internal interfaces to provide a clearer separation of read and write handling and make it simpler to override key methods. * New "empty" format reader. * Corrected return types (this ABI breakage required the "2.0" version bump) * Many bug fixes. Notes: svn path=/head/; revision=167186
* Fix the copyright notice; it was always intended to beTim Kientzle2007-01-091-3/+2
| | | | | | | | | | | | a vanilla 2-clause BSD license, but somehow some confusing extra verbage get copied from somewhere. Also, update the copyright dates to 2007 for all of the files. Prompted by: several questions about what those extra words really mean Notes: svn path=/head/; revision=165912
* Correct spelling of "accommodate", "guarantee", "guaranteed", "guard",Colin Percival2006-12-281-1/+1
| | | | | | | | | "return", "ridiculous", and "success". MFC after: 3 days Notes: svn path=/head/; revision=165576
* Portability and style fixes:Tim Kientzle2006-11-101-7/+15
| | | | | | | | | | | | | | | | | * Actually use the HAVE_<header>_H macros to conditionally include system headers. They've been defined for a long time, but only used in a few places. Now they're used pretty consistently throughout. * Fill in a lot of missing casts for conversions from void*. Although Standard C doesn't require this, some people have been trying to use C++ compilers with this code, and they do require it. Bit-for-bit, the compiled object files are identical, except for one assert() whose line number changed, so I'm pretty confident I didn't break anything. ;-) Notes: svn path=/head/; revision=164142
* Use 'skip' when ignoring data in tar archives. This dramaticallyTim Kientzle2006-07-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | increases performance when extracting a single entry from a large uncompressed archive, especially on slow devices such as USB hard drives. Requires a number of changes: * New archive_read_open2() supports a 'skip' client function * Old archive_read_open() is implemented as a wrapper now, to continue supporting the old API/ABI. * _read_open_fd and _read_open_file sprout new 'skip' functions. * compression layer gets a new 'skip' operation. * compression_none passes skip requests through to client. * compression_{gzip,bzip2,compress} simply ignore skip requests. Thanks to: Benjamin Lutz, who designed and implemented the whole thing. I'm just committing it. ;-) TODO: Need to update the documentation a little bit. Notes: svn path=/head/; revision=160830
* signed/unsigned fixes (thanks to GCC4) and a few related minor style ↵Tim Kientzle2005-09-241-1/+1
| | | | | | | corrections. Notes: svn path=/head/; revision=150527
* Portability nit: Some platforms require stdio.h before bzlib.h.Tim Kientzle2004-12-221-0/+1
| | | | | | | Thanks to: Kurt J. Lidl Notes: svn path=/head/; revision=139165
* Eliminate reliance on non-portable <err.h> by implementing a veryTim Kientzle2004-08-141-9/+32
| | | | | | | | | | simple errx() function. Improve behavior when bzlib/zlib are missing by detecting and issuing an error message on attempts to read gzip/bzip2 compressed archives. Notes: svn path=/head/; revision=133710
* Conditionalize the bzip2/gzip compression/decompressionTim Kientzle2004-07-301-0/+6
| | | | | | | | | | | | | | code on the existence of the relevant libraries (actually, the existence of the include files). This will allow the library to be easily ported to systems that don't have these libraries. (Of course, it also means that clients using the library on such systems will not be able to take advantage of the automatic compression format detection.) Notes: svn path=/head/; revision=132869
* Add statistics: track offset in compressed and uncompressed archive,Tim Kientzle2004-04-281-0/+1
| | | | | | | provide an interface for the client to query this information. Notes: svn path=/head/; revision=128703
* More work on ACLs: fix error in archive_entry's ACL parsing code,Tim Kientzle2004-04-121-3/+0
| | | | | | | | | | | | | | | | | try to set ACLs even if fflag restore fails, first cut at reading Solaris tar ACLs Code improvement: merge gnu tar read support into main tar reader; this eliminates a lot of duplicate code and generalizes the tar reader to handle formats with GNU-like extensions. Style: Makefile cleanup, eliminate 'dmalloc' references, remove 'tartype' from archive_entry (this makes archive_entry more format-agnostic) Thanks to: David Magda for providing Solaris tar test files Notes: svn path=/head/; revision=128148
* Many fixes.Tim Kientzle2004-03-091-12/+12
| | | | | | | | | | | | | | | | | | | Portability: Thanks to Juergen Lock, libarchive now compiles cleanly on Linux. Along the way, I cleaned up a lot of error return codes and reorganized some code to simplify conditional compilation of certain sections. Bug fixes: * pax format now actually stores filenames that are 101-154 characters long. * pax format now allows newline characters in extended attributes (this fixes a long-standing bug in ACL handling) * mtime/atime are now restored for directories * directory list is now sorted prior to fix-up to permit correct restore of non-writable dir heirarchies Notes: svn path=/head/; revision=126782
* Initial import of libarchive.Tim Kientzle2004-02-091-0/+365
What it is: A library for reading and writing various streaming archive formats, especially tar and cpio. Being a library, it should be easy to incorporate into pkg_* tools, sysinstall, and any other place that needs to read or write such archives. Features: * Full automatic detection of both compression and archive format. * Extensible internal architecture to make it easy to add new formats. * Support for "pax interchange format," a new POSIX-standard tar format that eliminates essentially all of the restrictions of historic formats. * BSD license Thanks to: jkh for pushing me to start this work, gordon for encouraging me to commit it, bde for answering endless style questions, and many others for feedback and encouragement. Status: Pretty good overall, though there are still a few rough edges and the library could always use more testing. Feedback eagerly solicited. Notes: svn path=/head/; revision=125635