Subject: | Erroneous handling of .packlist files |
Hello,
I tried to pack a module that use AnyEvent. All AnyEvent modules are packed with an incorrect module path.
For example for AnyEvent.pm, it appears as "mach/AnyEvent.pm" on FreeBSD and "i486-linux-gnu-thread-multi/AnyEvent.pm" on Linux, in the %fatpacked hash.
At the compilation phase of the fatpacked resulting script, the module AnyEvent.pm is not found...
Note that the problem occurs for each module that uses .packlist file, not only AnyEvent.
The attached patch correct the problem.
I just typed "fatpack pack myscript.pl", so I don't think I am misusing fatpack...
Tested on:
- FreeBSD 8.4 amd64 / perl 5.12.5
@INC:
/home/max/perl5/lib/perl5/amd64-freebsd
/home/max/perl5/lib/perl5
/usr/local/lib/perl5/5.12/BSDPAN
/usr/local/lib/perl5/site_perl/5.12/mach <- AnyEvent.pm installed here
/usr/local/lib/perl5/site_perl/5.12
/usr/local/lib/perl5/5.12/mach
/usr/local/lib/perl5/5.12
- Linux debian 2.6.26-2-686 / perl 5.10.0
@INC:
/home/max/perl5/lib/perl5/i486-linux-gnu-thread-multi <- AnyEvent.pm installed here
/home/max/perl5/lib/perl5
/etc/perl
/usr/local/lib/perl/5.10.0
/usr/local/share/perl/5.10.0
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.10
/usr/share/perl/5.10
/usr/local/lib/site_perl
Best regards,
Max.
Subject: | FatPacker.pm.patch |
--- FatPacker.pm~ 2013-05-30 03:46:30.000000000 +0200
+++ FatPacker.pm 2013-07-26 15:34:33.000000000 +0200
@@ -173,8 +173,8 @@
my $pack_base;
PART: foreach my $p (0 .. $#dir_parts) {
if ($dir_parts[$p] eq 'auto') {
- # $p-2 since it's <wanted path>/$Config{archname}/auto
- $pack_base = catpath $vol, catdir @dir_parts[0..$p-2];
+ # $p-1 since it's <wanted path>/$Config{archname}/auto
+ $pack_base = catpath $vol, catdir @dir_parts[0..$p-1];
last PART;
}
}