[med-svn] r2496 - in trunk/packages/agdbnet/trunk/debian: . po template
tille at alioth.debian.org
tille at alioth.debian.org
Mon Sep 15 13:37:44 UTC 2008
Author: tille
Date: 2008-09-15 13:37:43 +0000 (Mon, 15 Sep 2008)
New Revision: 2496
Modified:
trunk/packages/agdbnet/trunk/debian/config
trunk/packages/agdbnet/trunk/debian/dirs
trunk/packages/agdbnet/trunk/debian/po/templates.pot
trunk/packages/agdbnet/trunk/debian/postinst
trunk/packages/agdbnet/trunk/debian/template/agdbnet.xml
trunk/packages/agdbnet/trunk/debian/template/index.html
trunk/packages/agdbnet/trunk/debian/templates
Log:
More configurable values
Modified: trunk/packages/agdbnet/trunk/debian/config
===================================================================
--- trunk/packages/agdbnet/trunk/debian/config 2008-09-14 21:01:34 UTC (rev 2495)
+++ trunk/packages/agdbnet/trunk/debian/config 2008-09-15 13:37:43 UTC (rev 2496)
@@ -48,7 +48,24 @@
fi
db_set ${pkg}/xmlname "$XMLNAME"
-
db_input high ${pkg}/xmlname || true
+echo "xmlname input erledigt" >> $debuglog
+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
+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"
+fi
+db_input high ${pkg}/pathogen || true
+db_go || true
Modified: trunk/packages/agdbnet/trunk/debian/dirs
===================================================================
--- trunk/packages/agdbnet/trunk/debian/dirs 2008-09-14 21:01:34 UTC (rev 2495)
+++ trunk/packages/agdbnet/trunk/debian/dirs 2008-09-15 13:37:43 UTC (rev 2496)
@@ -1 +1 @@
-/etc
+/etc/agdbnet
Modified: trunk/packages/agdbnet/trunk/debian/po/templates.pot
===================================================================
--- trunk/packages/agdbnet/trunk/debian/po/templates.pot 2008-09-14 21:01:34 UTC (rev 2495)
+++ trunk/packages/agdbnet/trunk/debian/po/templates.pot 2008-09-15 13:37:43 UTC (rev 2496)
@@ -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-11 17:15+0200\n"
+"POT-Creation-Date: 2008-09-12 15:49+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"
@@ -19,15 +19,42 @@
#. Type: string
#. Description
#: ../templates:1001
-msgid "Name of the ${pkg} database:"
+msgid "Name of the agdbnet database:"
msgstr ""
#. Type: string
#. Description
#: ../templates:1001
msgid ""
-"The package ${pkg} is using a configuration file which stores the name of "
+"The package agdbnet is using a configuration file which stores the name of "
"the database. The configuration file should have the same name. The "
-"database specific configuration items will be stored in the file /etc/${pkg}/"
-"<name_you_input_here>.xml and can be adjusted there."
+"database specific configuration items will be stored in the file /etc/"
+"agdbnet/<name_you_input_here>.xml and can be adjusted there."
msgstr ""
+
+#. Type: string
+#. Description
+#: ../templates:2001
+msgid "Description of the agdbnet database:"
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../templates:2001
+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."
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../templates:3001
+msgid "Name of pathogen:"
+msgstr ""
+
+#. Type: string
+#. Description
+#: ../templates:3001
+msgid "The name of the pathogen that should be analysed."
+msgstr ""
Modified: trunk/packages/agdbnet/trunk/debian/postinst
===================================================================
--- trunk/packages/agdbnet/trunk/debian/postinst 2008-09-14 21:01:34 UTC (rev 2495)
+++ trunk/packages/agdbnet/trunk/debian/postinst 2008-09-15 13:37:43 UTC (rev 2496)
@@ -14,15 +14,41 @@
db_get ${pkg}/xmlname
XMLNAME=${RET}
-# Substitute the value ##database## in the templates and move them
+db_get ${pkg}/description
+DESCRIPTION=${RET}
+
+db_get ${pkg}/pathogen
+PATHOGEN=${RET}
+
+debuglog=/var/tmp/${pkg}.log
+echo "XMLNAME = $XMLNAME" >> $debuglog
+echo "DESCRIPTION = $DESCRIPTION" >> $debuglog
+echo "PATHOGEN = $PATHOGEN" >> $debuglog
+
+# Substitute the value ##variables## in the templates and move them
# right into place
-sed "s/##database##/${XMLNAME}/g" /usr/share/${pkg}/template/${pkg}.xml > \
- /etc/${pkg}/"$XMLNAME".xml
-sed "s/##database##/${XMLNAME}/g" /usr/share/${pkg}/template/index.html > \
- /etc/${pkg}/"$XMLNAME".html
+XMLOUT=/etc/${pkg}/"$XMLNAME".xml
+# if no config file exists, just create one from the template
+if [ ! -e "$XMLOUT" ] ; then
+ sed -e "s/##database##/${XMLNAME}/g" \
+ -e "s/##Description##/${DESCRIPTION}/g" \
+ -e "s/##Pathogen##/${PATHOGEN}/g" \
+ /usr/share/${pkg}/template/${pkg}.xml > \
+ "$XMLOUT"
+fi
+
+HTMLOUT=/etc/${pkg}/"$XMLNAME".html
+# if no HTML file exists, just create one from the template
+if [ ! -e "$HTMLOUT" ] ; then
+ sed -e "s/##database##/${XMLNAME}/g" \
+ -e "s/##Description##/${DESCRIPTION}/g" \
+ -e "s/##Pathogen##/${PATHOGEN}/g" \
+ /usr/share/${pkg}/template/index.html > \
+ "$HTMLOUT"
+fi
mkdir -p /var/www/${pkg}/"$XMLNAME"
if [ ! -e /var/www/${pkg}/"$XMLNAME"/index.html ] ; then
- ln -s /etc/${pkg}/"$XMLNAME".html /var/www/${pkg}/"$XMLNAME"/index.html
+ ln -s "$HTMLOUT" /var/www/${pkg}/"$XMLNAME"/index.html
fi
TMPDIR="/var/www/${pkg}/tmp"
Modified: trunk/packages/agdbnet/trunk/debian/template/agdbnet.xml
===================================================================
--- trunk/packages/agdbnet/trunk/debian/template/agdbnet.xml 2008-09-14 21:01:34 UTC (rev 2495)
+++ trunk/packages/agdbnet/trunk/debian/template/agdbnet.xml 2008-09-15 13:37:43 UTC (rev 2496)
@@ -11,11 +11,11 @@
<!-- _______________________________________________________ -->
<system
- longcode="##database##" webroot="/##database##" indexpage=""
+ longcode="##database##" webroot="/agdbnet/##database##" indexpage=""
description="##Description##"
downloadFASTAonly="yes"
>
-##Name##</system>
+##Pathogen##</system>
<!-- LOCI -->
<locus fullname="##Shortname##">##database##
Modified: trunk/packages/agdbnet/trunk/debian/template/index.html
===================================================================
--- trunk/packages/agdbnet/trunk/debian/template/index.html 2008-09-14 21:01:34 UTC (rev 2495)
+++ trunk/packages/agdbnet/trunk/debian/template/index.html 2008-09-15 13:37:43 UTC (rev 2496)
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>##title##</title>
+ <title>##Description##</title>
<meta name="description" content="##Description##" />
<meta name="keywords" content="agdbnet" />
@@ -11,7 +11,7 @@
</head>
<body>
-AgdbNet: <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>
</body>
</html>
Modified: trunk/packages/agdbnet/trunk/debian/templates
===================================================================
--- trunk/packages/agdbnet/trunk/debian/templates 2008-09-14 21:01:34 UTC (rev 2495)
+++ trunk/packages/agdbnet/trunk/debian/templates 2008-09-15 13:37:43 UTC (rev 2496)
@@ -1,8 +1,21 @@
Template: agdbnet/xmlname
Type: string
-_Description: Name of the ${pkg} database:
- The package ${pkg} is using a configuration file which stores the
+_Description: Name of the agdbnet database:
+ The package agdbnet is using a configuration file which stores the
name of the database. The configuration file should have the same
name. The database specific configuration items will be stored in
- the file /etc/${pkg}/<name_you_input_here>.xml and can be adjusted
+ the file /etc/agdbnet/<name_you_input_here>.xml and can be adjusted
there.
+
+Template: agdbnet/description
+Type: string
+_Description: Description of the agdbnet database:
+ 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.
+
+Template: agdbnet/pathogen
+Type: string
+_Description: Name of pathogen:
+ The name of the pathogen that should be analysed.
More information about the debian-med-commit
mailing list