Changeset 1616

Show
Ignore:
Timestamp:
06/01/06 23:46:51 (3 years ago)
Author:
proski
Message:

Improve error reporting, create function die() for that purpose

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/patches/install.sh

    r1603 r1616  
    77 
    88set -e 
     9 
     10die() 
     11{ 
     12        echo "FATAL ERROR: $1" >&2 
     13        exit 1 
     14} 
    915 
    1016DEPTH=.. 
     
    1824        KERNEL_PATH="/lib/modules/${KERNEL_VERSION}/build" 
    1925else 
    20         echo "Cannot guess kernel source location" 
    21         exit 1 
     26        die "Cannot guess kernel source location" 
    2227fi 
    2328fi 
     
    5055# 
    5156SRC_HAL=${HAL:-${DEPTH}/hal} 
    52 test -d ${SRC_HAL} || { echo "No hal directory ${SRC_HAL}!"; exit 1; } 
     57test -d ${SRC_HAL} || die "No hal directory ${SRC_HAL}" 
    5358SRC_NET80211=${WLAN:-${DEPTH}/net80211} 
    54 test -d ${SRC_NET80211} || 
    55         { echo "No net80211 directory ${SRC_NET80211}!"; exit 1; } 
     59test -d ${SRC_NET80211} || die "No net80211 directory ${SRC_NET80211}" 
    5660SRC_ATH=${ATH:-${DEPTH}/ath} 
    57 test -d ${SRC_ATH} || { echo "No ath directory ${SRC_ATH}!"; exit 1; } 
     61test -d ${SRC_ATH} || die "No ath directory ${SRC_ATH}" 
    5862SRC_ATH_RATE=${DEPTH}/ath_rate 
    5963test -d ${SRC_ATH_RATE} || 
    60         { echo "No rate control algorithm directory ${SRC_ATH_RATE}!"; exit 1; } 
     64        die "No rate control algorithm directory ${SRC_ATH_RATE}" 
    6165SRC_COMPAT=${DEPTH}/include 
    62 test -d ${SRC_COMPAT} || { echo "No compat directory ${SRC_COMPAT}!"; exit 1; } 
     66test -d ${SRC_COMPAT} || die "No compat directory ${SRC_COMPAT}" 
    6367 
    6468WIRELESS=${KERNEL_PATH}/drivers/net/wireless 
    65 test -d ${WIRELESS} || { echo "No wireless directory ${WIRELESS}!"; exit 1; } 
     69test -d ${WIRELESS} || die "No wireless directory ${WIRELESS}" 
    6670 
    6771if test -f ${WIRELESS}/Kconfig; then 
     
    7276        kbuildconf=Config.in 
    7377else 
    74         echo "Kernel build system is not supported" 
    75         echo 1 
     78        die "Kernel build system is not supported" 
    7679fi 
    7780fi