#11926: "make build" should run Sage once
------------------------+---------------------------------------------------
   Reporter:  jdemeyer  |          Owner:  GeorgSWeber   
       Type:  defect    |         Status:  needs_review  
   Priority:  major     |      Milestone:  sage-4.7.3    
  Component:  build     |       Keywords:  Makefile build
Work_issues:            |       Upstream:  N/A           
   Reviewer:            |         Author:  Jeroen Demeyer
     Merged:            |   Dependencies:                
------------------------+---------------------------------------------------

Comment(by jhpalmieri):

 I'm somewhat tempted to add a new command-line option to Sage:
 {{{
 #!diff
 diff --git a/sage-sage b/sage-sage
 --- a/sage-sage
 +++ b/sage-sage
 @@ -247,6 +247,27 @@ if [ $# -gt 0 ]; then
    fi
  fi

 +# The following function creates a temporary file and stores its name
 +# in $FILE.  (It would be nice to replace this with 'mktemp', but that
 +# command has different syntax on OS X compared to linux or Solaris.)
 +sagetempfile() {
 +    FILE=`mktemp -d 2>/dev/null`
 +    if [ $? -ne 0 ]; then
 +        # presumably because the "-d" option to mktemp expects an
 argument,
 +        # e.g., on OS X.
 +        FILE=`mktemp -d -t dotsage`
 +    fi
 +}
 +
 +if [ "$1" = '--norc' -o "$1" = '--nodotsage' ]; then
 +    OLD_DOT_SAGE=$DOT_SAGE
 +    sagetempfile
 +    DOT_SAGE=$FILE && export DOT_SAGE
 +    shift
 +    sage "$@"
 +    rm -rf "$DOT_SAGE"
 +    DOT_SAGE=$OLD_DOT_SAGE && export DOT_SAGE
 +fi

  LOGFILE="$SAGE_ROOT/sage.log"
  LOGOPT=""

 }}}
 We should probably check exit codes for various things here, and of course
 this would need to be documented.  If we had this, then in `Makefile`, we
 could replace "sage --docbuild ..." with "sage --norc --docbuild ...".  We
 could possibly do the same with "make test", etc.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11926#comment:13>
Sage <http://www.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.

Reply via email to