Commit 87b8f166 authored by ghweber's avatar ghweber
Browse files

Replaced bashisms in co_rctrun and visit_svn_helper scripts with POSIX so that...

Replaced bashisms in co_rctrun and visit_svn_helper scripts with POSIX so that these scripts run on Ubuntu with dash.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@6528 18c085ea-50e0-402c-830e-de6fd14e8384
parent d2c03767
...@@ -19,6 +19,9 @@ ...@@ -19,6 +19,9 @@
# Tom Fogal, Wed Mar 11 10:09:20 MST 2009 # Tom Fogal, Wed Mar 11 10:09:20 MST 2009
# Converted from Korn shell to Bourne shell # Converted from Korn shell to Bourne shell
# #
# Gunther H. Weber, Fri Mar 13 11:04:00 PDT 2009
# Replaced bashisms with POSIX so that script runs on Ubuntu with dash
#
# ***************************************************************************** # *****************************************************************************
issueHelp="no" issueHelp="no"
...@@ -30,11 +33,11 @@ P=$(which $0) ...@@ -30,11 +33,11 @@ P=$(which $0)
P2=${P%/*} P2=${P%/*}
. ${P2}/visit_svn_helper . ${P2}/visit_svn_helper
if [[ $# != 2 ]] ; then if [ $# != 2 ] ; then
issueHelp="yes" issueHelp="yes"
fi fi
if [[ "$issueHelp" == "yes" ]] ; then if [ "$issueHelp" = "yes" ] ; then
echo "" echo ""
echo "Usage: ${0##*/} RC_NAME <dir>" echo "Usage: ${0##*/} RC_NAME <dir>"
echo "Usage: ${0##*/} RC_NAME <known-dir-combo>" echo "Usage: ${0##*/} RC_NAME <known-dir-combo>"
...@@ -64,7 +67,7 @@ if [[ "$issueHelp" == "yes" ]] ; then ...@@ -64,7 +67,7 @@ if [[ "$issueHelp" == "yes" ]] ; then
fi fi
svn ls ${VISIT_SVN_BRANCHES}/${1} 2>/dev/null > /dev/null svn ls ${VISIT_SVN_BRANCHES}/${1} 2>/dev/null > /dev/null
if [[ $? != 0 ]] ; then if [ $? != 0 ] ; then
echo "The RC trunk location $1 does not appear to exist." echo "The RC trunk location $1 does not appear to exist."
echo "Aborting checkout" echo "Aborting checkout"
exit 1 exit 1
...@@ -73,25 +76,25 @@ fi ...@@ -73,25 +76,25 @@ fi
DIR="" DIR=""
ROOT="/" ROOT="/"
if [[ "$2" != "all" && "$2" != "sdt" ]] ; then if [ "$2" != "all" -a "$2" != "sdt" ] ; then
svn ls ${VISIT_SVN_BRANCHES}/${1}/${2} 2>/dev/null > /dev/null svn ls ${VISIT_SVN_BRANCHES}/${1}/${2} 2>/dev/null > /dev/null
if [[ $? != 0 ]] ; then if [ $? -ne 0 ] ; then
echo "The trunk location $1/$2 does not appear to exist." echo "The trunk location $1/$2 does not appear to exist."
echo "Aborting checkout" echo "Aborting checkout"
exit 1 exit 1
fi fi
if [[ "${2#/}" == "${2}" ]] ; then if [ "${2#/}" = "${2}" ] ; then
TMP="/${2}" TMP="/${2}"
ROOT="${TMP%/*}" ROOT="${TMP%/*}"
else else
ROOT="${2%/*}" ROOT="${2%/*}"
fi fi
if [[ "$ROOT" == "" ]] ; then if [ "$ROOT" = "" ] ; then
ROOT="/" ROOT="/"
fi fi
fi fi
function checkout_dir checkout_dir()
{ {
cd ${1}_trunk cd ${1}_trunk
echo "Getting files for \"${2}\" from remote repo..." echo "Getting files for \"${2}\" from remote repo..."
...@@ -99,25 +102,25 @@ function checkout_dir ...@@ -99,25 +102,25 @@ function checkout_dir
cd .. cd ..
} }
if [[ -d ${1}_trunk ]] ; then if [ -d ${1}_trunk ] ; then
cd ${1}_trunk cd ${1}_trunk
if [[ ! -f .branchname ]] ; then if [ ! -f .branchname ] ; then
echo "The subdirectory I want to place the check out in (${1}_trunk) does not appear " echo "The subdirectory I want to place the check out in (${1}_trunk) does not appear "
echo "to be a valid check out." echo "to be a valid check out."
exit 1 exit 1
fi fi
NAME=$(cat .branchname) NAME=$(cat .branchname)
if [[ "$NAME" != "${1}_trunk" ]] ; then if [ "$NAME" != "${1}_trunk" ] ; then
echo "The subdirectory I want to place the check out in (${1}_trunk) does not appear " echo "The subdirectory I want to place the check out in (${1}_trunk) does not appear "
echo "to be a valid check out." echo "to be a valid check out."
exit 1 exit 1
fi fi
if [[ ! -f .rootpath ]] ; then if [ ! -f .rootpath ] ; then
echo "The subdirectory I want to place the check out in is not consistent" echo "The subdirectory I want to place the check out in is not consistent"
exit 1 exit 1
fi fi
ROOT2=$(cat .rootpath) ROOT2=$(cat .rootpath)
if [[ "$ROOT" != "$ROOT2" ]] ; then if [ "$ROOT" != "$ROOT2" ] ; then
echo "The directory you are requesting is from a different directory in the repo." echo "The directory you are requesting is from a different directory in the repo."
echo "This is not allowed." echo "This is not allowed."
echo "Your previous checkout(s) have been from ${ROOT2}" echo "Your previous checkout(s) have been from ${ROOT2}"
...@@ -135,14 +138,14 @@ else ...@@ -135,14 +138,14 @@ else
cd .. cd ..
fi fi
if [[ "$2" == "sdt" ]] ; then if [ "$2" = "sdt" ] ; then
echo "Checking out /src" echo "Checking out /src"
checkout_dir $1 "/src" checkout_dir $1 "/src"
echo "Checking out /data" echo "Checking out /data"
checkout_dir $1 "/data" checkout_dir $1 "/data"
echo "Checking out /test" echo "Checking out /test"
checkout_dir $1 "/test" checkout_dir $1 "/test"
elif [[ "$2" == "all" ]] ; then elif [ "$2" == "all" ] ; then
echo "Checking out /src" echo "Checking out /src"
checkout_dir $1 "/src" checkout_dir $1 "/src"
echo "Checking out /data" echo "Checking out /data"
......
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
# Hank Childs, Thu Aug 7 08:41:15 PDT 2008 # Hank Childs, Thu Aug 7 08:41:15 PDT 2008
# Add support for two digit minor releases, such as 1.10 or 1.10.1. # Add support for two digit minor releases, such as 1.10 or 1.10.1.
# #
# Gunther H. Weber, Fri Mar 13 11:04:00 PDT 2009
# Replaced bashisms with POSIX so that script runs on Ubuntu with dash
#
# ***************************************************************************** # *****************************************************************************
...@@ -23,7 +26,7 @@ ...@@ -23,7 +26,7 @@
## ##
## ##
if [[ "$SVN_NERSC_NAME" == "" ]] ; then if [ "$SVN_NERSC_NAME" = "" ] ; then
echo "You must define the environment variable SVN_NERSC_NAME to use these scripts." echo "You must define the environment variable SVN_NERSC_NAME to use these scripts."
echo "This should be your username on svn.nersc.gov" echo "This should be your username on svn.nersc.gov"
exit 1 exit 1
...@@ -48,7 +51,7 @@ VISIT_SVN_TAGS=${VISIT_SVN_REPO}/tags ...@@ -48,7 +51,7 @@ VISIT_SVN_TAGS=${VISIT_SVN_REPO}/tags
## ##
## ##
function get_latest_rev get_latest_rev()
{ {
# This assumes a certain format for SVN log. It gets the second line, # This assumes a certain format for SVN log. It gets the second line,
# which has "r<REV> | ...", and then strips off the "| ...", and then # which has "r<REV> | ...", and then strips off the "| ...", and then
...@@ -71,18 +74,18 @@ function get_latest_rev ...@@ -71,18 +74,18 @@ function get_latest_rev
# Note that the is_version_string test would fail for numbers bigger than 9, # Note that the is_version_string test would fail for numbers bigger than 9,
# such as 1.6.10. If this ever comes up, it should be easy to fix. # such as 1.6.10. If this ever comes up, it should be easy to fix.
function is_version_string is_version_string()
{ {
if [[ ${#1} == 3 ]] ; then if [ ${#1} -eq 3 ] ; then
is_two_digit_version_string $1 is_two_digit_version_string $1
return $? return $?
elif [[ ${#1} == 4 ]] ; then elif [ ${#1} -eq 4 ] ; then
is_two_digit_version_string $1 is_two_digit_version_string $1
return $? return $?
elif [[ ${#1} == 5 ]] ; then elif [ ${#1} -eq 5 ] ; then
is_three_digit_version_string $1 is_three_digit_version_string $1
return $? return $?
elif [[ ${#1} == 6 ]] ; then elif [ ${#1} -eq 6 ] ; then
is_three_digit_version_string $1 is_three_digit_version_string $1
return $? return $?
fi fi
...@@ -90,36 +93,36 @@ function is_version_string ...@@ -90,36 +93,36 @@ function is_version_string
return 0 return 0
} }
function is_two_digit_version_string is_two_digit_version_string()
{ {
if [[ ${#1} != 3 ]] ; then if [ ${#1} -ne 3 ] ; then
if [[ ${#1} != 4 ]] ; then if [ ${#1} -ne 4 ] ; then
return 0 return 0
fi fi
fi fi
typeset X typeset X
typeset -L1 X=$1 typeset -L1 X=$1
if [[ "$X" != [0-9] ]] ; then if [ "$X" != [0-9] ] ; then
return 0 return 0
fi fi
typeset -L2 X=$1 typeset -L2 X=$1
typeset -R1 X typeset -R1 X
if [[ "$X" != "." ]] ; then if [ "$X" != "." ] ; then
return 0 return 0
fi fi
typeset -L3 X=$1 typeset -L3 X=$1
typeset -R1 X typeset -R1 X
if [[ "$X" != [0-9] ]] ; then if [ "$X" != [0-9] ] ; then
return 0 return 0
fi fi
if [[ ${#1} == 4 ]] ; then if [ ${#1} = 4 ] ; then
typeset -L4 X=$1 typeset -L4 X=$1
typeset -R1 X typeset -R1 X
if [[ "$X" != [0-9] ]] ; then if [ "$X" != [0-9] ] ; then
return 0 return 0
fi fi
fi fi
...@@ -127,50 +130,50 @@ function is_two_digit_version_string ...@@ -127,50 +130,50 @@ function is_two_digit_version_string
return 1 return 1
} }
function is_three_digit_version_string is_three_digit_version_string()
{ {
if [[ ${#1} != 5 ]] ; then if [ ${#1} != 5 ] ; then
return 0 return 0
fi fi
typeset X typeset X
typeset -L1 X=$1 typeset -L1 X=$1
if [[ "$X" != [0-9] ]] ; then if [ "$X" != [0-9] ] ; then
return 0 return 0
fi fi
typeset -L2 X=$1 typeset -L2 X=$1
typeset -R1 X typeset -R1 X
if [[ "$X" != "." ]] ; then if [ "$X" != "." ] ; then
return 0 return 0
fi fi
typeset -L3 X=$1 typeset -L3 X=$1
typeset -R1 X typeset -R1 X
if [[ "$X" != [0-9] ]] ; then if [ "$X" != [0-9] ] ; then
return 0 return 0
fi fi
typeset -L4 X=$1 typeset -L4 X=$1
typeset -R1 X typeset -R1 X
if [[ "$X" == "." ]] ; then if [ "$X" = "." ] ; then
typeset -L5 X=$1 typeset -L5 X=$1
typeset -R1 X typeset -R1 X
if [[ "$X" != [0-9] ]] ; then if [ "$X" != [0-9] ] ; then
return 0 return 0
fi fi
elif [[ "$X" != "." ]] ; then elif [ "$X" != "." ] ; then
if [[ "$X" != [0-9] ]] ; then if [ "$X" != [0-9] ] ; then
return 0 return 0
fi fi
typeset -L5 X=$1 typeset -L5 X=$1
typeset -R1 X typeset -R1 X
if [[ "$X" != "." ]] ; then if [ "$X" != "." ] ; then
return 0 return 0
fi fi
typeset -L6 X=$1 typeset -L6 X=$1
typeset -R1 X typeset -R1 X
if [[ "$X" != [0-9] ]] ; then if [ "$X" != [0-9] ] ; then
return 0 return 0
fi fi
fi fi
...@@ -178,51 +181,51 @@ function is_three_digit_version_string ...@@ -178,51 +181,51 @@ function is_three_digit_version_string
return 1 return 1
} }
function is_four_digit_version_string is_four_digit_version_string()
{ {
if [[ ${#1} != 7 ]] ; then if [ ${#1} != 7 ] ; then
return 0 return 0
fi fi
typeset X typeset X
typeset -L1 X=$1 typeset -L1 X=$1
if [[ "$X" != [0-9] ]] ; then if [ "$X" != [0-9] ] ; then
return 0 return 0
fi fi
typeset -L2 X=$1 typeset -L2 X=$1
typeset -R1 X typeset -R1 X
if [[ "$X" != "." ]] ; then if [ "$X" != "." ] ; then
return 0 return 0
fi fi
typeset -L3 X=$1 typeset -L3 X=$1
typeset -R1 X typeset -R1 X
if [[ "$X" != [0-9] ]] ; then if [ "$X" != [0-9] ] ; then
return 0 return 0
fi fi
typeset -L4 X=$1 typeset -L4 X=$1
typeset -R1 X typeset -R1 X
if [[ "$X" != "." ]] ; then if [ "$X" != "." ] ; then
return 0 return 0
fi fi
typeset -L5 X=$1 typeset -L5 X=$1
typeset -R1 X typeset -R1 X
if [[ "$X" != [0-9] ]] ; then if [ "$X" != [0-9] ] ; then
return 0 return 0
fi fi
typeset -L6 X=$1 typeset -L6 X=$1
typeset -R1 X typeset -R1 X
if [[ "$X" != "." ]] ; then if [ "$X" != "." ] ; then
return 0 return 0
fi fi
typeset -L7 X=$1 typeset -L7 X=$1
typeset -R1 X typeset -R1 X
if [[ "$X" != [0-9] ]] ; then if [ "$X" != [0-9] ] ; then
return 0 return 0
fi fi
...@@ -230,14 +233,14 @@ function is_four_digit_version_string ...@@ -230,14 +233,14 @@ function is_four_digit_version_string
} }
function svn_cp_dir svn_cp_dir()
{ {
SRC=$1 SRC=$1
DEST=$2 DEST=$2
# Confirm presence of $SRC # Confirm presence of $SRC
svn ls $SRC 2>/dev/null > /dev/null svn ls $SRC 2>/dev/null > /dev/null
if [[ $? != 0 ]] ; then if [ $? -ne 0 ] ; then
echo "Cannot locate directory ($SRC) for copying. Aborting!" echo "Cannot locate directory ($SRC) for copying. Aborting!"
echo "(Try using ls_branches to locate the directory.)" echo "(Try using ls_branches to locate the directory.)"
exit 1 exit 1
...@@ -245,14 +248,14 @@ function svn_cp_dir ...@@ -245,14 +248,14 @@ function svn_cp_dir
# Confirm that $DEST does not already exist # Confirm that $DEST does not already exist
svn ls $DEST 2>/dev/null > /dev/null svn ls $DEST 2>/dev/null > /dev/null
if [[ $? == 0 ]] ; then if [ $? -ne 0 ] ; then
echo "Destination ($DEST) already exists. Aborting!" echo "Destination ($DEST) already exists. Aborting!"
exit 1 exit 1
fi fi
echo "Creating ${DEST}...." echo "Creating ${DEST}...."
svn copy $SRC $DEST -m "Making copy of $SRC as $DEST" svn copy $SRC $DEST -m "Making copy of $SRC as $DEST"
if [[ $? == 0 ]] ; then if [ $? -ne 0 ] ; then
echo "Successful." echo "Successful."
else else
echo "Not successful." echo "Not successful."
...@@ -261,14 +264,14 @@ function svn_cp_dir ...@@ -261,14 +264,14 @@ function svn_cp_dir
} }
function svn_mv_dir svn_mv_dir()
{ {
SRC=$1 SRC=$1
DEST=$2 DEST=$2
# Confirm presence of $SRC # Confirm presence of $SRC
svn ls $SRC 2>/dev/null > /dev/null svn ls $SRC 2>/dev/null > /dev/null
if [[ $? != 0 ]] ; then if [ $? -ne 0 ] ; then
echo "Cannot locate directory ($SRC) for moving. Aborting!" echo "Cannot locate directory ($SRC) for moving. Aborting!"
echo "(Try using ls_branches to locate the directory.)" echo "(Try using ls_branches to locate the directory.)"
exit 1 exit 1
...@@ -276,14 +279,14 @@ function svn_mv_dir ...@@ -276,14 +279,14 @@ function svn_mv_dir
# Confirm that $DEST does not already exist # Confirm that $DEST does not already exist
svn ls $DEST 2>/dev/null > /dev/null svn ls $DEST 2>/dev/null > /dev/null
if [[ $? == 0 ]] ; then if [ $? -ne 0 ] ; then
echo "Destination ($DEST) already exists. Aborting!" echo "Destination ($DEST) already exists. Aborting!"
exit 1 exit 1
fi fi
echo "Creating ${DEST}...." echo "Creating ${DEST}...."
svn move $SRC $DEST -m "Making copy of $SRC as $DEST" svn move $SRC $DEST -m "Making copy of $SRC as $DEST"
if [[ $? == 0 ]] ; then if [ $? -ne 0 ] ; then
echo "Successful." echo "Successful."
else else
echo "Not successful." echo "Not successful."
...@@ -292,12 +295,12 @@ function svn_mv_dir ...@@ -292,12 +295,12 @@ function svn_mv_dir
} }
function svn_rm_dir svn_rm_dir()
{ {
DIR=$1 DIR=$1
# Confirm presence of $DIR # Confirm presence of $DIR
svn ls $DIR 2>/dev/null > /dev/null svn ls $DIR 2>/dev/null > /dev/null
if [[ $? != 0 ]] ; then if [ $? -ne 0 ] ; then
echo "Cannot locate release candidate ($DIR) for deleting. Aborting!" echo "Cannot locate release candidate ($DIR) for deleting. Aborting!"
exit 1 exit 1
fi fi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment