From cbe16b87046baaa1f644c11d539ea1b46b24116c Mon Sep 17 00:00:00 2001 From: sunny Date: Mon, 12 Nov 2007 23:40:36 +0000 Subject: [PATCH] branches/zip: Minor fix, remove the constant, calculate the length of string dynamically. --- scripts/build-plugin.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/build-plugin.sh b/scripts/build-plugin.sh index 3709419ea67..cd6fc185831 100755 --- a/scripts/build-plugin.sh +++ b/scripts/build-plugin.sh @@ -26,6 +26,14 @@ set -eu +# Calculate the length of a string +strlen() +{ + STRLEN=`echo "$@" | wc -c | cut -c1-8` + STRLEN=`expr $STRLEN - 1` + echo $STRLEN +} + # Set to dummy value if not defined : ${CC="x"} : ${CXX="x"} @@ -48,6 +56,7 @@ INNODIR="storage/innobase" DYNTMPFILE="/tmp/configure.$$" DYNCONFIG="$INNODIR/scripts/dynconfig" SVN_REPO="https://svn.innodb.com/svn/innodb" +SVN_REPO_STRLEN=`strlen $SVN_REPO` if [ $# -lt 4 ]; then echo>&2 "Usage: $0 mysql-source-dir build-dir innosrc (/path/to/mysqlbug | - followed by configure options)" @@ -80,7 +89,7 @@ rm -rf $INNODIR # If we are building from the SVN repository then use svn tools # otherwise the assumption is that we are dealing with a gzipped # tarball. -REPO=${SVN:0:33} +REPO=${SVN:0:$SVN_REPO_STRLEN} if [ "$REPO"x = "$SVN_REPO"x ]; then $SVN_CO "$SVN" $INNODIR else