mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-16 11:15:31 +00:00
gst-uninstalled: De-dedup before prepending to an env var
Helps us avoid breaching the maximum length limit for env var values on Windows.
This commit is contained in:
parent
35e6c8b160
commit
c786776f27
1 changed files with 6 additions and 1 deletions
|
@ -44,7 +44,12 @@ def stringify(o):
|
|||
raise AssertionError('Object {!r} must be a string or a list'.format(o))
|
||||
|
||||
def prepend_env_var(env, var, value):
|
||||
env[var] = os.pathsep + value + os.pathsep + env.get(var, "")
|
||||
env_val = env.get(var, '')
|
||||
val = os.pathsep + value + os.pathsep
|
||||
# Don't add the same value twice
|
||||
if val in env_val or env_val.startswith(value + os.pathsep):
|
||||
return
|
||||
env[var] = val + env_val
|
||||
env[var] = env[var].replace(os.pathsep + os.pathsep, os.pathsep).strip(os.pathsep)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue