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

Unified Diff: pylib/gyp/generator/ninja.py

Issue 10535052: Make Ninja backend robust to rules and actions containing slashes (Closed) Base URL: http://git.chromium.org/external/gyp.git@master
Patch Set: Created 8 years, 6 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 | « pylib/gyp/generator/make.py ('k') | pylib/gyp/generator/scons.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/generator/ninja.py
===================================================================
--- pylib/gyp/generator/ninja.py (revision 1410)
+++ pylib/gyp/generator/ninja.py (working copy)
@@ -12,7 +12,6 @@
import os.path
import re
import subprocess
-import string
import sys
import gyp.ninja_syntax as ninja_syntax
@@ -509,7 +508,7 @@
all_outputs = []
for action in actions:
# First write out a rule for the action.
- name = re.sub(r'[ {}$]', '_', action['action_name'])
+ name = action['action_name']
description = self.GenerateDescription('ACTION',
action.get('message', None),
name)
@@ -1098,7 +1097,7 @@
if self.toolset == 'target':
rule_name += '.' + self.toolset
rule_name += '.' + name
- rule_name = rule_name.translate(string.maketrans(' ()', '___'))
+ rule_name = re.sub('[^a-zA-Z0-9_]', '_', rule_name)
args = args[:]
« no previous file with comments | « pylib/gyp/generator/make.py ('k') | pylib/gyp/generator/scons.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698