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
1=== modified file '.bzrignore'
2--- .bzrignore 2010-10-13 00:26:41 +0000
3+++ .bzrignore 2012-03-27 13:43:19 +0000
4@@ -25,6 +25,8 @@
5 # setup.py working directory
6 ./build
7 ./build-win32
8+# local .mo files
9+./bzrlib/locale
10 # Editor temporary/working/backup files
11 *$
12 .*.sw[nop]
13
14=== modified file 'tools/bzr_distutils.py'
15--- tools/bzr_distutils.py 2012-03-27 13:43:19 +0000
16+++ tools/bzr_distutils.py 2012-03-27 13:43:19 +0000
17@@ -42,25 +42,37 @@
18 user_options = [('build-dir=', 'd', 'Directory to build locale files'),
19 ('output-base=', 'o', 'mo-files base name'),
20 ('source-dir=', None, 'Directory with sources po files'),
21+ ('inplace', 'i', 'Ignore build-dir and put locale dir '
22+ 'alongside source files.'),
23 ('force', 'f', 'Force creation of mo files'),
24 ('lang=', None, 'Comma-separated list of languages '
25 'to process'),
26 ]
27
28- boolean_options = ['force']
29+ boolean_options = ['force', 'inplace']
30
31 def initialize_options(self):
32+ self.build_lib = None
33 self.build_dir = None
34 self.output_base = None
35 self.source_dir = None
36+ self.inplace = False
37 self.force = None
38 self.lang = None
39
40 def finalize_options(self):
41- self.set_undefined_options('build', ('force', 'force'))
42+ self.set_undefined_options('build',
43+ ('build_lib', 'build_lib'),
44+ ('force', 'force'),
45+ )
46 self.prj_name = self.distribution.get_name()
47+ if self.inplace:
48+ # Relies on knowledge of where bzr will look for locale files.
49+ self.build_dir = "bzrlib/locale"
50 if self.build_dir is None:
51- self.build_dir = 'bzrlib/locale'
52+ # Really should use build_base subdir rather than build_lib, but
53+ # would break `clean --all` and generally be annoying.
54+ self.build_dir = os.path.join(self.build_lib, "bzrlib/locale")
55 if not self.output_base:
56 self.output_base = self.prj_name or 'messages'
57 if self.source_dir is None:

Subscribers

People subscribed via source and target branches