Re: Idea: cross-check versions during initdb - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Idea: cross-check versions during initdb
Date
Msg-id Pine.LNX.4.21.0010280027130.838-100000@peter.localdomain
Whole thread Raw
In response to Re: Idea: cross-check versions during initdb  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane writes:

> But it's still dependent on the user's PATH to point to the right
> executables, no?

This is what's puzzling me.  There's code in there that tries to locate
initdb and uses the executables and bki files (7.0 only) from the same
tree.  Evidently this code does not always work right, but that's what
needs to be fixed.

CMDNAME=`basename $0`

...

#
# Find out where we're located
#
if echo "$0" | grep '/' > /dev/null 2>&1
then       # explicit dir name given       PGPATH=`echo $0 | sed 's,/[^/]*$,,'`       # (dirname command is not
portable)
else       # look for it in PATH ('which' command is not portable)       for dir in `echo "$PATH" | sed 's/:/ /g'`
do               # empty entry in path means current dir               [ -z "$dir" ] && dir='.'               if [ -f
"$dir/$CMDNAME"]               then                       PGPATH="$dir"                       break               fi
  done
 
fi

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/



pgsql-hackers by date:

Previous
From: Alex Pilosov
Date:
Subject: Re: Summary: what to do about INET/CIDR
Next
From: Bruce Momjian
Date:
Subject: Re: Re: [GENERAL] 7.0 vs. 7.1 (was: latest version?)