Author: misha680-guest
Date: 2010-10-13 20:47:18 +0000 (Wed, 13 Oct 2010)
New Revision: 5352

Modified:
   trunk/packages/openmrs/trunk/debian/README.Debian
   trunk/packages/openmrs/trunk/debian/config
   trunk/packages/openmrs/trunk/debian/po/de.po
   trunk/packages/openmrs/trunk/debian/po/templates.pot
   trunk/packages/openmrs/trunk/debian/postinst
   trunk/packages/openmrs/trunk/debian/postrm
   trunk/packages/openmrs/trunk/debian/templates
Log:
Per comments of Ben Wolfe, lead developer, and per example of mysql-server 5.1 
postrm script, which uses debconf, see 
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick/annotate/head:/debian/mysql-server-5.1.postrm,
 ask about purge directly in postrm. 
http://old.nabble.com/OpenMRS-package-is-ready%2C-I-believe-tp29833953p29900223.html
 also shows Andreas' approval per my understanding.

Modified: trunk/packages/openmrs/trunk/debian/README.Debian
===================================================================
--- trunk/packages/openmrs/trunk/debian/README.Debian   2010-10-13 15:42:26 UTC 
(rev 5351)
+++ trunk/packages/openmrs/trunk/debian/README.Debian   2010-10-13 20:47:18 UTC 
(rev 5352)
@@ -1,9 +1,9 @@
 openmrs for Debian
 ------------------
 
-Please go to http://localhost:8080/openmrs to complete the setup
+Please go to http://localhost:8080/openmrs to complete the setup.
 
-You will find helpful directions for this process on the OpenMRS Wiki
+You will find helpful directions for this process on the OpenMRS Wiki:
 
 http://wiki.openmrs.org/display/docs/Step+6+-+Configuring+OpenMRS
 

Modified: trunk/packages/openmrs/trunk/debian/config
===================================================================
--- trunk/packages/openmrs/trunk/debian/config  2010-10-13 15:42:26 UTC (rev 
5351)
+++ trunk/packages/openmrs/trunk/debian/config  2010-10-13 20:47:18 UTC (rev 
5352)
@@ -7,18 +7,4 @@
 
 # show user database setup instructions
 db_input high openmrs/database-setup-instructions || true
