diff options
author | Björn Gustavsson <[email protected]> | 2010-01-06 13:26:20 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2010-01-12 08:35:30 +0100 |
commit | 9c1b2d0c4dde604e46edf8d45000ab1d71dd3fa3 (patch) | |
tree | f41cf4df1895eeda3640677456074ffefcccd129 | |
parent | 3e4db417a616038c9f327e9746544127067aa96e (diff) | |
download | otp-9c1b2d0c4dde604e46edf8d45000ab1d71dd3fa3.tar.gz otp-9c1b2d0c4dde604e46edf8d45000ab1d71dd3fa3.tar.bz2 otp-9c1b2d0c4dde604e46edf8d45000ab1d71dd3fa3.zip |
Support updating preloaded files in a git repository
The commands in otp_build for updating the checked-in preloaded
modules only works in ClearCase.
Add support updating the preloaded files in a git repository as well.
Check the $version_controller variable so that we can have
"otp_build update_preloaded" 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_preloaded" will
update and commit the preloaded modules (to undo the updating of
the preloaded modules, 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.
-rwxr-xr-x | otp_build | 44 |
1 files changed, 31 insertions, 13 deletions
@@ -85,14 +85,22 @@ usage () ;; esac - echo "" - echo "The following options concern preloaded code." - echo "They are, like the primary bootstrap, mainly the concern of the" - echo "main developers." - echo " prepare_preloaded - prepares for building preloaded code (only in Clearcase)" - echo " update_preloaded - creates the preloaded beam code, the one shipped" - echo " commit_preloaded - commits the preloaded code (only in Clearcase)" - echo " cancel_preloaded - uncheckout preloaded code (only in Clearcase)" + case $version_controller in + none) + ;; + clearcase) + echo "" + echo "Handle the preloaded modules in Clearcase:" + echo " prepare_preloaded - prepares for building preloaded code" + echo " update_preloaded - creates the preloaded code" + echo " commit_preloaded - commits the preloaded code" + echo " cancel_preloaded - uncheckout preloaded code" + ;; + git) + echo "" + echo "update_preloaded - build and commit the preloaded modules" + ;; + esac } export_cross_env () @@ -956,10 +964,6 @@ do_prepare_prel () do_update_prel () { CT=`lookup_prog_in_path cleartool` - if [ X"$CLEARCASE_ROOT" = X"" -o X"$CT" = X"" ]; then - echo "To prepare for update of preloaded code, you have to run in a Clearcase view" >&2 - return - fi if [ X"$ERL_TOP" = X"" ]; then echo "ERL_TOP is not set." >&2 @@ -975,6 +979,16 @@ do_update_prel () echo '*****************************************************' } +do_update_prel_git () +{ + setup_make + (cd $ERL_TOP/erts/preloaded/src && $MAKE MAKE="$MAKE" BOOTSTRAP_ROOT=$BOOTSTRAP_ROOT TARGET=$TARGET clean) + $MAKE MAKE="$MAKE" BOOTSTRAP_ROOT=$BOOTSTRAP_ROOT TARGET=$TARGET preloaded || exit 1 + (cd $ERL_TOP/erts/preloaded/src && $MAKE MAKE="$MAKE" BOOTSTRAP_ROOT=$BOOTSTRAP_ROOT TARGET=$TARGET copy) + git add -A $ERL_TOP/erts/preloaded/ebin/*.beam + git commit -m 'Update preloaded modules' +} + do_commit_prel () { CT=`lookup_prog_in_path cleartool` @@ -1319,7 +1333,11 @@ case "$1" in prepare_preloaded) do_prepare_prel;; update_preloaded) - do_update_prel;; + case $version_controller in + git) do_update_prel_git ;; + clearcase) do_update_prel ;; + none) do_update_prel ;; + esac ;; commit_preloaded) do_commit_prel;; cancel_preloaded) |