[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Stripping the Content-Type line from .po files (build time)

From: Erik Huelsmann <e.huelsmann_at_gmx.net>
Date: 2004-05-05 21:21:41 CEST

The patch below is for Makefile based systems. A solution for the Windows
build is in the works.

Because the current Makefile system does not use python yet (and I don't
want to add that requirement), I decided to go with a sed solution.

Because the Solaris version of msgfmt does not seem to be able to take stdin
as an input argument (and thus there is no way to pipe the sed output into
msgfmt), I have created an intermediate target to send the sed output to.
Currently I called it .spo but any name will do.

There may be one little problem with the patch: The match will work with the
auto-generated lines from GNU gettext, but might fail if spacing or line
wrapping are off... (I guess chances are slim that users start to edit these
lines manually though)



Rip charset designation from po files at build time (Makefile part).

* Makefile (.SUFFIXES): Add intermediate suffix for 'sed' output.
  (.po.mo): Rename to ...
  (.spo.mo): ... this
  (.po.spo): New intermediate target which rips out the offending
    "Content-Type" line.


Index: Makefile.in
--- Makefile.in (revision 9628)
+++ Makefile.in (working copy)
@@ -495,7 +495,8 @@
 # Implicit rules for creating outputs from input files
-.SUFFIXES: .c .lo .o .la-a .la .texi .info .dvi .txt .html .ps .pdf .po .mo
+.SUFFIXES: .c .lo .o .la-a .la .texi .info .dvi .txt .html .ps .pdf \
+ .po .spo .mo
        $(COMPILE) -o $@ -c $<
@@ -525,7 +526,10 @@
        $(DVIPDF) $< $@
+ sed '/^"Content-Type: text\/plain; charset=UTF-8\\n"$$/d' $< > $@
        $(MSGFMT) -o $@ $<
 install-docs: install-man @INSTALL_INFO@

"Sie haben neue Mails!" - Die GMX Toolbar informiert Sie beim Surfen!
Jetzt aktivieren unter http://www.gmx.net/info
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed May 5 21:22:06 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.