Help the package author understand where a given variable is coming from.
Motivation
In a complex environment, it can be challenging or impossible to determine whether a particular environment variable, or part of a variable, is coming from. Every package is able to append, prepend or replace a given variable.
Alternatives
Create a context and inspect the generated shell script; it will contain each variable added, visually grouped by their author
Create a context in rez gui and inspect the generated shell script visually (same thing)
Implementation
Wrap variables in a mutable EnvironmentVariable class, that tracks its point of origin during use.
Goal
Help the package author understand where a given variable is coming from.
Motivation
In a complex environment, it can be challenging or impossible to determine whether a particular environment variable, or part of a variable, is coming from. Every package is able to append, prepend or replace a given variable.
Alternatives
rez gui
and inspect the generated shell script visually (same thing)Implementation
Wrap variables in a mutable
EnvironmentVariable
class, that tracks its point of origin during use.Stored values are of type
list
, so as to facilitate multiple authors of a given variable.Ordered by which wrote first.
For PATH-like variables, the same principle applies.
An empty list indicates that this variable is not coming from any package, but could come from e.g. the system.