From: Matt S Trout Date: Wed, 18 Jan 2017 13:55:20 +0000 (+0000) Subject: handle versionlib X-Git-Tag: v0.010_006~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FApp-FatPacker.git;a=commitdiff_plain;h=9fecf34853eb73b3f1f37ebc0af4b9a541650ba7 handle versionlib --- diff --git a/Changes b/Changes index 86aa160..c96afb2 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,6 @@ Revision history for App-FatPacker + - detect and handle packing from within inc dirs w/version part - fix tests to no longer rely on . being in @INC 0.010005 - 2015-12-14 diff --git a/lib/App/FatPacker.pm b/lib/App/FatPacker.pm index e6710ad..cfa2db8 100644 --- a/lib/App/FatPacker.pm +++ b/lib/App/FatPacker.pm @@ -178,8 +178,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; } }