>>>>> "Jean-Marc" == Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes:

>>>>> "Georg" == Georg Baum <[EMAIL PROTECTED]> writes:
Georg> That looks like a good reason to rewrite the whole .pot
Georg> manipulation code in python. Then we can ditch awk and tell
Georg> Luis that python is now really required for building ;-)

Jean-Marc> I'd rather find a less radical solution.

Jean-Marc> What about the following? It is not perfect, but looks good
Jean-Marc> enough for now...

Oops, here is the patch.

JMarc

Index: po/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/po/ChangeLog,v
retrieving revision 1.230
diff -u -p -r1.230 ChangeLog
--- po/ChangeLog	13 Sep 2005 13:53:42 -0000	1.230
+++ po/ChangeLog	15 Sep 2005 13:16:45 -0000
@@ -1,3 +1,9 @@
+2005-09-15  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* Makefile.in.in: fix quoting of awk regexp constants. Use sed
+	instead of awk to change single backslashes to double ones in
+	LabelString*, since it is not possible to do this portably in awk.
+
 2005-09-12  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* Makefile.in.in: when invoking awk, use POSIX regexps only. 
Index: po/Makefile.in.in
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/po/Makefile.in.in,v
retrieving revision 1.52
diff -u -p -r1.52 Makefile.in.in
--- po/Makefile.in.in	13 Sep 2005 13:53:42 -0000	1.52
+++ po/Makefile.in.in	15 Sep 2005 13:16:45 -0000
@@ -420,7 +420,7 @@ qt_l10n.pot: $(top_srcdir)/src/frontends
 			gsub(/&amp;/, "\\&", line); \
 			gsub(/&lt;/, "<", line); \
 			gsub(/&gt;/, ">", line); \
-			gsub(/\"/, "\\\"", line); \
+			gsub(/"/, "\\\"", line); \
 			if (length(line) > 0) {\
 				printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n",\
 					fixupfilename(), FNR, line); \
@@ -438,7 +438,7 @@ layouts_l10n.pot: $(top_srcdir)/lib/layo
 		/^Style / { \
 			line=$$0; \
 			sub(/Style /, "", line); \
-			gsub(/\"/, "", line); \
+			gsub(/"/, "", line); \
 			gsub(/_/, " ", line); \
 			printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
 				fixupfilename(), FNR, line); \
@@ -446,8 +446,7 @@ layouts_l10n.pot: $(top_srcdir)/lib/layo
 		/LabelString[A-Za-z]*/ { \
 			line=$$0; \
 			sub(/[[:space:]]*LabelString[A-Za-z]*[[:space:]]*/, "", line); \
-			gsub(/\"/, "", line); \
-			gsub(/\/, "\\\\", line); \
+			gsub(/"/, "", line); \
 			if (line != "") \
 			  printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
 				 fixupfilename(), FNR, line); \
@@ -455,18 +454,19 @@ layouts_l10n.pot: $(top_srcdir)/lib/layo
 		/GuiName/ { \
 			line=$$0; \
 			sub(/[[:space:]]*GuiName[[:space:]]*/, "", line); \
-			gsub(/\"/, "", line); \
+			gsub(/"/, "", line); \
 			printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
 				fixupfilename(), FNR, line); \
 		} \
 		/ListName/ { \
 			line=$$0; \
 			sub(/[[:space:]]*ListName[[:space:]]*/, "", line); \
-			gsub(/\"/, "", line); \
+			gsub(/"/, "", line); \
 			printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
 				fixupfilename(), FNR, line); \
 		}' \
-	${top_srcdir}/lib/layouts/*.layout ${top_srcdir}/lib/layouts/*.inc > $@
+	${top_srcdir}/lib/layouts/*.layout ${top_srcdir}/lib/layouts/*.inc \
+	| sed 's/\\/\\\\/g' > $@
 
 languages_l10n.pot: $(top_srcdir)/lib/languages
 	$(AWK) -v top_srcdir="$(top_srcdir)" ' \
@@ -480,7 +480,7 @@ languages_l10n.pot: $(top_srcdir)/lib/la
 		{ \
 			match($$0,"\"[^\"]*\""); \
 			lang=substr($$0,RSTART,RLENGTH); \
-			gsub(/\"/, "", lang); \
+			gsub(/"/, "", lang); \
 			printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
 			fixupfilename(), FNR, lang); \
 		}' \

Reply via email to