From ohauer@gmx.de  Sat Jul 17 19:34:40 2010
Return-Path: <ohauer@gmx.de>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3DDD1106566C
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 17 Jul 2010 19:34:40 +0000 (UTC)
	(envelope-from ohauer@gmx.de)
Received: from mail.gmx.net (mail.gmx.net [213.165.64.20])
	by mx1.freebsd.org (Postfix) with SMTP id A5EE18FC15
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 17 Jul 2010 19:34:39 +0000 (UTC)
Received: (qmail invoked by alias); 17 Jul 2010 19:34:37 -0000
Received: from u18-124.dsl.vianetworks.de (EHLO u18-124.dsl.vianetworks.de) [194.231.39.124]
  by mail.gmx.net (mp021) with SMTP; 17 Jul 2010 21:34:37 +0200
Received: by u18-124.dsl.vianetworks.de (Postfix, from userid 1100)
	id 6FED220272; Sat, 17 Jul 2010 21:34:32 +0200 (CEST)
Message-Id: <20100717193432.6FED220272@u18-124.dsl.vianetworks.de>
Date: Sat, 17 Jul 2010 21:34:32 +0200 (CEST)
From: olli hauer <ohauer@gmx.de>
Reply-To: olli hauer <ohauer@gmx.de>
To: <FreeBSD-gnats-submit@freebsd.org>
Cc: <ohauer@gmx.de>
Subject: [patch] port sysutils/bacula-server small fix for script create_postgresql_database.in
X-Send-Pr-Version: 3.113
X-GNATS-Notify: dan@langille.org

>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:    ohauer
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 17 19:40:06 UTC 2010
>Closed-Date:    Tue Sep 07 16:36:01 UTC 2010
>Last-Modified:  Tue Sep 07 16:36:01 UTC 2010
>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:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Sat Jul 17 19:40:18 UTC 2010 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=148715 

From: Edwin Groothuis <edwin@FreeBSD.org>
To: dan@langille.org
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/148715: [patch] port sysutils/bacula-server small fix for script create_postgresql_database.in
Date: Sat, 17 Jul 2010 19:40:15 UT

 Maintainer of sysutils/bacula-server,
 
 Please note that PR ports/148715 has just been submitted.
 
 If it contains a patch for an upgrade, an enhancement or a bug fix
 you agree on, reply to this email stating that you approve the patch
 and a committer will take care of it.
 
 The full text of the PR can be found at:
     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/148715
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org

Date: Sat, 17 Jul 2010 16:44:36 -0400
From: Dan Langille <dan@langille.org>
To: olli hauer <ohauer@gmx.de>
Subject: Re: [patch] port sysutils/bacula-server small fix for script create_postgresql_database.in

 > A bug report was filed upstream: http://bugs.bacula.org/view.php?id=1609
 
 You get bonus points for that. :)
 
 -- 
 Dan Langille - http://langille.org/

From: Dan Langille <dan@langille.org>
To: bug-followup@FreeBSD.org
Cc: Edwin Groothuis <edwin@FreeBSD.org>
Subject: Re: ports/148715: [patch] port sysutils/bacula-server small fix for
 script create_postgresql_database.in
Date: Sat, 17 Jul 2010 17:35:24 -0400

 Approved.
State-Changed-From-To: feedback->open 
State-Changed-By: linimon 
State-Changed-When: Sat Jul 17 23:34:01 UTC 2010 
State-Changed-Why:  
Maintainer approved. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=148715 
Responsible-Changed-From-To: freebsd-ports-bugs->wxs 
Responsible-Changed-By: wxs 
Responsible-Changed-When: Wed Jul 21 19:44:36 UTC 2010 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=148715 
Responsible-Changed-From-To: wxs->ohauer 
Responsible-Changed-By: ohauer 
Responsible-Changed-When: Wed Aug 18 18:22:09 UTC 2010 
Responsible-Changed-Why:  
- take my own PR with approval from wxs (by email) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=148715 
State-Changed-From-To: open->closed 
State-Changed-By: ohauer 
State-Changed-When: Tue Sep 7 16:35:10 UTC 2010 
State-Changed-Why:  
- Fix is included in new bacula-5.0.3 version 

http://www.freebsd.org/cgi/query-pr.cgi?pr=148715 
>Unformatted:
