changeset 1178:59b3c22a404c

(issue142) Only remove certificates if requested Leave the TrustBridge.ini and the list-installed.txt around otherwise.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 22 Sep 2014 12:38:03 +0200
parents 53a02fbe2fc9
children 0651afddb4ec
files packaging/linux-installer-uninstall.inc packaging/linux-installer-uninstall.l10n-de
diffstat 2 files changed, 19 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/packaging/linux-installer-uninstall.inc	Mon Sep 22 11:51:59 2014 +0200
+++ b/packaging/linux-installer-uninstall.inc	Mon Sep 22 12:38:03 2014 +0200
@@ -31,23 +31,27 @@
   setup_cronjob deinstall
 }
 
-deinstall_certs()
+deinstall_certs_and_config()
 {
   local cinst="${oldinstcfg[PREFIX]}/bin/trustbridge-certificate-installer"
   local certlist=`ls 2>/dev/null -1  ${instdata_path}/list-installed.txt`
 
   getxt "Uninstalling certificates ...\n"
 
-  if [ "$certlist" ] ; then
+  if [ -f "$certlist" ] ; then
       getxt "Using certificate list '%s'.\n" "$certlist"
       if [ -x "$cinst" ] ; then
           "$cinst" "list=$certlist" "choices=uninstall"
       else
         getxt >&2 "WARNING: can't execute %s for certificate deinstallation.\n" "$cinst"
       fi
+      rm_files "$certlist"
   else
     getxt "No certificate list found.  Nothing to do.\n"
   fi
+
+  rm_files "${instcfg_path}/TrustBridge.ini"
+  rm_empty_dirs "$instcfg_path"
 }
 
 deinstall_etc()
@@ -55,22 +59,20 @@
   getxt "Removing cron job ...\n"
   remove_cronjob
 
-  # FIXME (issue133): delete all files created by the application.
-  local tbcfg_files=( "${instcfg_path}/TrustBridge.ini"
-                      "${instcfg_path}/trustbridge-tray-starter.cfg"
+  getxt "Removing certificate lists from: %s:\n" "$instdata_path"
+  rm_files "$instdata_path"/list-2*.txt
+
+  local tbcfg_files=( "${instcfg_path}/trustbridge-tray-starter.cfg"
                       "$instcfg_file" )
 
-  getxt "Removing certificate lists from: %s:\n" "$instdata_path"
-  rm_files "$instdata_path"/list-*.txt
+  getxt "Removing configuration files:\n"
+  rm_files "${tbcfg_files[@]}"
+  rm_empty_dirs "$instcfg_path"
 
   getxt "Removing PID file from: %s:\n" "$instdata_path"
   rm_files "$instdata_path"/*.pid
   rm_empty_dirs "$instdata_path"
 
-  getxt "Removing configuration files:\n"
-  rm_files "${tbcfg_files[@]}"
-  rm_empty_dirs "$instcfg_path"
-
   getxt "Removing TrustBridge from autostart\n"
   rm_files "${autostart_path}/trustbridge.desktop"
   update-desktop-database 2>&1 || true
@@ -84,7 +86,11 @@
   if [ "${oldinstcfg[PREFIX]}" ] ; then
       getxt "Really deinstall TrustBridge from '%s'? [y/n]\n" "${oldinstcfg[PREFIX]}"
       yorn || exit 0
-      deinstall_certs
+      local certlist=`ls 2>/dev/null -1  ${instdata_path}/list-installed.txt`
+      if [ -f "$certlist" ] ; then
+        getxt "Do you also want to remove the certificates installed by TrustBridge? [y/n]\n"
+        yorn && deinstall_certs_and_config
+      fi
       local deinstdir="${oldinstcfg[PREFIX]}/bin"
       getxt "Deinstalling from '%s'.\n" "${oldinstcfg[PREFIX]}"
       for file in $BINNAMES ; do
--- a/packaging/linux-installer-uninstall.l10n-de	Mon Sep 22 11:51:59 2014 +0200
+++ b/packaging/linux-installer-uninstall.l10n-de	Mon Sep 22 12:38:03 2014 +0200
@@ -16,4 +16,5 @@
   ["Using certificate list '%s'.\n"]="Die Zertifikatsliste '%s' wird verwendet.\n"
   ["WARNING: Could not delete: '%s'!\n"]="WARNUNG: Konnte '%s' nicht löschen!\n"
   ["WARNING: can't execute %s for certificate deinstallation.\n"]="WARNUNG: '%s' kann nicht zum deinstallieren der Zertifikate ausgeführt werden.\n"
+  ["Do you also want to remove the certificates installed by TrustBridge? [y/n]\n"]="Sollen die von TrustBridge installierten Zertifikate auch entfernt werden? [j\n]\n"
 )

http://wald.intevation.org/projects/trustbridge/