X-Git-Url: http://popeye.lapinbilly.eu/git/?p=fbsd-stable-mgmt.git;a=blobdiff_plain;f=update_stage0.sh;fp=update_stage0.sh;h=40bb517f6884bca624e0bdd7c02186be73aa0c97;hp=2a299b585a93910c75248a2fa02bfc549202a223;hb=53c05a1bbd3e8aca4b111f99faf45732fb258110;hpb=a334edfe5246e8c012e02fac0db3b8b0e0ecfa23 diff --git a/update_stage0.sh b/update_stage0.sh index 2a299b5..40bb517 100755 --- a/update_stage0.sh +++ b/update_stage0.sh @@ -2,6 +2,7 @@ usage() { echo 'Usage: ...' + echo '-c clean obj' echo '-u svn update' echo '-j jobs to be handled' echo 'default to ' ${jarg} @@ -11,11 +12,14 @@ usage() { parse() { RED='\033[0;31m' NC='\033[0m' # No Color - while getopts "uj:" option + while getopts "cuj:" option do case ${option} in + c) + CLEANING=1 + ;; u) - update="1" + UPDATE=1 ;; j) case ${OPTARG} in @@ -42,13 +46,20 @@ else parse ${*} fi -[ ${update} ] && svn update /usr/src +if [ ${UPDATE:=-0} -eq 1 ]; then + echo "updating ..." + svn update /usr/src + [ ${?} == 1 ] && exit 1 +fi + + +if [ ${CLEANING:=-0} -eq 1 ]; then + echo Cleaning + chflags -R noschg /usr/obj/* && sync && rm -rf /usr/obj && sync +fi -echo Cleaning -chflags -R noschg /usr/obj/* && rm -rf /usr/obj echo building process on ${jarg} jobs -cd /usr/src && \ -make -j${jarg} buildworld && make -j${jarg} kernel KERNCONF=PEPINS && \ -echo "Reboot the system." +cd /usr/src && make -j${jarg} buildworld && make -j${jarg} kernel KERNCONF=PEPINS \ + && echo "Reboot the system."