diff packaging/linux-installer.inc.in @ 972:8be2f510adbf

(issue91) Make installer architecture aware.
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 28 Aug 2014 17:51:22 +0200
parents 15f7b3ebf21b
children f5306f8c02f3
line wrap: on
line diff
--- a/packaging/linux-installer.inc.in	Thu Aug 28 15:03:10 2014 +0200
+++ b/packaging/linux-installer.inc.in	Thu Aug 28 17:51:22 2014 +0200
@@ -20,6 +20,7 @@
 HELPNAMES_SOURCES="###HELPNAMES_SOURCES###"
 HELPNAMES_STATIC="###HELPNAMES_STATIC###"
 HELPNAMES_IMG="###HELPNAMES_IMG###"
+ARCH="###ARCH###"
 
 declare -A instcfg oldinstcfg
 declare inst_default_prefix instdata_path instcfg_path instcfg_file
@@ -177,6 +178,7 @@
   fi
   instcfg_file="${instcfg_path}/${INSTCFGNAME}"
   extra_bin_path=`mktemp --tmpdir -d tmpbin.XXXXXXXXXX`
+  HOST_ARCH=$(uname -m)
 }
 
 cleanup()
@@ -501,11 +503,27 @@
 ------------------------------------------------------------------------
 
    TrustBridge - Installer
-   Version ${instcfg[VERSION]} (Testversion)
+   Version ${instcfg[VERSION]} - ${ARCH} (Testversion)
 
 ------------------------------------------------------------------------
 EOF
 
+if [ "$ARCH" == "x86_64" -a "$ARCH" != "$HOST_ARCH" ]; then
+    getxt "It appears your system architecture is %s.\n" "$HOST_ARCH"
+    getxt "This installer is for 64 bit systems.\n"
+    getxt "Really install TrustBridge for '%s' systems? [y/n]\n" "${ARCH}"
+    yorn || exit 0
+fi
+
+if [ "$ARCH" == "i386" ]; then
+    if [[ "$HOST_ARCH" != *86 ]]; then
+        getxt "It appears your system architecture is %s.\n" "$HOST_ARCH"
+        getxt "This installer is for 32 bit systems.\n"
+        getxt "Really install TrustBridge for '%s' systems? [y/n]\n" "${ARCH}"
+        yorn || exit 0
+    fi
+fi
+
 if [ $DEINSTALL -eq 1 ] ; then
     deinstall
     # Stop after deinstallation:

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