Ticket #5155: 5155_sage_location.patch

File 5155_sage_location.patch, 1.5 KB (added by jdemeyer, 10 years ago)
  • sage-location

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1347821016 -7200
    # Node ID 47f8580408f6f3085905cc68c22d67acb53858ba
    # Parent  4e31399e39e2f4173429e84644eb003ed7885cfa
    sage-location: add write_config_files()
    
    diff --git a/sage-location b/sage-location
    a b  
    215215            pass
    216216
    217217
     218def write_config_files():
     219    """
     220    Write various configuration files which contain the ``SAGE_ROOT``
     221    path.
     222    """
     223    # Currently only one file (for the experimental package qepcad):
     224    # $SAGE_ROOT/local/default.qepcadrc
     225    f = open(os.path.join(SAGE_LOCAL, 'default.qepcadrc'), 'w')
     226    text = \
     227"""# THIS FILE IS AUTOMATICALLY GENERATED by sage-location -- DO NOT EDIT
     228
     229#####################################################
     230# QEPCAD rc file.
     231# This file allows for some customization of QEPCAD.
     232# Right now, the ability to give a path to Singular,
     233# so that it gets used for some computer algebra
     234# computations is the only feature.
     235#####################################################
     236SINGULAR %s
     237""" % os.path.join(SAGE_LOCAL, 'bin')
     238
     239    f.write(text)
     240    f.close()
     241
     242
    218243def remove_files(path, remove_extensions):
    219244    """
    220245    Walk the tree starting at ``path``, and remove all files with
     
    245270    update_library_files()
    246271    update_pkgconfig_files()
    247272    make_scripts_relative()
     273    write_config_files()
    248274
    249275    # Compiled python files need to be regenerated, so we remove them:
    250276    remove_files(os.path.join(SAGE_LOCAL, 'lib', 'python'),