From 84b5452e248e10efffe9e83d0308b8577581b043 Mon Sep 17 00:00:00 2001 From: CyberLeo Date: Mon, 2 May 2011 05:42:35 -0500 Subject: [PATCH] script/makeworld: implement 'verbose' tag to quiet builds; everything is logged anyways --- script/makeworld | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/script/makeworld b/script/makeworld index 91cd79e..3076f82 100755 --- a/script/makeworld +++ b/script/makeworld @@ -12,6 +12,7 @@ pebkac() { echo " -c World configuration (in worlds//)" echo " -s Override source tree selection" echo " -h Help!" + echo " -v Verbose (show build log in real time)" echo "" echo "If, for some reason, you wish to spread out builds across multiple" echo "invocations, these might come in handy:" @@ -68,6 +69,7 @@ prepare() { # Cleanup chroot cleanup() { + [ "${BUILD_VERBOSE}" ] || exec 1>&3 [ "${CHROOT_DIRTY}" -a ! "${CHROOT_CLEAN}" ] && return 0 meh "Cleaning up" umount -f "${build}/mnt" @@ -96,6 +98,11 @@ make_tgts="buildworld buildkernel distrib-dirs installworld installkernel distri ARCH="$(uname -m)" CONF="GENERIC" MAKEOPTS="-j${make_jobs}" +SRCS="" +CHROOT_PREPARE="" +CHROOT_DIRTY="" +CHROOT_CLEAN="" +BUILD_VERBOSE="" while getopts "m:a:c:hpdq" opt do @@ -107,6 +114,7 @@ do p) CHROOT_PREPARE="TRUE" ;; d) CHROOT_DIRTY="TRUE" ;; q) CHROOT_CLEAN="TRUE" ;; + v) BUILD_VERBOSE="TRUE" ;; h) pebkac ;; [?]) pebkac "Unrecognized option ${opt}" ;; esac @@ -176,9 +184,12 @@ meh "DESTDIR=${world}/root" for step in ${sequence} do - meh "==> Step: ${step}" - script "${world}/log/${date}-${step}.log" env -i ${env} chroot "${build}" sh -c \ + build_log="${world}/log/${date}-${step}.log" + meh "==> Step: ${step} -> ${build_log}" + [ "${BUILD_VERBOSE}" ] || exec 3>&1 > /dev/null + script "${build_log}" env -i ${env} chroot "${build}" sh -c \ "cd /usr/src; time make ${MAKEOPTS} ${step} TARGET=${ARCH} KERNCONF=${CONF} DESTDIR=/mnt" || wtf "chroot-cmd ${step}" + [ "${BUILD_VERBOSE}" ] || exec 1>&3 done # Copy the config files into the target, to keep a record of the build options -- 2.42.0