~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to config/autorun.sh

  • Committer: Jay Pipes
  • Date: 2009-03-16 15:20:27 UTC
  • mto: (934.3.7 mordred)
  • mto: This revision was merged to the branch mainline in revision 938.
  • Revision ID: jpipes@serialcoder-20090316152027-njlreaim8vxqta6c
Fixes ENUM field type to throw an error on bad data input.  0 is now not
allowed on insertion.  MySQL allows 0, in the manual it states 0 is "the
null string error index" whatever that means.  Drizzle doesn't allow it.

Corrected test cases.

Also cleans up indentation on JOIN::exec() which was bothering me.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
#
3
 
#  Copyright (C) 2006 Jan Kneschke
4
 
#  Copyright (C) 2009 Sun Microsystems, Inc.
5
 
#  All rights reserved.
6
 
7
 
#  Redistribution and use in source and binary forms, with or without
8
 
#  modification, are permitted provided that the following conditions are met:
9
 
10
 
#  1. Redistributions of source code must retain the above copyright
11
 
#     notice, this list of conditions and the following disclaimer.
12
 
#  2. Redistributions in binary form must reproduce the above copyright
13
 
#     notice, this list of conditions and the following disclaimer in the
14
 
#     documentation and/or other materials provided with the distribution.
15
 
#  3. The name of the author may not be used to endorse or promote products
16
 
#     derived from this software without specific prior written permission.
17
 
18
 
#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 
#  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 
#  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 
#  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
22
 
#  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23
 
#  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24
 
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25
 
#  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26
 
#  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27
 
#  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28
 
#  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 
#
 
1
#!/usr/bin/env bash
 
2
# Taken from lighthttpd server (BSD). Thanks Jan!
30
3
# Run this to generate all the initial makefiles, etc.
31
4
 
32
5
die() { echo "$@"; exit 1; }
33
6
 
34
 
# --force means overwrite ltmain.sh script if it already exists 
 
7
# LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
35
8
LIBTOOLIZE_FLAGS=" --automake --copy --force"
 
9
# ACLOCAL=${ACLOCAL:-aclocal}
 
10
ACLOCAL_FLAGS="-I m4"
 
11
# AUTOHEADER=${AUTOHEADER:-autoheader}
 
12
# AUTOMAKE=${AUTOMAKE:-automake}
36
13
# --add-missing instructs automake to install missing auxiliary files
37
 
# and --force to overwrite them if they already exist
38
 
AUTOMAKE_FLAGS="--add-missing --copy --force --foreign"
39
 
ACLOCAL_FLAGS="-I m4"
 
14
# --copy tells it to make copies and not symlinks
 
15
AUTOMAKE_FLAGS="--add-missing --copy --force"
 
16
# AUTOCONF=${AUTOCONF:-autoconf}
40
17
 
41
18
ARGV0=$0
42
19
ARGS="$@"
43
20
 
 
21
 
44
22
run() {
45
23
        echo "$ARGV0: running \`$@' $ARGS"
46
24
        $@ $ARGS
47
25
}
48
26
 
49
 
# Try to locate a program by using which, and verify that the file is an
50
 
# executable
51
 
locate_binary() {
52
 
  for f in $@
53
 
  do
54
 
    file=`which $f 2>/dev/null | grep -v '^no '`
55
 
    if test -n "$file" -a -x "$file"; then
56
 
      echo $file
57
 
      return 0
58
 
    fi
59
 
  done
60
 
 
61
 
  echo "" 
62
 
  return 1
63
 
}
64
 
 
65
 
 
66
 
if test -f config/pre_hook.sh
67
 
then
68
 
  . config/pre_hook.sh
 
27
## jump out if one of the programs returns 'false'
 
28
set -e
 
29
 
 
30
if test -d ".bzr" ; then
 
31
  bzr log --short > ChangeLog || touch ChangeLog
 
32
  BZR_REVNO=`bzr revno`
 
33
  BZR_REVID=`bzr log -r-1 --show-ids | grep revision-id | awk '{print $2}' | head -1`
 
34
  BZR_BRANCH=`bzr nick`
 
35
  RELEASE_DATE=`date +%Y.%m`
 
36
  RELEASE_VERSION="${RELEASE_DATE}.${BZR_REVNO}"
 
37
  if test "x${BZR_BRANCH}" != "xdrizzle" ; then
 
38
    RELEASE_VERSION="${RELEASE_VERSION}-${BZR_BRANCH}"
 
39
  fi
 
40
  sed -e "s/@BZR_REVNO@/${BZR_REVNO}/" \
 
41
      -e "s/@BZR_REVID@/${BZR_REVID}/" \
 
42
      -e "s/@BZR_BRANCH@/${BZR_BRANCH}/" \
 
43
      -e "s/@RELEASE_DATE@/${RELEASE_DATE}/" \
 
44
      -e "s/@RELEASE_VERSION@/${RELEASE_VERSION}/" \
 
45
    m4/bzr_version.m4.in > m4/bzr_version.m4.new
 
46
 
 
47
  if ! diff m4/bzr_version.m4.new m4/bzr_version.m4 >/dev/null 2>&1 ; then
 
48
    mv m4/bzr_version.m4.new m4/bzr_version.m4
 
49
  else
 
50
    rm m4/bzr_version.m4.new
 
51
  fi
 
52
else
 
53
  touch ChangeLog
69
54
fi
70
55
 
71
 
# Try to detect the supported binaries if the user didn't
72
 
# override that by pushing the environment variable
73
56
if test x$LIBTOOLIZE = x; then
74
 
  LIBTOOLIZE=`locate_binary glibtoolize libtoolize-1.5 libtoolize`
75
 
  if test x$LIBTOOLIZE = x; then
