Merge lp:~miroslavr256/widelands/buildcat-fixes into lp:widelands

Proposed by Miroslav Remák
Status: Merged
Merged at revision: 7671
Proposed branch: lp:~miroslavr256/widelands/buildcat-fixes
Merge into: lp:widelands
Diff against target: 100 lines (+15/-7)
2 files modified
src/wui/mapdata.h (+1/-1)
utils/buildcat.py (+14/-6)
To merge this branch: bzr merge lp:~miroslavr256/widelands/buildcat-fixes
Reviewer Review Type Date Requested Status
GunChleoc Approve
Review via email: mp+280529@code.launchpad.net

Description of the change

This merge proposal renames every map directory that contains spaces to use underscores instead. This is to prevent the msguniq utility from splitting occurrences containing spaces.

Furthermore, maps.pot is now sorted properly.

Relevant discussion: https://code.launchpad.net/~miroslavr256/widelands/official-lua-xgettext/+merge/279224

To post a comment you must log in.
Revision history for this message
GunChleoc (gunchleoc) wrote :

Code LGTM, and the script will run through without error message. I haven't tested it yet though, compiling will take a few hours on my virtual machine...

Revision history for this message
GunChleoc (gunchleoc) wrote :

I have managed to test this now - will merge :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== renamed directory 'maps/Comet Island.wmf' => 'maps/Comet_Island.wmf'
2=== renamed directory 'maps/Crossing the Horizon.wmf' => 'maps/Crossing_the_Horizon.wmf'
3=== renamed directory 'maps/Desert Tournament.wmf' => 'maps/Desert_Tournament.wmf'
4=== renamed directory 'maps/Dry Riverbed.wmf' => 'maps/Dry_Riverbed.wmf'
5=== renamed directory 'maps/Elven Forests.wmf' => 'maps/Elven_Forests.wmf'
6=== renamed directory 'maps/Finnish Lakes.wmf' => 'maps/Finnish_Lakes.wmf'
7=== renamed directory 'maps/Four Castles.wmf' => 'maps/Four_Castles.wmf'
8=== renamed directory 'maps/Four Mountains.wmf' => 'maps/Four_Mountains.wmf'
9=== renamed directory 'maps/Glacier Lake.wmf' => 'maps/Glacier_Lake.wmf'
10=== renamed directory 'maps/Golden Peninsula.wmf' => 'maps/Golden_Peninsula.wmf'
11=== renamed directory 'maps/Ice wars.wmf' => 'maps/Ice_wars.wmf'
12=== renamed directory 'maps/Islands at war.wmf' => 'maps/Islands_at_war.wmf'
13=== renamed directory 'maps/Kings and Queens.wmf' => 'maps/Kings_and_Queens.wmf'
14=== renamed directory 'maps/Lake of Tranquility.wmf' => 'maps/Lake_of_Tranquility.wmf'
15=== renamed directory 'maps/Last Bastion.wmf' => 'maps/Last_Bastion.wmf'
16=== renamed directory 'maps/Long, long way.wmf' => 'maps/Long,_long_way.wmf'
17=== renamed directory 'maps/MP Scenarios' => 'maps/MP_Scenarios'
18=== renamed directory 'maps/MP Scenarios/Island Hopping.wmf' => 'maps/MP_Scenarios/Island_Hopping.wmf'
19=== renamed directory 'maps/Mystical Maze.wmf' => 'maps/Mystical_Maze.wmf'
20=== renamed directory 'maps/River Explorers.wmf' => 'maps/River_Explorers.wmf'
21=== renamed directory 'maps/Sun of fire.wmf' => 'maps/Sun_of_fire.wmf'
22=== renamed directory 'maps/Swamp Island.wmf' => 'maps/Swamp_Island.wmf'
23=== renamed directory 'maps/Swamp Monks.wmf' => 'maps/Swamp_Monks.wmf'
24=== renamed directory 'maps/The Big Lake.wmf' => 'maps/The_Big_Lake.wmf'
25=== renamed directory 'maps/The Far North.wmf' => 'maps/The_Far_North.wmf'
26=== renamed directory 'maps/The Green Plateau.wmf' => 'maps/The_Green_Plateau.wmf'
27=== renamed directory 'maps/The Nile.wmf' => 'maps/The_Nile.wmf'
28=== renamed directory 'maps/The Oasis Triangle.wmf' => 'maps/The_Oasis_Triangle.wmf'
29=== renamed directory 'maps/The Pass Through the Mountains.wmf' => 'maps/The_Pass_Through_the_Mountains.wmf'
30=== renamed directory 'maps/The Thaw.wmf' => 'maps/The_Thaw.wmf'
31=== renamed directory 'maps/The long way.wmf' => 'maps/The_long_way.wmf'
32=== renamed directory 'maps/Three Warriors.wmf' => 'maps/Three_Warriors.wmf'
33=== renamed directory 'maps/Together We’re Strong.wmf' => 'maps/Together_We’re_Strong.wmf'
34=== renamed directory 'maps/Trident of Fire.wmf' => 'maps/Trident_of_Fire.wmf'
35=== renamed directory 'maps/Twin Lagoons.wmf' => 'maps/Twin_Lagoons.wmf'
36=== renamed directory 'maps/Twinkling Waves.wmf' => 'maps/Twinkling_Waves.wmf'
37=== renamed directory 'maps/Two frontiers.wmf' => 'maps/Two_frontiers.wmf'
38=== renamed directory 'maps/Volcanic Winter.wmf' => 'maps/Volcanic_Winter.wmf'
39=== renamed directory 'maps/War of the Valleys.wmf' => 'maps/War_of_the_Valleys.wmf'
40=== renamed directory 'maps/Wisent Valley.wmf' => 'maps/Wisent_Valley.wmf'
41=== modified file 'src/wui/mapdata.h'
42--- src/wui/mapdata.h 2015-10-02 09:26:57 +0000
43+++ src/wui/mapdata.h 2015-12-14 23:27:30 +0000
44@@ -125,7 +125,7 @@
45 /// Create a subdirectory
46 static MapData create_directory(const std::string& directory) {
47 std::string localized_name;
48- if (boost::equals(directory, "maps/MP Scenarios")) {
49+ if (boost::equals(directory, "maps/MP_Scenarios")) {
50 /** TRANSLATORS: Directory name for MP Scenarios in map selection */
51 localized_name = _("Multiplayer Scenarios");
52 } else {
53
54=== modified file 'utils/buildcat.py'
55--- utils/buildcat.py 2015-12-12 05:29:22 +0000
56+++ utils/buildcat.py 2015-12-14 23:27:30 +0000
57@@ -107,8 +107,8 @@
58 ("map_%(name)s/map_%(name)s", "maps/",
59 [ "../../maps/%(name)s/scripting/*.lua", ]
60 ),
61- ("mp_scenario_%(name)s/mp_scenario_%(name)s", "maps/MP Scenarios/",
62- [ "../../maps/MP Scenarios/%(name)s/scripting/*.lua", ]
63+ ("mp_scenario_%(name)s/mp_scenario_%(name)s", "maps/MP_Scenarios/",
64+ [ "../../maps/MP_Scenarios/%(name)s/scripting/*.lua", ]
65 ),
66 ]
67
68@@ -216,7 +216,13 @@
69 potout.writelines(potin)
70
71 return True
72-
73+
74+def run_msguniq(potfile):
75+ msguniq_rv = os.system("msguniq \"%s\" -F --output-file=\"%s\"" % (potfile, potfile))
76+ if (msguniq_rv):
77+ sys.stderr.write("msguniq exited with errorcode %i\n" % msguniq_rv)
78+ return False
79+ return True
80
81 def do_compile( potfile, srcfiles ):
82 """
83@@ -274,13 +280,15 @@
84 with open(potfile, "at") as p:
85 p.write("\n" + conf.toString())
86
87- msguniq_rv = os.system("msguniq \"%s\" -F --output-file=\"%s\"" % (potfile, potfile))
88- if (msguniq_rv):
89- sys.stderr.write("msguniq exited with errorcode %i\n" % msguniq_rv)
90+ if not run_msguniq(potfile):
91 return False
92 elif (conf.found_something_to_translate):
93 with open(potfile, "wt") as p:
94 p.write(HEAD + conf.toString())
95+
96+ # Msguniq is run here only to sort POT entries by file
97+ if not run_msguniq(potfile):
98+ return False
99
100 return True
101

Subscribers

People subscribed via source and target branches

to status/vote changes: