Date: Sat, 17 Jul 2010 21:34:32 +0200 (CEST) From: olli hauer <ohauer@gmx.de> To: <FreeBSD-gnats-submit@FreeBSD.org> Cc: ohauer@gmx.de Subject: ports/148715: [patch] port sysutils/bacula-server small fix for script create_postgresql_database.in Message-ID: <20100717193432.6FED220272@u18-124.dsl.vianetworks.de> Resent-Message-ID: <201007171940.o6HJe7Lp078944@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 148715 >Category: ports >Synopsis: [patch] port sysutils/bacula-server small fix for script create_postgresql_database.in >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Sat Jul 17 19:40:06 UTC 2010 >Closed-Date: >Last-Modified: >Originator: olli hauer <ohauer@gmx.de> >Release: FreeBSD 7.3-RELEASE-p2 i386 >Organization: >Environment: >Description: The script create_postgresql_database tries to get the installed postgresql version in a wrong way. Output of the command 'psql -d template1 -c 'select version()' is not always on the first line, instead ' ... | head -n1 | cut ...' the script should use '| awk '/PostgreSQL/ {print $2}'. Sample output on my machine: $ psql -U pgsql -d template1 -c 'select version()' version --------------------------------------------------------------------------------------------------------- PostgreSQL 8.4.4 on i386-portbld-freebsd7.3, compiled by GCC cc (GCC) 4.2.1 20070719 [FreeBSD], 32-bit (1 row) With the original command $PSQLVERSION is empty, with the modified command $PSQLVERSION=8.4 A bug report was filed upstream: http://bugs.bacula.org/view.php?id=1609 >How-To-Repeat: >Fix: --- patch-create_postgresql_database.in.txt begins here --- --- /dev/null 2010-07-17 20:57:00.000000000 +0200 +++ files/patch-src__cats__create_postgresql_database.in 2010-07-17 20:55:31.000000000 +0200 @@ -0,0 +1,11 @@ +--- ./src/cats/create_postgresql_database.in.orig 2010-04-27 21:58:29.000000000 +0200 ++++ ./src/cats/create_postgresql_database.in 2010-07-17 20:48:50.000000000 +0200 +@@ -10,7 +10,7 @@ + # use SQL_ASCII to be able to put any filename into + # the database even those created with unusual character sets + +-PSQLVERSION=`$bindir/psql -d template1 -c 'select version()' | head -n1 | cut -d ' ' -f 2 | cut -d '.' -f 1,2` ++PSQLVERSION=`$bindir/psql -d template1 -c 'select version()' | awk '/PostgreSQL/ {print $2}' | cut -d '.' -f 1,2` + + # + # Note, LC_COLLATE and LC_TYPE are needed on 8.4 and beyond, but are --- patch-create_postgresql_database.in.txt ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100717193432.6FED220272>