comparison packaging/linux-installer.inc.in @ 724:d280e2d39d5a

Introduced data-directory and fixed config-directory.
author Sascha Wilde <wilde@intevation.de>
date Wed, 02 Jul 2014 19:30:03 +0200
parents e71c59b16eee
children ce3e33e66a17
comparison
equal deleted inserted replaced
723:e71c59b16eee 724:d280e2d39d5a
2 set -u 2 set -u
3 3
4 ME=`basename "$0"` 4 ME=`basename "$0"`
5 DEFAULT_PREFIX="$HOME/TrustBridge" 5 DEFAULT_PREFIX="$HOME/TrustBridge"
6 SYSDEFAULT_PREFIX="/usr/local" 6 SYSDEFAULT_PREFIX="/usr/local"
7 CFGPATH="${XDG_DATA_HOME:-$HOME/.local/share}/BSI/TrustBridge" 7 CFGPATH="${XDG_CONFIG_HOME:-$HOME/.config}/BSI"
8 DATAPATH="${XDG_DATA_HOME:-$HOME/.local/share}/BSI/TrustBridge"
8 SYSCFGPATH="/etc/TrustBridge" 9 SYSCFGPATH="/etc/TrustBridge"
9 INSTCFGNAME="installation.cfg" 10 INSTCFGNAME="TrustBridge-inst.cfg"
10 FORCE=0 11 FORCE=0
11 SYSINST=0 12 SYSINST=0
12 DEINSTALL=0 13 DEINSTALL=0
13 BINNAMES="###BINNAMES###" 14 BINNAMES="###BINNAMES###"
14 15
15 declare -A instcfg oldinstcfg 16 declare -A instcfg oldinstcfg
16 declare inst_default_prefix instcfg_path instcfg_file 17 declare inst_default_prefix instdata_path instcfg_path instcfg_file
17 instcfg=( 18 instcfg=(
18 [TIMESTMP]=`date -u +%Y%m%d%H%M%S` 19 [TIMESTMP]=`date -u +%Y%m%d%H%M%S`
19 [VERSION]='@PROJECT_VERSION@' 20 [VERSION]='@PROJECT_VERSION@'
20 [PREFIX]='' 21 [PREFIX]=''
21 ) 22 )
132 init_vars() 133 init_vars()
133 { 134 {
134 if [ $SYSINST -eq 1 ] ; then 135 if [ $SYSINST -eq 1 ] ; then
135 inst_default_prefix="$SYSDEFAULT_PREFIX" 136 inst_default_prefix="$SYSDEFAULT_PREFIX"
136 instcfg_path="${SYSCFGPATH}" 137 instcfg_path="${SYSCFGPATH}"
137 138 # TODO: where is the system wide installation data path?
139 instdata_path="${SYSCFGPATH}"
138 else 140 else
139 inst_default_prefix="$DEFAULT_PREFIX" 141 inst_default_prefix="$DEFAULT_PREFIX"
140 instcfg_path="${CFGPATH}" 142 instcfg_path="${CFGPATH}"
143 instdata_path="${DATAPATH}"
141 fi 144 fi
142 instcfg_file="${instcfg_path}/${INSTCFGNAME}" 145 instcfg_file="${instcfg_path}/${INSTCFGNAME}"
143 } 146 }
144 147
145 write_instcfg() 148 write_instcfg()
169 } 172 }
170 173
171 deinstall_certs() 174 deinstall_certs()
172 { 175 {
173 local cinst="${oldinstcfg[PREFIX]}/bin/cinst" 176 local cinst="${oldinstcfg[PREFIX]}/bin/cinst"
174 local certlist=`ls -1 ${instcfg_path}/list-*.txt | sort -nr | head -n 1` 177 local certlist=`ls -1 ${instdata_path}/list-*.txt | sort -nr | head -n 1`
175 178
176 echo "Uninstalling certificates ..." 179 echo "Uninstalling certificates ..."
177 180
178 if [ "$certlist" ] ; then 181 if [ "$certlist" ] ; then
179 echo "Using certificate list '$certlist'." 182 echo "Using certificate list '$certlist'."

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