postgres.git / summary / log / commit / refs

commit    ebe601c4daf3cdcde5156d941a6ae880ab94c7cd
Author:   Tom Lane <tgl@sss.pgh.pa.us>
Date:     Tue Jul 07 16:49:18 2015 +0000

    Fix portability issue in pg_upgrade test script: avoid $PWD.
    
    SUSv2-era shells don't set the PWD variable, though anything more modern
    does.  In the buildfarm environment this could lead to test.sh executing
    with PWD pointing to $HOME or another high-level directory, so that there
    were conflicts between concurrent executions of the test in different
    branch subdirectories.  This appears to be the explanation for recent
    intermittent failures on buildfarm members binturong and dingo (and might
    well have something to do with the buildfarm script's failure to capture
    log files from pg_upgrade tests, too).
    
    To fix, just use `pwd` in place of $PWD.  AFAICS test.sh is the only place
    in our source tree that depended on $PWD.  Back-patch to all versions
    containing this script.
    
    Per buildfarm.  Thanks to Oskari Saarenmaa for diagnosing the problem.


contrib/pg_upgrade/test.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/pg_upgrade/test.sh b/contrib/pg_upgrade/test.sh index d44c599a8ee..905729028fa 100644 --- a/contrib/pg_upgrade/test.sh +++ b/contrib/pg_upgrade/test.sh @@ -60,7 +60,8 @@ esac POSTMASTER_OPTS="-F -c listen_addresses=$LISTEN_ADDRESSES -k \"$PGHOST\"" export PGHOST -temp_root=$PWD/tmp_check +# don't rely on $PWD here, as old shells don't set it +temp_root=`pwd`/tmp_check if [ "$1" = '--install' ]; then temp_install=$temp_root/install @@ -117,7 +118,7 @@ PGREQUIRESSL=""; unset PGREQUIRESSL PGCONNECT_TIMEOUT=""; unset PGCONNECT_TIMEOUT PGHOSTADDR=""; unset PGHOSTADDR -logdir=$PWD/log +logdir=`pwd`/log rm -rf "$logdir" mkdir "$logdir" [parent: 6d88c1fc5f2e]