Commit Graph

484 Commits

Author SHA1 Message Date
Glenn L McGrath
bebc40b406 Check at least one context is specified 2003-11-20 09:53:31 +00:00
Glenn L McGrath
ba49651de9 Check there are files to add the archive before removing a specified
tar file.
2003-11-20 09:06:10 +00:00
Glenn L McGrath
90c9df93f3 Dont attempt to unlink directories 2003-11-20 08:00:38 +00:00
Glenn L McGrath
56f16b42c9 tar -Z, uncompress support 2003-11-18 21:37:52 +00:00
Glenn L McGrath
20872be9a4 Dont close original file handle, we may need it later. 2003-11-18 21:31:19 +00:00
Glenn L McGrath
3b9fc8fe2a Make unlink old files default behaviour and add a new option -k to
prevent overwritting existing files
2003-11-18 20:23:04 +00:00
Glenn L McGrath
f074afc2a0 Dont free filename, its needed in the extracted files list. 2003-11-17 21:58:00 +00:00
Glenn L McGrath
8dc8cb133c Fix a bug where cpio wouldnt work unless -u was specified 2003-11-15 23:44:31 +00:00
Glenn L McGrath
5699b8525e Move from read_gz to the pipe()+fork() method.
open_transformer(), common code for pipe+fork.
Function pointer for read() no longer needed.
Allow inflate to be initialised with a specified buffer size to avoid
over-reading.
Reset static variables in inflate_get_next_window to fix a bug where
only the first file in a .zip would be be extracted.
2003-11-15 23:19:05 +00:00
Glenn L McGrath
54ac057c00 Fix memory leaks 2003-11-15 00:24:43 +00:00
Glenn L McGrath
e57feeb9e6 Keep trying to find a good header, if we exit it will cause .tar.gz
files to compute incorrect crc and length for gzip
2003-11-14 12:57:14 +00:00
Glenn L McGrath
eba86e2adb Catch unsupported features 2003-11-14 12:53:42 +00:00
Glenn L McGrath
7b215b99b2 Fix build error with tar -j 2003-11-14 09:22:24 +00:00
Glenn L McGrath
1a41db8eaf Remove some tar_gz stuff that get dragged in 2003-11-14 09:21:27 +00:00
Glenn L McGrath
94cf153c2b Remove debugging noise. 2003-11-14 08:30:46 +00:00
Glenn L McGrath
d09bcecda8 Read in blocks rather than one char at a time, greatly improves speed 2003-11-14 08:26:25 +00:00
Eric Andersen
8211db5af0 Vladimir N. Oleynik (vodz) writes:
Hi Glenn.

I analysed BSS size gzip applet and found may be mistake:
updcrc() checking  if (crc_table_empty) but not resetted this var.
This do make slow gzip applet ;-)


--w
vodz
2003-11-14 02:44:28 +00:00
Eric Andersen
28d4e16cd7 This appears to be the correct fix to make CONFIG_FEATURE_DEB_TAR_BZ2
support compile.  Glenn, you may want to verify this.
 -Erik
2003-11-07 21:31:58 +00:00
Eric Andersen
d2160aaeab fix comment 2003-11-07 21:22:09 +00:00
Glenn L McGrath
2685724e23 Fix tar -j support
Use the old fork() method of tar compression support, rather than
read_bz2....
 - (*uncompress)(int in, int out) seems like a more natural interface
for compression code.
 - it might improve performance by seperating the work into one cpu
bound and one io bound process.
 - There is extra code required to do read_[gz|bunzip] since (*uncompress)(int in,
int out) will normally be used by the standalone compression applet.

