From ca75b3f8b6cbdc6448aae6c89c2d058b55a785ce Mon Sep 17 00:00:00 2001 From: David Marec Date: Fri, 1 Jan 2021 11:12:53 +0100 Subject: [PATCH] update by default --- update_stage0.sh | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/update_stage0.sh b/update_stage0.sh index 08e5a67..76f3a61 100755 --- a/update_stage0.sh +++ b/update_stage0.sh @@ -12,27 +12,25 @@ usage() { parse() { RED='\033[0;31m' NC='\033[0m' # No Color - while getopts "cuj:" option + while getopts "cnj:" option do case ${option} in c) CLEANING=1 ;; - u) + n) UPDATE=1 ;; j) - case ${OPTARG} in - (*[!0-9]*|'') + case ${OPTARG} in + (*[!0-9]*|'') echo -e "${RED}number expected for jobs${NC}; default value used." ;; - (*) - jarg=${OPTARG} + (*) + jarg=${OPTARG} ;; esac ;; - *) - usage;; esac done } @@ -41,21 +39,22 @@ parse() { jarg=`sysctl -n hw.ncpu` usrsrc=${USRSRC:-/usr/src} -parse ${*} +parse ${*} -if [ ${UPDATE:=-0} -eq 1 ]; then - echo "updating ..." +if [ ${UPDATE:=-0} -eq 0 ]; then + echo "updating ..." git -C ${usrsrc} pull --rebase [ ${?} == 1 ] && exit 1 fi -if [ ${CLEANING:=-0} -eq 1 ]; then +if [ ${CLEANING:=-0} -eq 1 ]; then echo Cleaning chflags -R noschg /usr/obj/* && sync && rm -rf /usr/obj && sync fi echo building process on ${jarg} jobs -make -C ${usrsrc} -j${jarg} buildworld && make -C ${usrsrc} -j${jarg} kernel KERNCONF=PEPINS \ +make -j${jarg} -C ${usrsrc} buildworld && make -j${jarg} -C ${usrsrc} kernel \ && echo "Reboot the system." + -- 2.44.0