Ignore:
Timestamp:
05/12/2008 23:13:38 (3 years ago)
Author:
chris
Message:

Simplify code for killing old fart processes on Windows/Cygwin?
and make it actually work at the end of the test. man kill for
why we use /bin/kill instead of just kill on cygwin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/infrastructure/makebuildenv.pl.in

    r2278 r2402  
    401401                        print TESTFILE "#!/bin/sh\necho TEST: $module\n"; 
    402402 
     403                        if ($target_windows) 
     404                        { 
     405                                print TESTFILE <<__E; 
     406kill_process() 
     407{ 
     408        test -r testfiles/$1.pid \ 
     409        && /bin/kill -0 -f `cat testfiles/$1.pid` \ 
     410        && /bin/kill    -f `cat testfiles/$1.pid` 
     411} 
     412__E 
     413                        } 
     414                        else 
     415                        { 
     416                                print TESTFILE <<__E; 
     417kill_process() 
     418{ 
     419        test -r testfiles/$1.pid \ 
     420        && kill -0 `cat testfiles/$1.pid` \ 
     421        && kill    `cat testfiles/$1.pid` 
     422} 
     423__E 
     424                        } 
     425 
    403426                        if (-d "$module/testfiles") 
    404427                        { 
    405                                 if ($target_windows) 
    406                                 { 
    407428                                print TESTFILE <<__E; 
    408429echo Killing any running daemons... 
    409 test -r testfiles/bbackupd.pid && /bin/kill -f `cat testfiles/bbackupd.pid` 
    410 test -r testfiles/bbstored.pid && /bin/kill -f `cat testfiles/bbstored.pid` 
    411 __E 
    412                         } 
    413                         else 
    414                         { 
    415                                 print TESTFILE <<__E; 
    416 echo Killing any running daemons... 
    417 test -r testfiles/bbackupd.pid && kill `cat testfiles/bbackupd.pid` 
    418 test -r testfiles/bbstored.pid && kill `cat testfiles/bbstored.pid` 
     430kill_process bbackupd 
     431kill_process bbstored 
    419432__E 
    420433                        } 
     
    431444                        } 
    432445 
    433                         if(-e "$module/testextra") 
     446                        if (-e "$module/testextra") 
    434447                        { 
    435448                                open FL,"$module/testextra" or die  
     
    441454                        print TESTFILE "$runcmd\n"; 
    442455 
    443                         if(-d "$module/testfiles") 
     456                        if (-d "$module/testfiles") 
    444457                        { 
    445458                                print TESTFILE <<__E; 
    446  
    447 # echo Killing any running daemons... 
    448 test -r testfiles/bbackupd.pid \\ 
    449 && kill -0 `cat testfiles/bbackupd.pid` \\ 
    450 && kill `cat testfiles/bbackupd.pid` 
    451  
    452 test -r testfiles/bbstored.pid \\ 
    453 && kill -0 `cat testfiles/bbstored.pid` \\ 
    454 && kill `cat testfiles/bbstored.pid` 
     459echo Killing any running daemons... 
     460kill_process bbackupd 
     461kill_process bbstored 
    455462__E 
    456463                        } 
Note: See TracChangeset for help on using the changeset viewer.