Revision history for File-Unpack
0.28 jw, Fri Oct 22 14:29:09 CEST 2010
Look only at files and dirs, ignore special files.
Reading a pipe could block us endlessly.
0.27 jw, Sat Sep 11 22:01:49 CEST 2010
new feature in mime(): attempt full file access
not only if flm reports currupt, but also when it reports
a/octet-stream. this helps to recognize a/x-iso9660-image
Added .iso by including my old unpack_iso.pl as a helper.
Added .lha
0.26 jw, Thu Sep 9 19:26:21 CEST 2010
Added .upx; we are testing all application/*-executable for upx to get
the mime type. Fixed test results on SLE-11, 02-mime.t now can match
regexp too.
0.25 jw, Wed Sep 8 21:44:37 CEST 2010
Added .cpio, .deb, .cab, .7z
Removed stupid debug die in helper.
Removed done_testing() for the sake of old Test::More on 11.1
0.23 jw, Wed Sep 1 23:17:52 CEST 2010
Added option one_shot, to new() and file_unpack.pl
Added unpacking of: application/pdf, %tar+lzma, %rar, %uuencode
Added '# Requires: ....' comments with the builtin handlers to document
the non-perlish dependencies.
Fixed recognition of .xls -- File::LibMagic said corrupt, with only a
short buffer. Swapped 2nd and 3rd parameter of _run_mime_handler():
mime helpers have now their suggested destname as second parameter.
mime(): added suffix rules for 'text/plain' and 'application/octet-stream',
to harvest even the least trusted source of information, in the absence
of anything else.
Implemented first draft of helper/text/=x-shellscript: tested embedded gzip.
Added -L option to file_unpack.pl;
_run_mime_handler() now untaints its argv. run() errors are now propagated.
t/04-subdir.t now does a real-life unzip test, if unzip is available.
Lowered $RECURSION_LIMIT to 200. 1000 takes ages with big files.
Call bunzip2 with -f, but don't call xz with -f.
Fixed unpack() to not hit 256 char limit per filename so easily.
Tested mime_handler_dir(), now it actually works. Introduced a default directory
/usr/share/File-Unpack/helper.
Preparing env variable PERL5LIB for helpers.
mime(): Fixed usage of LZMA alone decoder: count as positive, only of output appeared.
text/x-shellscript: uudecode and shar support tested; works now.
0.22 jw, Sun Aug 29 23:27:59 CEST 2010
Fixed descending of destdir into subdirs of subdirs
Added t/04-subdir.t,
Added first support for running unpack() under -T
Replaced MANIFEST.SKIP with a filter in t/manifest.t
Fixed t/02-mime.t to survive missing shared-mime-info.
(Makefile.PL cannot require non-perl packages, can it?)
0.21 jw, Wed Aug 25 22:15:48 CEST 2010
Added 'nothing-to-do' semantic for mime-helpers: Point back by symlink.
Added helper/text=x-shellscript to demonstrate this.
Made external mime-helpers work: registering, calling.
Remember absolut path, call mime_type() correctly.
Started to propagate errors from _run_mime_handler() to unpack().
mime(): In SLES11 we get 'text/plain charset=utf-8' without semicolon.
0.20 jw, Tue Aug 24 21:15:49 CEST 2010
POD polishing. Synopsis now has some illustrative code.
0.19 jw, Tue Aug 24 15:42:49 CEST 2010
Added _finalize_argvv() to call _locate_*() functions only if
find_mime_handler() needs it. Added _locate_tar() and _locate_cpio_i;
Converted sub _builtin_mime_handlers back into @builtin_mime_handlers;
Debugged run(); piping was broken. Made new(jail_chmod0 => 1) optional.
0.18 jw, Tue Aug 24 02:13:47 CEST 2010
Added handlers for x-tar+bzip2, x-tar+gzip, x-rpm;
Converted @builtin_mime_handlers into sub _builtin_mime_handlers;
Converted system() tests of tar options to run() tests. Added tests for
cpio too. Secured pump inside eval {}.
Added fmt_run_shellcmd() to the API; thus fixed file_unpac.pl -m ...
0.17 jw, Mon Aug 23 11:36:04 CEST 2010
Made the test suite run again with -t
0.16 jw, Mon Aug 23 01:28:09 CEST 2010
added tar handler. debugged dir unpacking, copy-in,
destdir=jail, and def_mime_handler_fmt.
0.15 jw, Mon Aug 16 01:08:32 CEST 2010
destroyed unpack(): recreated subdir code. To be completed.
0.14 jw, Thu Aug 12 00:14:00 CEST 2010
Using Text::Sprintf::Named for parsing builtin_mime_handlers.
Added _fmt_run_shellcmd(). Tested _run_mime_handler. Finished.
0.13 jw, Wed Aug 11 10:30:49 CEST 2010
regression fixed: application/oasis.*.text no longer had +zip suffix.
0.12 jw, Fri Aug 6 01:38:50 CEST 2010
Possibly finalized _run_mime_handler(), needs testing.
0.11 jw, Tue Aug 3 20:15:04 CEST 2010
Reporting @missing_unpacker in log.
0.10 jw, Tue Aug 3 00:30:25 CEST 2010
File::Unppack::run() finished. Oops, IPC::Run opens all redirects before init.
Jail construction done in _run_mime_handler(). Jail descruction TBD.
@builtin_mime_handlers now reflects the harness structure, knows which
suffixes to remove, and uses words in curly braces as templates, to
make it less ugly. Delayed template substitution into
_run_mime_handler(), as extra array-refs are no good idea in a harness.
0.09 jw, Sun Aug 1 23:42:19 CEST 2010
Added self->{done}, to protect against re-unpacking; enabled recursion in unpack.
More consistent use of C<...> in POD. _run_mime_handler() prepared for IPC::Run.
Changed use_mime_handler() to parse an array, rather than a format string.
0.08 jw, Mon Jul 12 00:54:09 CEST 2010
Added mime handler methods: use_mime_handler_dir(), use_mime_handler(),
find_mime_handler() using $self->{mime_orcish};
Added builtin handlers to new(), using "%{destdir} ..." format string syntax
Added _prep_configdir(), shell and json support.
Continued unpack() to dispatch into mime handlers.
Started _run_mime_handler()
0.07 jw, Fri Jul 9 01:19:19 CEST 2010
Added support for stacked compressions recognition without looking
at file suffixes at all:
mime(file => '.tar.gz.lzma') says: "application/x-tar+gzip+lzma"
Hack to make tar.bz2 appear as "application/x-tar+bzip2"
tar.bz2.lzma does not work, that is why I call bz2 support a hack.
Now we can work on efficient unpack helpers.
0.06 jw, Thu Jul 8 00:31:24 CEST 2010
using Compress::Raw::Lzma::AloneDecoder instead of lzcat.
0.05 jw, Wed Jun 30 01:35:17 CEST 2010
started unpack(), added _not_excluded(),
added file_unpack.pl for testing.
0.04 jw, Mon Jun 28 21:38:31 CEST 2010
added exclude(), with tests & docs.
added _fs_check() and _fs_warn() logic.
added and used _bytes_unit().
0.03 jw, Sun Jun 27 03:09:21 CEST 2010
new() completed, private log(), logf() added.
0.02 jw, Sat Jun 26 21:55:12 CEST 2010
mime() documented, implemented, tested.
0.01 jw, Sat Jun 26 12:45:63 CEST 2010
First version, skeleton drafted.