Hi All, I'm revising my buildscripts (long, _slow_ process) and as part of that I'm changing from prodigious use of '&&', with tests of "$?" when necessary, to 'set -e' and relying on the script to fail. But I'm having some results that aren't what I expected - advice would be welcome. Long details, for those who care:
In general, I have a series of "driver" scripts (build all of /tools, build all of chroot, build all of xorg, etc), and each of these invokes a number of other scripts, mostly to build and install a package : these I call the "client" scripts. For the client scripts, 'set -e' seems to be working fine. But for the driver scripts I've continued to use '&&', even with 'set -e', because things started to fall over after a client script failed [ i.e. the driver continued, attempting to run the subsequent client scripts ]. Today, I've just discovered that my build of GConf3 was incomplete (logs seem to start after the main install, which did nothing) - enough has changed since then that I'm willing to believe that was a result of some other problem. The end result was that the gconf-2.0.pc files was missing. I've just rerun GConf, now it is fine so I'm not worrying about that part of the problem. What surprises me, and causes me to admit that I'm out of my depth here, is that my gnome driver script invoked the client script to build geoclue. That failed in 'configure' because gconf-2.0.pc was missing [ so far, so good ], but the '&&'s in the driver script nevertheless allowed it to invoke webkit, yelp, epiphany, epiphany-extensions [ which all failed, of course ] together with all the other gnome packages I build (which all seem to have installed ok). Summary: both the 'driver' and 'client' scripts use 'set -e', the clients fail as expected if things go wrong, but the driver appears to be [sometimes] seeing a status of 0 from them. I'm sure that my earlier testing implied that a forced failure in a client (invoking a non-existent command) returned a non-zero status to the driver script, so '&&' caused the driver to bypass remaining packages. Probably, this means that my understanding of set -e is a long way short of adequate :) I can live with that, but help in understanding the problem - and in stopping the driver script after the client fails - would be much appreciated. This is on a build of LFS-7.2, bash --version | head -n1 : GNU bash, version 4.2.36(2)-release (x86_64-unknown-linux-gnu) For anyone who kept reading, Thanks. ĸen -- das eine Mal als Tragödie, das andere Mal als Farce -- http://linuxfromscratch.org/mailman/listinfo/lfs-chat FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page
