[Bps-public-commit] r15354 - in Shipwright/trunk: . lib/Shipwright/Script share/bin

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Aug 21 23:07:19 EDT 2008


Author: sunnavy
Date: Thu Aug 21 23:07:18 2008
New Revision: 15354

Modified:
   Shipwright/trunk/   (props changed)
   Shipwright/trunk/lib/Shipwright/Script/Build.pm
   Shipwright/trunk/lib/Shipwright/Test.pm
   Shipwright/trunk/lib/Shipwright/Util.pm
   Shipwright/trunk/share/bin/shipwright-builder

Log:
 r15959 at sunnavys-mb:  sunnavy | 2008-08-22 11:05:12 +0800
 replace rel2abs in File::Spec to abs_path in Cwd, because abs_path can handle /tmp/foo => /private/tmp/foo if /tmp/ is linked to /private/tmp


Modified: Shipwright/trunk/lib/Shipwright/Script/Build.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Script/Build.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Script/Build.pm	Thu Aug 21 23:07:18 2008
@@ -38,7 +38,7 @@
     if ( $self->install_base ) {
 
         # convert relative path to be absolute
-        $self->install_base( rel2abs( $self->install_base ) );
+        $self->install_base( abs_path( $self->install_base ) );
     }
 
     unless ( $self->name ) {

Modified: Shipwright/trunk/lib/Shipwright/Test.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Test.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Test.pm	Thu Aug 21 23:07:18 2008
@@ -29,7 +29,7 @@
 
 sub has_svk {
     if ( can_run('svk') && can_run('svnadmin') ) {
-        my $out = Shipwright::Util->run(['svk', '--version'], 1);
+        my $out = Shipwright::Util->run( [ 'svk', '--version' ], 1 );
         if ( $out && $out =~ /version v(\d)\./i ) {
             return 1 if $1 >= 2;
         }
@@ -46,7 +46,7 @@
 
 sub has_svn {
     if ( can_run('svn') && can_run('svnadmin') ) {
-        my $out = Shipwright::Util->run(['svn', '--version'], 1);
+        my $out = Shipwright::Util->run( [ 'svn', '--version' ], 1 );
         if ( $out && $out =~ /version 1\.(\d)/i ) {
             return 1 if $1 >= 4;
         }
@@ -61,7 +61,7 @@
 =cut
 
 sub create_fs_repo {
-    return tempdir( 'shipwright_XXXXXX',  CLEANUP => 1 , TMPDIR => 1);
+    return tempdir( 'shipwright_XXXXXX', CLEANUP => 1, TMPDIR => 1 );
 }
 
 =head2 create_svk_repo 
@@ -72,7 +72,7 @@
 =cut
 
 sub create_svk_repo {
-    $ENV{SVKROOT} = tempdir( 'shipwright_XXXXXX',  CLEANUP => 1 , TMPDIR => 1);
+    $ENV{SVKROOT} = tempdir( 'shipwright_XXXXXX', CLEANUP => 1, TMPDIR => 1 );
     my $svk_root_local = catfile( $ENV{SVKROOT}, 'local' );
     system("svnadmin create $svk_root_local");
     system("svk depotmap -i");
@@ -87,7 +87,7 @@
 =cut
 
 sub create_svn_repo {
-    my $repo = tempdir( 'shipwright_XXXXXX',  CLEANUP => 1 , TMPDIR => 1);
+    my $repo = tempdir( 'shipwright_XXXXXX', CLEANUP => 1, TMPDIR => 1 );
     system("svnadmin create $repo") && die "create repo failed: $!";
     return "file://$repo";
 }
@@ -149,7 +149,7 @@
     require Test::More;
     my ( $out, $err ) = Shipwright::Util->run( $cmd, 1 );    # ingnore failure
 
-    _test_cmd( $out, $exp, $msg ) if defined $exp;
+    _test_cmd( $out, $exp,     $msg )     if defined $exp;
     _test_cmd( $err, $exp_err, $msg_err ) if defined $exp_err;
 }
 

Modified: Shipwright/trunk/lib/Shipwright/Util.pm
==============================================================================
--- Shipwright/trunk/lib/Shipwright/Util.pm	(original)
+++ Shipwright/trunk/lib/Shipwright/Util.pm	Thu Aug 21 23:07:18 2008
@@ -4,8 +4,9 @@
 use strict;
 use Carp;
 use IPC::Run3;
-use File::Spec::Functions qw/catfile catdir splitpath splitdir rel2abs/;
+use File::Spec::Functions qw/catfile catdir splitpath splitdir/;
 use File::Temp qw/tempdir/;
+use Cwd qw/abs_path/;
 
 use Shipwright;    # we need this to find where Shipwright.pm lives
 
@@ -93,7 +94,7 @@
 
     unless ($SHIPWRIGHT_ROOT) {
         my $dir = ( splitpath( $INC{"Shipwright.pm"} ) )[1];
-        $SHIPWRIGHT_ROOT = rel2abs($dir);
+        $SHIPWRIGHT_ROOT = abs_path($dir);
     }
 
     return ($SHIPWRIGHT_ROOT);
@@ -111,7 +112,7 @@
 
     require File::ShareDir;
     $SHARE_ROOT ||=
-      eval { rel2abs( File::ShareDir::module_dir('Shipwright') ) };
+      eval { abs_path( File::ShareDir::module_dir('Shipwright') ) };
 
     unless ( $SHARE_ROOT ) {
 

Modified: Shipwright/trunk/share/bin/shipwright-builder
==============================================================================
--- Shipwright/trunk/share/bin/shipwright-builder	(original)
+++ Shipwright/trunk/share/bin/shipwright-builder	Thu Aug 21 23:07:18 2008
@@ -2,7 +2,7 @@
 use warnings;
 use strict;
 
-use File::Spec::Functions qw/catfile catdir splitdir rel2abs/;
+use File::Spec::Functions qw/catfile catdir splitdir/;
 use File::Temp qw/tempdir/;
 use File::Copy qw/move copy/;
 use File::Find qw/find/;
@@ -127,7 +127,7 @@
     $installed = YAML::Tiny->new;
 }
 
-$args{'install-base'} = rel2abs( $args{'install-base'} );
+$args{'install-base'} = abs_path( $args{'install-base'} );
 
 # YAML::Tiny objects are array based.
 my $order =



More information about the Bps-public-commit mailing list