Changeset bbcdeab for jhalfs


Ignore:
Timestamp:
10/30/2013 03:44:46 PM (10 years ago)
Author:
Pierre Labastie <pierre@…>
Branches:
2.4, ablfs-more, legacy, new_features, trunk
Children:
ef32ce5
Parents:
b81c951
Message:

Handle errors while installing blfs tools and makes the error
message more accurate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • jhalfs

    rb81c951 rbbcdeab  
    22# $Id$
    33set -e
     4# Pass trap handlers to functions
     5set -E
    46
    57# VT100 colors
     
    3840  # If +e then disable text output
    3941  if [[ "$-" =~ e ]]; then
    40     echo -e "\n${RED}ERROR:${GREEN} basic error trapped!${OFF}\n" >&2
    41   fi
     42    LASTLINE="$1"
     43    LASTERR="$2"
     44    LASTFUNC="$3"
     45    LASTSOURCE="$4"
     46#    echo -e "\n${RED}ERROR:${GREEN} basic error trapped!${OFF}\n" >&2
     47    echo -e "\n${RED}ERROR:${GREEN} Error $LASTERR at $LASTSOURCE line ${LASTLINE}!${OFF}\n" >&2
     48  fi
     49  exit $LASTERR
    4250}
    4351
     
    5866set -e
    5967trap see_ya 0
    60 trap simple_error ERR
     68trap 'simple_error "${LINENO}" "$?" "${FUNCNAME}" "${BASH_SOURCE}"' ERR
    6169trap 'echo -e "\n\n${RED}INTERRUPT${OFF} trapped\n" &&  exit 2'  1 2 3 15 17 18 23
    6270#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
     
    375383    echo '(may take some time...)'
    376384    install_blfs_tools 2>&1 | tee -a $LOGDIR/$LOG
     385    [[ ${PIPESTATUS[0]} != 0 ]] && exit 1
    377386  fi
    378387  #
Note: See TracChangeset for help on using the changeset viewer.