avoid 'tr' calls to improve performance a bit
This commit is contained in:
@@ -27,7 +27,7 @@ fn_exists() {
|
|||||||
|
|
||||||
repo_exists() {
|
repo_exists() {
|
||||||
DEP=$1
|
DEP=$1
|
||||||
dep_lc=$(echo $DEP | tr 'A-Z' 'a-z')
|
dep_lc=${DEP,,}
|
||||||
eval dirname=\${${DEP}_DIRNAME:=${dep_lc}}
|
eval dirname=\${${DEP}_DIRNAME:=${dep_lc}}
|
||||||
eval reponame=\${${DEP}_REPONAME:=${dep_lc}}
|
eval reponame=\${${DEP}_REPONAME:=${dep_lc}}
|
||||||
eval repourl=\${${DEP}_REPOURL:="https://github.com/\${${DEP}_REPOOWNER:=${REPOOWNER:-epics-modules}}/${reponame}.git"}
|
eval repourl=\${${DEP}_REPOURL:="https://github.com/\${${DEP}_REPOOWNER:=${REPOOWNER:-epics-modules}}/${reponame}.git"}
|
||||||
@@ -35,7 +35,7 @@ repo_exists() {
|
|||||||
git ls-remote --quiet --heads --exit-code $repourl > /dev/null 2>&1
|
git ls-remote --quiet --heads --exit-code $repourl > /dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
SETUP_DIRS=$(echo $SETUP_PATH | tr ":" "\n")
|
SETUP_DIRS=${SETUP_PATH//:/ }
|
||||||
|
|
||||||
SCRIPTDIR=$(dirname $(readlinkf $0))/travis
|
SCRIPTDIR=$(dirname $(readlinkf $0))/travis
|
||||||
CURDIR="$PWD"
|
CURDIR="$PWD"
|
||||||
|
|||||||
@@ -1,6 +1,17 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
if [ "$TRAVIS_OS_NAME" == "osx" -a "$BASH_VERSINFO" -lt 4 ]
|
||||||
|
then
|
||||||
|
brew install bash
|
||||||
|
if [ $(/usr/local/bin/bash -c 'echo $BASH_VERSINFO') -lt 4 ]
|
||||||
|
then
|
||||||
|
echo "Failed to install a recent bash" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
exec /usr/local/bin/bash $0 "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
# Set VV in .travis.yml to make scripts verbose
|
# Set VV in .travis.yml to make scripts verbose
|
||||||
[ "$VV" ] && set -x
|
[ "$VV" ] && set -x
|
||||||
|
|
||||||
@@ -14,6 +25,8 @@ CACHEDIR="$HOME/.cache"
|
|||||||
# source functions
|
# source functions
|
||||||
. $SCRIPTDIR/utils.sh
|
. $SCRIPTDIR/utils.sh
|
||||||
|
|
||||||
|
echo -e "${ANSI_YELLOW}Using bash version $BASH_VERSION${ANSI_RESET}"
|
||||||
|
|
||||||
# Load settings
|
# Load settings
|
||||||
# -------------
|
# -------------
|
||||||
|
|
||||||
@@ -34,7 +47,7 @@ fold_start check.out.dependencies "Checking/cloning dependencies"
|
|||||||
|
|
||||||
for mod in BASE $MODULES
|
for mod in BASE $MODULES
|
||||||
do
|
do
|
||||||
mod_uc=$(echo $mod | tr 'a-z' 'A-Z')
|
mod_uc=${mod^^}
|
||||||
eval add_dependency $mod_uc \${${mod_uc}:=master}
|
eval add_dependency $mod_uc \${${mod_uc}:=master}
|
||||||
done
|
done
|
||||||
[ -e ./configure ] && cp ${CACHEDIR}/RELEASE.local ./configure/RELEASE.local
|
[ -e ./configure ] && cp ${CACHEDIR}/RELEASE.local ./configure/RELEASE.local
|
||||||
@@ -190,7 +203,7 @@ echo "Module Tag Binaries Commit"
|
|||||||
echo "-----------------------------------------------------------------------------------"
|
echo "-----------------------------------------------------------------------------------"
|
||||||
for mod in base $MODULES
|
for mod in base $MODULES
|
||||||
do
|
do
|
||||||
mod_uc=$(echo $mod | tr 'a-z' 'A-Z')
|
mod_uc=${mod^^}
|
||||||
eval tag=\${${mod_uc}}
|
eval tag=\${${mod_uc}}
|
||||||
eval dir=${CACHEDIR}/\${${mod_uc}_DIRNAME}-$tag
|
eval dir=${CACHEDIR}/\${${mod_uc}_DIRNAME}-$tag
|
||||||
echo "$modules_to_compile" | grep -q "$dir" && stat="rebuilt" || stat="from cache"
|
echo "$modules_to_compile" | grep -q "$dir" && stat="rebuilt" || stat="from cache"
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ source_set() {
|
|||||||
local set_dir
|
local set_dir
|
||||||
local found=0
|
local found=0
|
||||||
[ "${SETUP_PATH}" ] || die "Search path for setup files (SETUP_PATH) is empty"
|
[ "${SETUP_PATH}" ] || die "Search path for setup files (SETUP_PATH) is empty"
|
||||||
for set_dir in $(echo $SETUP_PATH | tr ":" "\n")
|
for set_dir in ${SETUP_PATH//:/ }
|
||||||
do
|
do
|
||||||
if [ -e $set_dir/$set_file.set ]
|
if [ -e $set_dir/$set_file.set ]
|
||||||
then
|
then
|
||||||
@@ -132,13 +132,13 @@ add_dependency() {
|
|||||||
curdir="$PWD"
|
curdir="$PWD"
|
||||||
DEP=$1
|
DEP=$1
|
||||||
TAG=$2
|
TAG=$2
|
||||||
dep_lc=$(echo $DEP | tr 'A-Z' 'a-z')
|
dep_lc=${DEP,,}
|
||||||
eval dirname=\${${DEP}_DIRNAME:=${dep_lc}}
|
eval dirname=\${${DEP}_DIRNAME:=${dep_lc}}
|
||||||
eval reponame=\${${DEP}_REPONAME:=${dep_lc}}
|
eval reponame=\${${DEP}_REPONAME:=${dep_lc}}
|
||||||
eval repourl=\${${DEP}_REPOURL:="https://github.com/\${${DEP}_REPOOWNER:=${REPOOWNER:-epics-modules}}/${reponame}.git"}
|
eval repourl=\${${DEP}_REPOURL:="https://github.com/\${${DEP}_REPOOWNER:=${REPOOWNER:-epics-modules}}/${reponame}.git"}
|
||||||
eval varname=\${${DEP}_VARNAME:=${DEP}}
|
eval varname=\${${DEP}_VARNAME:=${DEP}}
|
||||||
eval recursive=\${${DEP}_RECURSIVE:=1}
|
eval recursive=\${${DEP}_RECURSIVE:=1}
|
||||||
recursive=$(echo $recursive | tr 'A-Z' 'a-z')
|
recursive=${recursive,,}
|
||||||
[ "$recursive" != "0" -a "$recursive" != "no" ] && recurse="--recursive"
|
[ "$recursive" != "0" -a "$recursive" != "no" ] && recurse="--recursive"
|
||||||
|
|
||||||
# determine if $DEP points to a valid release or branch
|
# determine if $DEP points to a valid release or branch
|
||||||
|
|||||||
Reference in New Issue
Block a user