X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FApp%2FFatPacker.pm;h=db65c001f455cf79177a9eff5087c1cc0bef60ce;hb=de0c2ef75de79bd3eaa8f29e9f583e7e86e42981;hp=056a502a1e423b05a52e05ea74b7d07b87b359e0;hpb=23b0c283a5a8c3589d089c1e92faf5d6ac7bf614;p=p5sagit%2FApp-FatPacker.git diff --git a/lib/App/FatPacker.pm b/lib/App/FatPacker.pm index 056a502..db65c00 100644 --- a/lib/App/FatPacker.pm +++ b/lib/App/FatPacker.pm @@ -14,7 +14,7 @@ use File::Copy qw(copy); use File::Path qw(mkpath rmtree); use B qw(perlstring); -our $VERSION = '0.010004'; # 0.10.4 +our $VERSION = '0.010_006'; # 0.10.6 $VERSION = eval $VERSION; @@ -142,11 +142,16 @@ sub script_command_packlists_for { sub packlists_containing { my ($self, $targets) = @_; - my @targets = @$targets; + my @targets; { local @INC = ('lib', @INC); - foreach my $t (@targets) { - require $t; + foreach my $t (@$targets) { + unless (eval { require $t; 1}) { + warn "Failed to load ${t}: $@\n" + ."Make sure you're not missing a packlist as a result\n"; + next; + } + push @targets, $t; } } my @search = grep -d $_, map catdir($_, 'auto'), @INC; @@ -178,8 +183,11 @@ sub packlists_to_tree { my $pack_base; PART: foreach my $p (0 .. $#dir_parts) { if ($dir_parts[$p] eq 'auto') { - # $p-2 since it's /$Config{archname}/auto - $pack_base = catpath $vol, catdir @dir_parts[0..$p-2]; + # $p-2 normally since it's /$Config{archname}/auto but + # if the last bit is a number it's $Config{archname}/$version/auto + # so use $p-3 in that case + my $version_lib = 0+!!($dir_parts[$p-1] =~ /^[0-9.]+$/); + $pack_base = catpath $vol, catdir @dir_parts[0..$p-(2+$version_lib)]; last PART; } }