From 54d2d0eb5dae74dc0862548d8711f11808f17332 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Fri, 14 Mar 2014 19:46:18 +0000 Subject: [PATCH] Print an error message when we exit out early. PR: 136889 Submitted by: Aragon Gouveia --- tools/tools/nanobsd/nanobsd.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/tools/nanobsd/nanobsd.sh b/tools/tools/nanobsd/nanobsd.sh index 388ef86b4f5e..ed68f05585d0 100644 --- a/tools/tools/nanobsd/nanobsd.sh +++ b/tools/tools/nanobsd/nanobsd.sh @@ -167,6 +167,13 @@ NANO_DATADIR="" # ####################################################################### +nano_cleanup ( ) ( + if [ $? -ne 0 ]; then + echo "Error encountered. Check for errors in last log file." 1>&2 + fi + exit $? +) + clean_build ( ) ( pprint 2 "Clean and create object directory (${MAKEOBJDIRPREFIX})" @@ -576,7 +583,8 @@ create_i386_diskimage ( ) ( fi mdconfig -d -u $MD - trap - 1 2 15 EXIT + trap - 1 2 15 + trap nano_cleanup EXIT ) > ${NANO_OBJ}/_.di 2>&1 ) @@ -929,6 +937,8 @@ if [ $# -gt 0 ] ; then usage fi +trap nano_cleanup EXIT + ####################################################################### # Setup and Export Internal variables #