Stop chdir when finding packlist. Absolutify %INC path in case there's a relative...
authorTatsuhiko Miyagawa <miyagawa@bulknews.net>
Wed, 3 Apr 2013 21:39:53 +0000 (14:39 -0700)
committerKaren Etheridge <ether@cpan.org>
Sat, 27 Jul 2013 02:57:17 +0000 (19:57 -0700)
commit0612cca16821f328d0e9c2ea4c18d307ee6dc2fc
tree9051b2c9ce230eeccc3218637b3cba925499fb8d
parent79f52f455d17f03a5164bec327b64038ea985b09
Stop chdir when finding packlist. Absolutify %INC path in case there's a relative path in @INC.

When there's a relative path in @INC (e.g. with -Mlib=./local/lib/perl5),
FatPacker died with `Can't open local/lib/perl5/.../.packlist` even if the
file exists, because of File::Find's chdir, and $File::Find::name is yet
relative.

This patch adds 'no_chdir' option to File::Find to stop chdir'ing to
the directories, and then expand the %INC entries to fullpath with
Cwd::abs_path, so that it will hopefully match with what you have in
.packlist content.

Reproduce:

  cpanm -l local Plack
  perl -Mlib=local/lib/perl5 -S fatpack packlists-for Plack.pm
lib/App/FatPacker.pm