X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=stage0%2Fstage0-install;h=fe9b2f741d831268d2a9517bdf5732edf63671ab;hb=97b938a7a341fe0d45ba4f93ce9e785b2bdc182a;hp=c358247d5573dd1cf0d59481b0215ece4e6eddd1;hpb=e31a492ed6daa2caeb62aa9ce355c988a62672df;p=hvlinux.git diff --git a/stage0/stage0-install b/stage0/stage0-install index c358247..fe9b2f7 100755 --- a/stage0/stage0-install +++ b/stage0/stage0-install @@ -1,8 +1,20 @@ #!/bin/bash -set -o errexit 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