Mercurial > trustbridge
changeset 726:3777482dc306
Merged
author | Sascha Wilde <wilde@intevation.de> |
---|---|
date | Wed, 02 Jul 2014 19:32:16 +0200 |
parents | ce3e33e66a17 (diff) b0929968562a (current diff) |
children | feaabee15e72 |
files | |
diffstat | 1 files changed, 30 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/packaging/linux-installer.inc.in Wed Jul 02 18:35:30 2014 +0200 +++ b/packaging/linux-installer.inc.in Wed Jul 02 19:32:16 2014 +0200 @@ -4,16 +4,17 @@ ME=`basename "$0"` DEFAULT_PREFIX="$HOME/TrustBridge" SYSDEFAULT_PREFIX="/usr/local" -CFGPATH="${XDG_DATA_HOME:-$HOME/.local/share}/BSI/TrustBridge" +CFGPATH="${XDG_CONFIG_HOME:-$HOME/.config}/BSI" +DATAPATH="${XDG_DATA_HOME:-$HOME/.local/share}/BSI/TrustBridge" SYSCFGPATH="/etc/TrustBridge" -INSTCFGNAME="installation.cfg" +INSTCFGNAME="TrustBridge-inst.cfg" FORCE=0 SYSINST=0 DEINSTALL=0 BINNAMES="###BINNAMES###" declare -A instcfg oldinstcfg -declare inst_default_prefix instcfg_file +declare inst_default_prefix instdata_path instcfg_path instcfg_file instcfg=( [TIMESTMP]=`date -u +%Y%m%d%H%M%S` [VERSION]='@PROJECT_VERSION@' @@ -133,11 +134,15 @@ { if [ $SYSINST -eq 1 ] ; then inst_default_prefix="$SYSDEFAULT_PREFIX" - instcfg_file="${SYSCFGPATH}/${INSTCFGNAME}" + instcfg_path="${SYSCFGPATH}" + # TODO: where is the system wide installation data path? + instdata_path="${SYSCFGPATH}" else inst_default_prefix="$DEFAULT_PREFIX" - instcfg_file="${CFGPATH}/${INSTCFGNAME}" + instcfg_path="${CFGPATH}" + instdata_path="${DATAPATH}" fi + instcfg_file="${instcfg_path}/${INSTCFGNAME}" } write_instcfg() @@ -166,11 +171,31 @@ fi } +deinstall_certs() +{ + local cinst="${oldinstcfg[PREFIX]}/bin/cinst" + local certlist=`ls -1 ${instdata_path}/list-*.txt | sort -nr | head -n 1` + + echo "Uninstalling certificates ..." + + if [ "$certlist" ] ; then + echo "Using certificate list '$certlist'." + if [ -x "$cinst" ] ; then + "$cinst" "list=$certlist" "choices=uninstall" + else + echo >&2 "WARNING: can't execute $cinst for certificate deinstallation." + fi + else + echo "No certificate list found. Nothing to do." + fi +} + deinstall() { if [ "${oldinstcfg[PREFIX]}" ] ; then echo "Really deinstall TrustBridge from '${oldinstcfg[PREFIX]}'?" yorn || exit 0 + deinstall_certs local deinstdir="${oldinstcfg[PREFIX]}/bin" echo "Deinstalling from '${oldinstcfg[PREFIX]}'." for file in $BINNAMES ; do