repo: ngircd
action: commit
revision: 
path_from: 
revision_from: 257fe922d2c2ee822c372bc5b979075271915553:
path_to: 
revision_to: 
git.thebackupbox.net
ngircd
git clone git://git.thebackupbox.net/ngircd
commit 257fe922d2c2ee822c372bc5b979075271915553
Author: Christoph Biedl 
Date:   Sat Mar 3 18:53:03 2012 +0100

    getpid.sh: Fix testcase error for Debian using sbuild

    When

     * building the ngircd Debian package (on Linux at least) and
     * using the sbuild build system,

    the command "ps -af" does not include the commands running inside the
    sbuild system. Therefore, start-server.sh will report a fail as getpid.sh
    cannot not  find the ./T-ngircd1 just started although it's actually
    running. This results in a funny build log ...

             starting server 1 ... failure!
       FAIL: start-server1
             running connect-test ... ok.
       PASS: connect-test

    The self-test of getpid.sh however will likely succeed as it's happy if
    it sees any process with "sh" somewhere in the name. Things go downhill
    from there.

    The confusing things are:

      * The alternative cowbuilder/pbuilder does not have this problem.
      * The alternative usage "ps ax" does fine.

    So, as a quick hack, the patch attached adds another switch to getpid.sh.

diff --git a/src/testsuite/getpid.sh b/src/testsuite/getpid.sh
index fd3b3422b1e5c90b85ceb0d672efce2d7719290a..
index ..19ced7620f13d9befb989eae635ab1fcdfc2e6a2 100755
--- a/src/testsuite/getpid.sh
+++ b/src/testsuite/getpid.sh
@@ -13,6 +13,8 @@ elif [ $UNAME = "A/UX" ]; then
   PS_FLAGS="-ae"; PS_PIDCOL="1"; HEAD_FLAGS="-1"
 elif [ $UNAME = "GNU" ]; then
   PS_FLAGS="-ax"; PS_PIDCOL="2"; HEAD_FLAGS="-n 1"
+elif [ $UNAME = "Linux" ]; then
+  PS_FLAGS="ax"; PS_PIDCOL="1"; HEAD_FLAGS="-n 1"
 elif [ $UNAME = "SunOS" ]; then
   PS_FLAGS="-af"; PS_PIDCOL=2; HEAD_FLAGS="-n 1"
 else

-----END OF PAGE-----