Date: Thu, 25 Jun 2009 13:15:20 +0000 (UTC) From: Nick Hibma <n_hibma@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r194958 - head/tools/tools/nanobsd Message-ID: <200906251315.n5PDFK71052290@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: n_hibma Date: Thu Jun 25 13:15:20 2009 New Revision: 194958 URL: http://svn.freebsd.org/changeset/base/194958 Log: - Make pprint print through fd 3, so it can be used in customisation functions to print something to the screen. - Prefix each line with the running time (bikeshed). Submitted by: Rick van der Zwet (Wireless Leiden) Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Thu Jun 25 13:08:02 2009 (r194957) +++ head/tools/tools/nanobsd/nanobsd.sh Thu Jun 25 13:15:20 2009 (r194958) @@ -664,7 +664,8 @@ late_customize_cmd () { # Print $2 at level $1. pprint() { if [ "$1" -le $PPLEVEL ]; then - printf "%.${1}s %s\n" "#####" "$2" + runtime=$(( `date +%s` - $NANO_STARTTIME )) + printf "%s %.${1}s %s\n" "`date -u -r $runtime +%H:%M:%S`" "#####" "$2" 1>&3 fi } @@ -806,6 +807,10 @@ export NANO_BOOTLOADER ####################################################################### # And then it is as simple as that... +# File descriptor 3 is used for logging output, see pprint +exec 3>&1 + +NANO_STARTTIME=`date +%s` pprint 1 "NanoBSD image ${NANO_NAME} build starting" if $do_world ; then
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906251315.n5PDFK71052290>