Mercurial > trustbridge
comparison packaging/linux-installer.inc @ 1182:0651afddb4ec
Merged.
author | Emanuel Schuetze <emanuel@intevation.de> |
---|---|
date | Mon, 22 Sep 2014 12:40:06 +0200 |
parents | 53a02fbe2fc9 |
children | 969970a83b6d |
comparison
equal
deleted
inserted
replaced
1181:f8ad8fc464db | 1182:0651afddb4ec |
---|---|
49 getxt "Install TrustBridge.\n\n" | 49 getxt "Install TrustBridge.\n\n" |
50 getxt "Options:\n" | 50 getxt "Options:\n" |
51 getxt " -p, --prefix=PATH install files in PATH\n" | 51 getxt " -p, --prefix=PATH install files in PATH\n" |
52 getxt " -f, --force install to given prefix, even when a current\n" | 52 getxt " -f, --force install to given prefix, even when a current\n" |
53 getxt " installation with different prefix exists.\n" | 53 getxt " installation with different prefix exists.\n" |
54 getxt " -d, --deinstall deinstall files from current installation\n" | 54 getxt " -u, --uninstall uninstall files from current installation\n" |
55 getxt " -s, --system create a system wide (de)installation\n" | 55 getxt " -s, --system create a system wide (de)installation\n" |
56 getxt " --help display this help and exit\n" | 56 getxt " --help display this help and exit\n" |
57 getxt " --version output version information and exit\n" | 57 getxt " --version output version information and exit\n" |
58 exit $1 | 58 exit $1 |
59 } | 59 } |
60 | 60 |
61 parse_args() | 61 parse_args() |
62 { | 62 { |
63 OPTS=`getopt \ | 63 OPTS=`getopt \ |
64 -l deinstall,update,show-after-update,force,help,prefix:,system,version \ | 64 -l uninstall,update,show-after-update,force,help,prefix:,system,version \ |
65 -o d,f,p:,s -n "$ME" -- "$@"` | 65 -o d,f,p:,s -n "$ME" -- "$@"` |
66 [ $? -eq 0 ] || usage 23 | 66 [ $? -eq 0 ] || usage 23 |
67 | 67 |
68 eval set -- "$OPTS" | 68 eval set -- "$OPTS" |
69 | 69 |
79 ;; | 79 ;; |
80 --force|-f) | 80 --force|-f) |
81 FORCE=1 | 81 FORCE=1 |
82 shift 1 | 82 shift 1 |
83 ;; | 83 ;; |
84 --deinstall|-d) | 84 --uninstall|-u) |
85 DEINSTALL=1 | 85 DEINSTALL=1 |
86 shift 1 | 86 shift 1 |
87 ;; | 87 ;; |
88 --update) | 88 --update) |
89 # Update is an internal option that is used when the application calls | 89 # Update is an internal option that is used when the application calls |
117 RUNCMD="" | 117 RUNCMD="" |
118 fi | 118 fi |
119 getxt "TrustBridge has been installed to: '%s'\n\n" "${instcfg[PREFIX]}" | 119 getxt "TrustBridge has been installed to: '%s'\n\n" "${instcfg[PREFIX]}" |
120 | 120 |
121 getxt "To remove the application and the root certificates it has inserted,\n" | 121 getxt "To remove the application and the root certificates it has inserted,\n" |
122 getxt "call the deinstall command:\n" | 122 getxt "call the uninstall command:\n" |
123 echo " $RUNCMD ${instcfg[PREFIX]}/bin/trustbridge-deinstall.sh" | 123 echo " $RUNCMD ${instcfg[PREFIX]}/bin/trustbridge-uninstall.sh" |
124 | 124 |
125 echo "#################################################################################" | 125 echo "#################################################################################" |
126 getxt "Press enter to launch '%s'\n" "${instcfg[PREFIX]}/bin/trustbridge" | 126 getxt "Press enter to launch '%s'\n" "${instcfg[PREFIX]}/bin/trustbridge" |
127 getxt "or press Control-C to quit the installer.\n" | 127 getxt "or press Control-C to quit the installer.\n" |
128 if [ $UPDATE -eq 0 ]; then | 128 if [ $UPDATE -eq 0 ]; then |
294 if [ "${oldinstcfg[PREFIX]}" ] ; then | 294 if [ "${oldinstcfg[PREFIX]}" ] ; then |
295 inst_default_prefix="${oldinstcfg[PREFIX]}" | 295 inst_default_prefix="${oldinstcfg[PREFIX]}" |
296 getxt "An existing installation (v%s) was detected!\n" "${oldinstcfg[VERSION]}" | 296 getxt "An existing installation (v%s) was detected!\n" "${oldinstcfg[VERSION]}" |
297 getxt "It is HIGHLY RECOMMENDED to accept the default prefix\n" | 297 getxt "It is HIGHLY RECOMMENDED to accept the default prefix\n" |
298 getxt "to update the current installation.\n" | 298 getxt "to update the current installation.\n" |
299 getxt "For a new prefix you should deinstall first!\n" | 299 getxt "For a new prefix you should uninstall first!\n" |
300 fi | 300 fi |
301 getxt "Select installation prefix for TrustBridge [%s]: " "${inst_default_prefix}" | 301 until [ "${instcfg[PREFIX]}" ] ; do |
302 read -e instcfg[PREFIX] | 302 getxt "Select installation prefix for TrustBridge [%s]: " "${inst_default_prefix}" |
303 | 303 read -e instcfg[PREFIX] |
304 [ -z "${instcfg[PREFIX]}" ] && instcfg[PREFIX]="${inst_default_prefix}" | 304 if echo "${instcfg[PREFIX]}" | grep -q '[~$"\\]' ; then |
305 getxt "\nWARNING: The given path name contains special characters\n" | |
306 getxt "(one or more of %s )\n" "~ $ \" \\" | |
307 getxt "Please note that these characters are not expanded by the installer,\n" | |
308 getxt "the installation directory will be containing these characters verbatim.\n\n" | |
309 getxt "Do you really want to use %s as installation prefix?\n" "${instcfg[PREFIX]}" | |
310 yorn || { instcfg[PREFIX]="" ; continue ; } | |
311 fi | |
312 [ -z "${instcfg[PREFIX]}" ] && instcfg[PREFIX]="${inst_default_prefix}" | |
313 done | |
305 else | 314 else |
306 # Prefix was given on invocation: | 315 # Prefix was given on invocation: |
307 if [ "${oldinstcfg[PREFIX]}" -a \ | 316 if [ "${oldinstcfg[PREFIX]}" -a \ |
308 "${instcfg[PREFIX]}" != "${oldinstcfg[PREFIX]}" -a \ | 317 "${instcfg[PREFIX]}" != "${oldinstcfg[PREFIX]}" -a \ |
309 $FORCE -ne 1 ] ; then | 318 $FORCE -ne 1 ] ; then |