Fix tex2lyx include output for roundtrip

In roundtrip mode, tex2lyx produces documents with extension lyx.lyx, so that
the original files are not overwritten on re-export. This was not done for
included documents which were converted, and this broke 'make dist'.
This commit is contained in:
Georg Baum 2013-05-26 16:06:11 +02:00
parent 83a6107392
commit 3ebf1c9bac
13 changed files with 28 additions and 20 deletions

View File

@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.1.0dev
\lyxformat 471
\lyxformat 472
\begin_document
\begin_header
\textclass article

View File

@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.1.0dev
\lyxformat 471
\lyxformat 472
\begin_document
\begin_header
\textclass article

View File

@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.1.0dev
\lyxformat 471
\lyxformat 472
\begin_document
\begin_header
\textclass article

View File

@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.1.0dev
\lyxformat 471
\lyxformat 472
\begin_document
\begin_header
\textclass article
@ -142,7 +142,7 @@ has_inner_box 1
inner_pos "c"
use_parbox 0
use_makebox 1
width "-999col%"
width ""
special "none"
height "1in"
height_special "totalheight"
@ -663,7 +663,7 @@ has_inner_box 0
inner_pos "c"
use_parbox 0
use_makebox 0
width "-999col%"
width ""
special "none"
height "1in"
height_special "totalheight"
@ -688,7 +688,7 @@ has_inner_box 0
inner_pos "c"
use_parbox 0
use_makebox 0
width "-999col%"
width ""
special "none"
height "1in"
height_special "totalheight"

View File

@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.1.0dev
\lyxformat 471
\lyxformat 472
\begin_document
\begin_header
\textclass article
@ -734,7 +734,7 @@ We can input files too, like this
\begin_inset CommandInset include
LatexCommand input
preview false
filename "DummyDocument.lyx"
filename "DummyDocument.lyx.lyx"
\end_inset
@ -742,7 +742,7 @@ filename "DummyDocument.lyx"
\begin_inset CommandInset include
LatexCommand include
preview false
filename "Dummy Document.lyx"
filename "Dummy Document.lyx.lyx"
\end_inset
@ -750,7 +750,7 @@ filename "Dummy Document.lyx"
\begin_inset CommandInset include
LatexCommand include
preview false
filename "Dummy Document.lyx"
filename "Dummy Document.lyx.lyx"
\end_inset
@ -758,7 +758,7 @@ filename "Dummy Document.lyx"
\begin_inset CommandInset include
LatexCommand include
preview false
filename "Dummy~Document.lyx"
filename "Dummy~Document.lyx.lyx"
\end_inset
@ -766,7 +766,7 @@ filename "Dummy~Document.lyx"
\begin_inset CommandInset include
LatexCommand include
preview false
filename "Dummy~Document.lyx"
filename "Dummy~Document.lyx.lyx"
\end_inset

View File

@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.1.0dev
\lyxformat 471
\lyxformat 472
\begin_document
\begin_header
\textclass amsart

View File

@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.1.0dev
\lyxformat 471
\lyxformat 472
\begin_document
\begin_header
\textclass book

View File

@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.1.0dev
\lyxformat 471
\lyxformat 472
\begin_document
\begin_header
\textclass article

View File

@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.1.0dev
\lyxformat 471
\lyxformat 472
\begin_document
\begin_header
\textclass article

View File

@ -1,5 +1,5 @@
#LyX file created by tex2lyx 2.1.0dev
\lyxformat 471
\lyxformat 472
\begin_document
\begin_header
\textclass article

View File

@ -818,6 +818,12 @@ bool skipChildren()
}
bool roundtripMode()
{
return roundtrip;
}
namespace {
/*!

View File

@ -193,6 +193,8 @@ extern bool overwriteFiles();
extern bool copyFiles();
/// Shall we skip child documents and keep them as TeX?
extern bool skipChildren();
/// Does tex2lyx run in roundtrip mode?
extern bool roundtripMode();
/*!

View File

@ -3929,8 +3929,8 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
string const absfigname =
changeExtension(abstexname, ".fig");
fix_child_filename(filename);
string const lyxname =
changeExtension(filename, ".lyx");
string const lyxname = changeExtension(filename,
roundtripMode() ? ".lyx.lyx" : ".lyx");
string const abslyxname = makeAbsPath(
lyxname, getParentFilePath(false)).absFileName();
bool xfig = false;