Changeset 2425

Show
Ignore:
Timestamp:
12/29/07 16:38:19 (1 year ago)
Author:
taj
Message:

Sat Dec 29 21:33:12 UTC 2007 Taj Morton <tajmorton@gmail.com>

  • share/apkg-bashlib: Add errorMessage() function for displaying warnings in a GUI dialog or the
    shell. This function is private until 1.3.
  • share/installer.[2].template: Tell users they have to install the 32-bit compat libs when attempting to
    install Autopackage on a 64-bit system.
  • makepackage: Substitute %ErrorMessage?% in installer.[?].template.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • main/trunk/ChangeLog

    r2423 r2425  
     1Sat Dec 29 21:33:12 UTC 2007  Taj Morton  <tajmorton@gmail.com> 
     2        * share/apkg-bashlib: Add errorMessage() function for displaying warnings in a GUI dialog or the 
     3          shell. This function is private until 1.3. 
     4        * share/installer.[2].template: Tell users they have to install the 32-bit compat libs when attempting to 
     5          install Autopackage on a 64-bit system. 
     6        * makepackage: Substitute %ErrorMessage% in installer.[?].template. 
     7 
    18Wed Sep  5 01:31:23 UTC 2007  Curtis L. Knight  <knighcl@gmail.com> 
    29        * release/autopackage-install: Add XDG variables scoped for autopackage. 
  • main/trunk/makepackage

    r2415 r2425  
    874874        installer=`substituteCode "$autopackage_share/apkg-bashlib" "START LOCATECOMMAND" "END LOCATECOMMAND" "$installer" "%LocateCommand%"` 
    875875        installer=`substituteCode "$autopackage_share/apkg-bashlib" "START MESSAGE" "END MESSAGE" "$installer" "%Message%"` 
     876        installer=`substituteCode "$autopackage_share/apkg-bashlib" "START ERRORMESSAGE" "END ERRORMESSAGE" "$installer" "%ErrorMessage%"` 
    876877 
    877878        downloader=`substituteCode "$autopackage_share/apkg-funclib" "START INSTALLAUTOPACKAGE" "END INSTALLAUTOPACKAGE" "$downloader" "%InstallAutopackage%"` 
  • main/trunk/share/apkg-bashlib

    r2318 r2425  
    969969## END MESSAGE 
    970970 
     971# Usage: errorMessage <MESSAGE> <TITLE> 
     972## START ERRORMESSAGE 
     973## Function is substituted from apkg-bashlib. 
     974## This function is PRIVATE until 1.3 (because it's new). 
     975function errorMessage() { 
     976        if ! tty -s; then 
     977                # there is no tty 
     978                if [[ "$DISPLAY" == "" ]] || ! xdpyinfo &>/dev/null; then     # check for X 
     979                        # we're not in X, so just echo (we might be in a headless script) 
     980                        echo "$1" 
     981                else 
     982                        # we ARE in X, and there is no TTY; started from a gui file manager 
     983                        if command -v zenity &>/dev/null; then 
     984                                zenity --error "--text=$1" "--title=$2" 
     985                        elif command -v gdialog &>/dev/null; then 
     986                                gdialog --msgbox "$1" 100 100 
     987                        elif command -v kdialog &>/dev/null; then 
     988                                kdialog --error "$1" --title "$2" 
     989                        elif command -v xmessage &>/dev/null; then 
     990                                xmessage "$1" 
     991                        else 
     992                                local DIALOG= 
     993                                DIALOG=`command -v dialog 2>/dev/null` || DIALOG=`command -v gdialog 2>/dev/null` || DIALOG=`command -v whiptail 2>/dev/null` 
     994                                if [[ "$DIALOG" != "" ]]; then 
     995                                        # No graphical dialog; fallback to terminal showing a dialog 
     996                                        launchInTerminal --title "$2" $DIALOG --msgbox "$1" 17 65 
     997                                else 
     998                                        local msg=`escapeFilename "$1"` 
     999                                        launchInTerminal --title "$2" bash -c "echo $msg; read" 
     1000                                fi 
     1001                        fi 
     1002                fi 
     1003        else 
     1004                # else there is a tty, ie we're in an xterm or the standard console 
     1005                # so just use echo 
     1006                echo "$1" 
     1007        fi 
     1008} 
     1009## END ERRORMESSAGE 
     1010 
    9711011 
    9721012## 
  • main/trunk/share/installer.2.template

    r2415 r2425  
    2222 
    2323%Message% 
     24 
     25%ErrorMessage% 
     26 
     27# are we on 32bit (or 64bit + compat libs?) 
     28locateCommand uname 
     29cpu_architecture=`"$lc_location" -m` 
     30case "$cpu_architecture" in 
     31        i386 | i486 | i586 | i686 ) 
     32                export cpu_architecture="x86";; 
     33esac 
     34 
     35if [[ "$cpu_architecture" != "x86" ]]; then 
     36        if [ ! -d /usr/lib32 ]; then 
     37                errorMessage "Sorry, Autopackage only supports x86 32-bit systems, or 64-bit systems with compatibility libraries installed. Please install the compatibility libraries and rerun install." "Error Installing Autopackage" 
     38                rm -rf "$WORKING_DIRECTORY" 
     39                exit 1 
     40        fi 
     41fi 
    2442 
    2543# setup XDG configuration variables scoped for autopackage 
  • main/trunk/share/installer.template

    r2415 r2425  
    2222 
    2323%Message% 
     24 
     25%ErrorMessage% 
     26 
     27# are we on 32bit (or 64bit + compat libs?) 
     28locateCommand uname 
     29cpu_architecture=`"$lc_location" -m` 
     30case "$cpu_architecture" in 
     31        i386 | i486 | i586 | i686 ) 
     32                export cpu_architecture="x86";; 
     33esac 
     34 
     35if [[ "$cpu_architecture" != "x86" ]]; then 
     36        if [ ! -d /usr/lib32 ]; then 
     37                errorMessage "Sorry, Autopackage only supports x86 32-bit systems, or 64-bit systems with compatibility libraries installed. Please install the compatibility libraries and rerun install." "Error Installing Autopackage" 
     38                rm -rf "$WORKING_DIRECTORY" 
     39                exit 1 
     40        fi 
     41fi 
    2442 
    2543# setup XDG configuration variables scoped for autopackage