From mark@mkproductions.org  Wed Dec 13 23:02:43 2006
Return-Path: <mark@mkproductions.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 96DA016A415;
	Wed, 13 Dec 2006 23:02:43 +0000 (UTC)
	(envelope-from mark@mkproductions.org)
Received: from flpvm09.prodigy.net (flpvm09.prodigy.net [207.115.20.39])
	by mx1.FreeBSD.org (Postfix) with ESMTP id E75AE43CB6;
	Wed, 13 Dec 2006 23:01:11 +0000 (GMT)
	(envelope-from mark@mkproductions.org)
Received: from amd64.localhost (ppp-70-248-222-106.dsl.spfdmo.swbell.net [70.248.222.106])
	by flpvm09.prodigy.net (8.13.8 out.dk.spool/8.13.8) with ESMTP id kBDN2aBg021819;
	Wed, 13 Dec 2006 15:02:36 -0800
Message-Id: <1166050962.27474@amd64.localhost>
Date: Wed, 13 Dec 2006 17:02:42 -0600
From: "Mark Kane" <mark@mkproductions.org>
To: "FreeBSD gnats submit" <FreeBSD-gnats-submit@freebsd.org>
Cc: girgen@freebsd.org
Subject: [PATCH] databases/postgresql82-server - initdb in RC Script Doesn't Set Encoding
X-Send-Pr-Version: gtk-send-pr 0.4.7 
X-GNATS-Notify:

>Number:         106696
>Category:       ports
>Synopsis:       [PATCH] databases/postgresql82-server - initdb in RC Script Doesn't Set Encoding
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    girgen
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 13 23:10:02 GMT 2006
>Closed-Date:    Tue Jan 09 17:36:55 GMT 2007
>Last-Modified:  Tue Jan 09 17:36:55 GMT 2007
>Originator:     Mark Kane
>Release:        FreeBSD 6.1-RELEASE
>Organization:
MKProductions 
>Environment:


FreeBSD server1.domain 6.1-RELEASE FreeBSD 6.1-RELEASE #1: Mon Sep 18 14:24:33 CDT 2006     admin@server1.domain:/usr/obj/usr/src/sys/QUOTA  i386


>Description:


Hi.

When installing PostgreSQL 8.2 and doing an initdb through the RC script, the encoding does not get set properly. The "${postgresql_initdb_flags}" variable is not part of the initdb command that gets executed through the script, so neither the default of utf-8 or anything that would be set custom by the user gets passed to initdb to be set.

Also, the option of "--lc-collate" is listed incorrectly as "--lc_collate" in the RC script, which doesn't work.

Thanks!

-Mark


>How-To-Repeat:





>Fix:


--- postgresql.patch begins here ---
--- postgresql.in.orig	Wed Dec 13 16:18:52 2006
+++ postgresql.in	Wed Dec 13 16:44:33 2006
@@ -12,7 +12,7 @@
 #  # optional
 #  postgresql_data="%%PREFIX%%/pgsql/data"
 #  postgresql_flags="-w -s -m fast"
-#  postgresql_initdb_flags="--encoding=utf-8 --lc_collate=C"
+#  postgresql_initdb_flags="--encoding=utf-8 --lc-collate=C"
 #  postgresql_class="default"
 #
 # See %%PREFIX%%/share/doc/postgresql/README-server for more info
@@ -36,7 +36,7 @@
 postgresql_user=pgsql
 eval postgresql_data=${postgresql_data:-"~${postgresql_user}/data"}
 postgresql_class=${postgresql_class:-"default"}
-postgresql_initdb_flags=${postgresql_initdb_flags:-"--encoding=utf-8 --lc_collate=C"}
+postgresql_initdb_flags=${postgresql_initdb_flags:-"--encoding=utf-8 --lc-collate=C"}
 
 name=postgresql
 rcvar=`set_rcvar`
@@ -58,7 +58,7 @@
     
 postgresql_initdb()
 {
-    su -l -c ${postgresql_class} ${postgresql_user} -c "exec ${prefix}/bin/initdb -D ${postgresql_data}"
+    su -l -c ${postgresql_class} ${postgresql_user} -c "exec ${prefix}/bin/initdb -D ${postgresql_data} ${postgresql_initdb_flags}"
 }
 
 run_rc_command "$1"
--- postgresql.patch ends here ---



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->girgen 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Wed Dec 13 23:10:18 UTC 2006 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106696 
State-Changed-From-To: open->closed 
State-Changed-By: girgen 
State-Changed-When: Tue Jan 9 17:36:18 UTC 2007 
State-Changed-Why:  
Committed. Thanks! 

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