Peter Jeremy wrote: > On 2009-Aug-02 12:24:26 -0700, William Stein <wst...@gmail.com> wrote: >>> 1) It uses 'set -e' to exit the spkg-install if any error occurs. >> +1 we should do that for all spkg-install's > > Agreed (and there are other shell-scripts that probably should also > have 'set -e'). But this is a very intrusive change since it touches > at least one file in virtually every spkg. > > It's also non-trivial: The spkg-install files are full of constructs > like: > sage_fortran -c -fPIC *.f > if [ $? -ne 0 ]; then > echo "Error compiling blas." > exit 1 > fi > In order to add 'set -e', this needs to be changed to directly test the > exit code rather than using $? - otherwise the script will immediately > exit when the command fails. The revised code should look like: > if ! sage_fortran -c -fPIC *.f; then > echo "Error compiling blas." > exit 1 > fi > > In addition to the above, there is a non-trivial amount of shell code > embedded in python scripts that also needs improved error checking. > > Assuming that the change should be implemented, what approach should > be used: > 1) Big bang: Someone goes through all the skpg files and fixes them > in one go with no other changes as part of a major release. > 2) If you touch any part of an spkg, you must add 'set -e' and fixup > any subsequent fallout in all scripts in that spkg. > 3) If you touch a script, you must fixup that script. > 4) Fix it if you feel like it. >
I think (2). As you note, it does need some care when applied. If it is applied where it should not, it will not give a useful error message, but it will at least exit. One could reasonably say that is better than carrying on, when something is broken. --~--~---------~--~----~------------~-------~--~----~ To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---