changeset 878:ad3b32a7375f

merge
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 07 Aug 2014 19:13:46 +0200
parents ccbc74ad855f (current diff) ce7c4d07d4aa (diff)
children 59fc7ececa5f
files
diffstat 2 files changed, 51 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/packaging/linux-installer.inc.in	Thu Aug 07 19:13:32 2014 +0200
+++ b/packaging/linux-installer.inc.in	Thu Aug 07 19:13:46 2014 +0200
@@ -171,7 +171,13 @@
     autostart_path=${XDG_CONFIG_HOME:-~/.config/autostart}
     startmenu_path=${XDG_DATA_HOME:-~/.local/share/applications}
   fi
-    instcfg_file="${instcfg_path}/${INSTCFGNAME}"
+  instcfg_file="${instcfg_path}/${INSTCFGNAME}"
+  extra_bin_path=`mktemp --tmpdir -d tmpbin.XXXXXXXXXX`
+}
+
+cleanup()
+{
+  rm -rf "$extra_bin_path"
 }
 
 write_instcfg()
@@ -392,6 +398,38 @@
   write_autostart "${autostart_path}/trustbridge.desktop"
 }
 
+provide_uudecode_maybe()
+{
+  # The shar needs uudecode, which might not be installed.  If its not
+  # available we will provide our own python based implementation.
+  if which uudecode >/dev/null 2>&1 ; then
+      getxt "Found system uudecode.\n"
+  else
+    local myuudecode="$extra_bin_path/uudecode"
+    cat >"$myuudecode" <<EOF
+#!/usr/bin/python2
+import os
+import sys
+import uu
+os.path.chmod = os.chmod
+def rm_if_exists(file):
+    try:
+        os.remove(file)
+    except OSError:
+        pass
+os.path.exists = rm_if_exists
+if len(sys.argv) > 1:
+    f = open(sys.argv[1], 'r')
+else:
+    f = sys.stdin
+uu.decode(f, None, None, 1)
+EOF
+    chmod 755 "$myuudecode"
+    PATH="${extra_bin_path}:$PATH"
+    getxt "Using python uudecode provided by installer.\n"
+  fi
+}
+
 #======================================================================
 # main()
 
@@ -444,6 +482,9 @@
     install -d "${instcfg[PREFIX]}" || fatal "Could not create '%s'!\n" "${instcfg[PREFIX]}"
 fi
 
+getxt "checking for uudecode ...\n"
+provide_uudecode_maybe
+
 getxt "unpacking files ...\n"
 cd "${instcfg[PREFIX]}"
 
@@ -469,4 +510,7 @@
 
 getxt "Writing installation configuration to: %s ...\n" "$instcfg_file"
 write_instcfg
+
+getxt "Cleaning up temporary stuff ...\n"
+cleanup
 exit 0
--- a/packaging/linux-installer.l10n-de	Thu Aug 07 19:13:32 2014 +0200
+++ b/packaging/linux-installer.l10n-de	Thu Aug 07 19:13:46 2014 +0200
@@ -8,6 +8,7 @@
   ["  -s, --system       create a system wide (de)installation\n"]="  -s, --system       eine systemweite (De)Installation durchführen\n"
   ["An existing installation (v%s) was detected!\n"]="Es wurde eine vorhandene Installation (v%s) gefunden!\n"
   ["Answer [Y]es or [N]o:\n"]="Bitte [J]a oder [N]ein eingeben:\n"
+  ["Cleaning up temporary stuff ...\n"]="Räume temporäre Dateien auf ...\n"
   ["Could not create '%s'!\n"]="Konnte '%s' nicht erstellen!\n"
   ["Deinstallation failed.\n"]="Deinstallation fehlgeschlagen.\n"
   ["Deinstallation finished.\n"]="Deinstallation abgeschlossen.\n"
@@ -17,6 +18,7 @@
   ["Failed to create autostart directory: '%s'\n"]="Konnte das autostart-Verzeichnis '%s' nicht erstellen\n"
   ["Failed to create startmenu directory: '%s'\n"]="Konnte das Startmenü-Verzeichnis '%s' nicht erstellen\n"
   ["For a new prefix you should deinstall first!\n"]="Um einen neuen Installations-Pfad zu verwenden bitte erst deinstallieren!\n"
+  ["Found system uudecode.\n"]="System uudecode gefunden.\n"
   ["Install TrustBridge.\n\n"]="Installiere TrustBridge.\n\n"
   ["Installation failed.\n"]="Installation fehlgeschlagen.\n"
   ["Installing to '%s':\n"]="Installiere in '%s':\n"
@@ -30,21 +32,23 @@
   ["Really deinstall TrustBridge from '%s'? [y/n]\n"]="Soll TrustBridge wirklich aus '%s' deinstalliert werden? [j/n]\n"
   ["Removing PID file from: %s:\n"]="Entferne PID-File aus: %s\n"
   ["Removing TrustBridge from autostart\n"]="Entferne TrustBridge aus autostart\n"
-  ["Removing TrustBridge from startmenu\n"]="Entferne TrustBridge aus dem Startmenü\n"
+  ["Removing TrustBridge from start menu\n"]="Entferne TrustBridge aus dem Startmenü\n"
   ["Removing certificate lists from: %s:\n"]="Entferne Zertifikatsliste aus: %s\n"
   ["Removing configuration files:\n"]="Entferne Konfigurationsdateien:\n"
   ["Removing cron job ...\n"]="Entferne den Cron-Job ...\n"
   ["Select installation prefix for TrustBridge [%s]: "]="Installations-Pfad für TrustBridge [%s]: "
   ["Setting up autostart ...\n"]="Konfiguriere autostart ...\n"
-  ["Setting up startmenu...\n"]="Konfiguriere Startmenü ...\n"
   ["Setting up cronjob ...\n"]="Konfiguriere den Cron-Job ...\n"
+  ["Setting up start menu entries ...\n"]="Konfiguriere Startmenü-Einträge...\n"
   ["System wide installation requires root privileges!\n"]="Für die systemweite Installation werden root-Rechte benötigt!\n"
   ["Uninstalling certificates ...\n"]="Deinstalliere Zertifikate ...\n"
   ["Usage: %s [OPTION]...\n"]="Aufruf:  %s [OPTION]...\n"
   ["Using certificate list '%s'.\n"]="Die Zertifikatsliste '%s' wird verwendet.\n"
+  ["Using python uudecode provided by installer.\n"]="Verwende vom Installer bereitgestelltes python uudecode.\n"
   ["WARNING: Could not delete: '%s'!\n"]="WARNUNG: Konnte '%s' nicht löschen!\n"
   ["WARNING: can't execute %s for certificate deinstallation.\n"]="WARNUNG: '%s' kann nicht zum deinstallieren der Zertifikate ausgeführt werden.\n"
   ["Writing installation configuration to: %s ...\n"]="Schreibe Installationskonfiguration nach: %s ...\n"
+  ["checking for uudecode ...\n"]="Prüfe uudecode ...\n"
   ["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"

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