From faac8129e160c133686e334a6b7e9497b6be1ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 2 Dec 2009 16:35:32 +0100 Subject: Determine which VCS is being used We want to add the ability for otp_build to determine which version control system (VCS) is being used, so that the commands for updating the primary bootstrap and pre-loaded modules can be updated to do different things depending on the VCS. In the beginning of the otp_build script, set the variable "version_controller" to either "none" (for no VCS), "git", or "clearcase". --- otp_build | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'otp_build') diff --git a/otp_build b/otp_build index cddb477db5..07edcb1d4d 100755 --- a/otp_build +++ b/otp_build @@ -189,7 +189,23 @@ target_contains () return $? } +determine_version_controller () +{ + version_controller=none + # The current directory is now $ERL_TOP. Check for + # either this directory being controlled by git or + # for the "otp_build" file being a Clearcase controlled + # object. + + if git rev-parse --git-dir 2>/dev/null >/dev/null; then + version_controller=git + else + if test -d "otp_build@@/"; then + version_controller=clearcase + fi + fi +} # Execution of the different options @@ -1144,6 +1160,8 @@ check_erltop cd $ERL_TOP +determine_version_controller + # Unset ERL_FLAGS and ERL__FLAGS to prevent, for instance, # a value of "-hybrid" to run the hybrid emulator during bootstrap. sys_vsn=`awk '/SYSTEM_VSN = / {print $3}' < erts/vsn.mk` -- cgit v1.2.3