[med-svn] r2504 - in trunk/packages/agdbnet/trunk/debian: . po template

tille at alioth.debian.org tille at alioth.debian.org
Wed Sep 17 10:11:42 UTC 2008


Author: tille
Date: 2008-09-17 10:11:41 +0000 (Wed, 17 Sep 2008)
New Revision: 2504

Modified:
   trunk/packages/agdbnet/trunk/debian/config
   trunk/packages/agdbnet/trunk/debian/po/templates.pot
   trunk/packages/agdbnet/trunk/debian/postinst
   trunk/packages/agdbnet/trunk/debian/postrm
   trunk/packages/agdbnet/trunk/debian/template/agdbnet.xml
   trunk/packages/agdbnet/trunk/debian/template/index.html
   trunk/packages/agdbnet/trunk/debian/templates
Log:
More debconf values and removal of all files when purging the package


Modified: trunk/packages/agdbnet/trunk/debian/config
===================================================================
--- trunk/packages/agdbnet/trunk/debian/config	2008-09-16 23:33:14 UTC (rev 2503)
+++ trunk/packages/agdbnet/trunk/debian/config	2008-09-17 10:11:41 UTC (rev 2504)
@@ -1,7 +1,8 @@
 #!/bin/sh
 set -e
 
-pkg=agdbnet
+# export should ensure that pkg is available in the template
+export pkg=agdbnet
 
 DEBCONF_DEBUG=developer
 
@@ -15,14 +16,8 @@
 # Then we can read out the remaining config items from the apropriate
 # config file
 
-# DEBUG
-debuglog=/var/tmp/${pkg}.log
-rm -f $debuglog
-touch $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
@@ -34,24 +29,27 @@
 	# 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
-echo "xmlname input erledigt" >> $debuglog
 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"
+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
@@ -59,13 +57,19 @@
 fi
 db_input high ${pkg}/description || true
 db_go || true
-echo "DESCRIPTION = $DESCRIPTION" >> $debuglog
-    
-PATOGEN=`grep '</system>' /etc/${pkg}/${XMLNAME}.xml | sed 's?\([^>]\+\)</system>.*?\1?'`
-echo "PATHOGEN = $PATHOGEN" >> $debuglog
-# verify whether Pathogen is set in config file
-if [ "$PATOGEN" != "##Pathogen##" -a "$PATOGEN" != "" ] ; then
-    db_set ${pkg}/pathogen "$PATOGEN"
+
+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}/pathogen || true
+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/po/templates.pot
===================================================================
--- trunk/packages/agdbnet/trunk/debian/po/templates.pot	2008-09-16 23:33:14 UTC (rev 2503)
+++ trunk/packages/agdbnet/trunk/debian/po/templates.pot	2008-09-17 10:11:41 UTC (rev 2504)
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: agdbnet at packages.debian.org\n"
-"POT-Creation-Date: 2008-09-12 15:49+0200\n"
+"POT-Creation-Date: 2008-09-17 11:40+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
@@ -34,14 +34,43 @@
 
 #. Type: string
 #. Description
+#: ../templates:1001
+msgid ""
+"It is suggested to use a characteristical lower-case character name which is "
+"handy for file names for instance.  A shortcut for the pathogen that will be "
+"typed by agdbnet makes perfectly sense."
+msgstr ""
+
+#. Type: string
+#. Description
 #: ../templates:2001
-msgid "Description of the agdbnet database:"
+msgid "Systematic name of pathogen:"
 msgstr ""
 
 #. Type: string
 #. Description
 #: ../templates:2001
+msgid "The name of the pathogen that should be analysed."
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../templates:2001
 msgid ""
+"Reasonable values for pathogen are things like: Campylobacter, Neisseria, "
+"Streptococcus, etc."
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../templates:3001
+msgid "Short description of the pathogen:"
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../templates:3001
+msgid ""
 "Each agdbnet database should have a description of the pathogen that will be "
 "analysed.  The description will be stored in the configuration file in /etc/"
 "agdbnet and can be changed there if needed."
@@ -50,11 +79,49 @@
 #. Type: string
 #. Description
 #: ../templates:3001
-msgid "Name of pathogen:"
+msgid ""
+"Resonable values for such a short description are something like:\n"
+" * Campylobacter jejuni FlaA\n"
+" * Neisseria meningitidis FetA variable region\n"
+" * Streptococcus equi seM"
 msgstr ""
 
 #. Type: string
 #. Description
