Fix bug #7718 (Configure fails if shell autorun commands are enabled in the registry)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@39565 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2011-08-29 22:05:26 +00:00
parent 176eb924a5
commit a6aebc801a
5 changed files with 30 additions and 23 deletions

View File

@ -77,7 +77,9 @@ The two following programs should be available at configuration time:
as. Otherwise, LyX will not be able to run a number of tests. Note
that users can run these tests manually with Tools>Reconfigure.
o Python 2.3 or newer installed to be able to import older LyX files
o Python 2.4 or newer must be installed. Python is used for many
simple tasks that are executed by external scripts, such as the
automatic configuration step and the import of older LyX documents
with the lyx2lyx script (this script is called automatically when
opening a file). Python 3.0 or later is not supported.

View File

@ -30,10 +30,10 @@ Prerequisites:
--------------
* Python:
Python >= 2.6.0 is required to run scons, but Python >= 2.3.4 is used by
lyx itself so the newer version is needed. Python is widely
available on non-windows systems. Windows users can download and install
python from http://www.python.org.
Python >= 2.6.0 is required to run scons, while LyX itself requires
Python >= 2.4.0 for scripts such as configure.py. Python is widely
available on non-windows systems. Windows users can download and
install python from http://www.python.org.
* SCons:
scons >= 1.1.0 is needed. You can either use a full system-wide scons

10
README
View File

@ -33,13 +33,9 @@ What do I need to run LyX?
A decent LaTeX2e installation (e.g. TeX Live for Linux, MikTeX for
Windows).
Python 2.3 or later to convert old LyX files and for helper scripts.
Note 1: Python 2.3.4 or later is required for exporting LyX files
to a pre-unicode format, as previous versions are affected by a bug
about the normalization of unicode strings.
Note 2: Python 2.4.0 or later is required for the clean_dvi.py script,
which, however, is only used on Windows, where at least Python 2.6.0
is anyway recommended.
Python 2.4 or later to convert old LyX files and for helper scripts.
Note 1: Python 2.4 or later is required due to the subprocess module.
Note 2: Python 2.6 or later is recommended on Windows.
Note 3: Python 3.0 or later is not supported.
How does the LyX version scheme work?

View File

@ -8,7 +8,7 @@
# \author Bo Peng
# Full author contact details are available in file CREDITS.
import sys, os, re, shutil, glob, logging
import sys, os, re, shutil, glob, logging, subprocess
# set up logging
logging.basicConfig(level = logging.DEBUG,
@ -60,9 +60,16 @@ def cmdOutput(cmd):
'''utility function: run a command and get its output as a string
cmd: command to run
'''
fout = os.popen(cmd)
output = fout.read()
fout.close()
if os.name == 'nt':
b = False
cmd = 'cmd /d /c ' + cmd
else:
b = True
pipe = subprocess.Popen(cmd, shell=b, close_fds=b, stdin=subprocess.PIPE, \
stdout=subprocess.PIPE, universal_newlines=True)
pipe.stdin.close()
output = pipe.stdout.read()
pipe.stdout.close()
return output.strip()
@ -1135,15 +1142,14 @@ def checkLatexConfig(check_config, bool_docbook):
cl.close()
#
# we have chklayouts.tex, then process it
fout = os.popen(LATEX + ' wrap_chkconfig.ltx')
while True:
line = fout.readline()
if not line:
break;
ret = 1
latex_out = cmdOutput(LATEX + ' wrap_chkconfig.ltx')
for line in latex_out.splitlines():
if re.match('^\+', line):
logger.info(line.strip())
# if the command succeeds, None will be returned
ret = fout.close()
# return None if the command succeeds
if line == "+Inspection done.":
ret = None
#
# currently, values in chhkconfig are only used to set
# \font_encoding

View File

@ -258,6 +258,9 @@ What's new
- On Windows, fix call to Computer Algebra System programs (bug 7715).
- On Windows, fix configuration failure when shell autorun commands are
are enabled in the registry (bug 7718).
* ADVANCED FIND AND REPLACE