From 592d3b6953a57b5a2ed575ab0676cc5a0b10c40a Mon Sep 17 00:00:00 2001 From: thierry Date: Mon, 14 Jul 2008 10:19:24 +0000 Subject: [PATCH] options for selecting trunk or branch --- scripts/all-builds.sh | 69 ++++++++++++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 23 deletions(-) diff --git a/scripts/all-builds.sh b/scripts/all-builds.sh index 1d82ddb..e016379 100755 --- a/scripts/all-builds.sh +++ b/scripts/all-builds.sh @@ -11,11 +11,28 @@ function usage () { echo "In manual mode you should export the following vars (or use related option)" echo "MAJOR_DISTROS (-d) TRUNK_DISTROS (-td) VS_DISTROS (-vd)" echo "FCDISTROS (-f) BITS (-i) BASE (-b)" + echo "BUILD_BRANCH (-bb) BUILD_TRUNK (-bt)" echo "RETRY (-O) TEST (-T) DRY_RUN (-n)" echo "Use at least one space for blanking a set of distros" exit 1 } +function run () { + [ -n "$manual" ] && echo "$@" '; \' + if [ -z "$DRY_RUN" ] ; then + "$@" + fi +} + +function shortname () { + distro=$1; shift + case $distro in + onelab) echo 1l;; + planetlab) echo pl;; + *) echo xx;; + esac +} + # comment off for usual dailies MAJOR=4.2 MINOR=rc18 @@ -28,6 +45,8 @@ while [[ -n "$@" ]] ; do -td) shift; TRUNK_DISTROS="$1" ;; -vd) shift; VS_DISTROS="$1" ;; -b) shift; BASE="$1" ;; + -bb) BUILD_BRANCH=true ;; + -bt) BUILD_TRUNK=true ;; -O) RETRY=true ;; -T) TEST=true ;; -n) DRY_RUN=true ;; @@ -41,22 +60,38 @@ DEFAULT_FCDISTROS="f8" DEFAULT_BITS="32 64" DEFAULT_BASE="@DATE@" -if [ -z "$MINOR" ] ; then +function trunk_builds () { DEFAULT_MAJOR_DISTROS="" DEFAULT_VS_DISTROS="" # 5.0 ready for planetlab distro only so far DEFAULT_TRUNK_DISTROS="planetlab" # DEFAULT_TRUNK_DISTROS="onelab planetlab" - BUILDOPT="" -else +} + +function branch_builds () { + DEFAULT_MAJOR_DISTROS="onelab planetlab" + DEFAULT_VS_DISTROS="" + DEFAULT_BITS="32" + DEFAULT_TRUNK_DISTROS="" +} + +function tagged_builds () { DEFAULT_MAJOR_DISTROS="onelab planetlab" DEFAULT_VS_DISTROS="onelab" DEFAULT_TRUNK_DISTROS="" +} + +if [ -n "$BUILD_BRANCH" ] ; then + branch_builds + BUILDOPT="-s http://svn.planet-lab.org/svn/build/branches/${MAJOR}" +elif [ -n "$BUILD_TRUNK" ] ; then + trunk_builds + BUILDOPT="" +else + tagged_builds BUILDOPT="-s http://svn.planet-lab.org/svn/build/tags/${MAJOR}-${MINOR}" fi - - [[ -n "$@" ]] && usage # export any of these to override - this is for manual use only @@ -70,29 +105,15 @@ if [ -z "$BASE" ] ; then BASE=$DEFAULT_BASE ; else manual=true ; fi [ -n "$TEST" ] && { extra_option="$extra_option -T" ; manual=true ; } [ -n "$DRY_RUN" ] && { manual=true ; } -function run () { - [ -n "$manual" ] && echo "$@" '; \' - if [ -z "$DRY_RUN" ] ; then - "$@" - fi -} - -function shortname () { - distro=$1; shift - case $distro in - onelab) echo 1l;; - planetlab) echo pl;; - *) echo xx;; - esac -} - ############################## ${MAJOR} for bits in $BITS; do for f in $FCDISTROS ; do for d in $MAJOR_DISTROS ; do p=linux${bits} s=$(shortname $d) - if [ -z "$MINOR" ] ; then + if [ -n "$BUILD_BRANCH" ] ; then + buildname="${d}-${MAJOR}-@DATE@.1lab-${f}-${bits}" + elif [ -n "$BUILD_TRUNK" ] ; then buildname="${BASE}--${s}.${MAJOR}--${f}-${bits}" else buildname="${d}-${MAJOR}-${MINOR}.1lab-${f}-${bits}" @@ -114,7 +135,9 @@ if [ -z "$TEST" ] ; then for bits in $BITS ; do p=linux${bits} s=$(shortname $d) - if [ -z "$MINOR" ] ; then + if [ -n "$BUILD_BRANCH" ] ; then + buildname="${d}-${MAJOR}-@DATE@.1lab-${f}-${bits}" + elif [ -n "$BUILD_TRUNK" ] ; then buildname="${BASE}--${s}.${MAJOR}--${f}-${bits}" else buildname="${d}-${MAJOR}-${MINOR}.1lab-${f}-${bits}" -- 2.47.0