5 messages in com.mysql.lists.plusplusRe: patch for bootstrap script
FromSent OnAttachments
Jonathan Wakely15 Dec 2007 11:20.patch
Warren Young17 Dec 2007 06:11 
Jonathan Wakely17 Dec 2007 12:56 
Warren Young28 Dec 2007 01:37 
Jonathan Wakely28 Dec 2007 12:53 
Subject:Re: patch for bootstrap script
From:Jonathan Wakely (mys@kayari.org)
Date:12/17/2007 12:56:08 PM
List:com.mysql.lists.plusplus

On 17/12/2007, Warren Young <mysq@etr-usa.com> wrote:

Jonathan Wakely wrote:

Should bootstrap be patched like so?

Hmmm, sh logic doesn't work like I thought, apparently.

What we have here is a mix of things which must succeed and things which don't have to. Your version makes one of the latter mandatory, which can make it fail unnecessarily.

Ah, I see. You could have done this:

mandatory1 && mandatory2 && { not_mandatory >/dev/null 2>&1 ; mandatory3 ; } && mandatory4 etc.

The { bracketed group } will return the exit status of the last command in the group, so that lets you chain them all, but ignore the exit status of "non_mandatory"

e.g. this prints "yes" true && true && { false ; true ; } && echo yes

I've checked in something that should have the effect you want. Can you try it on your bakefile-less system? I'd rather not remove Bakefile here just to test that it fails gracefully on such a system.

Now I get this output:

+ bakefilize ./bootstrap: line 48: bakefilize: command not found + '[' -n '' ']' + '[' -z '' ']' + echo BOOTSTRAP 'FAILED!' BOOTSTRAP FAILED! + echo

+ exit 1

which is better, but I think the placement of the set +/-x commands is still off.

You should be able to reproduce this like so: ln -s /bin/false bakefile PATH=.:$PATH ./bootstrap

just "rm bakefile" when finished.

If the second part fails I see this:

+ bakefilize + bakefile_gen [1/1] generating autoconf from ./mysql++.bkl writing ./Makefile.in writing ./autoconf_inc.m4 Exception exceptions.TypeError: "'NoneType' object is not callable" in ignored Exception exceptions.TypeError: "'NoneType' object is not callable" in ignored 2 files modified + bakefile -f gnu -o Makefile.simple -DBUILDLIBRARY=no mysql++.bkl no changes in Makefile.simple + set +x aclocal: couldn't open directory `/usr/local/share/aclocal': No such file or directory BOOTSTRAP FAILED!

(not sure about the warnings, but the aclocal error is because I have no /usr/local/share/aclocal directory, bakefile isn't installed under /usr/local, so I've modified bootstrap to use a BAKEFILE_ROOT dir, which I can override: BAKEFILE_ROOT=${BAKEFILE_ROOT:-/usr/local}

that syntax won't work in traditional "sh" so for portability it should be:

if [ -z "$BAKEFILE_ROOT" ] ; then BAKEFILE_ROOT=/usr/local fi

I changed the aclocal call to use -I $BAKEFILE_ROOT/share/aclocal/ and I set BAKEFILE_ROOT when running boostrap.

Jon