From 822e1717626467b13de66bb50942240e5e036438 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Sun, 7 Jul 2013 09:56:34 +0200 Subject: [PATCH] Fix inconsistent version in .lyx files (#7951) LyX, lyx2lyx and tex2lyx produce now all the same version indicator consisting only of the major and minor version. It is not decided yet whether future development versions will add a -dev suffix, but for 2.1.0 this change fixes the inconsistencies. --- lib/lyx2lyx/lyx2lyx_version.py.in | 4 +++- src/Buffer.cpp | 2 ++ src/tex2lyx/Preamble.cpp | 6 +++++- src/tex2lyx/test/CJK.lyx.lyx | 2 +- src/tex2lyx/test/CJKutf8.lyx.lyx | 2 +- src/tex2lyx/test/DummyDocument.lyx.lyx | 2 +- src/tex2lyx/test/Dummy~Document.lyx.lyx | 2 +- src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx | 2 +- src/tex2lyx/test/box-color-size-space-align.lyx.lyx | 2 +- src/tex2lyx/test/test-insets.lyx.lyx | 2 +- src/tex2lyx/test/test-modules.lyx.lyx | 2 +- src/tex2lyx/test/test-refstyle-theorems.lyx.lyx | 2 +- src/tex2lyx/test/test-structure.lyx.lyx | 2 +- src/tex2lyx/test/test.lyx.lyx | 2 +- src/tex2lyx/test/verbatim.lyx.lyx | 2 +- 15 files changed, 22 insertions(+), 14 deletions(-) diff --git a/lib/lyx2lyx/lyx2lyx_version.py.in b/lib/lyx2lyx/lyx2lyx_version.py.in index e99da0bf64..d3b6609986 100644 --- a/lib/lyx2lyx/lyx2lyx_version.py.in +++ b/lib/lyx2lyx/lyx2lyx_version.py.in @@ -16,7 +16,9 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -version = "@PACKAGE_VERSION@" +# Important: Keep the version formatting in sync with LyX and +# tex2lyx (bug 7951) +version = "@LYX_MAJOR_VERSION@.@LYX_MINOR_VERSION@" if __name__ == "__main__": pass diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 014dcd6929..6ef03f6c78 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -1404,6 +1404,8 @@ bool Buffer::write(ostream & ofs) const // The top of the file should not be written by params(). // write out a comment in the top of the file + // Important: Keep the version formatting in sync with lyx2lyx and + // tex2lyx (bug 7951) ofs << "#LyX " << lyx_version_major << "." << lyx_version_minor << " created this file. For more info see http://www.lyx.org/\n" << "\\lyxformat " << LYX_FORMAT << "\n" diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp index 9759663808..0dda8de51b 100644 --- a/src/tex2lyx/Preamble.cpp +++ b/src/tex2lyx/Preamble.cpp @@ -21,6 +21,7 @@ #include "Layout.h" #include "Lexer.h" #include "TextClass.h" +#include "version.h" #include "support/convert.h" #include "support/FileName.h" @@ -1040,7 +1041,10 @@ bool Preamble::writeLyXHeader(ostream & os, bool subdoc) } // output the LyX file settings - os << "#LyX file created by tex2lyx " << PACKAGE_VERSION << "\n" + // Important: Keep the version formatting in sync with LyX and + // lyx2lyx (bug 7951) + os << "#LyX file created by tex2lyx " << lyx_version_major << '.' + << lyx_version_minor << '\n' << "\\lyxformat " << LYX_FORMAT << '\n' << "\\begin_document\n" << "\\begin_header\n" diff --git a/src/tex2lyx/test/CJK.lyx.lyx b/src/tex2lyx/test/CJK.lyx.lyx index dcd4d5bd43..5a73840979 100644 --- a/src/tex2lyx/test/CJK.lyx.lyx +++ b/src/tex2lyx/test/CJK.lyx.lyx @@ -1,4 +1,4 @@ -#LyX file created by tex2lyx 2.1.0 +#LyX file created by tex2lyx 2.1 \lyxformat 474 \begin_document \begin_header diff --git a/src/tex2lyx/test/CJKutf8.lyx.lyx b/src/tex2lyx/test/CJKutf8.lyx.lyx index 61071a79fa..894bb062da 100644 --- a/src/tex2lyx/test/CJKutf8.lyx.lyx +++ b/src/tex2lyx/test/CJKutf8.lyx.lyx @@ -1,4 +1,4 @@ -#LyX file created by tex2lyx 2.1.0 +#LyX file created by tex2lyx 2.1 \lyxformat 474 \begin_document \begin_header diff --git a/src/tex2lyx/test/DummyDocument.lyx.lyx b/src/tex2lyx/test/DummyDocument.lyx.lyx index 8bb60fcb31..12f4950441 100644 --- a/src/tex2lyx/test/DummyDocument.lyx.lyx +++ b/src/tex2lyx/test/DummyDocument.lyx.lyx @@ -1,4 +1,4 @@ -#LyX file created by tex2lyx 2.1.0 +#LyX file created by tex2lyx 2.1 \lyxformat 474 \begin_document \begin_header diff --git a/src/tex2lyx/test/Dummy~Document.lyx.lyx b/src/tex2lyx/test/Dummy~Document.lyx.lyx index 3d7022364c..4335937fb7 100644 --- a/src/tex2lyx/test/Dummy~Document.lyx.lyx +++ b/src/tex2lyx/test/Dummy~Document.lyx.lyx @@ -1,4 +1,4 @@ -#LyX file created by tex2lyx 2.1.0 +#LyX file created by tex2lyx 2.1 \lyxformat 474 \begin_document \begin_header diff --git a/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx b/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx index fd6f4c3cdb..bcf4c0f566 100644 --- a/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx +++ b/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx @@ -1,4 +1,4 @@ -#LyX file created by tex2lyx 2.1.0 +#LyX file created by tex2lyx 2.1 \lyxformat 474 \begin_document \begin_header diff --git a/src/tex2lyx/test/box-color-size-space-align.lyx.lyx b/src/tex2lyx/test/box-color-size-space-align.lyx.lyx index 90824d41af..c09701a262 100644 --- a/src/tex2lyx/test/box-color-size-space-align.lyx.lyx +++ b/src/tex2lyx/test/box-color-size-space-align.lyx.lyx @@ -1,4 +1,4 @@ -#LyX file created by tex2lyx 2.1.0 +#LyX file created by tex2lyx 2.1 \lyxformat 474 \begin_document \begin_header diff --git a/src/tex2lyx/test/test-insets.lyx.lyx b/src/tex2lyx/test/test-insets.lyx.lyx index 608948c5c2..c7ba2a51dc 100644 --- a/src/tex2lyx/test/test-insets.lyx.lyx +++ b/src/tex2lyx/test/test-insets.lyx.lyx @@ -1,4 +1,4 @@ -#LyX file created by tex2lyx 2.1.0 +#LyX file created by tex2lyx 2.1 \lyxformat 474 \begin_document \begin_header diff --git a/src/tex2lyx/test/test-modules.lyx.lyx b/src/tex2lyx/test/test-modules.lyx.lyx index 8cd8b65f46..4fd4178775 100644 --- a/src/tex2lyx/test/test-modules.lyx.lyx +++ b/src/tex2lyx/test/test-modules.lyx.lyx @@ -1,4 +1,4 @@ -#LyX file created by tex2lyx 2.1.0 +#LyX file created by tex2lyx 2.1 \lyxformat 474 \begin_document \begin_header diff --git a/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx b/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx index 37d43938d6..b29f4c127f 100644 --- a/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx +++ b/src/tex2lyx/test/test-refstyle-theorems.lyx.lyx @@ -1,4 +1,4 @@ -#LyX file created by tex2lyx 2.1.0 +#LyX file created by tex2lyx 2.1 \lyxformat 474 \begin_document \begin_header diff --git a/src/tex2lyx/test/test-structure.lyx.lyx b/src/tex2lyx/test/test-structure.lyx.lyx index adcc292c1c..e7de51d1cd 100644 --- a/src/tex2lyx/test/test-structure.lyx.lyx +++ b/src/tex2lyx/test/test-structure.lyx.lyx @@ -1,4 +1,4 @@ -#LyX file created by tex2lyx 2.1.0 +#LyX file created by tex2lyx 2.1 \lyxformat 474 \begin_document \begin_header diff --git a/src/tex2lyx/test/test.lyx.lyx b/src/tex2lyx/test/test.lyx.lyx index ec4c54080f..21ecd0afed 100644 --- a/src/tex2lyx/test/test.lyx.lyx +++ b/src/tex2lyx/test/test.lyx.lyx @@ -1,4 +1,4 @@ -#LyX file created by tex2lyx 2.1.0 +#LyX file created by tex2lyx 2.1 \lyxformat 474 \begin_document \begin_header diff --git a/src/tex2lyx/test/verbatim.lyx.lyx b/src/tex2lyx/test/verbatim.lyx.lyx index 8d7d3cea97..f0a1d2b7c9 100644 --- a/src/tex2lyx/test/verbatim.lyx.lyx +++ b/src/tex2lyx/test/verbatim.lyx.lyx @@ -1,4 +1,4 @@ -#LyX file created by tex2lyx 2.1.0 +#LyX file created by tex2lyx 2.1 \lyxformat 474 \begin_document \begin_header