William Stein wrote:
On Sun, Jan 10, 2010 at 4:30 PM, Dr. David Kirkby
<david.kir...@onetel.net> wrote:
William Stein wrote:
On Sun, Jan 10, 2010 at 5:55 AM, Dr. David Kirkby
<david.kir...@onetel.net> wrote:
Please read if you intend to edit any shell scripts, such as
spkg-install.
...

Which is just another reason why I personally never ever use "set -e"...

William
Well, failing to do so does give the problem that if something fails, the
build continues.

Personally I think exiting with no useful error message is better than
continuing, despite a failure. That results in package appearing to be
successfully installed, when they are not.


Obviously, having a useful error message is even better, but it gets a bit
tedious to put a check on every single command.

Is the following possible with sh?   Instead of

 <do something>
if [ $? -ne 0 ]; then
    echo "Foo bar argh"
    exit 1
fi

we make a function so that we can just write

<do something>
sage-err "Foo bar argh".
(causes script to exit).

We can ensure that sage-err is defined before spkg-install is run.

William

That may be possible. It's worth looking at.

Yesterday I ordered a copy of this book

http://www.amazon.com/Shell-Scripting-Recipes-Problem-Solution-Approach/dp/1590594711

it might give me some ideas. The author, Chris F.A. Johnson, is a regular poster on comp.unix.shell, and seems to 'know his stuff' better than most. According to Amazon, I should receive it Monday, but given the weather here in the UK (lots of snow), I would not be surprised if i dont get it for a while.

Dave




-- 
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
URL: http://www.sagemath.org

Reply via email to