On Mon, Jan 11, 2010 at 5:42 PM, William Stein <wst...@gmail.com> wrote:
> Cool.  Instead of suggesting people use bits of code like this in
> their spkg-install's, why don't we make a single *sage sh library*
> that gets used.  It could start as a script
>
>    local/bin/sage-spkg-lib
>
> that gets sourced before spkg-install gets sourced.  It could contain
> at least the following functions:
>
>    * unsetmake  -- based on what you wrote above
>
>    * check_err    -- based on what Gonzalo posted in another thread.
>
> I think this would be much better than scattering coding snippets in
> spkg-installs, since there is one place where we can fix/change
> everything related to something like this.

Sounds good... Let me suggest

arg1 ()
{
    echo $1
}

resetmake ()
{
    MAKE=`arg1 $MAKE`
}

This avoids spawning awk altogether... (won't spawn anything if echo
is builtin as in bash)

Alternative (no echo):

setmake1 ()
{
    MAKE=$1
}

resetmake ()
{
    setmake1 $MAKE
}


Also, it might be a good idea to define:

sage-spkg-lib ()
{
    return
}

The idea is to override the loading of the shell library so it's not
loaded more than once.
(not sure if dashes are allowed in function names, so that may not work).

Alternative:

alias sage-spkg-lib=true

(still no spawning if true is builtin)

Gonzalo
-- 
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