summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xinfrastructure/makebuildenv.pl.in45
1 files changed, 26 insertions, 19 deletions
diff --git a/infrastructure/makebuildenv.pl.in b/infrastructure/makebuildenv.pl.in
index 291e479d..15e15dac 100755
--- a/infrastructure/makebuildenv.pl.in
+++ b/infrastructure/makebuildenv.pl.in
@@ -400,22 +400,35 @@ for my $mod (@implicit_deps, @modules)
"test script file for $module for writing\n";
print TESTFILE "#!/bin/sh\necho TEST: $module\n";
- if (-d "$module/testfiles")
+ if ($target_windows)
{
- if ($target_windows)
- {
print TESTFILE <<__E;
-echo Killing any running daemons...
-test -r testfiles/bbackupd.pid && /bin/kill -f `cat testfiles/bbackupd.pid`
-test -r testfiles/bbstored.pid && /bin/kill -f `cat testfiles/bbstored.pid`
+kill_process()
+{
+ test -r testfiles/$1.pid \
+ && /bin/kill -0 -f `cat testfiles/$1.pid` \
+ && /bin/kill -f `cat testfiles/$1.pid`
+}
__E
}
else
{
print TESTFILE <<__E;
+kill_process()
+{
+ test -r testfiles/$1.pid \
+ && kill -0 `cat testfiles/$1.pid` \
+ && kill `cat testfiles/$1.pid`
+}
+__E
+ }
+
+ if (-d "$module/testfiles")
+ {
+ print TESTFILE <<__E;
echo Killing any running daemons...
-test -r testfiles/bbackupd.pid && kill `cat testfiles/bbackupd.pid`
-test -r testfiles/bbstored.pid && kill `cat testfiles/bbstored.pid`
+kill_process bbackupd
+kill_process bbstored
__E
}
@@ -430,7 +443,7 @@ cp -p -R ../../../$module/testfiles .
__E
}
- if(-e "$module/testextra")
+ if (-e "$module/testextra")
{
open FL,"$module/testextra" or die
"Can't open $module/testextra";
@@ -440,18 +453,12 @@ __E
print TESTFILE "$runcmd\n";
- if(-d "$module/testfiles")
+ if (-d "$module/testfiles")
{
print TESTFILE <<__E;
-
-# echo Killing any running daemons...
-test -r testfiles/bbackupd.pid \\
-&& kill -0 `cat testfiles/bbackupd.pid` \\
-&& kill `cat testfiles/bbackupd.pid`
-
-test -r testfiles/bbstored.pid \\
-&& kill -0 `cat testfiles/bbstored.pid` \\
-&& kill `cat testfiles/bbstored.pid`
+echo Killing any running daemons...
+kill_process bbackupd
+kill_process bbstored
__E
}