#11932: Allow running Sage with a temporary DOT_SAGE directory
---------------------------------+------------------------------------------
       Reporter:  jdemeyer       |         Owner:  leif          
           Type:  enhancement    |        Status:  needs_review  
       Priority:  major          |     Milestone:  sage-5.0      
      Component:  scripts        |    Resolution:                
       Keywords:                 |   Work issues:                
Report Upstream:  N/A            |     Reviewers:  Jeroen Demeyer
        Authors:  John Palmieri  |     Merged in:                
   Dependencies:  #11926         |      Stopgaps:                
---------------------------------+------------------------------------------

Old description:

> Apply
>
>  - [attachment:trac_11932-root.patch] to the Sage root repository
>  - [attachment:trac_11932-scripts.patch] to the local/bin repository
>  - [attachment:trac_11932-doc.patch] to the Sage repository

New description:

 Version which ignores matplotlib issue: apply

  - [attachment:trac_11932-root.patch] to the Sage root repository
  - [attachment:trac_11932-scripts.patch] to the local/bin repository
  - [attachment:trac_11932-doc.patch] to the Sage repository

 ------

 Version which deals with matplotlib issue: apply

  - [attachment:trac_11932-root.v2.patch] to the Sage root repository
  - [attachment:trac_11932-scripts.patch] to the local/bin repository
  - [attachment:trac_11932-doc.patch] to the Sage repository
  - [attachment:trac_11932-sage.v2.patch] to the Sage repository

--

Comment (by jhpalmieri):

 Here are two versions. If we want the easy root, the first version just
 makes the change
 {{{
 #!diff
 diff --git a/spkg/bin/sage b/spkg/bin/sage
 --- a/spkg/bin/sage
 +++ b/spkg/bin/sage
 @@ -238,7 +238,7 @@ cd "$SAGE_ROOT"
  if [ "$1" = '--nodotsage' ]; then
      export DOT_SAGE=`mktemp -d ${TMPDIR:-/tmp}/dotsageXXXXXX`
      shift
 -    command sage "$@"
 +    command "$0" "$@"
      status=$?
      rm -rf "$DOT_SAGE"
      exit $status
 }}}
 The second version deals (I think) with the matplotlib issue, creating the
 config directory in sage.misc.misc, where other subdirectories of
 `DOT_SAGE` are created. It's not a very significant difference: the file
 [attachment:trac_11932-sage.v2.patch] and these changes to the root patch:
 {{{
 #!diff
 diff --git a/spkg/bin/sage-env b/spkg/bin/sage-env
 --- a/spkg/bin/sage-env
 +++ b/spkg/bin/sage-env
 @@ -281,8 +281,9 @@ fi

  if [ "$DOT_SAGE" = "" ]; then
      # It is *not* an error if this directory does not exist, it will
 -    # be created in spkg/bin/sage.  This also works if $HOME/.sage is a
 -    # symbolic link to a non-existing directory.
 +    # be created in spkg/bin/sage or devel/sage/sage/misc/misc.py.
 +    # This also works if $HOME/.sage is a symbolic link to a
 +    # non-existing directory.
      DOT_SAGE=`resolvelinks "$HOME/.sage"`

      # In theory, DOT_SAGE is not required to have a trailing slash.
 @@ -340,8 +341,7 @@ if [ -f "$MPLINITFILE" ]; then
          MPLCONFIGDIR="$DOT_SAGE/matplotlib"
      fi
      export MPLCONFIGDIR
 -    # Create the directory, because matplotlib doesn't seem to be happy
 otherwi
 -    mkdir -p "$MPLCONFIGDIR"
 +    # The directory is created when Sage starts (see sage.misc.misc).
  fi

  # Add some directories to $LD_LIBRARY_PATH:
 }}}
 If you have time to look at the second version, please consider it. If you
 would rather deal with just the first version here, we can move the other
 version to a new ticket.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11932#comment:27>
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