[Rt-commit] rt branch, 4.0/save-dependency-script-location, created. rt-4.0.19-62-gef0630e

Jim Brandt jbrandt at bestpractical.com
Thu Mar 27 15:18:24 EDT 2014


The branch, 4.0/save-dependency-script-location has been created
        at  ef0630e30f2bbd763f03d162db75a64704d9ed15 (commit)

- Log -----------------------------------------------------------------
commit ef0630e30f2bbd763f03d162db75a64704d9ed15
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Mar 27 15:16:47 2014 -0400

    Save path because some installers or tests can change cwd
    
    In cases where the CPAN installer fails to install GD and
    its dependencies, the cwd can remain set to the directory
    where GD was unpacked and tests were run like
    
      ~/.cpan/build/GDGraph-1.48-N0EX5K
    
    When $0 is invoked later, rt-test-dependencies isn't found
    because we're in the wrong directory.
    
    The warning was masked in RT 4.0 because after the 'use'
    to determine if Test::NoWarnings was installed, all warnings
    were consumed by that module. This is fixed in RT 4.2 by ff15f21d3.

diff --git a/sbin/rt-test-dependencies.in b/sbin/rt-test-dependencies.in
index 7da0b61..263eab5 100644
--- a/sbin/rt-test-dependencies.in
+++ b/sbin/rt-test-dependencies.in
@@ -55,9 +55,13 @@ use strict;
 use warnings;
 no warnings qw(numeric redefine);
 use Getopt::Long;
+use Cwd qw(abs_path);
 my %args;
 my %deps;
 my @orig_argv = @ARGV;
+# Save our path because installers or tests can change cwd
+my $script_path = abs_path($0);
+
 GetOptions(
     \%args,                               'v|verbose',
     'install!',                           'with-MYSQL',
@@ -417,7 +421,7 @@ foreach my $type (sort grep $args{$_}, keys %args) {
 }
 
 if ( $args{'install'} && keys %Missing_By_Type ) {
-    exec($0, @orig_argv, '--no-install');
+    exec($script_path, @orig_argv, '--no-install');
 }
 else {
     conclude(%Missing_By_Type);

-----------------------------------------------------------------------


More information about the rt-commit mailing list