fi
fi
+# For convenience set a global variable with the FreeBSD branch
+# under test, so that we don't need to repeat this in several
+# places
+case "$branch" in
+freebsd-*) freebsd_branch=${branch#freebsd-} ;;
+*) freebsd_branch=master ;;
+esac
+
+case "$branch" in
+freebsd-*)
+ IFS=$'\n'
+ for anointed in \
+ `./mg-anoint list-prepared "freebsd build $freebsd_branch *"`; do
+ # Check if the anointed version matches OLD_VERSION,
+ # or else force a new flight, even if OLD_REVISION matches
+ # NEW_REVISION.
+ flight_job=`./mg-anoint retrieve "$anointed"`
+ anointed_revision=`check_tested --flight=${flight_job%% *} \
+ --print-revision=$tree`
+ if [ "x$anointed_revision" != "x$OLD_REVISION" ]; then
+ skipidentical=false
+ break
+ fi
+ done
+ unset IFS
+ ;;
+esac
+
if [ "x$REVISION_XEN" = x ]; then
REVISION_XEN="`fetch_version $xenbranch`"
export REVISION_XEN
;;
esac
+IFS=$'\n'
+for anointed in \
+ `./mg-anoint list-prepared "freebsd build $freebsd_branch *"`; do
+ # Retrieve previous successful FreeBSD build for each arch.
+ freebsd_arch=${anointed##* }
+ freebsd_envvar="FREEBSD_${freebsd_arch^^}_BUILDJOB"
+ if [ "x${!freebsd_envvar}" = "x" ]; then
+ flight_job=`./mg-anoint retrieve "$anointed"`
+ export ${freebsd_envvar}=${flight_job/ /.}
+ fi
+done
+unset IFS
+
if [ "x$OLD_REVISION" = xdetermine-late ]; then
OLD_REVISION="`\
$AP_FETCH_PFX ./ap-fetch-version-baseline-late $branch $NEW_REVISION`"
echo
fi
+# Do the anoints after the push: if for some reason this fails,
+# and osstest ends up with a pushed revision that doesn't match
+# the latest anointed artifact a new flight will be run regardless
+# of whether OLD_REVISION == NEW_REVISION.
+case "$branch" in
+freebsd-*)
+ if grep '^tolerable$' $mrof >/dev/null 2>&1 && $OSSTEST_ANOINT &&
+ [ "x$OSSTEST_BLESSING" == "xreal" ]; then
+ IFS=$'\n'
+ for anointed in `./mg-anoint list-prepared \
+ "freebsd build $freebsd_branch *"`; do
+ # Update anointed versions
+ # NB: failure to update an anointed build for a specific arch
+ # should not be fatal, and it's not an issue if one of the
+ # arches gets slightly out of sync with the other ones.
+ freebsd_arch=${anointed##* }
+ if ./mg-anoint anoint "$anointed" \
+ $flight build-$freebsd_arch-freebsd; then
+ echo "Anointed artifacts from build-$freebsd_arch-freebsd"
+ fi
+ done
+ unset IFS
+ fi
+ ;;
+esac
+
if [ -f $revlog ]; then
revlog_lines=`wc -l <$revlog`
if [ $revlog_lines -lt 300 ]; then