76
 
    die "Did not find a supported libtoolize"
 
57
  if test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then
 
58
    LIBTOOLIZE=glibtoolize
 
59
  elif test \! "x`which libtoolize-1.5 2> /dev/null | grep -v '^no'`" = x; then
 
60
    LIBTOOLIZE=libtoolize-1.5
 
61
  elif test \! "x`which libtoolize 2> /dev/null | grep -v '^no'`" = x; then
 
62
    LIBTOOLIZE=libtoolize
 
63
  elif test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then
 
64
    LIBTOOLIZE=glibtoolize
 
65
  else
 
66
    echo "libtoolize 1.5.x wasn't found, exiting"; exit 1
77
67
  fi
78
68
fi
79
69
 
80
70
if test x$ACLOCAL = x; then
81
 
  ACLOCAL=`locate_binary aclocal-1.11 aclocal-1.10 aclocal-1.9 aclocal19 aclocal`
82
 
  if test x$ACLOCAL = x; then
83
 
    die "Did not find a supported aclocal"
 
71
  if test \! "x`which aclocal-1.10 2> /dev/null | grep -v '^no'`" = x; then
 
72
    ACLOCAL=aclocal-1.10
 
73
  elif test \! "x`which aclocal110 2> /dev/null | grep -v '^no'`" = x; then
 
74
    ACLOCAL=aclocal110
 
75
  elif test \! "x`which aclocal 2> /dev/null | grep -v '^no'`" = x; then
 
76
    ACLOCAL=aclocal
 
77
  else 
 
78
    echo "automake 1.10.x (aclocal) wasn't found, exiting"; exit 1
84
79
  fi
85
80
fi
86
81
 
87
82
if test x$AUTOMAKE = x; then
88
 
  AUTOMAKE=`locate_binary automake-1.11 automake-1.10 automake-1.9 automake19 automake`
89
 
  if test x$AUTOMAKE = x; then
90
 
    die "Did not find a supported automake"
 
83
  if test \! "x`which automake-1.10 2> /dev/null | grep -v '^no'`" = x; then
 
84
    AUTOMAKE=automake-1.10
 
85
  elif test \! "x`which automake110 2> /dev/null | grep -v '^no'`" = x; then
 
86
    AUTOMAKE=automake110
 
87
  elif test \! "x`which automake 2> /dev/null | grep -v '^no'`" = x; then
 
88
    AUTOMAKE=automake
 
89
  else 
 
90
    echo "automake 1.10.x wasn't found, exiting"; exit 1
91
91
  fi
92
92
fi
93
93
 
 
94
 
 
95
## macosx has autoconf-2.59 and autoconf-2.60
94
96
if test x$AUTOCONF = x; then
95
 
  AUTOCONF=`locate_binary autoconf-2.59 autoconf259 autoconf`
96
 
  if test x$AUTOCONF = x; then
97
 
    die "Did not find a supported autoconf"
 
97
  if test \! "x`which autoconf-2.59 2> /dev/null | grep -v '^no'`" = x; then
 
98
    AUTOCONF=autoconf-2.59
 
99
  elif test \! "x`which autoconf259 2> /dev/null | grep -v '^no'`" = x; then
 
100
    AUTOCONF=autoconf259
 
101
  elif test \! "x`which autoconf 2> /dev/null | grep -v '^no'`" = x; then
 
102
    AUTOCONF=autoconf
 
103
  else 
 
104
    echo "autoconf 2.59+ wasn't found, exiting"; exit 1
98
105
  fi
99
106
fi
100
107
 
101
108
if test x$AUTOHEADER = x; then
102
 
  AUTOHEADER=`locate_binary autoheader-2.59 autoheader259 autoheader`
103
 
  if test x$AUTOHEADER = x; then
104
 
    die "Did not find a supported autoheader"
 
109
  if test \! "x`which autoheader-2.59 2> /dev/null | grep -v '^no'`" = x; then
 
110
    AUTOHEADER=autoheader-2.59
 
111
  elif test \! "x`which autoheader259 2> /dev/null | grep -v '^no'`" = x; then
 
112
    AUTOHEADER=autoheader259
 
113
  elif test \! "x`which autoheader 2> /dev/null | grep -v '^no'`" = x; then
 
114
    AUTOHEADER=autoheader
 
115
  else 
 
116
    echo "autoconf 2.59+ (autoheader) wasn't found, exiting"; exit 1
105
117
  fi
106
118
fi
107
119
 
 
120
 
 
121
# --force means overwrite ltmain.sh script if it already exists 
108
122
run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Can't execute libtoolize"
 
123
 
109
124
run $ACLOCAL $ACLOCAL_FLAGS || die "Can't execute aclocal"
110
125
run $AUTOHEADER || die "Can't execute autoheader"
111
126
run $AUTOMAKE $AUTOMAKE_FLAGS  || die "Can't execute automake"
112
127
run $AUTOCONF || die "Can't execute autoconf"
113
 
 
114
 
if test -f config/post_hook.sh
115
 
then
116
 
  . config/post_hook.sh
117
 
fi
118
 
 
119
 
echo "---"
120
 
echo "Configured with the following tools:"
121
 
echo "  * `$LIBTOOLIZE --version | head -1`"
122
 
echo "  * `$ACLOCAL --version | head -1`"
123
 
echo "  * `$AUTOHEADER --version | head -1`"
124
 
echo "  * `$AUTOMAKE --version | head -1`"
125
 
echo "  * `$AUTOCONF --version | head -1`"
126
 
echo "---"
 
128
echo -n "Automade with: "
 
129
$AUTOMAKE --version | head -1
 
130
echo -n "Configured with: "
 
131
$AUTOCONF --version | head -1