[Rt-commit] r13764 - in rt/3.8/trunk: .
spang at bestpractical.com
spang at bestpractical.com
Thu Jul 3 07:15:41 EDT 2008
Author: spang
Date: Thu Jul 3 07:15:41 2008
New Revision: 13764
Modified:
rt/3.8/trunk/ (props changed)
rt/3.8/trunk/t/shredder/utils.pl
Log:
r43559 at loki: spang | 2008-07-03 12:10:14 +0100
make t/shredder/utils.pl use relocateable paths
Modified: rt/3.8/trunk/t/shredder/utils.pl
==============================================================================
--- rt/3.8/trunk/t/shredder/utils.pl (original)
+++ rt/3.8/trunk/t/shredder/utils.pl Thu Jul 3 07:15:41 2008
@@ -3,7 +3,7 @@
use strict;
use warnings;
-require File::Spec;
+use File::Spec;
require File::Path;
require File::Copy;
require Cwd;
@@ -138,7 +138,11 @@
foreach ( qw(Type Host Port Name User Password) ) {
$ENV{ "RT_DB_". uc $_ } = RT->Config->Get("Database$_");
}
- my $cmd = "$^X sbin/rt-setup-database --action init";
+ (my $volume, my $directories, my $file) = File::Spec->splitpath($0);
+ my $rt_setup_database = File::Spec->catfile(
+ File::Spec->catdir(File::Spec->curdir(), $directories, File::Spec->updir(),
+ File::Spec->updir(), "sbin"), "rt-setup-database");
+ my $cmd = "$^X $rt_setup_database --action init";
my ($child_out, $child_in);
my $pid = open2($child_out, $child_in, $cmd);
@@ -212,15 +216,19 @@
=head3 tmpdir
Return absolute path to tmp dir used in tests.
-It is C<cwd(). "t/data/shredder">.
+It is C<Cwd->getcwd()>. $directories . "../data/shredder", relative to the
+location of this file, where $directories is the directory portion of $0.
=cut
-sub tmpdir { return File::Spec->catdir(Cwd::cwd(), qw(t data shredder)) }
+sub tmpdir {
+ (my $volume, my $directories, my $file) = File::Spec->splitpath($0);
+ return File::Spec->catdir(Cwd->getcwd(),
+ $directories, File::Spec->updir(), qw(data shredder)) }
=head2 create_tmpdir
-Creates tmp dir if doesn't exist. Returns tmpdir absolute path.
+Creates tmp dir if doesn't exist. Returns tmpdir path.
=cut
More information about the Rt-commit
mailing list