strip-po-charset.py

Checkout Tools
  • last updated 7 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
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

  1. … 4 more files in changeset.
Apply ASF license headers to a number of files included under that license

but lacking said header.

Patch by: Niall Pemberton <niallp{_AT_}apache.org>

  1. … 175 more files in changeset.
Python 3 compatibility:

Update calls to print() in 'subversion/bindings' and 'subversion/libsvn_subr'

directories.

* subversion/bindings/ctypes-python/csvn/ext/listmixin.py:

* subversion/bindings/ctypes-python/examples/example.py:

* subversion/bindings/ctypes-python/examples/log.py:

* subversion/bindings/ctypes-python/examples/mucc.py:

* subversion/libsvn_subr/genctype.py: Call print().

* build/strip-po-charset.py

(main): Fix call to print() for compatibility with Python 2.

  1. … 5 more files in changeset.
Python 3 compatibility:

Use str.replace() instead of string.replace().

* build/generator/gen_base.py:

* build/generator/gen_make.py:

* build/generator/gen_msvc_dsp.py:

* build/generator/gen_vcnet_vcproj.py:

* build/generator/gen_win.py:

* build/generator/swig/header_wrappers.py:

* build/strip-po-charset.py: Use str.replace() instead of string.replace().

  1. … 6 more files in changeset.
Python 3 compatibility:

Update calls to print() in 'build' directory, 'gen-make.py' and 'win-tests.py'.

* build/generator/extractor.py:

* build/generator/gen_win.py:

* build/generator/swig/checkout_swig_header.py:

* build/generator/swig/external_runtime.py:

* build/generator/swig/header_wrappers.py:

* build/get-py-info.py:

* build/getversion.py:

* build/run_tests.py:

* build/strip-po-charset.py:

* build/win32/make_dist.py:

* gen-make.py:

* win-tests.py: Call print() or file.write().

  1. … 11 more files in changeset.
For all executable Python scripts:

- set svn:executable if not already set.

- add/change shebang to '#!/usr/bin/env python' if not already that.

* build/generator/extractor.py

* build/strip-po-charset.py

* build/run_tests.py

* subversion/libsvn_subr/genctype.py

* tools/test-scripts/svntest/encode-base64.py

* tools/hook-scripts/log-police.py

* tools/bdb/erase-all-text-data.py

* tools/bdb/svn-bdb-view.py

* tools/bdb/whatis-rep.py

* tools/dev/mlpatch.py

* tools/dev/verify-history.py

* tools/dev/normalize-dump.py

* tools/examples/check-modified.py

* contrib/hook-scripts/case-insensitive.py

* contrib/hook-scripts/check-case-insensitive.py

* contrib/server-side/authz_svn_group.py

  1. … 15 more files in changeset.
* build/get-py-info.py

* build/run_tests.py

Revert part of r17905, removing the svn:executable property for

these scripts. They're meant to be run with the version of python

detected by configure -- clarify usage text accordingly.

* build/strip-po-charset.py

Add #! line to allow invocation from the command-line.

  1. … 2 more files in changeset.
* build/get-py-info.py

* build/strip-po-charset.py

* build/run_tests.py

Set the svn:executable property for these scripts.

  1. … 2 more files in changeset.
Set svn:eol-style='native' on some text files that were lacking it.

  1. … 44 more files in changeset.
Add charset stripping for po files to the Windows build.

* build/generator/build_locale.ezt: Add intermediate .spo step

also used in the Makefile build

* build/generator/gen_win.py (): Pass the base name instead of

.po and .mo.

(POFile.__Init__): Initialize fields fields from base parameter.

* build/strip-po-charset.py: New file. Contains the actual sed-like

script.

  1. … 2 more files in changeset.