diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2019-12-19 02:45:44 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-01-04 08:30:02 +0530 |
commit | edd77b7b3b564718350e5def556ef85f88e61495 (patch) | |
tree | 7129307a788baad5b9885e1a7d6d61a96eba2bca | |
parent | a16cc82ec72c7147a47a82e4fb6d93ff30342a43 (diff) |
gst-uninstalled: 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.
-rwxr-xr-x | gst-uninstalled.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gst-uninstalled.py b/gst-uninstalled.py index 45e559c..2b6e6e2 100755 --- a/gst-uninstalled.py +++ b/gst-uninstalled.py @@ -345,7 +345,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): @@ -356,7 +356,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 |