There have been problems with this method so if you see a "Short read"
error let me know.
2003-11-05 04:55:58 +00:00
Eric Andersen
8179cf2b78 Put back the tar support stubs (and warnings) for now. 2003-10-31 08:52:57 +00:00
Eric Andersen
0120be94a0 Fix stupid typo 2003-10-31 00:21:28 +00:00
Glenn L McGrath
6530f0d3a1 make CONFIG_FEATURE_UNARCHIVE_TAPE common between itar and cpio, patch
by Arthur Othieno
2003-10-29 04:46:30 +00:00
Glenn L McGrath
f235d05773 Use the return value from uncompress_bunzip, fix some typo 2003-10-29 03:37:54 +00:00
Glenn L McGrath
1c834407e3 Add some error messages, use xmalloc instead of malloc 2003-10-28 23:32:12 +00:00
Glenn L McGrath
debb21ece7 Fix a logic error, the old bunzip code returned non-zero for success,
new code returns 0 for success.
2003-10-28 23:04:50 +00:00
Glenn L McGrath
e81fc5fb30 Conditionally compile some files.
This hides a bug related to the new bunzip code in the tar and dpkg[-deb]
applets.
It will also reduce compile time a little as some unused files wont be
compiled.
2003-10-28 10:44:58 +00:00
Eric Andersen
5fa4db29f7 Another bzip2 update and speedup from Manuel Novoa III, with some
additional changes (primarily lots of comments) from Rob Landley.
2003-10-23 06:52:01 +00:00
Eric Andersen
88c916bdec Andreas Mohr writes:
the busybox menuconfig triggered my "inacceptable number of spelling mistakes"
upper level, so I decided to make a patch ;-)

I also improved some wording to describe some things in a better way.

Many thanks for an incredible piece of software!

Andreas Mohr, random OSS developer
2003-10-22 09:58:56 +00:00
Eric Andersen
1acfb72e71 Manuel Novoa III writes:
Hello Rob,

Here's a patch to your bunzip-3.c file.  Nice work btw.

One minor bug fix... checking for error return when read()ing.
Some size/performance optimizations as well.  One instance of
memset() seems unnecssary.  You might want to take a look.

Anyway, on my machine, decompressing linux-2.6.0-test7.tar.bz2
to /dev/null gave the following times:

        bunzip-3.c    bzcat (system)   bunzip-3.c (patched)
real    0m24.420s     0m22.725s        0m20.701s
user    0m23.930s     0m22.170s        0m20.180s
sys     0m0.070s      0m0.080s         0m0.140s

Size of the patched version is comparable (slightly larger or
smaller depending on compiler flags).

Manuel
2003-10-18 01:59:46 +00:00
Eric Andersen
0d6d88a205 Rob Landley's new micro-bunzip version 3. Rob writes:
The API for using partial writes, as described in my last message, sucked.

So here's a patch against my last patch that changes things so that
write_bunzip_data calls read_bunzip_data itself behind the scenes whenever
necessary.  So usage is now just start_bunzip(), write_bunzip_data() until it
returns a negative number, and then the cleanup at the end of
uncompressStream.

It adds 32 bytes to the executable, but it should allow the caller (tar) to be
simplified enough to compensate.  Total -Os stripped exe size now 6856 bytes.

Rob

P.S.  I attached the whole C file so you don't have to keep incremental
patches straight if you don't want to. :)

P.S.  In the version I'm banging on now, I've simplified the license to just
LGPL.  I read the OSL a bit more closely and the patent termination clause
would have bit IBM in their counter-suit of SCO if the code in question had
been OSL instead of GPL, and I've decided I just don't want to beta-test
legal code right now.
2003-10-18 01:58:35 +00:00
Glenn L McGrath
91b3d460c7 Fix -C option when creating tar files.
Need to chdir after the tar file is opened, so make common tar filename
parsing and send the file descriptor rather than filename to
writeTarFile.
Modify the verboseFlag operation to determine wether to display on
stderr or stdout at display time, simpler than doing it in tar_main.
2003-10-02 14:33:23 +00:00
Eric Andersen
1393a39df4 Do not shadow the global name 'accept' 2003-09-15 08:06:15 +00:00
Glenn L McGrath
beb3bbd991 Fix handling of hardlinks when OLDGNU and GNU extensions arent enabled. 2003-09-12 06:49:09 +00:00
Glenn L McGrath
ef91bf67ed Use the typeflag to identify if its a hardlink on OLD and GNU posix
modes, fixes a bug extracting hardlinks to symlinks.
2003-09-12 06:31:28 +00:00
Eric Andersen
2fdba24620 Marc A. Lehmann writes:
The tar -x command in busybox does not restore the file mode correctly.

