First issue
[fbsd-stable-mgmt.git] / update_stagep.sh
diff --git a/update_stagep.sh b/update_stagep.sh
new file mode 100755 (executable)
index 0000000..ed637bd
--- /dev/null
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+usage() {
+       echo 'Usage: ...'
+       echo '-u        svn update'
+       echo '-j        jobs to be handled'
+       echo 'default to ' ${jarg}
+       echo '---------------------'
+}
+
+parse() {
+       RED='\033[0;31m'
+       NC='\033[0m' # No Color
+       while getopts "uj:" option 
+       do
+               case ${option} in
+                       u)
+                               update="1"
+                               ;;
+                       j)
+                               case ${OPTARG} in 
+                               (*[!0-9]*|'') 
+                                       echo -e "${RED}number expected for jobs${NC}; default value used."
+                                       ;;
+                               (*) 
+                                       jarg=${OPTARG} 
+                                       ;;
+                               esac
+                               ;;
+               esac
+       done
+}
+
+
+jarg=`sysctl -n hw.ncpu`
+
+
+if [ $? -ne 0 ] 
+then 
+       usage 
+else
+       parse ${*} 
+fi
+
+echo "Updating port Tree"
+
+[ ${update} ] && poudriere ports -p HEAD -u
+
+echo "building lapinbilly"
+
+poudriere bulk -J ${jarg} -j lapinbilly -p HEAD -f /usr/local/etc/poudriere.d/port-list
+
+echo "building llanura"
+
+poudriere bulk -J ${jarg} -j release11 -p HEAD -f /usr/local/etc/poudriere.d/port-list-llanura