X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=stage0%2Fstage0-install;h=fe9b2f741d831268d2a9517bdf5732edf63671ab;hb=81b44564a13cf0bf396398a274d8346206c09865;hp=20d1f7bc67166fc3e59ef142cf9c8cf34644b785;hpb=f9cf3632a64429991fa5e6f556b0c4017e0e9435;p=hvlinux.git diff --git a/stage0/stage0-install b/stage0/stage0-install index 20d1f7b..fe9b2f7 100755 --- a/stage0/stage0-install +++ b/stage0/stage0-install @@ -1,8 +1,20 @@ -#!/bin/sh -set -o errexit +#!/bin/bash LFS_STAGE=stage0 +# Let shell functions inherit ERR trap. Same as `set -E'. +set -o errtrace + +# Setting ERR trap does implicit `set -o errexit'. +trap myerr ERR + +function myerr() +{ + echo + echo "*** An error occured during ${LFS_STAGE}" + exit 1 +} + # Reading system configuration informations, functions and package versions. source ../sysinfos source ../functions @@ -21,11 +33,6 @@ echo "Performing pre-install" # directory of the user. su - lfs -c "cd ${PWD}; ./install-1" -if [ $? -ne 0 ]; then - echo "*** An error occured during ${LFS_STAGE}" - exit 1 -fi - echo "Total build time: $(get_total_build_time ${LFS_LOG_FILE})h" exit 0