-#: ../templates:3001
-msgid "The name of the pathogen that should be analysed."
+#: ../templates:4001
+msgid "Locus full name of pathogen:"
 msgstr ""
+
+#. Type: string
+#. Description
+#: ../templates:4001
+msgid ""
+"The full name of the locus specifies the region which will be used for "
+"typing."
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../templates:4001
+msgid "Reasonable values might be: variable region <number>."
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../templates:5001
+msgid "Short name of locus:"
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../templates:5001
+msgid "A shortcut for the locus which will be used in the web interface."
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../templates:5001
+msgid ""
+"Reasonable values might be: VR1 for \"variable region 1\" or also "
+"Campylobacter jejuni flaA for \"Campylobacter jejuni FlaA\"."
+msgstr ""

Modified: trunk/packages/agdbnet/trunk/debian/postinst
===================================================================
--- trunk/packages/agdbnet/trunk/debian/postinst	2008-09-16 23:33:14 UTC (rev 2503)
+++ trunk/packages/agdbnet/trunk/debian/postinst	2008-09-17 10:11:41 UTC (rev 2504)
@@ -20,11 +20,12 @@
 db_get ${pkg}/pathogen
 PATHOGEN=${RET}
 
-debuglog=/var/tmp/${pkg}.log
-echo "XMLNAME = $XMLNAME" >> $debuglog
-echo "DESCRIPTION = $DESCRIPTION" >> $debuglog
-echo "PATHOGEN = $PATHOGEN" >> $debuglog
+db_get ${pkg}/locusfullname
+LOCUSFULLNAME=${RET}
 
+db_get ${pkg}/locus
+LOCUS=${RET}
+
 # Substitute the value ##variables## in the templates and move them
 # right into place
 XMLOUT=/etc/${pkg}/"$XMLNAME".xml
@@ -33,6 +34,8 @@
     sed -e "s/##database##/${XMLNAME}/g" \
         -e "s/##Description##/${DESCRIPTION}/g" \
         -e "s/##Pathogen##/${PATHOGEN}/g" \
+        -e "s/##LocusFullName##/${LOCUSFULLNAME}/g" \
+        -e "s/##Locus##/${LOCUS}/g" \
         /usr/share/${pkg}/template/${pkg}.xml > \
        "$XMLOUT"
 else
@@ -41,6 +44,7 @@
         -e "s/longcode=\"[^\"]\+\"/longcode=\"${XMLNAME}\"/g" \
         -e "s/description=\"[^\"]\+\"/description=\"${DESCRIPTION}\"/g" \
         -e "s?[^>]\+</system>?${PATHOGEN}</system>?g" \
+        -e "s/<locus fullname=\"[^\"]*\">[^<]\+/<locus fullname=\"${LOCUSFULLNAME}\">${LOCUS}/" \
        "$XMLOUT"
 fi
 
@@ -50,6 +54,8 @@
     sed -e "s/##database##/${XMLNAME}/g" \
         -e "s/##Description##/${DESCRIPTION}/g" \
         -e "s/##Pathogen##/${PATHOGEN}/g" \
+        -e "s/##LocusFullName##/${LOCUSFULLNAME}/g" \
+        -e "s/##Locus##/${LOCUS}/g" \
        /usr/share/${pkg}/template/index.html > \
        "$HTMLOUT"    
 fi

Modified: trunk/packages/agdbnet/trunk/debian/postrm
===================================================================
--- trunk/packages/agdbnet/trunk/debian/postrm	2008-09-16 23:33:14 UTC (rev 2503)
+++ trunk/packages/agdbnet/trunk/debian/postrm	2008-09-17 10:11:41 UTC (rev 2504)
@@ -5,25 +5,24 @@
 
 set -e
 
-# summary of how this script can be called:
-#        * <postrm> `remove'
-#        * <postrm> `purge'
-#        * <old-postrm> `upgrade' <new-version>
-#        * <new-postrm> `failed-upgrade' <old-version>
-#        * <new-postrm> `abort-install'
-#        * <new-postrm> `abort-install' <old-version>
-#        * <new-postrm> `abort-upgrade' <old-version>
-#        * <disappearer's-postrm> `disappear' <overwriter>
-#          <overwriter-version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
+pkg=agdbnet
 
