Sophie

Sophie

distrib > Mandriva > current > i586 > media > contrib-release-src > by-pkgid > 00815a9fc0aa3cff159e1d13a67ec81a > files > 10

sagemath-4.4-1mdv2010.1.src.rpm

diff -p -up sage-4.4/sage/interfaces/qepcad.py.orig sage-4.4/sage/interfaces/qepcad.py
--- sage-4.4/spkg/build/sage-4.4/sage/interfaces/qepcad.py.orig	2010-04-28 17:47:54.310196979 -0300
+++ sage-4.4/spkg/build/sage-4.4/sage/interfaces/qepcad.py	2010-04-28 17:48:20.541197389 -0300
@@ -542,6 +542,8 @@ from sage.misc.preparser import implicit
 
 from expect import Expect, ExpectFunction, AsciiArtString
 
+QEPCAD_LOCAL = "/usr/share/qepcad"
+
 def _qepcad_cmd(memcells=None):
     r"""
     Construct a QEPCAD command line.  Optionally set the
@@ -558,7 +560,7 @@ def _qepcad_cmd(memcells=None):
         memcells_arg = '+N%s' % memcells
     else:
         memcells_arg = ''
-    return "env qe=%s qepcad %s"%(sage.misc.misc.SAGE_LOCAL, memcells_arg)
+    return "env qe=%s qepcad %s"%(QEPCAD_LOCAL, memcells_arg)
 
 _command_info_cache = None
 
@@ -579,7 +581,7 @@ def _update_command_info():
 
     cache = {}
 
-    with open('%s/bin/qepcad.help'%sage.misc.misc.SAGE_LOCAL) as help:
+    with open('%s/bin/qepcad.help'%QEPCAD_LOCAL) as help:
         assert(help.readline().strip() == '@')
 
         while True:
@@ -627,23 +629,22 @@ def _update_command_info():
 
     _command_info_cache = cache
             
-_rewrote_qepcadrc = False
+_rewrote_qepcadrc = True	# don't rewrite a system file
 def _rewrite_qepcadrc():
     r"""
     Write the file \file{default.qepcadrc} to specify a path to Singular
     (which QEPCAD uses for Gr\"obner basis computations).
 
     EXAMPLES:
-        sage: from sage.interfaces.qepcad import _rewrite_qepcadrc
+        sage: from sage.interfaces.qepcad import _rewrite_qepcadrc, QEPCAD_LOCAL
         sage: _rewrite_qepcadrc()
-        sage: from sage.misc.misc import SAGE_LOCAL
-        sage: open('%s/default.qepcadrc'%SAGE_LOCAL).readlines()[-1]
-        'SINGULAR .../local//bin'
+        sage: open('%s/default.qepcadrc'%QEPCAD_LOCAL).readlines()[-1]
+        'SINGULAR /usr/bin'
     """
     global _rewrote_qepcadrc
     if _rewrote_qepcadrc: return
 
-    SL = sage.misc.misc.SAGE_LOCAL
+    SL = QEPCAD_LOCAL
     fn = '%s/default.qepcadrc'%SL
     text = \
 """# THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT
@@ -655,7 +656,7 @@ def _rewrite_qepcadrc():
 # so that it gets used for some computer algebra
 # computations is the only feature.
 #####################################################
-SINGULAR %s/bin""" % SL
+SINGULAR /usr/bin"""
 
     open(fn, 'w').write(text)