1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
#################################################################
# #
# Copyright (c) 2001-2016 Fidelity National Information #
# Services, Inc. and/or its subsidiaries. All rights reserved. #
# #
# This source code contains the intellectual property #
# of its copyright holder(s), and is made available #
# under a license. If you do not know the terms of #
# the license, please stop and do not read further. #
# #
#################################################################
#
#######################################################################################################################
#
# setactive.csh - set active GT.M version (aliased to "version")
#
# Because setactive must be source'd, it cannot take any arguments (in csh). We get around this by requiring the
# shell variable setactive_parms to be set to a (possibly empty) list:
#
# setactive_parms[1] - version
# "A" or "a" => use (current) active version (i. e., don't change the version)
# "D" or "d" => use current development (volatile) version
# "P" or "p" => use current production (fully tested) version
# omitted - if argument 2 specified, this is the same as "A" or "a"
#
# setactive_parms[2] - type of binaries
# "B" or "b" => use bta (beta) binaries (optimized with asserts but without debugger information)
# "D" or "d" => use dbg (debug) binaries (unoptimized with asserts and debugger information)
# "P" or "p" => use pro (production) binaries (optimized without asserts or debugger information)
#
# If both arguments are omitted:
# In an interactive shell, setactive will prompt for each argument.
# In a non-interactive shell, setactive will not change anything (no-op).
#
#######################################################################################################################
set setactive_save_verbose = $?verbose
set exit_status = 0
unset verbose
set setactive_p1 = ""
set setactive_p2 = ""
if ( $#setactive_parms >= 1 ) then
set setactive_p1 = $setactive_parms[1]
endif
if ( $#setactive_parms >= 2 ) then
set setactive_p2 = $setactive_parms[2]
endif
set setactive_setenv = "/tmp/setactive.${USER}_$$.setenv"
if (-e $setactive_setenv) \rm -f $setactive_setenv
if ( $?prompt == "1" ) then
set setactive_interact = 1
if ($?gtm_ver_noecho == 0) echo ""
else
set setactive_interact = 0
endif
$shell -f $gtm_tools/setactive1.csh "$setactive_p1" "$setactive_p2" $setactive_interact $setactive_setenv
set setactive_status = $status
if ($setactive_status) @ exit_status++
unsetenv gtm_log
unsetenv gtm_map
unsetenv gtm_obj
if ( $setactive_status == 0 ) then
source $setactive_setenv
if ($status) @ exit_status++
source $gtm_ver/gtmsrc.csh
if ($status) @ exit_status++
endif
FINI:
# Clean up local shell variables and files:
if ( -f $setactive_setenv ) then
\rm $setactive_setenv
endif
unset setactive_interact
unset setactive_parms
unset setactive_p1
unset setactive_p2
unset setactive_setenv
unset setactive_status
if ( "$setactive_save_verbose" == "1" ) then
unset setactive_save_verbose
set verbose
else
unset setactive_save_verbose
unset verbose
endif
exit $exit_status
|