Author: dagolden
Date: Wed Dec 16 02:30:37 2009
New Revision: 13663

Modified:
   Module-Build/trunk/Changes
   Module-Build/trunk/lib/Module/Build/API.pod
   Module-Build/trunk/lib/Module/Build/Base.pm
   Module-Build/trunk/t/properties/share_dir.t

Log:
share_dir no longer defaults to 'share'

Modified: Module-Build/trunk/Changes
==============================================================================
--- Module-Build/trunk/Changes  (original)
+++ Module-Build/trunk/Changes  Wed Dec 16 02:30:37 2009
@@ -4,6 +4,10 @@
 
  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

Modified: Module-Build/trunk/lib/Module/Build/API.pod
==============================================================================
--- Module-Build/trunk/lib/Module/Build/API.pod (original)
+++ Module-Build/trunk/lib/Module/Build/API.pod Wed Dec 16 02:30:37 2009
@@ -763,14 +763,15 @@
 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.
-
-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.
+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.
+
+  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 @@
     }
   }
 
-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
 

Modified: Module-Build/trunk/lib/Module/Build/Base.pm
==============================================================================
--- Module-Build/trunk/lib/Module/Build/Base.pm (original)
+++ Module-Build/trunk/lib/Module/Build/Base.pm Wed Dec 16 02:30:37 2009
@@ -3990,8 +3990,7 @@
 
   # 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

Modified: Module-Build/trunk/t/properties/share_dir.t
==============================================================================
--- Module-Build/trunk/t/properties/share_dir.t (original)
+++ Module-Build/trunk/t/properties/share_dir.t Wed Dec 16 02:30:37 2009
@@ -33,7 +33,7 @@
 # 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 @@
 
 # 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(
   {

Reply via email to