From 360b82fe771ad4431fc3da32aa968928ebb4fa35d3a6c1f28dfb3de33d109a72 Mon Sep 17 00:00:00 2001 From: Reinhard Max Date: Fri, 28 Jan 2022 15:27:29 +0000 Subject: [PATCH] - Avoid a dependency on awk in postgresql-script. OBS-URL: https://build.opensuse.org/package/show/server:database:postgresql/postgresql?expand=0&rev=138 --- postgresql-script | 6 ++++-- postgresql.changes | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/postgresql-script b/postgresql-script index b4842da..2d2ecf4 100644 --- a/postgresql-script +++ b/postgresql-script @@ -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 || { diff --git a/postgresql.changes b/postgresql.changes index 119e240..5f36068 100644 --- a/postgresql.changes +++ b/postgresql.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jan 28 15:26:21 UTC 2022 - Reinhard Max + +- Avoid a dependency on awk in postgresql-script. + ------------------------------------------------------------------- Thu Dec 2 14:08:12 UTC 2021 - Reinhard Max