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 as. Otherwise, LyX will not be able to run a number of tests. Note
that users can run these tests manually with Tools>Reconfigure. 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 with the lyx2lyx script (this script is called automatically when
opening a file). Python 3.0 or later is not supported. opening a file). Python 3.0 or later is not supported.

View File

@ -30,10 +30,10 @@ Prerequisites:
-------------- --------------
* Python: * Python:
Python >= 2.6.0 is required to run scons, but Python >= 2.3.4 is used by Python >= 2.6.0 is required to run scons, while LyX itself requires
lyx itself so the newer version is needed. Python is widely Python >= 2.4.0 for scripts such as configure.py. Python is widely
available on non-windows systems. Windows users can download and install available on non-windows systems. Windows users can download and
python from http://www.python.org. install python from http://www.python.org.
* SCons: * SCons:
scons >= 1.1.0 is needed. You can either use a full system-wide 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 A decent LaTeX2e installation (e.g. TeX Live for Linux, MikTeX for
Windows). Windows).
Python 2.3 or later to convert old LyX files and for helper scripts. Python 2.4 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 Note 1: Python 2.4 or later is required due to the subprocess module.
to a pre-unicode format, as previous versions are affected by a bug Note 2: Python 2.6 or later is recommended on Windows.
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.
Note 3: Python 3.0 or later is not supported. Note 3: Python 3.0 or later is not supported.
How does the LyX version scheme work? How does the LyX version scheme work?

View File

@ -8,7 +8,7 @@
# \author Bo Peng # \author Bo Peng
# Full author contact details are available in file CREDITS. # 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 # set up logging
logging.basicConfig(level = logging.DEBUG, logging.basicConfig(level = logging.DEBUG,
@ -60,9 +60,16 @@ def cmdOutput(cmd):
'''utility function: run a command and get its output as a string '''utility function: run a command and get its output as a string
cmd: command to run cmd: command to run
''' '''
fout = os.popen(cmd) if os.name == 'nt':
output = fout.read() b = False
fout.close() 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() return output.strip()
@ -1135,15 +1142,14 @@ def checkLatexConfig(check_config, bool_docbook):
cl.close() cl.close()
# #
# we have chklayouts.tex, then process it # we have chklayouts.tex, then process it
fout = os.popen(LATEX + ' wrap_chkconfig.ltx') ret = 1
while True: latex_out = cmdOutput(LATEX + ' wrap_chkconfig.ltx')
line = fout.readline() for line in latex_out.splitlines():
if not line:
break;
if re.match('^\+', line): if re.match('^\+', line):
logger.info(line.strip()) logger.info(line.strip())
# if the command succeeds, None will be returned # return None if the command succeeds
ret = fout.close() if line == "+Inspection done.":
ret = None
# #
# currently, values in chhkconfig are only used to set # currently, values in chhkconfig are only used to set
# \font_encoding # \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 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 * ADVANCED FIND AND REPLACE