From bb53335350715cde22cf2e25a583c0914e1f7bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Fri, 21 Oct 2011 23:22:58 +0000 Subject: [PATCH] cmake fix po generation/update: msguniq.exe doesn't like dos line endings (produces broken pot files) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39914 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/cmake/po/dos2unix.py | 17 +++++++++++++++++ development/cmake/po/unix2dos.py | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 development/cmake/po/dos2unix.py create mode 100644 development/cmake/po/unix2dos.py diff --git a/development/cmake/po/dos2unix.py b/development/cmake/po/dos2unix.py new file mode 100644 index 0000000000..1ba822b4c6 --- /dev/null +++ b/development/cmake/po/dos2unix.py @@ -0,0 +1,17 @@ +#! /usr/bin/env python + +############### +import sys + +for fname in sys.argv[1:]: + infile = open( fname, "rb" ) + instr = infile.read() + infile.close() + outstr = instr.replace( "\r\n", "\n" ).replace( "\r", "\n" ) + + if len(outstr) == len(instr): + continue + + outfile = open( fname , "wb" ) + outfile.write( outstr ) + outfile.close() \ No newline at end of file diff --git a/development/cmake/po/unix2dos.py b/development/cmake/po/unix2dos.py new file mode 100644 index 0000000000..170b8a7a8d --- /dev/null +++ b/development/cmake/po/unix2dos.py @@ -0,0 +1,17 @@ +#! /usr/bin/env python + +############### +import sys + +for fname in sys.argv[1:]: + infile = open( fname, "rb" ) + instr = infile.read() + infile.close() + outstr = instr.replace( "\r\n", "\n" ).replace( "\r", "\n" ).replace( "\n", "\r\n" ) + + if len(outstr) == len(instr): + continue + + outfile = open( fname , "wb" ) + outfile.write( outstr ) + outfile.close() \ No newline at end of file