Chromium Code Reviews
Description[context] Add path prefix/suffix manipulation.
Add the ability to manipulate pathsep-delimited environment variables
more easily with specific helper functions targeting the prefixing and
suffixing of values to those variables.
Previously, the supported way to augment path environment variables was
to manually construct them, referencing the current value:
new_path = "%s%%(PATH)s%s" % (api.path.pathsep, api.path.pathsep)
Not only is this very verbose, but it is also error-prone, as the user
may not use OS-specific path separators, can add the same entries
multiple times, and can forget the double-percent to escape the
inner substitition.
This patch adds the concept of path prefixes and suffixes to the
"context" recipe module. Path elements can be added to either, and will
be compiled into properly-delimited prefix and suffix values on the
context's environment.
BUG=None
TEST=expectations,run
Review-Url: https://codereview.chromium.org/2925453002
Committed: https://github.com/luci/recipes-py/commit/c40412cbc4e1b8ee1e6eba2e88328ca71c6ec1e4
Patch Set 1 #Patch Set 2 : advise #
Total comments: 19
Patch Set 3 : comments, use sentinels #
Total comments: 10
Patch Set 4 : comments #
Total comments: 1
Messages
Total messages: 20 (9 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||