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

Unified Diff: toolchain_build/substituter.py

Issue 355883002: The toolchain_build git cache is now referenced as a git-alternate. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: rebase Created 6 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 | « toolchain_build/command.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: toolchain_build/substituter.py
diff --git a/toolchain_build/substituter.py b/toolchain_build/substituter.py
index ff3ff029d985fccc68bbdb14c6ef810232dddf2e..bacb1619e16fef8bba4f3b3ee67d089b14b59341 100644
--- a/toolchain_build/substituter.py
+++ b/toolchain_build/substituter.py
@@ -73,8 +73,15 @@ class Substituter(object):
self._variables = self._nonpaths.copy()
self._variables['cwd'] = FixPath(os.path.abspath(self._cwd))
for key, value in self._paths.iteritems():
- self._variables['abs_' + key] = FixPath(os.path.abspath(value))
- self._variables[key] = FixPath(os.path.relpath(value, self._cwd))
+ if value:
+ abs_path = FixPath(os.path.abspath(value))
+ key_path = FixPath(os.path.relpath(value, self._cwd))
+ else:
+ abs_path = value
+ key_path = value
+
+ self._variables['abs_' + key] = abs_path
+ self._variables[key] = key_path
def Substitute(self, template):
""" Substitute the %-variables in 'template' """
@@ -86,7 +93,10 @@ class Substituter(object):
All variables in the template must be paths, and if the values are relative
paths, they are resolved relative to cwd and returned as absolute paths.
"""
- return AbsPath(self.Substitute(template), self._cwd)
+ path = self.Substitute(template)
+ if path:
+ path = AbsPath(path, self._cwd)
+ return path
def _SetUpCommonNonPaths(self):
try:
« no previous file with comments | « toolchain_build/command.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698