Skip Menu |

This queue is for tickets about the File-Unpack CPAN distribution.

Report information
The Basics
Id: 73670
Status: open
Priority: 0/
Queue: File-Unpack

People
Owner: JNW [...] cpan.org
Requestors: leoncogs [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



I have little expertise in perl. I have This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux-thread-multi on fedora 16 kernel 3.1.6-1.fc16.x86_64. I seem to have all cpan required modules for this package installed ok. When trying to make test I get Use of qw(...) as parentheses is deprecated at /home/leonc16/Downloads/File-Unpack-0.47/t/../blib/lib/File/Unpack.pm line 367. I seem to have fixed that by changing appropriate lines with (qw/empty_file empty_dir force/). However I cannot find any answers for this error when I make test make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/00-load.t ....... 1/1 # Testing File::Unpack 0.47, Perl 5.014002, /usr/bin/perl t/00-load.t ....... ok t/01-init.t ....... ok t/02-mime.t ....... 1/29 # Failed test 'xterm-snippet.desktop: text/plain' # at t/02-mime.t line 56. # got: 'text/plain' # expected: 'text/x-desktop' # Looks like you failed 1 test of 29. t/02-mime.t ....... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/29 subtests t/03-exclude.t .... ok t/04-subdir.t ..... 1/5 Non-Zero return value: 256 t/04-subdir.t ..... ok t/05-list.t ....... ok t/06-logfile.t .... ok t/boilerplate.t ... ok t/manifest.t ...... ok t/pod-coverage.t .. ok t/pod.t ........... ok Test Summary Report ------------------- t/02-mime.t (Wstat: 256 Tests: 29 Failed: 1) Failed test: 23 Non-zero exit status: 1 Files=11, Tests=71, 1 wallclock secs ( 0.04 usr 0.01 sys + 1.07 cusr 0.13 csys = 1.25 CPU) Result: FAIL Failed 1/11 test programs. 1/71 subtests failed. make: *** [test_dynamic] Error 255
Subject: 02-mime.t
#!perl -T use Test::More; use FindBin; BEGIN { unshift @INC, "$1/../blib/lib" if $FindBin::Bin =~ m{(.*)} }; use File::Unpack; use Data::Dumper; diag("File::MimeInfo::Magic missing\n") unless $INC{'File/MimeInfo/Magic.pm'}; diag("File::LibMagic missing\n") unless $INC{'File/LibMagic.pm'}; my $shared_mime_info_db = '/usr/share/mime/magic'; my $u = File::Unpack->new(); my $d = "data"; $d = "t/data" unless -d $d; opendir DIR, $d or diag("where is my test data?"); my @f = sort grep { !/^\./ } readdir DIR; closedir DIR; %exp = ( ## 0.22 used to say application/x-lzma, but true binary data. Not even compressed. 'lxknf09SCc0.bin' => [ 'application/octet-stream', qr{^(binary|)$} ], ## actually 'application/x-desktop' or 'text/x-desktop' 'Desktop.directory' => [ 'text/plain', 'utf-8', 'UTF-8 Unicode text' ], 'xterm-snippet.desktop' => ['text/x-desktop','utf-8','UTF-8 Unicode Pascal program text',['text/x-pascal','application/x-desktop']], 'IPA-snippet.pfa' => [ 'text/x-font-type1', qr{^(us-ascii|)$}, 'PostScript Type 1 font text (OmegaSerifIPA 001.000)', [ 'text/plain', 'application/x-font-type1' ] ], 'Times-Roman-snippet.afm' => [qr{^(application|text)/x-font-sunos-news$}, 'us-ascii','ASCII font metrics',['text/x-fortran','application/x-font-sunos-news']], ## actually 'text/x-xslfo' 'columns-snippet.fo' => [qr{^(text/plain|application/xml)$},'us-ascii','XML document text'], 'empty.odt' => ['application/vnd.oasis.opendocument.text+zip',qr{^(binary|)$},'Zip archive data, at least v2.0 to extract, mime type application/vnd OpenDocument Text'], 'ruhyphal.tex' => ['text/plain','iso-8859-1','ISO-8859 English text'], 'test2.tga' => ['image/x-tga',qr{^(binary|)$},'Targa image data - RGB - RLE 32 x 32',['application/octet-stream','image/x-tga']], ## actually a 'audio/x-mpegurl' 'wzbc-2009-06-28-17-00.m3u' => ['text/plain','us-ascii','M3U playlist text'], ## File::LibMagic says application/octet-stream here: 'monotone.info' => ['application/x-text-mixed', 'binary', 'data', ['application/octet-stream','application/x-text-mixed']], ## this is actually plain text, but we are fooled by its apparent magic. 'pdftex-a.txt' => ['application/pdf', 'utf-8', 'PDF document, version 1.4' ] # ); plan tests => (-f $shared_mime_info_db ? 2 * keys %exp : 0) + 5; if (-f $shared_mime_info_db) { my %e = %exp; for my $f (@f) { my $r = $u->mime("$d/$f"); diag("test file $f not in \%exp: ", Dumper $r),last unless $exp{$f}; my $ref = ref($exp{$f}[0]||'')||''; if ($ref eq 'Regexp') { cmp_ok($r->[0], '=~', $exp{$f}[0], "$f: $r->[0]"); } else { cmp_ok($r->[0], 'eq', $exp{$f}[0]||'', "$f: $r->[0]"); } $ref = ref($exp{$f}[1]||'')||''; my $r1 = $r->[1]||''; if ($ref eq 'Regexp') { cmp_ok($r1, '=~', $exp{$f}[1], "$f: \t\t\tcharset=$r1"); } else { cmp_ok($r1, 'eq', $exp{$f}[1]||'', "$f: \t\t\tcharset=$r1"); } delete $e{$f}; } # any remainders? diag("no files for \%exp: ", Dumper keys %e) if keys %e; } else { diag("shared mime info not tested: $shared_mime_info_db not found"); } cmp_ok($u->mime( file => "$d/$f[0]" )->[0], 'eq', $exp{$f[0]}[0], "mime(file => ..)"); cmp_ok($u->mime({file => "$d/$f[0]"})->[0], 'eq', $exp{$f[0]}[0], "mime({file => ..})"); cmp_ok($u->mime(file => 'file_does_not_exist')->[0], 'eq', 'x-system/x-error', "file not found"); my $buf = "\x25\x50\x44\x46\x2d\x31\x2e\x34\x0a\x25\xc3\xa4\xc3\xbc\xc3\xb6" . "\xc3\x9f\x0a\x32\x20\x30\x20\x6f\x62\x6a\x0a\x3c\x3c\x2f\x4c\x65" . "\x6e\x67\x74\x68\x20\x33\x20\x30\x20\x52\x2f\x46\x69\x6c\x74\x65" . "\x72\x2f\x46\x6c\x61\x74\x65\x44\x65\x63\x6f\x64\x65\x3e\x3e\x0a"; open my $fd, '<', \$buf; cmp_ok($u->mime(fd => $fd )->[0], 'eq', "application/pdf", "mime(fd => ..)"); cmp_ok($u->mime(buf => $buf)->[0], 'eq', "application/pdf", "mime(buf => ..)"); close $fd;
Subject: fixed
Both issues are fixed in version 0.50, please update and let me know if this works.
From: leoncogs [...] gmail.com
On Wed Jan 25 15:18:26 2012, JNW wrote: Show quoted text
> Both issues are fixed in version 0.50, please update and let me know if > this works.
Jurgen thant works fine. Couple things doesn't seem to install to /usr/bin. I ran perl file_unpack.pl from the home directory and it worked. I tried it on .tar.gz file ok but when I tried it on a directory with several .tar.gz files it would only do one at a time. However i tried it on a directory with over 1000 zip files it worked like a charm creating directory to suit. Also tried it on a dir with over 200 dirs containing rar files unpacking to a different folder. This also worked great extracting subdirectory to a seperate folder. Keep up the good works.
From: leoncogs [...] gmail.com
Sorry meant to include the following [leonc16@localhost File-Unpack-0.50]$ perl Makefile.PL Argument "6.57_05" isn't numeric in numeric ge (>=) at Makefile.PL line 5. Checking if your kit is complete... Looks good Writing Makefile for File::Unpack Writing MYMETA.yml [leonc16@localhost File-Unpack-0.50]$ make cp file_unpack.pl blib/lib/File/file_unpack.pl cp Unpack.pm blib/lib/File/Unpack.pm cp children_fuser.pl blib/lib/File/children_fuser.pl Manifying blib/man3/File::Unpack.3pm [leonc16@localhost File-Unpack-0.50]$ make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/00-load.t ....... 1/1 # Testing File::Unpack 0.50, Perl 5.014002, /usr/bin/perl t/00-load.t ....... ok t/01-init.t ....... ok t/02-mime.t ....... ok t/03-exclude.t .... ok t/04-subdir.t ..... 1/5 Non-Zero return value: 256 t/04-subdir.t ..... ok t/05-list.t ....... ok t/06-logfile.t .... ok t/boilerplate.t ... ok t/manifest.t ...... ok t/pod-coverage.t .. ok t/pod.t ........... ok All tests successful. Files=11, Tests=71, 1 wallclock secs ( 0.04 usr 0.02 sys + 1.04 cusr 0.14 csys = 1.24 CPU) Result: PASS [leonc16@localhost File-Unpack-0.50]$ sudo make install Appending installation info to /usr/lib64/perl5/perllocal.pod
0.52 is hitting cpan, fixing a couple of things... Show quoted text
> Jurgen thant works fine. Couple things doesn't seem to install to > /usr/bin.
Yeah, I had not thought of this. Was installing via RPM packages, not via make install. Thanks for testing the obviuous :-) Fixed. Show quoted text
> I ran perl file_unpack.pl from the home directory and it > worked. I tried it on .tar.gz file ok
Show quoted text
> but when I tried it on a > directory with several .tar.gz files it would only do one at a time.
Fixed. Show quoted text
> However i tried it on a directory with over 1000 zip files it worked > like a charm creating directory to suit.
Gad to hear that! Show quoted text
> Also tried it on a dir with > over 200 dirs containing rar files unpacking to a different folder. > This also worked great extracting subdirectory to a seperate folder. > > Keep up the good works.
thanks for testing!
From: leoncogs [...] gmail.com
I can confirm that worked like a charm. I ran all the above on fedora16 3.2.2-1.fc16.x86_64 by using something like:- file_unpack Downloads/tmp/* -D Downloads/tmp2/ It now also unpacks multiple .tar.gz archives I also ran it on Slackware 13.37 2.6.37.6-smp 32bit only on a dir with several .gz archives and it again worked. Once again fine work.
From: leoncogs [...] gmail.com
Jurgen I have noticed little problem with regard rar files e.g part1.rar, part2.rar etc and .roo and ro1 etc. Where there are several parts in one folder and there are several folders. if you set unpack to extract the folder you end up with several of the same file as you have parts.rar. See the attached files may give a better idea. When I point file-upack to first rar file i.e part1.rar or .r00 then it is ok but this method I have to do it with each folder.
Subject: unpack-rar.png
Download unpack-rar.png
image/png 29k
unpack-rar.png
Subject: unpack.rars
Download unpack.rars
application/octet-stream 12.3k

Message body not shown because it is not plain text.

On Fri Feb 17 04:55:05 2012, leonc wrote: Show quoted text
> Jurgen > > I have noticed little problem with regard rar files e.g part1.rar, > part2.rar etc and .roo and ro1 etc. Where there are several parts in > one folder and there are several folders. if you set unpack to extract > the folder you end up with several of the same file as you have > parts.rar.
This unfortunate, but I have no good idea what to do about this. The code was written to unpack as much as possible, this include also 'as often as possible' in your case. Ideas: - post process the result tree, and see if there are multiple indentical (colliding!) subtrees. That would be quite generic, but not so efficient. - preprocess the input files, so that an ignore list prevents us from touching the other parts again. This would need rar specific code, which I am not so happy about.