Chromium Code Reviews| Index: pylib/gyp/common.py |
| diff --git a/pylib/gyp/common.py b/pylib/gyp/common.py |
| index b6875e43efcbc40a14eb6a258626455e7ed91054..4480ca9fac5a163a688767af46bbc118f74be008 100644 |
| --- a/pylib/gyp/common.py |
| +++ b/pylib/gyp/common.py |
| @@ -131,13 +131,16 @@ def QualifiedTarget(build_file, target, toolset): |
| @memoize |
| -def RelativePath(path, relative_to): |
| +def RelativePath(path, relative_to, follow_path_symlink=True): |
|
scottmg
2015/09/24 21:30:51
could you add some explanation for this arg here?
lindleyf
2015/09/24 21:47:14
I've added a comment here and at the point of use.
|
| # Assuming both |path| and |relative_to| are relative to the current |
| # directory, returns a relative path that identifies path relative to |
| # relative_to. |
| # Convert to normalized (and therefore absolute paths). |
| - path = os.path.realpath(path) |
| + if follow_path_symlink: |
| + path = os.path.realpath(path) |
| + else: |
| + path = os.path.abspath(path) |
| relative_to = os.path.realpath(relative_to) |
| # On Windows, we can't create a relative path to a different drive, so just |