Author: kwilliams
Date: Sat Apr 28 10:42:59 2007
New Revision: 9470
Modified:
Module-Build/trunk/Changes
Module-Build/trunk/lib/Module/Build/Base.pm
Module-Build/trunk/t/tilde.t
Log:
Have to revert the de-tildefying change, because it doesn't handle
~user/foo paths and we're better with the old breakage than the new
breakage. I've left the tests in as TODO items so we can eventually
fix this, perhaps with getpwnam() or something.
Modified: Module-Build/trunk/Changes
==============================================================================
--- Module-Build/trunk/Changes (original)
+++ Module-Build/trunk/Changes Sat Apr 28 10:42:59 2007
@@ -8,8 +8,6 @@
- Support get_action_docs() =head2 style. [ewilhelm]
- - Reworked _detildefy with regexp instead of glob(). [ewilhelm]
-
- Workaround Test::Pod::Coverage @INC bug. [Eric Wilhelm]
- Fixed the command-line args --extra_compiler_flags and
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 Sat Apr 28 10:42:59 2007
@@ -1681,13 +1681,12 @@
}
-# replace ~ with $ENV{HOME}
# (bash shell won't expand tildes mid-word: "--foo=~/thing")
+# TODO: handle ~user/foo
sub _detildefy {
my $arg = shift;
- $arg =~ s#^~(/|$)#$ENV{HOME}$1#;
- return $arg;
+ return $arg =~ /^~/ ? (glob $arg)[0] : $arg;
}
Modified: Module-Build/trunk/t/tilde.t
==============================================================================
--- Module-Build/trunk/t/tilde.t (original)
+++ Module-Build/trunk/t/tilde.t Sat Apr 28 10:42:59 2007
@@ -49,6 +49,9 @@
$mb = run_sample( install_base => '~~' );
is( $mb->install_base, '~~' );
+ TODO: {
+ local $TODO = "Not handling spaces in _detildefy() properly yet";
+
$mb = run_sample( install_base => '~ foo' );
is( $mb->install_base, '~ foo' );
@@ -58,6 +61,7 @@
$mb = run_sample( install_base => '~/fo o' );
is( $mb->install_base, "$ENV{HOME}/fo o" );
+ }
$mb = run_sample( install_base => 'foo~' );
is( $mb->install_base, 'foo~' );