[PATCH 1 of 2] (issue91) Make installer architecture aware
Wald Commits
scm-commit at wald.intevation.org
Thu Aug 28 17:51:42 CEST 2014
# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1409241082 -7200
# Node ID 8be2f510adbfbc2abbfbd84f8173408ef1c75faf
# Parent d3258a6faedd44fbc1aa6a148b086254cb9b6298
(issue91) Make installer architecture aware.
diff -r d3258a6faedd -r 8be2f510adbf packaging/create-dist-package.sh.in
--- a/packaging/create-dist-package.sh.in Thu Aug 28 15:03:10 2014 +0200
+++ b/packaging/create-dist-package.sh.in Thu Aug 28 17:51:22 2014 +0200
@@ -27,10 +27,10 @@
cd @CMAKE_SOURCE_DIR@/build-i386
echo "Building x86 package"
make -j`nproc`
-/bin/bash packaging/linux-createpackage.sh
+/bin/bash packaging/linux-createpackage.sh i386
cd @CMAKE_BINARY_DIR@
echo "Building amd64 package"
-/bin/bash packaging/linux-createpackage.sh
+/bin/bash packaging/linux-createpackage.sh x86_64
mkdir -p $TMPDIR/linux
mkdir -p $TMPDIR/windows
mv @CMAKE_BINARY_DIR@/TrustBridge- at PROJECT_VERSION@.sh \
diff -r d3258a6faedd -r 8be2f510adbf packaging/linux-createpackage.sh.in
--- a/packaging/linux-createpackage.sh.in Thu Aug 28 15:03:10 2014 +0200
+++ b/packaging/linux-createpackage.sh.in Thu Aug 28 17:51:22 2014 +0200
@@ -9,12 +9,20 @@
TMPDIR=$(mktemp -d)
TMPSHAR=$(mktemp "@CMAKE_BINARY_DIR@/shar.XXXXXXXXXX")
+ARCH="$1"
+
+if [ "$ARCH" != "i386" -a "$ARCH" != "x86_64" ]; then
+ echo "Usage $0 <architecture>"
+ echo "with archtiecture either i386 or x86_64"
+fi
+
INSTALLER="@CMAKE_BINARY_DIR@/TrustBridge- at PROJECT_VERSION@.sh"
EXEFILES=("@CMAKE_BINARY_DIR@/cinst/cinst"
"@CMAKE_BINARY_DIR@/cinst/mozilla"
"@CMAKE_BINARY_DIR@/ui/trustbridge"
"@CMAKE_BINARY_DIR@/ui/trustbridge-tray-starter.sh")
+
ICON="@CMAKE_SOURCE_DIR@/ui/img/logo-128.png"
HELPFILES=$(find @CMAKE_BINARY_DIR@/manuals/help-manual/html \
-maxdepth 1 -type f -printf "%p \n")
@@ -74,6 +82,7 @@
sed -i "s/###HELPNAMES_SOURCES###/${helpnames_sources}/" "$INSTALLER"
sed -i "s/###HELPNAMES_STATIC###/${helpnames_static}/" "$INSTALLER"
sed -i "s/###HELPNAMES_IMG###/${helpnames_img}/" $INSTALLER
+sed -i "s/###ARCH###/${ARCH}/" $INSTALLER
chmod +x "$INSTALLER"
echo "Signing"
diff -r d3258a6faedd -r 8be2f510adbf packaging/linux-installer.inc.in
--- 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:
diff -r d3258a6faedd -r 8be2f510adbf packaging/linux-installer.l10n-de
--- a/packaging/linux-installer.l10n-de Thu Aug 28 15:03:10 2014 +0200
+++ b/packaging/linux-installer.l10n-de Thu Aug 28 17:51:22 2014 +0200
@@ -52,4 +52,8 @@
["creating installation directory ...\n"]="lege das Installations-Verzeichnis an ...\n"
["to update the current installation.\n"]="um die vorhandene Installation zu aktualisieren.\n"
["unpacking files ...\n"]="Entpacke Dateien ...\n"
+ ["It appears your system architecture is %s.\n"]="Dieses System scheint eine %s Architektur zu besitzen.\n"
+ ["This installer is for 64 bit systems.\n"]="Dieses Installationspaket ist für 64 bit Systeme.\n"
+ ["This installer is for 32 bit systems.\n"]="Dieses Installationspaket ist für 32 bit Systeme.\n"
+ ["Really install TrustBridge for '%s' systems? [y/n]\n"]="Soll TrustBridge für '%s' wirklich installiert werden? [j/n]\n"
)
diff -r d3258a6faedd -r 8be2f510adbf ui/l10n/trustbridge_de_DE.ts
--- a/ui/l10n/trustbridge_de_DE.ts Thu Aug 28 15:03:10 2014 +0200
+++ b/ui/l10n/trustbridge_de_DE.ts Thu Aug 28 17:51:22 2014 +0200
@@ -129,7 +129,7 @@
</message>
<message>
<location filename="../mainwindow.cpp" line="462"/>
- <location filename="../mainwindow.cpp" line="590"/>
+ <location filename="../mainwindow.cpp" line="591"/>
<source>Check for Updates</source>
<translation type="unfinished"></translation>
</message>
More information about the Trustbridge-commits
mailing list