Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Mar 2014 19:46:19 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r263187 - head/tools/tools/nanobsd
Message-ID:  <201403141946.s2EJkJBW056020@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Fri Mar 14 19:46:18 2014
New Revision: 263187
URL: http://svnweb.freebsd.org/changeset/base/263187

Log:
  Print an error message when we exit out early.
  
  PR: 136889
  Submitted by: Aragon Gouveia

Modified:
  head/tools/tools/nanobsd/nanobsd.sh

Modified: head/tools/tools/nanobsd/nanobsd.sh
==============================================================================
--- head/tools/tools/nanobsd/nanobsd.sh	Fri Mar 14 19:45:40 2014	(r263186)
+++ head/tools/tools/nanobsd/nanobsd.sh	Fri Mar 14 19:46:18 2014	(r263187)
@@ -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
 #



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403141946.s2EJkJBW056020>