subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdo...@apache.org
Subject svn commit: r1380056 - in /subversion/trunk: build/generator/gen_win.py build/generator/templates/build_locale.ezt build/strip-po-charset.py subversion/libsvn_subr/nls.c subversion/svn_private_config.hw
Date Sun, 02 Sep 2012 21:03:15 GMT
Author: rdonch
Date: Sun Sep  2 21:03:14 2012
New Revision: 1380056

URL: http://svn.apache.org/viewvc?rev=1380056&view=rev
Log:
On Windows, don't strip the Content-Type field from .po files during their compilation.

GNU libintl, by default, converts the l10n strings into the locale encoding, while Subversion
requires UTF-8. This conversion can be suppressed by calling bind_textdomain_codeset, but
certain old versions of libintl don't have that, so the Unix build system checks for the existence
of that function, and if it's not present, strips the Content-Type header from the .po files
(which prevents encoding conversion, as well, but makes msgfmt complain).

When building on Windows, this stripping is done unconditionally, but is completely unnecessary:

- On Windows, we only support linking with svn-win32-libintl, which is hacked to disable all
encoding conversions.
- Even if someone links with with his own version of libintl, it's a safe bet that it will
be new enough to support bind_textdomain_codeset, so we can just call that.

This patch removes Content-Type stripping on Windows, which gets rid of msgfmt warnings, as
well as simplifies the build system.

* build/generator/build_locale.ezt: Remove the strip-po-charset.py invocation.

* build/generator/gen_win.py:
    (POFile.__init__): don't store the .spo file name.

* build/strip-po-charset.py: Delete.

* subversion/libsvn_subr/nls.c:
    (svn_nls_init): Move the bind_textdomain_codeset call out of the #ifdef WIN32 block, so
it's executed on Windows, as well.

* subversion/svn_private_config.hw: Indicate that bind_textdomain_codeset is available if
NLS is enabled.

Approved by: brane


Removed:
    subversion/trunk/build/strip-po-charset.py
Modified:
    subversion/trunk/build/generator/gen_win.py
    subversion/trunk/build/generator/templates/build_locale.ezt
    subversion/trunk/subversion/libsvn_subr/nls.c
    subversion/trunk/subversion/svn_private_config.hw

Modified: subversion/trunk/build/generator/gen_win.py
URL: http://svn.apache.org/viewvc/subversion/trunk/build/generator/gen_win.py?rev=1380056&r1=1380055&r2=1380056&view=diff
==============================================================================
--- subversion/trunk/build/generator/gen_win.py (original)
+++ subversion/trunk/build/generator/gen_win.py Sun Sep  2 21:03:14 2012
@@ -1615,7 +1615,6 @@ class POFile:
   "Item class for holding po file info"
   def __init__(self, base):
     self.po = base + '.po'
-    self.spo = base + '.spo'
     self.mo = base + '.mo'
 
 # MSVC paths always use backslashes regardless of current platform

Modified: subversion/trunk/build/generator/templates/build_locale.ezt
URL: http://svn.apache.org/viewvc/subversion/trunk/build/generator/templates/build_locale.ezt?rev=1380056&r1=1380055&r2=1380056&view=diff
==============================================================================
--- subversion/trunk/build/generator/templates/build_locale.ezt (original)
+++ subversion/trunk/build/generator/templates/build_locale.ezt Sun Sep  2 21:03:14 2012
@@ -22,11 +22,8 @@ cd ..\..\..\subversion\po
 mkdir ..\..\%1\mo
 set exitcode=0
 [for pofiles]echo Running msgfmt on [pofiles.po]...
-python ..\..\build\strip-po-charset.py [pofiles.po] [pofiles.spo]
+msgfmt.exe -c -o ..\..\%1\mo\[pofiles.mo] [pofiles.po]
 if errorlevel 1 goto err
-msgfmt.exe -c -o ..\..\%1\mo\[pofiles.mo] [pofiles.spo]
-if errorlevel 1 goto err
-del [pofiles.spo]
 [end]
 goto end
 @rem **************************************************************************

Modified: subversion/trunk/subversion/libsvn_subr/nls.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/nls.c?rev=1380056&r1=1380055&r2=1380056&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/nls.c (original)
+++ subversion/trunk/subversion/libsvn_subr/nls.c Sun Sep  2 21:03:14 2012
@@ -121,10 +121,12 @@ svn_nls_init(void)
 #else /* ! WIN32 */
       bindtextdomain(PACKAGE_NAME, SVN_LOCALE_DIR);
     }
+#endif /* WIN32 */
+
 #ifdef HAVE_BIND_TEXTDOMAIN_CODESET
   bind_textdomain_codeset(PACKAGE_NAME, "UTF-8");
 #endif /* HAVE_BIND_TEXTDOMAIN_CODESET */
-#endif /* WIN32 */
+
 #endif /* ENABLE_NLS */
 
   return err;

Modified: subversion/trunk/subversion/svn_private_config.hw
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn_private_config.hw?rev=1380056&r1=1380055&r2=1380056&view=diff
==============================================================================
--- subversion/trunk/subversion/svn_private_config.hw (original)
+++ subversion/trunk/subversion/svn_private_config.hw Sun Sep  2 21:03:14 2012
@@ -83,6 +83,7 @@
 #include <libintl.h>
 #define _(x) dgettext(PACKAGE_NAME, x)
 #define Q_(x1, x2, n) dngettext(PACKAGE_NAME, x1, x2, n)
+#define HAVE_BIND_TEXTDOMAIN_CODESET
 #else
 #define _(x) (x)
 #define Q_(x1, x2, n) (((n) == 1) ? x1 : x2)



Mime
View raw message