Commit 2d366a45 authored by sunny's avatar sunny

branches/zip: Minor fix, remove the constant, calculate the length of

string dynamically.
parent be9e4416
...@@ -26,6 +26,14 @@ ...@@ -26,6 +26,14 @@
set -eu 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 # Set to dummy value if not defined
: ${CC="x"} : ${CC="x"}
: ${CXX="x"} : ${CXX="x"}
...@@ -48,6 +56,7 @@ INNODIR="storage/innobase" ...@@ -48,6 +56,7 @@ INNODIR="storage/innobase"
DYNTMPFILE="/tmp/configure.$$" DYNTMPFILE="/tmp/configure.$$"
DYNCONFIG="$INNODIR/scripts/dynconfig" DYNCONFIG="$INNODIR/scripts/dynconfig"
SVN_REPO="https://svn.innodb.com/svn/innodb" SVN_REPO="https://svn.innodb.com/svn/innodb"
SVN_REPO_STRLEN=`strlen $SVN_REPO`
if [ $# -lt 4 ]; then if [ $# -lt 4 ]; then
echo>&2 "Usage: $0 mysql-source-dir build-dir innosrc (/path/to/mysqlbug | - followed by configure options)" echo>&2 "Usage: $0 mysql-source-dir build-dir innosrc (/path/to/mysqlbug | - followed by configure options)"
...@@ -80,7 +89,7 @@ rm -rf $INNODIR ...@@ -80,7 +89,7 @@ rm -rf $INNODIR
# If we are building from the SVN repository then use svn tools # If we are building from the SVN repository then use svn tools
# otherwise the assumption is that we are dealing with a gzipped # otherwise the assumption is that we are dealing with a gzipped
# tarball. # tarball.
REPO=${SVN:0:33} REPO=${SVN:0:$SVN_REPO_STRLEN}
if [ "$REPO"x = "$SVN_REPO"x ]; then if [ "$REPO"x = "$SVN_REPO"x ]; then
$SVN_CO "$SVN" $INNODIR $SVN_CO "$SVN" $INNODIR
else else
......
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