Index: chrome/tools/build/repack_locales.py |
diff --git a/chrome/tools/build/repack_locales.py b/chrome/tools/build/repack_locales.py |
index 3903805ee82f1a2a1e1032cbaa17c0260f878a47..007db0d78abac90218936a6239e773854f2f1767 100755 |
--- a/chrome/tools/build/repack_locales.py |
+++ b/chrome/tools/build/repack_locales.py |
@@ -26,6 +26,8 @@ GRIT_DIR = None |
SHARE_INT_DIR = None |
INT_DIR = None |
+# The target platform. If it is not defined, sys.platform will be used. |
+PLATFORM = None |
tony
2012/07/31 16:47:00
I would call this OS since we call it OS in the gy
newt (away)
2012/07/31 21:13:54
Done.
|
class Usage(Exception): |
def __init__(self, msg): |
@@ -39,7 +41,7 @@ def calc_output(locale): |
# reference it. |
if locale == 'fake-bidi': |
return '%s/%s.pak' % (INT_DIR, locale) |
- if sys.platform in ('darwin',): |
+ if PLATFORM == 'mac' or (PLATFORM == None and sys.platform in ('darwin',)): |
# For Cocoa to find the locale at runtime, it needs to use '_' instead |
# of '-' (http://crbug.com/20441). Also, 'en-US' should be represented |
# simply as 'en' (http://crbug.com/19165, http://crbug.com/25578). |
@@ -131,8 +133,9 @@ def DoMain(argv): |
global GRIT_DIR |
global SHARE_INT_DIR |
global INT_DIR |
+ global PLATFORM |
- short_options = 'iog:s:x:b:h' |
+ short_options = 'iog:s:x:b:hp:' |
long_options = 'help' |
print_inputs = False |
@@ -140,7 +143,7 @@ def DoMain(argv): |
usage_msg = '' |
helpstr = """\ |
-Usage: %s [-h] [-i | -o] -g <DIR> -x <DIR> -s <DIR> -b <branding> <locale> [...] |
+Usage: %s [-h] [-i | -o] -g <DIR> -x <DIR> -s <DIR> -b <branding> [-p <platform>] <locale> [...] |
-h, --help Print this help, then exit. |
-i Print the expected input file list, then exit. |
-o Print the expected output file list, then exit. |
@@ -148,6 +151,7 @@ Usage: %s [-h] [-i | -o] -g <DIR> -x <DIR> -s <DIR> -b <branding> <locale> [... |
-x DIR Intermediate build files output directory. |
-s DIR Shared intermediate build files output directory. |
-b branding Branding type of this build. |
+ -p platform The target platform. (e.g. mac, linux, win and etc.) |
tony
2012/07/31 16:47:00
Nit: os
newt (away)
2012/07/31 21:13:54
Done.
|
locale [...] One or more locales to repack.""" % ( |
os.path.basename(__file__)) |
@@ -172,6 +176,8 @@ Usage: %s [-h] [-i | -o] -g <DIR> -x <DIR> -s <DIR> -b <branding> <locale> [... |
INT_DIR = a |
elif o in ('-b'): |
BRANDING = a |
+ elif o in ('-p'): |
tony
2012/07/31 16:47:00
Hmm, the use of 'in' here happens to work, but it'
newt (away)
2012/07/31 21:13:54
I figured I might as well fix these.
|
+ PLATFORM = a |
elif o in ('-h', '--help'): |
raise Usage(helpstr) |
tony
2012/07/31 16:47:00
I would probably normalize OS around here. E.g.,
newt (away)
2012/07/31 21:13:54
Done. This is much cleaner.
|