From alex@vaio.alexdupre.com  Wed Feb  5 02:37:15 2003
Return-Path: <alex@vaio.alexdupre.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 65D3137B405
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  5 Feb 2003 02:37:15 -0800 (PST)
Received: from vaio.alexdupre.com (212-41-211-209.adsl.galactica.it [212.41.211.209])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 9FF0243FA3
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  5 Feb 2003 02:37:08 -0800 (PST)
	(envelope-from alex@vaio.alexdupre.com)
Received: from vaio.alexdupre.com (localhost [127.0.0.1])
	by vaio.alexdupre.com (8.12.2/8.12.2) with ESMTP id h15Ake3u037899
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 5 Feb 2003 11:46:40 +0100 (CET)
	(envelope-from alex@vaio.alexdupre.com)
Received: (from alex@localhost)
	by vaio.alexdupre.com (8.12.2/8.12.2/Submit) id h15AkdnW037898;
	Wed, 5 Feb 2003 11:46:39 +0100 (CET)
Message-Id: <200302051046.h15AkdnW037898@vaio.alexdupre.com>
Date: Wed, 5 Feb 2003 11:46:39 +0100 (CET)
From: Alex Dupre <sysadmin@alexdupre.com>
Reply-To: Alex Dupre <sysadmin@alexdupre.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [Maintainer Patch] Port: MySQL 4.0
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         47945
>Category:       ports
>Synopsis:       [Maintainer Patch] Port: MySQL 4.0
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    gnats-admin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 05 02:40:10 PST 2003
>Closed-Date:    Wed Feb 05 07:35:12 PST 2003
>Last-Modified:  Wed Feb 05 07:35:12 PST 2003
>Originator:     Alex Dupre
>Release:        FreeBSD 4.5-ALEXDUPRE i386
>Organization:
>Environment:
System: FreeBSD vaio.alexdupre.com 4.5-ALEXDUPRE FreeBSD 4.5-ALEXDUPRE #0: Fri Apr 12 14:12:57 CEST 2002 alex@vaio.alexdupre.com:/usr/obj/usr/src/sys/VAIO i386


	
>Description:
Definitely fix building on -current.
Really overwrite databases when OVERWRITE_DB is set.
Automatically skip installing databases if they already exist (unless
OVERWRITE_DB is set)
	
>How-To-Repeat:
	
>Fix:

	

--- mysql40-server.diff begins here ---
diff -ruN mysql40-server.orig/Makefile mysql40-server/Makefile
--- mysql40-server.orig/Makefile	Tue Feb  4 15:13:33 2003
+++ mysql40-server/Makefile	Wed Feb  5 11:35:21 2003
@@ -39,7 +39,6 @@
 		--without-bench \
 		--without-extra-tools \
 		--with-libwrap \
-		--with-raid \
 		--with-mysqlfs \
 		--with-vio \
 		--with-low-memory \
@@ -102,8 +101,7 @@
 	@${ECHO} "	WITH_OPENSSL=yes	Enable secure connections."
 	@${ECHO} "	DB_DIR=directory	Set alternate directory for database files"
 	@${ECHO} "				(default is /var/db/mysql)."
-	@${ECHO} "	SKIP_INSTALL_DB=yes	Skip database initialization"
-	@${ECHO} "				(useful for upgrades)."
+	@${ECHO} "	OVERWRITE_DB=yes	Re-initialize default databases"
 	@${ECHO} "	SKIP_DNS_CHECK=yes	Don't run resolveip to do an additional"
 	@${ECHO} "				DNS check before inserting local hostname to"
 	@${ECHO} "				mysql database"
@@ -118,27 +116,12 @@
 	@${FALSE}
 .endif
 
-.if exists(${DB_DIR}) && !defined(PACKAGE_BUILDING) && !defined(OVERWRITE_DB) && !defined(SKIP_INSTALL_DB)
-pre-install:
-	@${ECHO} "You appear to already have a mysql database directory in ${DB_DIR}."
-	@${ECHO} ""
-	@${ECHO} "In order to preserve your existing data, you should:"
-	@${ECHO} "	- dump all your databases"
-	@${ECHO} "	- kill mysql if it is running"
-	@${ECHO} "	- delete the ${DB_DIR} directory"
-	@${ECHO} "	- run 'make install'"
-	@${ECHO} "	- start up mysql"
-	@${ECHO} "	- re-create all of your database"
-	@${ECHO} "	- re-load your data"
-	@${ECHO} ""
-	@${ECHO} "If you understand the consequences of this upgrade, please re-build this"
-	@${ECHO} "port with the environment variable OVERWRITE_DB defined."
-	@${FALSE}
-.endif
-
 post-install:
 .if !defined(PACKAGE_BUILDING)
-.if !defined(SKIP_INSTALL_DB)
+.if exists(${DB_DIR}) && defined(OVERWRITE_DB)
+	@${RM} -r ${DB_DIR}/mysql ${DB_DIR}/test 2>/dev/null || true
+.endif
+.if !exists(${DB_DIR}) || defined(OVERWRITE_DB)
 .if defined(SKIP_DNS_CHECK)
 	${PREFIX}/bin/mysql_install_db --force
 .else
diff -ruN mysql40-server.orig/files/patch-sql::mysqld.cc mysql40-server/files/patch-sql::mysqld.cc
--- mysql40-server.orig/files/patch-sql::mysqld.cc	Thu Jan  1 01:00:00 1970
+++ mysql40-server/files/patch-sql::mysqld.cc	Wed Feb  5 09:22:15 2003
@@ -0,0 +1,12 @@
+--- sql/mysqld.cc.orig	Wed Feb  5 01:55:03 2003
++++ sql/mysqld.cc	Wed Feb  5 01:57:06 2003
+@@ -104,7 +104,8 @@
+ int allow_severity = LOG_INFO;
+ int deny_severity = LOG_WARNING;
+ 
+-#ifdef __STDC__
++#include <osreldate.h>
++#if defined(__STDC__) && __FreeBSD_version < 500000
+ #define my_fromhost(A)	   fromhost(A)
+ #define my_hosts_access(A) hosts_access(A)
+ #define my_eval_client(A)  eval_client(A)
--- mysql40-server.diff ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: nork 
State-Changed-When: Wed Feb 5 07:34:39 PST 2003 
State-Changed-Why:  
Correct gnats category. 

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