diff packaging/linux-installer.inc @ 1173:7282def018bc

Warn if installation path contains suspicious special characters.
author Sascha Wilde <wilde@intevation.de>
date Fri, 19 Sep 2014 17:32:14 +0200
parents d51ae656cfd6
children 53a02fbe2fc9
line wrap: on
line diff
--- a/packaging/linux-installer.inc	Fri Sep 19 15:27:19 2014 +0200
+++ b/packaging/linux-installer.inc	Fri Sep 19 17:32:14 2014 +0200
@@ -298,10 +298,19 @@
         getxt "to update the current installation.\n"
         getxt "For a new prefix you should deinstall first!\n"
     fi
-    getxt "Select installation prefix for TrustBridge [%s]: " "${inst_default_prefix}"
-    read -e instcfg[PREFIX]
-
-    [ -z "${instcfg[PREFIX]}" ] && instcfg[PREFIX]="${inst_default_prefix}"
+    until [ "${instcfg[PREFIX]}" ] ; do
+      getxt "Select installation prefix for TrustBridge [%s]: " "${inst_default_prefix}"
+      read -e instcfg[PREFIX]
+      if echo "${instcfg[PREFIX]}" | grep -q '[~$"\\]' ; then
+          getxt "\nWARNING: The given path name contains special characters\n"
+          getxt "(one or more of %s )\n" "~ $ \" \\"
+          getxt "Please note that these characters are not expanded by the installer,\n"
+          getxt "the installation directory will be containing these characters verbatim.\n\n"
+          getxt "Do you really want to use %s as installation prefix?\n" "${instcfg[PREFIX]}"
+          yorn || { instcfg[PREFIX]="" ; continue ; }
+      fi
+      [ -z "${instcfg[PREFIX]}" ] && instcfg[PREFIX]="${inst_default_prefix}"
+    done
 else
   # Prefix was given on invocation:
   if [ "${oldinstcfg[PREFIX]}" -a \

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