-db_go || true
-
-# try to load from configuration file
-# default is _not_ to purge
-db_set openmrs/remove-data-on-purge false
-if [ -f /etc/openmrs/behavior_on_purge ]; then
-   REMOVE_DATA_ON_PURGE=$(grep "RemoveDataOnPurge" 
/etc/openmrs/behavior_on_purge | sed s/RemoveDataOnPurge=// || true)
-   if [ "$REMOVE_DATA_ON_PURGE" = "yes" ]; then
-       db_set openmrs/remove-data-on-purge true
-   fi
-fi
-
-# ask user (low priority - only seen in expert mode)
-db_input low openmrs/remove-data-on-purge || true
-db_go || true
+db_go || true
\ No newline at end of file

Modified: trunk/packages/openmrs/trunk/debian/po/de.po
===================================================================
--- trunk/packages/openmrs/trunk/debian/po/de.po        2010-10-13 15:42:26 UTC 
(rev 5351)
+++ trunk/packages/openmrs/trunk/debian/po/de.po        2010-10-13 20:47:18 UTC 
(rev 5352)
@@ -7,7 +7,7 @@
 msgstr ""
 "Project-Id-Version: openmrs, 1.6.1\n"
 "Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2010-10-12 11:57-0500\n"
+"POT-Creation-Date: 2010-10-13 14:25-0500\n"
 "PO-Revision-Date: 2010-10-08 13:13+2000\n"
 "Last-Translator: Andreas Tille <[email protected]>\n"
 "Language-Team: LANGUAGE <[email protected]>\n"
@@ -20,7 +20,9 @@
 #. Description
 #: ../templates:1001
 msgid "Please go to http://localhost:8080/openmrs to complete the setup."
-msgstr "Die Installation muß unter http://localhost:8080/openmrs weitergeführt 
werden."
+msgstr ""
+"Die Installation muß unter http://localhost:8080/openmrs weitergeführt "
+"werden."
 
 #. Type: note
 #. Description
@@ -35,17 +37,14 @@
 #. Type: boolean
 #. Description
 #: ../templates:2001
-msgid "Remove local OpenMRS database on package purge?"
+msgid "Remove local OpenMRS database?"
 msgstr ""
-"Löschen der lokalen OpenMRS Datenbank, wenn das openmrs Paket mittels purge "
-"entfernt wird?"
+"Löschen der lokalen OpenMRS Datenbank?"
 
 #. Type: boolean
 #. Description
 #: ../templates:2001
-msgid ""
-"Attention, enabling this option will result in LOSS OF ALL DATA if the "
-"package is purged."
+msgid "Attention, enabling this option will result in LOSS OF ALL DATA."
 msgstr ""
 "Achtung, das Bejahen der Frage hat einen TOTALEN VERLUST ALLER DATEN zur "
-"Folge, sollte das Paket mittels purge entfernt werden."
+"Folge."

Modified: trunk/packages/openmrs/trunk/debian/po/templates.pot
===================================================================
--- trunk/packages/openmrs/trunk/debian/po/templates.pot        2010-10-13 
15:42:26 UTC (rev 5351)
+++ trunk/packages/openmrs/trunk/debian/po/templates.pot        2010-10-13 
20:47:18 UTC (rev 5352)
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2010-10-12 11:57-0500\n"
+"POT-Creation-Date: 2010-10-13 14:25-0500\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <em...@address>\n"
 "Language-Team: LANGUAGE <[email protected]>\n"
@@ -34,13 +34,11 @@
 #. Type: boolean
 #. Description
 #: ../templates:2001
-msgid "Remove local OpenMRS database on package purge?"
+msgid "Remove local OpenMRS database?"
 msgstr ""
 
 #. Type: boolean
 #. Description
 #: ../templates:2001
-msgid ""
-"Attention, enabling this option will result in LOSS OF ALL DATA if the "
-"package is purged."
+msgid "Attention, enabling this option will result in LOSS OF ALL DATA."
 msgstr ""

Modified: trunk/packages/openmrs/trunk/debian/postinst
===================================================================
--- trunk/packages/openmrs/trunk/debian/postinst        2010-10-13 15:42:26 UTC 
(rev 5351)
+++ trunk/packages/openmrs/trunk/debian/postinst        2010-10-13 20:47:18 UTC 
(rev 5352)
@@ -7,18 +7,6 @@
 
 case "$1" in
     configure)
-
-       # Save remove data on purge config
-       echo '## attention, if you set the following variable to "yes" all your 
data' > /etc/openmrs/behavior_on_purge
-       echo '## will be gone in case of purging the openmrs package' >> 
/etc/openmrs/behavior_on_purge
-       echo -n 'RemoveDataOnPurge=' >> /etc/openmrs/behavior_on_purge
-       db_get openmrs/remove-data-on-purge
-       if [ "$RET" = true ]; then
-           echo "yes" >> /etc/openmrs/behavior_on_purge
-       else
-           echo "no" >> /etc/openmrs/behavior_on_purge
-       fi
-
        # Retrieve tomcat6 group
        db_get tomcat6/groupname && TOMCAT6_GROUP="$RET" || 
TOMCAT6_GROUP="tomcat6"
 

Modified: trunk/packages/openmrs/trunk/debian/postrm
===================================================================
--- trunk/packages/openmrs/trunk/debian/postrm  2010-10-13 15:42:26 UTC (rev 
5351)
+++ trunk/packages/openmrs/trunk/debian/postrm  2010-10-13 20:47:18 UTC (rev 
5352)
@@ -3,34 +3,35 @@
 
 set -e
 
-. /usr/share/debconf/confmodule
+# it is possible that Debconf has already been removed, too.
+if [ -f /usr/share/debconf/confmodule ]; then
+  . /usr/share/debconf/confmodule
+fi
 
 case "$1" in
     purge)