The reason is most probably this code in
archival/libunarachive/data_extract_all.c:

       chmod(file_header->name, file_header->mode);
       chown(file_header->name, file_header->uid, file_header->gid);

chown clears the set*id bits (on current versions of linux :). Flipping
the order around fixes the problem.

(tested with 1.00pre3 from cvs).
2003-09-11 08:32:40 +00:00
Glenn L McGrath
87af49f26b If a tar entry is a regualr file ending in a '/' then its really a
directory.
From http://www.gnu.org/manual/tar/html_node/tar_123.html
REGTYPE
AREGTYPE
    These flags represent a regular file. In order to be compatible with
older versions of tar, a typeflag value of AREGTYPE should be silently
recognized as a regular file. New archives should be created using
REGTYPE. Also, for backward compatibility, tar treats a regular file
whose name ends with a slash as a directory.
2003-09-09 17:41:03 +00:00
Glenn L McGrath
4cee66d5a8 Dont unlink when testing !
Always preserve creation date
Disable the -p option its for modification date
Remove some cpio header debugging noise
Syncronise file listing behaviour with upstream.
2003-08-28 19:12:23 +00:00
Eric Andersen
6d3c7e7a9c trivial doc fix 2003-08-22 21:15:07 +00:00
Glenn L McGrath
3d5828fb6d Change hardlink handling for tar to work the same way as cpio 2003-08-14 02:55:15 +00:00
Glenn L McGrath
91e464632b Fix bug when handling debian packages.
If we read the contents of compressed files within the ar archive,
e.g. control.tar.gz, then file position gets all out of whack, so
it has to be reset before reading thenext header.
2003-07-31 01:53:50 +00:00
Eric Andersen
1b0075d243 Fixup problem unconditionally converting all hard links to symlinks. 2003-07-16 06:29:51 +00:00
Eric Andersen
cb81e6484d Update a bunch of docs. Run a script to update my email addr. 2003-07-14 21:21:08 +00:00
Eric Andersen
e5642119ee Patch from Thomas Cameron:
Hello all,
	    This patch adds more "Help" text to the config system.  Almost
    all applets now have a help entry.  Also, I cleaned up the spacing of
    the existing text so that things are consistent.  This patch is against
    this morning's CVS.

    Thomas Cameron
    CEI Systems, Inc.
2003-07-14 19:37:08 +00:00
Eric Andersen
e3393513c5 Be certain to not abort prematurely when reading stuff from pipes. 2003-07-05 23:10:27 +00:00
Eric Andersen
3c5a83c567 As noted by Thomas Eckert:
bb-tar "cjf" does not create a valid tbz2-archive -- if fact the result is a
    plain tar-file (no compression) -- but does not warn about the unrecognized
    parameter combination "cj" (bb does not have bzip2-compression yet, right?).

to fix this I have added an error message stating this does not work.

He also reported

    cosmetic: versose "-v" does not show any output when used with "create"

which I have now fixed as well.

 -Erik
2003-07-05 21:56:55 +00:00
Eric Andersen
65e20a33c2 Patch from Kent Robotti adding a bunch of needed docs!
-Erik
2003-07-05 07:52:35 +00:00
Eric Andersen
a21f4e018a Glenn McGrath (bug1) isaway from my email till the 17th, but caught me on IRC.
He took a look into the recent reports of tar problems, and found an obvious
typo in last_patch91 from vodz which converted tar to use bb_getopt_ulflags.
2003-07-05 06:38:41 +00:00
Eric Andersen
e5920a2dc0 Patch from Kent Robotti adding a bunch of menuconfig help 2003-07-03 10:00:15 +00:00
Eric Andersen
27cb6846d7 last_patch91 from vodz to convert tar to use bb_getopt_ulflags 2003-06-26 09:07:59 +00:00