summaryrefslogtreecommitdiff
path: root/gst-env.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2019-12-19 02:45:44 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2019-12-19 02:45:44 +0530
commit245baadbce97279d7d8902769305c0fc10d5c2a6 (patch)
tree8bdb974fa5721326dbcb4053f40b8c100e1a14d1 /gst-env.py
parente13e6758e343d8012a2b15a9621d02f57fcbab93 (diff)
downloadgstreamer-245baadbce97279d7d8902769305c0fc10d5c2a6.tar.gz
gst-env: Fix shell name check
We should use `endswith`, not `in`. Else we'll match paths like: `/home/arbash/.local/bin/fish` as a bash shell, not a fish shell.
Diffstat (limited to 'gst-env.py')
-rwxr-xr-xgst-env.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/gst-env.py b/gst-env.py
index 56d90dddc2..2124c9c578 100755
--- a/gst-env.py
+++ b/gst-env.py
@@ -374,7 +374,7 @@ if __name__ == "__main__":
args += ['/k', 'prompt [gst-{}] $P$G'.format(gst_version)]
else:
args = [os.environ.get("SHELL", os.path.realpath("/bin/sh"))]
- if "bash" in args[0] and not strtobool(os.environ.get("GST_BUILD_DISABLE_PS1_OVERRIDE", r"FALSE")):
+ if args[0].endswith('bash') and not strtobool(os.environ.get("GST_BUILD_DISABLE_PS1_OVERRIDE", r"FALSE")):
tmprc = tempfile.NamedTemporaryFile(mode='w')
bashrc = os.path.expanduser('~/.bashrc')
if os.path.exists(bashrc):
@@ -385,7 +385,7 @@ if __name__ == "__main__":
# Let the GC remove the tmp file
args.append("--rcfile")
args.append(tmprc.name)
- if 'fish' in args[0]:
+ if args[0].endswith('fish'):
# Ignore SIGINT while using fish as the shell to make it behave
# like other shells such as bash and zsh.
# See: https://gitlab.freedesktop.org/gstreamer/gst-build/issues/18