_scan_share_dir gets passed a structure to $_[4] to control dot-dir inclusion:
sub _scan_share_dir
{
my( $files, $idir, $dir, $def ) = @_;
...
next if not $def->{dotfiles}
However, in the recursive step, this structure is not passed:
_scan_share_dir( $files, File::Spec->catdir( $idir, $entry ), $full );
Which means that on subsequent calls "$def" is undefined, regardless of user configuration.
This leads to dotfiles in any path other than the top level getting ignored.
Attached is output from instrumented run showing decision making and availabilty of $def in the currrent logic on CPAN ( pre_instrument.txt )
And also attached is the output after modifying
_scan_share_dir( $files, File::Spec->catdir( $idir, $entry ), $full );
to read
_scan_share_dir( $files, File::Spec->catdir( $idir, $entry ), $full , $def );
( post_instrument.txt )
And the difference ( instrument_difference.txt ) shows the desired effect.
( Makefile.PL in question is https://metacpan.org/source/KENTNL/Dist-Zilla-PluginBundle-Author-KENTNL-2.013004/Makefile.PL which is using the interface as documented, but alas, does not install *any* dotfiles with the current CPAN release )
--- pre_instrument.txt 2014-05-18 19:24:27.088248481 +1200
+++ post_instrument.txt 2014-05-18 19:24:53.074264403 +1200
@@ -1,22 +1,23 @@
def is defined
?? share/profiles/moo-role
-> enterdir
-def is NOT defined
+def is defined
?? share/profiles/moo-role/profile.ini
-> file included
?? share/profiles/moo-role/skel
-> enterdir
-def is NOT defined
+def is defined
?? share/profiles/moo-role/skel/Changes
-> file included
?? share/profiles/moo-role/skel/maint
-> enterdir
-def is NOT defined
+def is defined
?? share/profiles/moo-role/skel/maint/perlcritic.rc.gen.pl
-> file included
?? share/profiles/moo-role/skel/maint/..
?? share/profiles/moo-role/skel/maint/.
?? share/profiles/moo-role/skel/.gitignore
+ -> file included
?? share/profiles/moo-role/skel/..
?? share/profiles/moo-role/skel/perlcritic.rc
-> file included
@@ -24,6 +25,7 @@
-> file included
?? share/profiles/moo-role/skel/.
?? share/profiles/moo-role/skel/.perltidyrc
+ -> file included
?? share/profiles/moo-role/skel/weaver.ini
-> file included
?? share/profiles/moo-role/..
@@ -32,22 +34,23 @@
-> file included
?? share/profiles/moose-role
-> enterdir
-def is NOT defined
+def is defined
?? share/profiles/moose-role/profile.ini
-> file included
?? share/profiles/moose-role/skel
-> enterdir
-def is NOT defined
+def is defined
?? share/profiles/moose-role/skel/Changes
-> file included
?? share/profiles/moose-role/skel/maint
-> enterdir
-def is NOT defined
+def is defined
?? share/profiles/moose-role/skel/maint/perlcritic.rc.gen.pl
-> file included
?? share/profiles/moose-role/skel/maint/..
?? share/profiles/moose-role/skel/maint/.
?? share/profiles/moose-role/skel/.gitignore
+ -> file included
?? share/profiles/moose-role/skel/..
?? share/profiles/moose-role/skel/perlcritic.rc
-> file included
@@ -55,6 +58,7 @@
-> file included
?? share/profiles/moose-role/skel/.
?? share/profiles/moose-role/skel/.perltidyrc
+ -> file included
?? share/profiles/moose-role/skel/weaver.ini
-> file included
?? share/profiles/moose-role/..
@@ -63,22 +67,23 @@
-> file included
?? share/profiles/default
-> enterdir
-def is NOT defined
+def is defined
?? share/profiles/default/profile.ini
-> file included
?? share/profiles/default/skel
-> enterdir
-def is NOT defined
+def is defined
?? share/profiles/default/skel/Changes
-> file included
?? share/profiles/default/skel/maint
-> enterdir
-def is NOT defined
+def is defined
?? share/profiles/default/skel/maint/perlcritic.rc.gen.pl
-> file included
?? share/profiles/default/skel/maint/..
?? share/profiles/default/skel/maint/.
?? share/profiles/default/skel/.gitignore
+ -> file included
?? share/profiles/default/skel/..
?? share/profiles/default/skel/perlcritic.rc
-> file included
@@ -86,6 +91,7 @@
-> file included
?? share/profiles/default/skel/.
?? share/profiles/default/skel/.perltidyrc
+ -> file included
?? share/profiles/default/skel/weaver.ini
-> file included
?? share/profiles/default/..
@@ -96,22 +102,23 @@
?? share/profiles/.
?? share/profiles/moo
-> enterdir
-def is NOT defined
+def is defined
?? share/profiles/moo/profile.ini
-> file included
?? share/profiles/moo/skel
-> enterdir
-def is NOT defined
+def is defined
?? share/profiles/moo/skel/Changes
-> file included
?? share/profiles/moo/skel/maint
-> enterdir
-def is NOT defined
+def is defined
?? share/profiles/moo/skel/maint/perlcritic.rc.gen.pl
-> file included
?? share/profiles/moo/skel/maint/..
?? share/profiles/moo/skel/maint/.
?? share/profiles/moo/skel/.gitignore
+ -> file included
?? share/profiles/moo/skel/..
?? share/profiles/moo/skel/perlcritic.rc
-> file included
@@ -119,6 +126,7 @@
-> file included
?? share/profiles/moo/skel/.
?? share/profiles/moo/skel/.perltidyrc
+ -> file included
?? share/profiles/moo/skel/weaver.ini
-> file included
?? share/profiles/moo/..
def is defined
?? share/profiles/moo-role
-> enterdir
def is defined
?? share/profiles/moo-role/profile.ini
-> file included
?? share/profiles/moo-role/skel
-> enterdir
def is defined
?? share/profiles/moo-role/skel/Changes
-> file included
?? share/profiles/moo-role/skel/maint
-> enterdir
def is defined
?? share/profiles/moo-role/skel/maint/perlcritic.rc.gen.pl
-> file included
?? share/profiles/moo-role/skel/maint/..
?? share/profiles/moo-role/skel/maint/.
?? share/profiles/moo-role/skel/.gitignore
-> file included
?? share/profiles/moo-role/skel/..
?? share/profiles/moo-role/skel/perlcritic.rc
-> file included
?? share/profiles/moo-role/skel/perlcritic.deps
-> file included
?? share/profiles/moo-role/skel/.
?? share/profiles/moo-role/skel/.perltidyrc
-> file included
?? share/profiles/moo-role/skel/weaver.ini
-> file included
?? share/profiles/moo-role/..
?? share/profiles/moo-role/.
?? share/profiles/moo-role/ModuleTemplate.pm.tpl
-> file included
?? share/profiles/moose-role
-> enterdir
def is defined
?? share/profiles/moose-role/profile.ini
-> file included
?? share/profiles/moose-role/skel
-> enterdir
def is defined
?? share/profiles/moose-role/skel/Changes
-> file included
?? share/profiles/moose-role/skel/maint
-> enterdir
def is defined
?? share/profiles/moose-role/skel/maint/perlcritic.rc.gen.pl
-> file included
?? share/profiles/moose-role/skel/maint/..
?? share/profiles/moose-role/skel/maint/.
?? share/profiles/moose-role/skel/.gitignore
-> file included
?? share/profiles/moose-role/skel/..
?? share/profiles/moose-role/skel/perlcritic.rc
-> file included
?? share/profiles/moose-role/skel/perlcritic.deps
-> file included
?? share/profiles/moose-role/skel/.
?? share/profiles/moose-role/skel/.perltidyrc
-> file included
?? share/profiles/moose-role/skel/weaver.ini
-> file included
?? share/profiles/moose-role/..
?? share/profiles/moose-role/.
?? share/profiles/moose-role/ModuleTemplate.pm.tpl
-> file included
?? share/profiles/default
-> enterdir
def is defined
?? share/profiles/default/profile.ini
-> file included
?? share/profiles/default/skel
-> enterdir
def is defined
?? share/profiles/default/skel/Changes
-> file included
?? share/profiles/default/skel/maint
-> enterdir
def is defined
?? share/profiles/default/skel/maint/perlcritic.rc.gen.pl
-> file included
?? share/profiles/default/skel/maint/..
?? share/profiles/default/skel/maint/.
?? share/profiles/default/skel/.gitignore
-> file included
?? share/profiles/default/skel/..
?? share/profiles/default/skel/perlcritic.rc
-> file included
?? share/profiles/default/skel/perlcritic.deps
-> file included
?? share/profiles/default/skel/.
?? share/profiles/default/skel/.perltidyrc
-> file included
?? share/profiles/default/skel/weaver.ini
-> file included
?? share/profiles/default/..
?? share/profiles/default/.
?? share/profiles/default/ModuleTemplate.pm.tpl
-> file included
?? share/profiles/..
?? share/profiles/.
?? share/profiles/moo
-> enterdir
def is defined
?? share/profiles/moo/profile.ini
-> file included
?? share/profiles/moo/skel
-> enterdir
def is defined
?? share/profiles/moo/skel/Changes
-> file included
?? share/profiles/moo/skel/maint
-> enterdir
def is defined
?? share/profiles/moo/skel/maint/perlcritic.rc.gen.pl
-> file included
?? share/profiles/moo/skel/maint/..
?? share/profiles/moo/skel/maint/.
?? share/profiles/moo/skel/.gitignore
-> file included
?? share/profiles/moo/skel/..
?? share/profiles/moo/skel/perlcritic.rc
-> file included
?? share/profiles/moo/skel/perlcritic.deps
-> file included
?? share/profiles/moo/skel/.
?? share/profiles/moo/skel/.perltidyrc
-> file included
?? share/profiles/moo/skel/weaver.ini
-> file included
?? share/profiles/moo/..
?? share/profiles/moo/.
?? share/profiles/moo/ModuleTemplate.pm.tpl
-> file included
Generating a Unix-style Makefile
Writing Makefile for Dist::Zilla::PluginBundle::Author::KENTNL
Writing MYMETA.yml and MYMETA.json
def is defined
?? share/profiles/moo-role
-> enterdir
def is NOT defined
?? share/profiles/moo-role/profile.ini
-> file included
?? share/profiles/moo-role/skel
-> enterdir
def is NOT defined
?? share/profiles/moo-role/skel/Changes
-> file included
?? share/profiles/moo-role/skel/maint
-> enterdir
def is NOT defined
?? share/profiles/moo-role/skel/maint/perlcritic.rc.gen.pl
-> file included
?? share/profiles/moo-role/skel/maint/..
?? share/profiles/moo-role/skel/maint/.
?? share/profiles/moo-role/skel/.gitignore
?? share/profiles/moo-role/skel/..
?? share/profiles/moo-role/skel/perlcritic.rc
-> file included
?? share/profiles/moo-role/skel/perlcritic.deps
-> file included
?? share/profiles/moo-role/skel/.
?? share/profiles/moo-role/skel/.perltidyrc
?? share/profiles/moo-role/skel/weaver.ini
-> file included
?? share/profiles/moo-role/..
?? share/profiles/moo-role/.
?? share/profiles/moo-role/ModuleTemplate.pm.tpl
-> file included
?? share/profiles/moose-role
-> enterdir
def is NOT defined
?? share/profiles/moose-role/profile.ini
-> file included
?? share/profiles/moose-role/skel
-> enterdir
def is NOT defined
?? share/profiles/moose-role/skel/Changes
-> file included
?? share/profiles/moose-role/skel/maint
-> enterdir
def is NOT defined
?? share/profiles/moose-role/skel/maint/perlcritic.rc.gen.pl
-> file included
?? share/profiles/moose-role/skel/maint/..
?? share/profiles/moose-role/skel/maint/.
?? share/profiles/moose-role/skel/.gitignore
?? share/profiles/moose-role/skel/..
?? share/profiles/moose-role/skel/perlcritic.rc
-> file included
?? share/profiles/moose-role/skel/perlcritic.deps
-> file included
?? share/profiles/moose-role/skel/.
?? share/profiles/moose-role/skel/.perltidyrc
?? share/profiles/moose-role/skel/weaver.ini
-> file included
?? share/profiles/moose-role/..
?? share/profiles/moose-role/.
?? share/profiles/moose-role/ModuleTemplate.pm.tpl
-> file included
?? share/profiles/default
-> enterdir
def is NOT defined
?? share/profiles/default/profile.ini
-> file included
?? share/profiles/default/skel
-> enterdir
def is NOT defined
?? share/profiles/default/skel/Changes
-> file included
?? share/profiles/default/skel/maint
-> enterdir
def is NOT defined
?? share/profiles/default/skel/maint/perlcritic.rc.gen.pl
-> file included
?? share/profiles/default/skel/maint/..
?? share/profiles/default/skel/maint/.
?? share/profiles/default/skel/.gitignore
?? share/profiles/default/skel/..
?? share/profiles/default/skel/perlcritic.rc
-> file included
?? share/profiles/default/skel/perlcritic.deps
-> file included
?? share/profiles/default/skel/.
?? share/profiles/default/skel/.perltidyrc
?? share/profiles/default/skel/weaver.ini
-> file included
?? share/profiles/default/..
?? share/profiles/default/.
?? share/profiles/default/ModuleTemplate.pm.tpl
-> file included
?? share/profiles/..
?? share/profiles/.
?? share/profiles/moo
-> enterdir
def is NOT defined
?? share/profiles/moo/profile.ini
-> file included
?? share/profiles/moo/skel
-> enterdir
def is NOT defined
?? share/profiles/moo/skel/Changes
-> file included
?? share/profiles/moo/skel/maint
-> enterdir
def is NOT defined
?? share/profiles/moo/skel/maint/perlcritic.rc.gen.pl
-> file included
?? share/profiles/moo/skel/maint/..
?? share/profiles/moo/skel/maint/.
?? share/profiles/moo/skel/.gitignore
?? share/profiles/moo/skel/..
?? share/profiles/moo/skel/perlcritic.rc
-> file included
?? share/profiles/moo/skel/perlcritic.deps
-> file included
?? share/profiles/moo/skel/.
?? share/profiles/moo/skel/.perltidyrc
?? share/profiles/moo/skel/weaver.ini
-> file included
?? share/profiles/moo/..
?? share/profiles/moo/.
?? share/profiles/moo/ModuleTemplate.pm.tpl
-> file included
Generating a Unix-style Makefile
Writing Makefile for Dist::Zilla::PluginBundle::Author::KENTNL
Writing MYMETA.yml and MYMETA.json