Commit 57b1b23b authored by Nirbheek Chauhan's avatar Nirbheek Chauhan 🐜
Browse files

cerbero: Avoid trailing/leading spaces in EnvVarOp

Adding a leading space to any env var with a path in it will cause
MSYS to interpret it as an MSYS path and convert, f.ex.
C:/foo/bar to C;C:\\MinGW\\msys\\1.0\foo\bar

In our case, this causes a build failure in openssl.

See also: fbaf3bc4

Part-of: <gstreamer/cerbero!480>
parent ccb729a9
......@@ -97,17 +97,24 @@ class EnvVarOp:
env[self.var] = self.sep.join(self.vals)
def append(self, env):
if self.var not in env:
env[self.var] = self.sep.join(self.vals)
# Avoid appending trailing space
val = self.sep.join(self.vals)
if not val:
return
if self.var not in env or not env[self.var]:
env[self.var] = val
else:
env[self.var] += self.sep + self.sep.join(self.vals)
env[self.var] += self.sep + val
def prepend(self, env):
if self.var not in env:
env[self.var] = self.sep.join(self.vals)
# Avoid prepending a leading space
val = self.sep.join(self.vals)
if not val:
return
if self.var not in env or not env[self.var]:
env[self.var] = val
else:
old = env[self.var]
env[self.var] = self.sep.join(self.vals) + self.sep + old
env[self.var] = val + self.sep + env[self.var]
def remove(self, env):
if self.var not in env:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment