Permalink
Browse files

share_dir no longer defaults to 'share'

git-svn-id: http://svn.perl.org/modules/Module-Build/trunk@13663 50811bd7-b8ce-0310-adc1-d9db26280581
  • Loading branch information...
1 parent cbca168 commit 86cdbe9c10742c845ac772743b38abd5b71128c6 @xdg xdg committed Dec 16, 2009
Showing with 21 additions and 16 deletions.
  1. +4 −0 Changes
  2. +10 −9 lib/Module/Build/API.pod
  3. +1 −2 lib/Module/Build/Base.pm
  4. +6 −5 t/properties/share_dir.t
View
@@ -4,6 +4,10 @@ Revision history for Perl extension Module::Build.
Bug fixes:
+ - The 'share_dir' property no longer defaults to 'share' and must be
+ explicitly set instead; this fixes problems for CPAN distributions that
+ already have a 'share' directory for whatever reason
+
- Change t/00-compile.t test for more portability
- Skip ppm.t if Pod::HTML is not available
View
@@ -763,14 +763,15 @@ be installed as read-only files for use with L<File::ShareDir>. The
C<share_dir> property supports both distribution-level and
module-level share files.
-The default when C<share_dir> is not set is for any files in a F<share>
-directory at the top level of the distribution to be installed in
-distribution-level share directory. Alternatively, C<share_dir> can be set to
-a directory name or an arrayref of directory names containing files to be
-installed in the distribution-level share directory.
+The simplest use of C<share_dir> is to set it to a directory name or an
+arrayref of directory names containing files to be installed in the
+distribution-level share directory.
-If C<share_dir> is a hashref, it may have C<dist> or C<module> keys
-providing full flexibility in defining share directories to install.
+ share_dir => 'share'
+
+Alternatively, if C<share_dir> is a hashref, it may have C<dist> or
+C<module> keys providing full flexibility in defining how share
+directories should be installed.
share_dir => {
dist => [ 'examples', 'more_examples' ],
@@ -780,8 +781,8 @@ providing full flexibility in defining share directories to install.
}
}
-If C<share_dir> is set (manually or automatically), then File::ShareDir
-will automatically be added to the C<requires> hash.
+If C<share_dir> is set, then File::ShareDir will automatically be added
+to the C<requires> hash.
=item sign
View
@@ -3990,8 +3990,7 @@ sub share_dir {
# Always coerce to proper hash form
if ( ! defined $p->{share_dir} ) {
- # not set -- use default 'share' dir if exists
- $p->{share_dir} = { dist => [ 'share' ] } if -d 'share';
+ return;
}
elsif ( ! ref $p->{share_dir} ) {
# scalar -- treat as a single 'dist' directory
View
@@ -33,7 +33,7 @@ my $mb = $dist->new_from_context;
# Test without a 'share' dir
ok( $mb, "Created Module::Build object" );
is( $mb->share_dir, undef,
- "default share undef if no 'share' dir exists"
+ "default share_dir undef if no 'share' dir exists"
);
ok( ! exists $mb->{properties}{requires}{'File::ShareDir'},
"File::ShareDir not added to 'requires'"
@@ -52,13 +52,14 @@ ok( -e catfile(qw/other share bar.txt/), "Created 'other/share' directory" );
# Check default when share_dir is not given
stdout_stderr_of( sub { $mb = $dist->new_from_context });
-is_deeply( $mb->share_dir, { dist => [ 'share' ] },
- "Default share_dir set as dist-type share"
+is( $mb->share_dir, undef,
+ "Default share_dir is undef even if 'share' exists"
);
-is( $mb->{properties}{requires}{'File::ShareDir'}, '1.00',
- "File::ShareDir 1.00 added to 'requires'"
+ok( ! exists $mb->{properties}{requires}{'File::ShareDir'},
+ "File::ShareDir not added to 'requires'"
);
+
# share_dir set to scalar
$dist->change_build_pl(
{

0 comments on commit 86cdbe9

Please sign in to comment.