From a9f1e66d463805eaab6301f64dc433a8dbef83f5 Mon Sep 17 00:00:00 2001
From: Arno Schoenmakers <schoenmakers@astron.nl>
Date: Tue, 8 Sep 2009 12:33:22 +0000
Subject: [PATCH] Bug 1228: Fix typo and allow useage with -M option on
 development system

---
 MAC/Deployment/data/PVSS/create_db_files | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/MAC/Deployment/data/PVSS/create_db_files b/MAC/Deployment/data/PVSS/create_db_files
index 738cdb2f896..052cc532539 100755
--- a/MAC/Deployment/data/PVSS/create_db_files
+++ b/MAC/Deployment/data/PVSS/create_db_files
@@ -47,7 +47,7 @@ SyntaxError()
         echo "                 Output dir is then /opt/pvss/dpdef (overrules -d)"
 	echo "    -C           CEP datapoints are created (overrules -s)"
 	echo "    -M           MainCU datapoints are created (overrules -s)"
-	echo ""
+	echo "    Default option is -M"
 	exit 1
 }
 
@@ -1207,14 +1207,14 @@ if [ "$DBTYPE" == "S" -a "$DBTYPENAME" == "LOCALHOST" ]; then
    STNNAME=$DBTYPENAME
    cd $DESTDIR
    echo "Making files for station $STNNAME in $DESTDIR"
-elif [ "$DBTYPE" == "M" ]; then  
+elif [ "$DBTYPE" == "M" -a "$HOSTNAME" == "MCU001" ]; then  
    configdir="/opt/lofar/etc/"
    dpdefdir="/opt/pvss/dpdef/"
    DESTDIR=$dpdefdir
    STNNAME=$DBTYPENAME
    cd $DESTDIR
    echo "Making files for $STNNAME in $DESTDIR"
-elif [ "$DBTYPE" == "C" ]; then  
+elif [ "$DBTYPE" == "C" -a "$HOSTNAME" == "CCU001" ]; then  
    configdir="/opt/lofar/etc/"
    dpdefdir="/opt/pvss/dpdef/"
    DESTDIR=$dpdefdir
@@ -1268,8 +1268,9 @@ create_dp_file  ${INPUTFILE} ${DBTYPE}
 cat ${TMP_FILE} >>${DESTDIR}/${DPT_FILE}
 rm -f ${TMP_FILE}
 
-# Creating the c++ header file is for development, only
-if [ "${DBTYPE}" != "S" -a "${DBTYPE}" != "M" -a "${DBTYPE}" != "C"]; then
+# Creating the c++ header file is for development hosts, only; in that case
+# the $dpdefdir is an empty string
+if [ "${dpdefdir}" == "" ]; then
   (
 	echo -n "// This file was generated by $(basename $0) ${VERSION} on " ; date
 	echo	""
-- 
GitLab