ports/148715: [patch] port sysutils/bacula-server small fix for script create_postgresql_database.in
olli hauer
ohauer at gmx.de
Sat Jul 17 19:40:07 UTC 2010
>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 at 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:
More information about the freebsd-ports-bugs
mailing list