- Avoid a dependency on awk in postgresql-script.
OBS-URL: https://build.opensuse.org/package/show/server:database:postgresql/postgresql?expand=0&rev=138
This commit is contained in:
parent
301c4bf8b2
commit
360b82fe77
@ -34,7 +34,10 @@ if test ! -x "$POSTGRES"; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
BINDIR=$(dirname $POSTGRES)
|
BINDIR=$(dirname $POSTGRES)
|
||||||
VERSION=$($POSTGRES --version|awk '{print $NF}')
|
# Avoiding the use of awk to get the last word
|
||||||
|
# in the line, which is the version number
|
||||||
|
VERSION=$($POSTGRES --version)
|
||||||
|
VERSION=${VERSION##* }
|
||||||
pg_ctl () {
|
pg_ctl () {
|
||||||
$BINDIR/pg_ctl -s -D $DATADIR ${POSTGRES_TIMEOUT:+-t $POSTGRES_TIMEOUT} "$@"
|
$BINDIR/pg_ctl -s -D $DATADIR ${POSTGRES_TIMEOUT:+-t $POSTGRES_TIMEOUT} "$@"
|
||||||
}
|
}
|
||||||
@ -44,7 +47,6 @@ case "$1" in
|
|||||||
start)
|
start)
|
||||||
if [ ! -f $DATADIR/PG_VERSION ]; then
|
if [ ! -f $DATADIR/PG_VERSION ]; then
|
||||||
test -n "$POSTGRES_LANG" && export LC_ALL="$POSTGRES_LANG"
|
test -n "$POSTGRES_LANG" && export LC_ALL="$POSTGRES_LANG"
|
||||||
V=$(printf "%02d%02d" $(echo $VERSION|awk -F. '{print $1, $2}'))
|
|
||||||
install -d -m 700 ${DATADIR} &&
|
install -d -m 700 ${DATADIR} &&
|
||||||
echo "Initializing PostgreSQL $VERSION at location ${DATADIR}"
|
echo "Initializing PostgreSQL $VERSION at location ${DATADIR}"
|
||||||
/usr/bin/initdb --auth=ident $DATADIR &> initlog || {
|
/usr/bin/initdb --auth=ident $DATADIR &> initlog || {
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Jan 28 15:26:21 UTC 2022 - Reinhard Max <max@suse.com>
|
||||||
|
|
||||||
|
- Avoid a dependency on awk in postgresql-script.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Dec 2 14:08:12 UTC 2021 - Reinhard Max <max@suse.com>
|
Thu Dec 2 14:08:12 UTC 2021 - Reinhard Max <max@suse.com>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user