#6550: We need to be able to save itermediate files - particulary for ATLAS
-------------------------+--------------------------------------------------
Reporter: drkirkby | Owner: drkirkby
Type: enhancement | Status: new
Priority: major | Milestone: sage-4.1.1
Component: build | Keywords:
Reviewer: | Author:
Merged: |
-------------------------+--------------------------------------------------
Comment(by drkirkby):
It seems if I only change DELETE_TMP to 0, then it does work. But any
attempt I have made to get the code to behave in the way an environment
variable is set, just fails miserably. This is despite the fact that a bit
of code that changes the value of DELETE_TMP outwide of Sage works fine.
Also, I note from that script that the -m option is supposed to be used to
save temp files, which is what william told me. But it only works for one
file.
I wrote a small script (see below) which sets the variable DELETE_TMP to 0
or 1 in exactly the same way as in the script inside $SAGE_ROOT/local/bin
/sage-spkg However, the setting is done depending on the value of an
environment variable. (I've tried simpler version too, but whatever I
try, I can't seem to get something that allows an environment variable to
decide if temporary files are kept or not.
{{{
kir...@t2:[~] $ ./testprog
TMPVAR=1
DELETE_TMP=1
DELETE_TMP is one
kir...@t2:[~] $ export DELETE_TMP_FILES=0
kir...@t2:[~] $ ./testprog
TMPVAR=0
DELETE_TMP=0
DELETE_TMP is zero
kir...@t2:[~] $ export DELETE_TMP_FILES=1
kir...@t2:[~] $ ./testprog
TMPVAR=1
DELETE_TMP=1
DELETE_TMP is one
kir...@t2:[~] $ unset DELETE_TMP_FILES
kir...@t2:[~] $ ./testprog
TMPVAR=1
DELETE_TMP=1
DELETE_TMP is one
}}}
Here's the code which generates this.
{{{
#!/bin/sh
TMPVAR="${DELETE_TMP_FILES-1}"
echo "TMPVAR=$TMPVAR"
if [ "x$TMPVAR" = "x0" ] ; then
DELETE_TMP=0
elif [ "x$TMPVAR" = "x1" ] ; then
DELETE_TMP=1
else
echo "Error in enviroment variable DELETE_TMP_FILES."
echo "The enviroment variable DELETE_TMP_FILES should be set to 0 to
keep the temporary files, or 1 to delete them. By default they are
deleted"
exit
fi
echo "DELETE_TMP=$DELETE_TMP"
if [ $DELETE_TMP -eq 1 ] ; then
echo "DELETE_TMP is one"
fi
if [ $DELETE_TMP -eq 0 ] ; then
echo "DELETE_TMP is zero"
fi
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6550#comment:4>
Sage <http://sagemath.org/>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---