-TMPDIR=/var/www/agdbnet/tmp
-
 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`
+
+	    rm -f  /etc/${pkg}/"$XMLNAME".xml /etc/${pkg}/"$XMLNAME".html
+	    rm -f /etc/${pkg}/"$XMLNAME".xml.old
+	    rm -rf /var/www/${pkg}/"$XMLNAME"
+	done
+
 	# If package should be purged also purge temporary web directory
-	rm -rf ${TMPDIR}
+	rm -rf /var/www/${pkg}/tmp
+
+	# finally remove web directory
+	rmdir /var/www/${pkg}
     ;;
     
     remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
@@ -38,5 +37,3 @@
 #DEBHELPER#
 
 exit 0
-
-

Modified: trunk/packages/agdbnet/trunk/debian/template/agdbnet.xml
===================================================================
--- trunk/packages/agdbnet/trunk/debian/template/agdbnet.xml	2008-09-16 23:33:14 UTC (rev 2503)
+++ trunk/packages/agdbnet/trunk/debian/template/agdbnet.xml	2008-09-17 10:11:41 UTC (rev 2504)
@@ -18,7 +18,7 @@
 ##Pathogen##</system>
 
 <!-- LOCI -->
-<locus fullname="##Shortname##">##database##
+<locus fullname="##LocusFullName##">##Locus##
 <nucleotide>
 <field type="int" length="##?##" userupdate="no" comments="primary key">id</field>
 <field type="text" length="##?##" width="30" maindisplay="no">sequence</field>

Modified: trunk/packages/agdbnet/trunk/debian/template/index.html
===================================================================
--- trunk/packages/agdbnet/trunk/debian/template/index.html	2008-09-16 23:33:14 UTC (rev 2503)
+++ trunk/packages/agdbnet/trunk/debian/template/index.html	2008-09-17 10:11:41 UTC (rev 2504)
@@ -11,7 +11,9 @@
 </head>
 <body>
 
-##Pathogen##: <a href="http://localhost/cgi-bin/agdbnet.pl?file=##database##.xml">##database##</a>
+##Pathogen##: <a href="http://localhost/cgi-bin/agdbnet.pl?file=##database##.xml">##database##</a><br />
+##Description##<br />
+##LocusFullName##
 
 </body>
 </html>

Modified: trunk/packages/agdbnet/trunk/debian/templates
===================================================================
--- trunk/packages/agdbnet/trunk/debian/templates	2008-09-16 23:33:14 UTC (rev 2503)
+++ trunk/packages/agdbnet/trunk/debian/templates	2008-09-17 10:11:41 UTC (rev 2504)
@@ -6,16 +6,46 @@
  name.  The database specific configuration items will be stored in
  the file /etc/agdbnet/<name_you_input_here>.xml and can be adjusted
  there.
+ .
+ It is suggested to use a characteristical lower-case character
+ name which is handy for file names for instance.  A shortcut for
+ the pathogen that will be typed by agdbnet makes perfectly sense.
 
+Template: agdbnet/pathogen
+Type: string
+_Description: Systematic name of pathogen:
+ The name of the pathogen that should be analysed.
+ .
+ Reasonable values for pathogen are things like: Campylobacter,
+ Neisseria, Streptococcus, etc.
+
 Template: agdbnet/description
 Type: string
-_Description: Description of the agdbnet database:
+_Description: Short description of the pathogen:
  Each agdbnet database should have a description of the pathogen
  that will be analysed.  The description will be stored in the
  configuration file in /etc/agdbnet and can be changed there if
  needed.
+ .
+ Resonable values for such a short description are something
+ like:
+  * Campylobacter jejuni FlaA
+  * Neisseria meningitidis FetA variable region
+  * Streptococcus equi seM
 
-Template: agdbnet/pathogen
+Template: agdbnet/locusfullname
 Type: string
-_Description: Name of pathogen:
- The name of the pathogen that should be analysed.
+_Description: Locus full name of pathogen:
+ The full name of the locus specifies the region which will
+ be used for typing.
+ .
+ Reasonable values might be: variable region <number>.
+
+Template: agdbnet/locus
+Type: string
+_Description: Short name of locus:
+ A shortcut for the locus which will be used in the web
+ interface.
+ .
+ Reasonable values might be: VR1 for "variable region 1" or
+ also Campylobacter jejuni flaA for "Campylobacter jejuni FlaA".




More information about the debian-med-commit mailing list