From 3e4db417a616038c9f327e9746544127067aa96e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 2 Dec 2009 19:22:55 +0100 Subject: Support updating the primary bootstrap in a git repository The commands in otp_build for updating the checked-in primary bootstrap only works in ClearCase. Add support updating the bootstrap in a git repository as well. Check the $version_controller variable so that we can have "otp_build update_primary" do different things depending on whether it is run in a ClearCase view or a git repository. When run in a git repository, "otp_build update_primary" will update and commit the bootstrap (to undo the updating of the bootstrap, do "git reset --hard HEAD^"). Update the usage text to only show the commands relevant to the kind of VCS it is being run in. --- otp_build | 49 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 10 deletions(-) (limited to 'otp_build') diff --git a/otp_build b/otp_build index 07edcb1d4d..efd1cad849 100755 --- a/otp_build +++ b/otp_build @@ -68,15 +68,23 @@ usage () echo "Before trying to cross compile, set environment via the following option" echo "Please note that the path to the configuration file should be absolute." echo " env_cross - echo environment settings for cross compilation, use with eval" - echo "" - echo "The following options concern the primary bootstrap." - echo "{prepare,update,commit,cancel}_primary is for actually updating" - echo "the checked in derivates of the main code base, they are not for" - echo "managing a downloaded spource-tree." - echo " prepare_primary - prepares for building primary bootstrap (only in Clearcase)" - echo " update_primary - creates the primary bootstrap, the one shipped" - echo " commit_primary - commits a primary bootstrap (only in Clearcase)" - echo " cancel_primary - uncheckout a primary bootstrap (only in Clearcase)" + case $version_controller in + none) + ;; + clearcase) + echo "" + echo "Handle the primary bootstrap in Clearcase:" + echo " prepare_primary - prepare for building a primary bootstrap" + echo " update_primary - create the primary bootstrap" + echo " commit_primary - commit a primary bootstrap" + echo " cancel_primary - uncheckout a primary bootstrap" + ;; + git) + echo "" + echo "update_primary - build and commit a new primary bootstrap" + ;; + esac + echo "" echo "The following options concern preloaded code." echo "They are, like the primary bootstrap, mainly the concern of the" @@ -829,6 +837,23 @@ do_primary () fi } +do_primary_git () +{ + setup_make + if [ "x$OVERRIDE_TARGET" != "x" -a "x$OVERRIDE_TARGET" != "xwin32" ]; then + do_primary_cross + else + $MAKE MAKE="$MAKE" BOOTSTRAP_ROOT=$BOOTSTRAP_ROOT TARGET=$TARGET primary_bootstrap || exit 1; + fi + git add -A bootstrap/lib/kernel \ + bootstrap/lib/stdlib \ + bootstrap/lib/compiler \ + bootstrap/lib/orber/include \ + bootstrap/bin + git commit -m 'Update primary bootstrap' +} + + do_prepare () { CT=`lookup_prog_in_path cleartool` @@ -1282,7 +1307,11 @@ case "$1" in prepare_primary) do_prepare;; update_primary) - do_primary;; + case $version_controller in + git) do_primary_git ;; + clearcase) do_primary ;; + none) do_primary ;; + esac ;; commit_primary) do_commit;; cancel_primary) -- cgit v1.2.3