Ticket #45: 64bit-detection.diff

File 64bit-detection.diff, 4.4 kB (added by taj, 1 year ago)

64-bit Detection and Warning

  • makepackage

    old new  
    873873        installer=`substituteCode "$autopackage_share/apkg-bashlib" "START LAUNCHINTERMINAL" "END LAUNCHINTERMINAL" "$installer" "%LaunchInTerminal%"` 
    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%"` 
    878879        downloader=`substituteCode "$autopackage_share/apkg-bashlib" "START YESNO" "END YESNO" "$downloader" "%YesNo%"` 
  • share/apkg-bashlib

    old new  
    968968} 
    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 
    9711010 
     1011 
    9721012## 
    9731013# haveWriteAccess <DIRECTORY> 
    9741014# DIRECTORY: The directory name. 
  • share/installer.2.template

    old new  
    2222 
    2323%Message% 
    2424 
     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 
     42 
    2543# setup XDG configuration variables scoped for autopackage 
    2644# 
    2745#   AUTOPACKAGE_CONFIG_HOME     User configuration directory 
  • share/installer.template

    old new  
    2222 
    2323%Message% 
    2424 
     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 
     42 
    2543# setup XDG configuration variables scoped for autopackage 
    2644# 
    2745#   AUTOPACKAGE_CONFIG_HOME     User configuration directory