|
From: <emc...@li...> - 2003-06-19 02:30:23
|
Update of /cvsroot/emc/rcslib/etc
In directory sc8-pr-cvs1:/tmp/cvs-serv18788/etc
Modified Files:
platname
Log Message:
Fixed rcslib/etc/platname to work on the BDI 2.18
Index: platname
===================================================================
RCS file: /cvsroot/emc/rcslib/etc/platname,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** platname 9 Apr 2003 13:36:33 -0000 1.29
--- platname 19 Jun 2003 02:30:20 -0000 1.30
***************
*** 1,4 ****
--- 1,25 ----
#!/bin/sh
+ # 18JUN03 MGS made some additions to this file so that it would work on the 2.18 BDI
+ # Hopefully, it won't break anything else...
+
+ # Uncomment the next line to aid in troubleshooting this script
+ #set -x
+
+ # Save the original path and working directory
+ ORIGINAL_PATH=$PATH
+ ORIGINAL_DIR=`pwd`
+
+ # Change to the directory containing this script
+ cd $0/..
+
+ # Add this directory to the PATH environment variable
+ # so the the which `$PROGRAM_NAME...` command doesn't fail
+ # We'll restore the original path at the end of the file
+ PATH=$PATH:`pwd`
+
+ # Change back to the original directory
+ cd $ORIGINAL_DIR
+
if test "0${PLAT}" != 0 ; then
echo ${PLAT}
***************
*** 162,167 ****
fi
-
-
if test 0$ORIG_PLAT != 0$PLAT ; then
--- 183,186 ----
***************
*** 207,216 ****
fi
-
- if test -f /etc/redhat-release ; then
- REDHAT_VERSION=`cat /etc/redhat-release | awk '{print $5}' | sed 'y/./_/' | sed 'y/-/_/'`
- REDHAT_PLAT=`echo "redhat_"$REDHAT_VERSION `
if test -w $RCSLIB_ETC_DIR -a -d $RCSLIB_ETC_DIR -a ${LINK_FLAG} $RCSLIB_ETC_DIR/$REDHAT_PLAT.def ; then
( cd $RCSLIB_ETC_DIR; rm $REDHAT_PLAT.def; );
--- 226,244 ----
fi
+ if test -f /etc/redhat-release ; then
+ # /etc/redhat_relaese on a 2.18 BDI contains the following lines:
+ # Realtime Linux for EMC
+ # Based on RH 6.0 6.1, and 6.2 Linux
+ # MGS added an extra sed operation at the end of this line
+ # to remove the comma at the end of the fifth element - "6.1,".
+ REDHAT_VERSION=`cat /etc/redhat-release | awk '{print $5}' | sed 'y/./_/' | sed 'y/-/_/' | sed 's/,//'`
+ # MGS also added an extra sed operation at the end of this line
+ # to remove the space between "redhat_" and "6_1".
+ REDHAT_PLAT=`echo "redhat_"$REDHAT_VERSION | sed 's/ //'`
+ # Uncomment these echo statements to see the result of the variable assignments:
+ #echo $REDHAT_VERSION
+ #echo $REDHAT_PLAT
if test -w $RCSLIB_ETC_DIR -a -d $RCSLIB_ETC_DIR -a ${LINK_FLAG} $RCSLIB_ETC_DIR/$REDHAT_PLAT.def ; then
( cd $RCSLIB_ETC_DIR; rm $REDHAT_PLAT.def; );
***************
*** 456,459 ****
--- 484,490 ----
fi
fi
+
+ # Here's where we restore the original path
+ PATH=$ORIGINAL_PATH
export PLAT
|