InsetInfo: Move LaTeXConfig.lyx.in to LaTeXConfig.lyx and stop processing this file in configure.py (and chkconfig.ltx.

* development/scons/scons_manifest.py: build system changes
	* lib/doc/Makefile.am
	* lib/doc/LaTeXConfig.lyx.in: rename to
	* lib/doc/LaTeXConfig.lyx: this one.
	* lib/chkconfig.ltx: stop processing sed file and LaTeXConfig.lyx.in
	* lib/configure.py


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20910 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Bo Peng 2007-10-11 15:43:44 +00:00
parent e224999ae6
commit 8d9893ad50
5 changed files with 4 additions and 61 deletions

View File

@ -2047,7 +2047,7 @@ lib_doc_files = Split('''
Extended.lyx Extended.lyx
FAQ.lyx FAQ.lyx
Intro.lyx Intro.lyx
LaTeXConfig.lyx.in LaTeXConfig.lyx
Reference.lyx Reference.lyx
Tutorial.lyx Tutorial.lyx
UserGuide.lyx UserGuide.lyx

View File

@ -58,7 +58,6 @@
\immediate\write\layouts{"#2" "#1" "#3" "#4"}} \immediate\write\layouts{"#2" "#1" "#3" "#4"}}
\newcommand{\AddVariable}[2]{ \newcommand{\AddVariable}[2]{
\immediate\write\sed{s!@chk_#1@!#2!g}
\immediate\write\vars{chk_#1='#2'}} \immediate\write\vars{chk_#1='#2'}}
\newcommand{\AddPackage}[1]{ \newcommand{\AddPackage}[1]{
@ -130,7 +129,6 @@
% Initializes the files % Initializes the files
\typeout{\prefix Inspecting your LaTeX configuration.} \typeout{\prefix Inspecting your LaTeX configuration.}
\newwrite{\layouts} \immediate\openout \layouts = textclass.lst.tmp \newwrite{\layouts} \immediate\openout \layouts = textclass.lst.tmp
\newwrite{\sed} \immediate\openout \sed = chkconfig.sed
\newwrite{\vars} \immediate\openout \vars = chkconfig.vars \newwrite{\vars} \immediate\openout \vars = chkconfig.vars
\newwrite{\packages} \immediate\openout \packages = packages.lst.tmp \newwrite{\packages} \immediate\openout \packages = packages.lst.tmp
@ -301,7 +299,6 @@
% End of the LaTeX job % End of the LaTeX job
\immediate\closeout\layouts \immediate\closeout\layouts
\immediate\closeout\sed
\immediate\closeout\vars \immediate\closeout\vars
\immediate\closeout\packages \immediate\closeout\packages
\typeout{\prefix Inspection done.} \typeout{\prefix Inspection done.}

View File

@ -597,7 +597,7 @@ def checkLatexConfig(check_config, bool_docbook, bool_linuxdoc):
# version of textclass.lst, re-generate a default file. # version of textclass.lst, re-generate a default file.
if not os.path.isfile('textclass.lst') or not check_config: if not os.path.isfile('textclass.lst') or not check_config:
# remove the files only if we want to regenerate # remove the files only if we want to regenerate
removeFiles(['textclass.lst', 'packages.lst', 'chkconfig.sed']) removeFiles(['textclass.lst', 'packages.lst'])
# #
# Then, generate a default textclass.lst. In case configure.py # Then, generate a default textclass.lst. In case configure.py
# fails, we still have something to start lyx. # fails, we still have something to start lyx.
@ -697,59 +697,6 @@ def checkLatexConfig(check_config, bool_docbook, bool_linuxdoc):
shutil.move('packages.lst.tmp', 'packages.lst') shutil.move('packages.lst.tmp', 'packages.lst')
def createLaTeXConfig():
''' create LaTeXConfig.lyx '''
# if chkconfig.sed does not exist (because LaTeX did not run),
# then provide a standard version.
if not os.path.isfile('chkconfig.sed'):
writeToFile('chkconfig.sed', 's!@.*@!???!g\n')
print "creating packages.lst"
# if packages.lst does not exist (because LaTeX did not run),
# then provide a standard version.
if not os.path.isfile('packages.lst'):
writeToFile('packages.lst', '''
### This file should contain the list of LaTeX packages that have been
### recognized by LyX. Unfortunately, since configure could not find
### your LaTeX2e program, the tests have not been run. Run ./configure.py
### if you need to update it after a configuration change.
''')
print 'creating doc/LaTeXConfig.lyx'
#
# This is originally done by sed, using a
# tex-generated file chkconfig.sed
##sed -f chkconfig.sed ${srcdir}/doc/LaTeXConfig.lyx.in
## >doc/LaTeXConfig.lyx
# Now, we have to do it by hand (python).
#
# add to chekconfig.sed
writeToFile('chkconfig.sed', '''s!@chk_linuxdoc@!%s!g
s!@chk_docbook@!%s!g
''' % (chk_linuxdoc, chk_docbook) , append=True)
# process this sed file!!!!
lyxin = open( os.path.join(srcdir, 'doc', 'LaTeXConfig.lyx.in')).readlines()
# get the rules
p = re.compile(r's!(.*)!(.*)!g')
# process each sed replace.
for sed in open('chkconfig.sed').readlines():
if sed.strip() == '':
continue
try:
fr, to = p.match(sed).groups()
# if latex did not run, change all @name@ to '???'
if fr == '@.*@':
for line in range(len(lyxin)):
lyxin[line] = re.sub('@.*@', to, lyxin[line])
else:
for line in range(len(lyxin)):
lyxin[line] = lyxin[line].replace(fr, to)
except: # wrong sed entry?
print "Wrong sed entry in chkconfig.sed: '" + sed + "'"
sys.exit(4)
#
writeToFile( os.path.join('doc', 'LaTeXConfig.lyx'),
''.join(lyxin))
def checkModulesConfig(): def checkModulesConfig():
removeFiles(['lyxmodules.lst']) removeFiles(['lyxmodules.lst'])
@ -824,7 +771,7 @@ def checkTeXAllowSpaces():
def removeTempFiles(): def removeTempFiles():
# Final clean-up # Final clean-up
if not lyx_keep_temps: if not lyx_keep_temps:
removeFiles(['chkconfig.sed', 'chkconfig.vars', \ removeFiles(['chkconfig.vars', \
'wrap_chkconfig.ltx', 'wrap_chkconfig.log', \ 'wrap_chkconfig.ltx', 'wrap_chkconfig.log', \
'chklayouts.tex', 'missfont.log', 'chklayouts.tex', 'missfont.log',
'chklatex.ltx', 'chklatex.log']) 'chklatex.ltx', 'chklatex.log'])
@ -893,6 +840,5 @@ Options:
checkOtherEntries() checkOtherEntries()
# --without-latex-config can disable lyx_check_config # --without-latex-config can disable lyx_check_config
checkLatexConfig( lyx_check_config and LATEX != '', bool_docbook, bool_linuxdoc) checkLatexConfig( lyx_check_config and LATEX != '', bool_docbook, bool_linuxdoc)
createLaTeXConfig()
checkModulesConfig() #lyx_check_config and LATEX != '') checkModulesConfig() #lyx_check_config and LATEX != '')
removeTempFiles() removeTempFiles()

View File

@ -207,7 +207,7 @@ dist_doc_DATA = \
Extended.lyx \ Extended.lyx \
FAQ.lyx \ FAQ.lyx \
Intro.lyx \ Intro.lyx \
LaTeXConfig.lyx.in \ LaTeXConfig.lyx \
Reference.lyx \ Reference.lyx \
Tutorial.lyx \ Tutorial.lyx \
UserGuide.lyx UserGuide.lyx