Files
epics-base/src/tools/getrel
T
1996-02-20 20:58:44 +00:00

155 lines
3.4 KiB
Bash
Executable File

#!/bin/sh
#
# $Id$
#
# Author: Matthew Needes
#
# $Log$
# Revision 1.13 1996/01/25 21:03:20 mrk
# Changes for new all ascii database definitions
#
# Revision 1.12 1995/08/18 15:26:05 jba
# Added pathname to GetVar
#
# Revision 1.11 1995/08/17 20:35:20 jba
# EPICS added on calls to GetVar
#
# Revision 1.10 1995/04/26 16:20:35 jba
# Added date to .current_rel_hist file output
#
# Revision 1.9 1995/03/30 23:16:07 jba
# Changed example comment
#
# Revision 1.8 1994/09/15 22:06:36 mcn
# Removed -h from test flags.
#
# Revision 1.7 1994/09/07 20:59:17 mcn
# Revamped GetVar, modified scripts for new GetVar.
#
# Revision 1.6 1994/09/07 19:08:52 jba
# Modified to work with extensions and do depends
#
# Revision 1.5 1994/08/21 00:56:43 mcn
# New Stuff
#
# Revision 1.4 1994/08/16 17:20:45 mcn
# exported variable
#
# Revision 1.3 1994/08/16 16:12:19 mcn
# Added GetVar, made use of 'ln' compatible with SYSV Unix.
#
# Revision 1.2 1994/08/02 18:36:30 mcn
# Support new configuration.
#
# Revision 1.1 1994/07/14 16:17:36 mcn
# Modified to support structure of base, made more intelligent (mcn)
#
USAGE="Usage:
getrel <EpicsNode> [arch1 arch2 ...]
ex: getrel /usr/local/epics/R3.12
--------- OR -----------
getrel ~/epics mv197
If the optional architecture list is left out links
for supported architectures will automatically be
created.
"
# one arg
if [ $# -lt 1 ]; then
cat <<!message
$USAGE
!message
exit
fi
EPICS=${1}
BASE=${1}/base
CONFIG=${1}/config
if [ ! -d ${BASE}/bin -o \
! -d ${BASE}/db ]; then
cat <<-!usage
$USAGE
${EPICS} does not appear to be an EPICS root tree...
!usage
exit 1
fi
/bin/rm -f \
base \
config \
target* \
vxWorks* \
vw
ln -s ${BASE} base
ln -s ${CONFIG} config
# Read config/CONFIG_SITE for VX_DIR variable
VW=`${EPICS}/base/bin/${HOST_ARCH}/GetVar ${EPICS} VX_DIR`
ln -s ${VW} vw
touch .current_rel_hist
echo ${EPICS} - `date` >> .current_rel_hist
# Create/Parse VX architecture list reliably
if [ $# -eq 1 ]; then
# Find what architectures are supported in
# the release by examining bin
ARCHS=`ls -1 ${BASE}/bin`
# Suppress some error messages in automatic mode.
QUIET="T"
else
# Look at command line arguments 2 and onward
# shift to remove first argument.
shift
ARCHS=${*}
QUIET="F"
fi
#
# Check architecture list by examining:
# $CONFIG/CONFIG_ARCH.ARCH file
# $BASE/bin/ARCH directory
#
echo
echo "Creating soft links for:"
for T_A in $ARCHS; do
if [ -f ${CONFIG}/CONFIG_ARCH.${T_A} ]; then
TYPE=`${EPICS}/base/bin'${HOST_ARCH}/GetVar ${EPICS} BUILD_TYPE ${T_A}`
if [ "${TYPE}" = "Vx" ]; then
if [ ! -f ${BASE}/bin/${T_A}/iocCore ]; then
echo " ${T_A}: Warning: This architecture has not been built in EPICS base."
fi
echo " ${T_A}: Creating soft links."
ln -s base/bin/${T_A} target${T_A}
ln -s ./target${T_A}/vxWorks vxWorks${T_A}
ln -s ./target${T_A}/vxWorks.sym vxWorks${T_A}.sym
else
if [ "${QUIET}" = "F" ]; then
echo " ${T_A}: This is not an IOC architecture."
echo " ${T_A}: NOT creating soft links."
fi
fi
else
echo " ${T_A}: No configuration file exists for ${T_A} in EPICS config."
echo " ${T_A}: Create config/CONFIG_ARCH.${T_A} and build."
echo " ${T_A}: NOT creating soft links."
fi
done
echo
echo "getrel: - completed!"
echo
exit 0