$OpenBSD: patch-enforcer_utils_1_4-2_0_db_convert_convert_mysql,v 1.1 2019/01/25 08:32:02 pvk Exp $

Index: enforcer/utils/1.4-2.0_db_convert/convert_mysql
--- enforcer/utils/1.4-2.0_db_convert/convert_mysql.orig
+++ enforcer/utils/1.4-2.0_db_convert/convert_mysql
@@ -1,11 +1,11 @@
-#!/bin/bash
+#!/bin/sh
 set -e
 
 # This scipt converts a ODS 1.4.9 MySQL database to ODS 2.0. It assumes both
 # old and new databases live on the same host and are accessable by the same 
 # user.
 
-SCHEMA=../../src/db/schema.mysql
+SCHEMA=${PREFIX}/share/opendnssec/schema.mysql
 
 DB_IN=""
 DB_OUT=""
@@ -44,7 +44,7 @@ if [ ! $DB_VERSION -eq 4 ]; then
 fi
 
 # Look for zones without an active key.
-Z=`mysql -u $DB_USR -p$DB_PWD -h $DB_HOST $DB_IN < find_problematic_zones.sql`	
+Z=`mysql -u $DB_USR -p$DB_PWD -h $DB_HOST $DB_IN < ${PREFIX}/share/opendnssec/migration/find_problematic_zones.sql`	
 if [[ $Z = *[![:space:]]* ]]; then
 	echo "Found zones without an active KSK but with a ready KSK waiting for ds-seen. This can cause problem after the conversion if the DS was actually already uploaded. You are adviced to submit these DS records and issue a ds-seen command before continueing. If you know better, disable this check to continue."
 	       echo "Zones: $Z"
@@ -59,6 +59,6 @@ echo "Creating tables in $DB_OUT (as user $DB_USR)"
 mysql -u $DB_USR -p$DB_PWD -h $DB_HOST $DB_OUT < $SCHEMA
 
 echo "Converting database"
-sed "s/REMOTE/$DB_IN/g" mysql_convert.sql > TMP
+sed "s/REMOTE/$DB_IN/g" ${PREFIX}/share/opendnssec/migration/migrate-mysql.sql > TMP
 mysql -u $DB_USR -p$DB_PWD -h $DB_HOST $DB_OUT < TMP
 rm TMP