-       # should we remove data on purge?
-       REMOVE_DATA_ON_PURGE=""
-       if [ -f /etc/openmrs/behavior_on_purge ]; then
-           REMOVE_DATA_ON_PURGE=$(grep "RemoveDataOnPurge" 
/etc/openmrs/behavior_on_purge | sed s/RemoveDataOnPurge=// || true)
-       fi
+       # are we using the default openmrs-runtime.properties location?
+       if [ -f /etc/openmrs/openmrs-runtime.properties ]; then
+           
+           # extract data from properties file
+           CONNECTION_URL=$(cat /etc/openmrs/openmrs-runtime.properties | grep 
connection.url || true)
+           CONNECTION_URL_DATABASE_NAME=$(echo $CONNECTION_URL | sed 
's...@.*localhost:3306/\([^?]*\)....@\1@' || true)
+           CONNECTION_URL_MYSQL=$(echo $CONNECTION_URL | grep mysql || true)
+           CONNECTION_URL_LOCALHOST3306=$(echo $CONNECTION_URL | grep 
localhost:3306 || true)
+           CONNECTION_USERNAME=$(cat /etc/openmrs/openmrs-runtime.properties | 
grep connection.username | sed 's/connection.username=//' || true)
+           CONNECTION_PASSWORD=$(cat /etc/openmrs/openmrs-runtime.properties | 
grep connection.password | sed 's/connection.password=//' || true)
 
-       if [ "$REMOVE_DATA_ON_PURGE" = "yes" ]; then
+           # sanity check
+           if ! [ "$CONNECTION_URL_MYSQL" = "" ] && ! [  
"$CONNECTION_URL_LOCALHOST3306" = "" ] && 
+              ! [ "$CONNECTION_URL_DATABASE_NAME" = "" ] && ! [ 
"$CONNECTION_USERNAME" = "" ] && 
+              ! [ "$CONNECTION_PASSWORD" = "" ]; then
 
-           # are we using the default openmrs-runtime.properties location?
-           if [ -f /etc/openmrs/openmrs-runtime.properties ]; then
-           
-               # extract data from properties file
-               CONNECTION_URL=$(cat /etc/openmrs/openmrs-runtime.properties | 
grep connection.url || true)
-               CONNECTION_URL_DATABASE_NAME=$(echo $CONNECTION_URL | sed 
's...@.*localhost:3306/\([^?]*\)....@\1@' || true)
-               CONNECTION_URL_MYSQL=$(echo $CONNECTION_URL | grep mysql || 
true)
-               CONNECTION_URL_LOCALHOST3306=$(echo $CONNECTION_URL | grep 
localhost:3306 || true)
-               CONNECTION_USERNAME=$(cat 
/etc/openmrs/openmrs-runtime.properties | grep connection.username | sed 
's/connection.username=//' || true)
-               CONNECTION_PASSWORD=$(cat 
/etc/openmrs/openmrs-runtime.properties | grep connection.password | sed 
's/connection.password=//' || true)
+               # prompt user
+               db_input high openmrs/remove-data || true
+               db_go || true
+               db_get openmrs/remove-data || true
+               if [ "$RET" = "true" ]; then
 
-               # sanity check
-               if ! [ "$CONNECTION_URL_MYSQL" = "" ] && ! [  
"$CONNECTION_URL_LOCALHOST3306" = "" ] && 
-                  ! [ "$CONNECTION_URL_DATABASE_NAME" = "" ] && ! [ 
"$CONNECTION_USERNAME" = "" ] && 
-                  ! [ "$CONNECTION_PASSWORD" = "" ]; then
-
                    # we only drop the database, we cannot drop the user as the 
openmrs default user
                    # does not have permissions to drop users
                    echo "drop database $CONNECTION_URL_DATABASE_NAME" | mysql 
--user=$CONNECTION_USERNAME --password=$CONNECTION_PASSWORD > /dev/null 2>&1 || 
true

Modified: trunk/packages/openmrs/trunk/debian/templates
===================================================================
--- trunk/packages/openmrs/trunk/debian/templates       2010-10-13 15:42:26 UTC 
(rev 5351)
+++ trunk/packages/openmrs/trunk/debian/templates       2010-10-13 20:47:18 UTC 
(rev 5352)
@@ -3,9 +3,8 @@
 _Description: Please go to http://localhost:8080/openmrs to complete the setup.
  This step will allow you to create the databases necessary for OpenMRS to 
function.
 
-Template: openmrs/remove-data-on-purge
+Template: openmrs/remove-data
 Type: boolean
 Default: false
-_Description: Remove local OpenMRS database on package purge?
- Attention, enabling this option will result in LOSS OF ALL DATA if the 
package is
- purged.
+_Description: Remove local OpenMRS database?
+ Attention, enabling this option will result in LOSS OF ALL DATA.


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

Reply via email to