Ticket #10469: trac_10469.patch

File trac_10469.patch, 1.5 KB (added by iandrus, 11 years ago)
  • sage-env

    # HG changeset patch
    # User Ivan Andrus <darthandrus@gmail.com>
    # Date 1300925116 25200
    # Node ID 20decc69e60efb1bab5b1cfc1f88d831eac6deb4
    # Parent  016049e835b3a55bf91652001b2ac1804503f90c
    #10469: Only source sage-env once
    
    diff --git a/sage-env b/sage-env
    a b  
    1 #!/usr/bin/env bash
     1#!/this/script/must/be/sourced -*- shell-script -*-
    22
    33###########################################################################
    44#
    55#  Set environment variables for building and/or running Sage.
    66#  You must source this; see below!
    7 # 
     7#
    88#  AUTHORS:   William Stein                            2005-12
    99#             David Kirkby <david.kirkby@onetel.net>   2005-12-17
    1010#
     
    1313##########################################################################
    1414#
    1515#  If you want to set all environment variables for your shell like
    16 #  they are during the build of Sage packages, type 
     16#  they are during the build of Sage packages, type
    1717#
    18 #             source local/bin/sage-env 
     18#             source local/bin/sage-env
    1919#
    2020#  from the SAGE_ROOT directory.   To do the same from a /bin/bash
    21 #  script use ". local/bin/sage-env". 
    22 # 
     21#  script use ". local/bin/sage-env".
     22#
    2323##########################################################################
    2424
     25# Don't execute the commands more than once
     26if [ "x$SAGE_ENV_SOURCED" = "x" ]; then
     27    SAGE_ENV_SOURCED=1
     28    export SAGE_ENV_SOURCED
     29else
     30    # Already sourced, nothing to do.
     31    return 0
     32fi
     33
     34
    2535# GUESS SAGE_ROOT from pwd
    2636SAVEDIR="`pwd`"
    2737if [ -f sage -a -d spkg ]; then