Make script portable to Linux
authorPeter Eisentraut <peter_e@gmx.net>
Sun, 18 Jan 2009 09:38:04 +0000 (09:38 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Sun, 18 Jan 2009 09:38:04 +0000 (09:38 +0000)
wwwtools/update-nls-www

index 769c5864c3f0d4fcb3832f1106a39468b4a80c6d..a68ba9662354e1534ad337fac29d51232e74af20 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/local/bin/bash
+#! /usr/bin/env bash
 shopt -s nullglob
 
 echo "================="
@@ -12,6 +12,10 @@ MYDIR=$(cd $(dirname $0) && pwd)
 WEBDIR=$MYDIR/../../htwork
 CVSDIR=$(cd $MYDIR/../../cvs && pwd)
 
+GMAKE=make
+which gmake >/dev/null && GMAKE=gmake
+export GMAKE
+
 active_branches="current 8.3-branch 8.2-branch 8.1-branch 8.0-branch 7.4-branch"
 
 if [ -n "$1" ]; then
@@ -25,12 +29,12 @@ trap 'rm -f $tmp $lock' EXIT ERR SIGHUP SIGINT SIGPIPE SIGTERM
 touch "$lock"
 
 for branch in $active_branches; do
-       tmp=`mktemp -t "$me"`
+       tmp=`mktemp`
 
        PGSRC=$CVSDIR/postgresql-$branch
 
        pushd $PGSRC
-       test -f GNUmakefile && gmake maintainer-clean
+       test -f GNUmakefile && $GMAKE maintainer-clean
        cvs -q update | tee "$tmp"
        popd