projects
/
platform
/
upstream
/
gstreamer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
35e6c8b
)
gst-uninstalled: De-dedup before prepending to an env var
author
Nirbheek Chauhan
<nirbheek@centricular.com>
Mon, 15 Apr 2019 10:02:36 +0000
(15:32 +0530)
committer
Nirbheek Chauhan
<nirbheek@centricular.com>
Mon, 15 Apr 2019 10:02:36 +0000
(15:32 +0530)
Helps us avoid breaching the maximum length limit for env var values
on Windows.
gst-uninstalled.py
patch
|
blob
|
history
diff --git
a/gst-uninstalled.py
b/gst-uninstalled.py
index 982988a0100e399160392f633fce9538bf0fb735..03b9416f9651e887168f7ba8950ab0175939d86b 100755
(executable)
--- a/
gst-uninstalled.py
+++ b/
gst-uninstalled.py
@@
-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)