William Stein wrote: > 2009/7/12 Dr. David Kirkby <david.kir...@onetel.net>: >> William Stein wrote: >>> On Wed, Jul 1, 2009 at 8:00 PM, Craig Citro<craigci...@gmail.com> wrote: >>>>> Perhaps this facility exists. If not, do others thinks it would be worth >>>>> adding? >>>>> >>>> Yep, this is very handy -- and indeed already exists. Try sage -f -m >>>> foo.spkg. (I have no idea what "m" stands for ... maybe William does?) >>> It used to be that nothing was deleted from spkg/build during the build >>> process. >>> Hence during the *m*ake process, sage-spkg was always run with the -m >>> flag, for "make". However, now-a-days not deleting from spkg/build >>> would use up too much disk space in most cases. So it's a >>> historical accident. I remember the moment I named it that thinking >>> "I will regret this choice of name". >>> >>>> This will leave everything in $SAGE_ROOT/spkg/build after building the >>>> spkg. >>>> >>>> Or, alternatively, if you wanted it to work for *every* spkg, you >>>> could change the default value of DELETE_TMP on line 76 of >>>> $SAGE_ROOT/local/bin/sage-spkg. >>> It would be nice to make an environment variable that makes this happen >>> no matter what, as David Kirkby suggested aobve. One way would be to >>> change the variable DELETE_TMP to SAGE_DELETE_TMP then change line 76 >>> to only set it to 0 if it is not already defined. That would I think >>> nicely do the trick. >>> >>> William >>> >> >> What package builds $SAGE_ROOT/local/bin/sage-spkg ? I will have a go >> at sorting this out. > > It's the sage_scripts spkg. > > -- William
I tried to do this, but setting DELETE_TMP to 0 causes a syntax error. The first line is the original line. The second line is what I think it would be sensible to change that line to, but it fails. The third line just sets DELETE_TMP to 0 instead of 1. That causes an error in the file. #DELETE_TMP=1 #DELETE_TMP="${REMOVE_TMP:-1}" DELETE_TMP=0 In theory, if the second line was left uncommented, then setting the environment variable REMOVE_TMP to 0 would make DELETE_TMP change from 1 to 0. Otherwise, it would default to 1. Here's a simple example script, which shows the idea, but I can't seem to get it to work in that big script. drkir...@kestrel:[~] $ cat assign #!/bin/bash DELETE_TMP="${REMOVE_TMP:-1}" echo "DELETE_TMP=$DELETE_TMP" drkir...@kestrel:[~] $ ./assign DELETE_TMP=1 drkir...@kestrel:[~] $ export REMOVE_TMP=0 drkir...@kestrel:[~] $ ./assign DELETE_TMP=0 drkir...@kestrel:[~] $ export REMOVE_TMP= drkir...@kestrel:[~] $ ./assign DELETE_TMP=1 --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send 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 -~----------~----~----~----~------~----~------~--~---