- 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:
Reinhard Max 2022-01-28 15:27:29 +00:00 committed by Git OBS Bridge
parent 301c4bf8b2
commit 360b82fe77
2 changed files with 9 additions and 2 deletions

View File

@ -34,7 +34,10 @@ if test ! -x "$POSTGRES"; then
exit 1
fi
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 () {
$BINDIR/pg_ctl -s -D $DATADIR ${POSTGRES_TIMEOUT:+-t $POSTGRES_TIMEOUT} "$@"
}
@ -44,7 +47,6 @@ case "$1" in
start)
if [ ! -f $DATADIR/PG_VERSION ]; then
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} &&
echo "Initializing PostgreSQL $VERSION at location ${DATADIR}"
/usr/bin/initdb --auth=ident $DATADIR &> initlog || {

View File

@ -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>