Merge lp:~gz/bzr/inplace_mo_ignored_955314 into lp:bzr/2.5

Proposed by Martin Packman
Status: Work in progress
Proposed branch: lp:~gz/bzr/inplace_mo_ignored_955314
Merge into: lp:bzr/2.5
Prerequisite: lp:~gz/bzr/install_mo_command_941835
Diff against target: 57 lines (+17/-3)
2 files modified
.bzrignore (+2/-0)
tools/bzr_distutils.py (+15/-3)
To merge this branch: bzr merge lp:~gz/bzr/inplace_mo_ignored_955314
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) Approve
Review via email: mp+99523@code.launchpad.net

Description of the change

Moves the default location for building .mo files into the build/ directory, and adds an --inplace option for the current behaviour when testing in a workingtree is useful. Also adds the local locale dir containing translations to ignores for those cases.

To do testing of translations without installing, the steps now look like:

    $ make update-pot
    $ ./setup.py build_mo -i
    $ LANG=ja_JP ./bzr help branch

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve
Revision history for this message
Martin Packman (gz) wrote :

When trying to build the windows installers, the .mo files seemed to end up in a different lib directory from the other bzrlib stuff. That might be the fault of this change or the weird things the installer build script does.

Revision history for this message
Martin Packman (gz) wrote :

This needs revisiting when I work out what went wrong with the installers.

Unmerged revisions

6498. By Martin Packman

Ignore ./bzrlib/locale

6497. By Martin Packman

Put .mo files under build/ during setup unless --inplace is given

6496. By Martin Packman

Move distutils commands module to tools/ from bzrlib/

6495. By Martin Packman

Add install_mo distutils command so setup works when .mo files don't exist yes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2010-10-13 00:26:41 +0000
+++ .bzrignore 2012-03-27 13:43:19 +0000
@@ -25,6 +25,8 @@
25# setup.py working directory25# setup.py working directory
26./build26./build
27./build-win3227./build-win32
28# local .mo files
29./bzrlib/locale
28# Editor temporary/working/backup files30# Editor temporary/working/backup files
29*$31*$
30.*.sw[nop]32.*.sw[nop]
3133
=== modified file 'tools/bzr_distutils.py'
--- tools/bzr_distutils.py 2012-03-27 13:43:19 +0000
+++ tools/bzr_distutils.py 2012-03-27 13:43:19 +0000
@@ -42,25 +42,37 @@
42 user_options = [('build-dir=', 'd', 'Directory to build locale files'),42 user_options = [('build-dir=', 'd', 'Directory to build locale files'),
43 ('output-base=', 'o', 'mo-files base name'),43 ('output-base=', 'o', 'mo-files base name'),
44 ('source-dir=', None, 'Directory with sources po files'),44 ('source-dir=', None, 'Directory with sources po files'),
45 ('inplace', 'i', 'Ignore build-dir and put locale dir '
46 'alongside source files.'),
45 ('force', 'f', 'Force creation of mo files'),47 ('force', 'f', 'Force creation of mo files'),
46 ('lang=', None, 'Comma-separated list of languages '48 ('lang=', None, 'Comma-separated list of languages '
47 'to process'),49 'to process'),
48 ]50 ]
4951
50 boolean_options = ['force']52 boolean_options = ['force', 'inplace']
5153
52 def initialize_options(self):54 def initialize_options(self):
55 self.build_lib = None
53 self.build_dir = None56 self.build_dir = None
54 self.output_base = None57 self.output_base = None
55 self.source_dir = None58 self.source_dir = None
59 self.inplace = False
56 self.force = None60 self.force = None
57 self.lang = None61 self.lang = None
5862
59 def finalize_options(self):63 def finalize_options(self):
60 self.set_undefined_options('build', ('force', 'force'))64 self.set_undefined_options('build',
65 ('build_lib', 'build_lib'),
66 ('force', 'force'),
67 )
61 self.prj_name = self.distribution.get_name()68 self.prj_name = self.distribution.get_name()
69 if self.inplace:
70 # Relies on knowledge of where bzr will look for locale files.
71 self.build_dir = "bzrlib/locale"
62 if self.build_dir is None:72 if self.build_dir is None:
63 self.build_dir = 'bzrlib/locale'73 # Really should use build_base subdir rather than build_lib, but
74 # would break `clean --all` and generally be annoying.
75 self.build_dir = os.path.join(self.build_lib, "bzrlib/locale")
64 if not self.output_base:76 if not self.output_base:
65 self.output_base = self.prj_name or 'messages'77 self.output_base = self.prj_name or 'messages'
66 if self.source_dir is None:78 if self.source_dir is None:

Subscribers

People subscribed via source and target branches