Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2065)

Unified Diff: build/config/mac/gen_plist.py

Issue 2142903002: Fix build/config/mac/gen_plist.py. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@{0}
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/mac/gen_plist.py
diff --git a/build/config/mac/gen_plist.py b/build/config/mac/gen_plist.py
index e3d4f4af4804c870a07fb5cb68789f22776ecbd1..0004179505ee6e63bc5988c65b4aeba58f3d1b93 100644
--- a/build/config/mac/gen_plist.py
+++ b/build/config/mac/gen_plist.py
@@ -18,7 +18,7 @@ import shlex
# while IDENT_RE matches all characters that are not valid in an "identifier"
# value (used when applying the modifier).
SUBST_RE = re.compile(r'\$\{(?P<id>[^}]*?)(?P<modifier>:[^}]*)?\}')
-IDENT_RE = re.compile(r'[/\s]')
+IDENT_RE = re.compile(r'[_/\s]')
class ArgumentParser(argparse.ArgumentParser):
@@ -73,13 +73,13 @@ def InterpolateString(value, substitutions):
return None
# Some values need to be identifier and thus the variables references may
# contains :modifier attributes to indicate how they should be converted
- # to identifiers ("identifier" replaces all invalid characters by '-' and
- # "rfc1034identifier" replaces them by "_" to make valid URI too).
+ # to identifiers ("identifier" replaces all invalid characters by '_' and
+ # "rfc1034identifier" replaces them by "-" to make valid URI too).
modifier = match.group('modifier')
- if modifier == 'identifier':
- interpolated = IDENT_RE.sub('-', substitutions[variable])
- elif modifier == 'rfc1034identifier':
+ if modifier == ':identifier':
interpolated = IDENT_RE.sub('_', substitutions[variable])
+ elif modifier == ':rfc1034identifier':
+ interpolated = IDENT_RE.sub('-', substitutions[variable])
else:
interpolated = substitutions[variable]
result = result[:match.start()] + interpolated + result[match.end():]
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698