Author: tille
Date: 2008-09-17 11:44:06 +0000 (Wed, 17 Sep 2008)
New Revision: 2505

Modified:
   trunk/packages/agdbnet/trunk/debian/config
   trunk/packages/agdbnet/trunk/debian/postrm
Log:
Fix several configure and purge issues


Modified: trunk/packages/agdbnet/trunk/debian/config
===================================================================
--- trunk/packages/agdbnet/trunk/debian/config  2008-09-17 10:11:41 UTC (rev 
2504)
+++ trunk/packages/agdbnet/trunk/debian/config  2008-09-17 11:44:06 UTC (rev 
2505)
@@ -25,10 +25,12 @@
 else
     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`
+    if [ -d /etc/agdbnet ] ; then
+       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`
+       fi
     fi
 fi
 
@@ -42,34 +44,39 @@
 db_input high ${pkg}/xmlname || true
 db_go || true
 
-PATOGEN=`grep '</system>' /etc/${pkg}/${XMLNAME}.xml | sed 
's?\([^>]\+\)</system>.*?\1?'`
-# verify whether Pathogen is set in config file
-if [ "$PATOGEN" != "##Pathogen##" -a "$PATOGEN" != "" ] ; then
-    db_set ${pkg}/pathogen "$PATOGEN"
+# Verify whether config file might contain values different from
+# debconf database and set these values
+if [ -s /etc/${pkg}/${XMLNAME}.xml ] ; then
+    PATOGEN=`grep '</system>' /etc/${pkg}/${XMLNAME}.xml | sed 
's?\([^>]\+\)</system>.*?\1?'`
+    # verify whether Pathogen is set in config file
+    if [ "$PATOGEN" != "##Pathogen##" -a "$PATOGEN" != "" ] ; then
+        db_set ${pkg}/pathogen "$PATOGEN"
+    fi
+    DESCRIPTION=`grep 'description="' /etc/${pkg}/${XMLNAME}.xml | sed 
's/.*description="\([^"]*\)".*/\1/'`
+    # verify whether description is set in config file
+    if [ "$DESCRIPTION" != "##Description##" -a "$DESCRIPTION" != "" ] ; then
+       db_set ${pkg}/description "$DESCRIPTION"
+    fi
+    LOCUSFULLNAME=`grep '<locus fullname=' /etc/${pkg}/${XMLNAME}.xml | sed 
's/.*<locus fullname="\([^"]*\)".*/\1/'`
+    # verify whether LocusFullName is set in config file
+    if [ "$LOCUSFULLNAME" != "##LocusFullName##" -a "$LOCUSFULLNAME" != "" ] ; 
then
+       db_set ${pkg}/locusfullname "$LOCUSFULLNAME"
+    fi
+    LOCUS=`grep '<locus fullname=' /etc/${pkg}/${XMLNAME}.xml | sed 
's/.*<locus fullname="[^"]*">\([^<]\+\)/\1/'`
+    # verify whether Locus is set in config file
+    if [ "$LOCUS" != "##Locus##" -a "$LOCUS" != "" ] ; then
+       db_set ${pkg}/locus "$LOCUS"
+    fi
 fi
+
 db_input high ${pkg}/pathogen || true
 db_go || true
 
-DESCRIPTION=`grep 'description="' /etc/${pkg}/${XMLNAME}.xml | sed 
's/.*description="\([^"]*\)".*/\1/'`
-# verify whether description is set in config file
-if [ "$DESCRIPTION" != "##Description##" -a "$DESCRIPTION" != "" ] ; then
-    db_set ${pkg}/description "$DESCRIPTION"
-fi
 db_input high ${pkg}/description || true
 db_go || true
 
-LOCUSFULLNAME=`grep '<locus fullname=' /etc/${pkg}/${XMLNAME}.xml | sed 
's/.*<locus fullname="\([^"]*\)".*/\1/'`
-# verify whether LocusFullName is set in config file
-if [ "$LOCUSFULLNAME" != "##LocusFullName##" -a "$LOCUSFULLNAME" != "" ] ; then
-    db_set ${pkg}/locusfullname "$LOCUSFULLNAME"
-fi
 db_input high ${pkg}/locusfullname || true
 db_go || true
 
-LOCUS=`grep '<locus fullname=' /etc/${pkg}/${XMLNAME}.xml | sed 's/.*<locus 
fullname="[^"]*">\([^<]\+\)/\1/'`
-# verify whether Locus is set in config file
-if [ "$LOCUS" != "##Locus##" -a "$LOCUS" != "" ] ; then
-    db_set ${pkg}/locus "$LOCUS"
-fi
 db_input high ${pkg}/locus || true
 db_go || true

Modified: trunk/packages/agdbnet/trunk/debian/postrm
===================================================================
--- trunk/packages/agdbnet/trunk/debian/postrm  2008-09-17 10:11:41 UTC (rev 
2504)
+++ trunk/packages/agdbnet/trunk/debian/postrm  2008-09-17 11:44:06 UTC (rev 
2505)
@@ -10,19 +10,23 @@
 case "$1" in
     purge)
        # remove all potential config files and dirs in /var/www
-       for confxml in `grep -l "<agdb>" /etc/agdbnet/*.xml` ; do
-           XMLNAME=`basename ${confxml} .xml`
+       if ls /etc/${pkg}/*.xml 1>/dev/null 2>/dev/null  ; then
+           for confxml in `grep -l "<agdb>" /etc/${pkg}/*.xml` ; do
+               XMLNAME=`basename ${confxml} .xml`
 
-           rm -f  /etc/${pkg}/"$XMLNAME".xml /etc/${pkg}/"$XMLNAME".html
-           rm -f /etc/${pkg}/"$XMLNAME".xml.old
-           rm -rf /var/www/${pkg}/"$XMLNAME"
-       done
+               rm -f  /etc/${pkg}/"$XMLNAME".xml /etc/${pkg}/"$XMLNAME".html
+               rm -f /etc/${pkg}/"$XMLNAME".xml.old
+               rm -rf /var/www/${pkg}/"$XMLNAME"
+           done
+       fi
 
        # If package should be purged also purge temporary web directory
        rm -rf /var/www/${pkg}/tmp
 
        # finally remove web directory
-       rmdir /var/www/${pkg}
+       if [ -d /var/www/${pkg} ] ; then
+           rmdir /var/www/${pkg}
+       fi
     ;;
     
     remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)


_______________________________________________
debian-med-commit mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/debian-med-commit

Reply via email to