[med-svn] r2490 - trunk/packages/agdbnet/trunk/debian

tille at alioth.debian.org tille at alioth.debian.org
Fri Sep 12 12:46:23 UTC 2008


Author: tille
Date: 2008-09-12 12:46:22 +0000 (Fri, 12 Sep 2008)
New Revision: 2490

Modified:
   trunk/packages/agdbnet/trunk/debian/config
   trunk/packages/agdbnet/trunk/debian/templates
Log:
Fix detecting xmlname


Modified: trunk/packages/agdbnet/trunk/debian/config
===================================================================
--- trunk/packages/agdbnet/trunk/debian/config	2008-09-12 12:43:23 UTC (rev 2489)
+++ trunk/packages/agdbnet/trunk/debian/config	2008-09-12 12:46:22 UTC (rev 2490)
@@ -14,19 +14,41 @@
 # and thus we have to look first, where the config items are stored.
 # Then we can read out the remaining config items from the apropriate
 # config file
-db_get ${pkg}/xmlname || true
-XMLNAME=$RET
 
 # DEBUG
 debuglog=/var/tmp/${pkg}.log
 rm -f $debuglog
 touch $debuglog
-if [ "$XMLNAME" != "" ] ; then
-    echo "XMLNAME = $XMLNAME" > $debuglog
+
+db_get ${pkg}/xmlname || true
+XMLNAME=$RET
+printf "aus debconfdb: XMLNAME = $XMLNAME\n" >> $debuglog
+
+# Verify the existence of a /etc/agdbnet/${XMLNAME}.xml file
+if [ -e /etc/agdbnet/${XMLNAME}.xml ] ; then
+    confavail="true"
 else
-    echo "Kein XMLNAME in debconfdb" > $debuglog
+    confavail="false"
+    # Verify whether there are other potential XML conffiles
+    if grep -q "<agdb>" /etc/agdbnet/*.xml 2> /dev/null ; then
+	# use first potential conffile
+	confxml=`grep -l "<agdb>" /etc/agdbnet/*.xml | head -1`
+	confxml=`basename ${confxml} .xml`
+	echo "confxml = $confxml" >> $debuglog
+    fi
 fi
 
+if [ "$XMLNAME" = "" ] ; then
+    echo "Kein XMLNAME in debconfdb (confavail = $confavail ; confxml = $confxml)" >> $debuglog
+    if [ "$confavail" = "false" -a "$confxml" != "" ] ; then
+	XMLNAME="$confxml"
+    fi
+else
+    echo "XMLNAME = $XMLNAME" >> $debuglog
+fi
+
+db_set ${pkg}/xmlname "$XMLNAME"
+
 db_input high ${pkg}/xmlname || true
 
 db_go || true

Modified: trunk/packages/agdbnet/trunk/debian/templates
===================================================================
--- trunk/packages/agdbnet/trunk/debian/templates	2008-09-12 12:43:23 UTC (rev 2489)
+++ trunk/packages/agdbnet/trunk/debian/templates	2008-09-12 12:46:22 UTC (rev 2490)
@@ -1,6 +1,5 @@
 Template: agdbnet/xmlname
 Type: string
-Default: agdbnet
 _Description: Name of the ${pkg} database:
  The package ${pkg} is using a configuration file which stores the
  name of the database.  The configuration file should have the same




More information about the debian-med-commit mailing list