Files
pcas/src/tools/getrel
1996-06-28 15:20:11 +00:00

66 lines
875 B
Bash
Executable File

#!/bin/sh
#
# $Id$
#
# Author: Matthew Needes
#
USAGE="Usage:
getrel <EpicsNodeFullPathName>
ex: getrel /usr/local/epics/base_R3.13
--------- OR -----------
getrel ~/epics/base
"
# one arg
if [ $# -lt 1 ]; then
cat <<!message
$USAGE
!message
exit
fi
BASE=${1}
if [ ! -d ${BASE}/bin -o \
! -d ${BASE}/dbd ]; then
cat <<-!usage
$USAGE
${BASE} does not appear to be an epics BASE root tree...
!usage
exit 1
fi
FIRSTCHAR=`expr "${BASE}" : '\(.\).*'`
if [ ${FIRSTCHAR} != "/" ]; then
cat <<-!usage
$USAGE
${BASE} does not appear to be a full path name.
!usage
exit 1
fi
/bin/rm -f \
epics \
base \
target* \
vxWorks* \
vw
echo EPICS_BASE=${BASE} >> EPICS_BASE
ln -s ${BASE} base
touch .current_rel_hist
echo ${BASE} - `date` >> .current_rel_hist
exit 0