Commit f3bde6dc authored by Eugene Shalygin's avatar Eugene Shalygin Committed by Eugene Shalygin
Browse files

Fix the app shell script to run with zsh

Do not repeat shell test in the kdevplatform_shell_environment.sh file,
but instead detect the shell which runs the script via ps and $$. The
testing and shell selection is done by the app/kdevelop! script.

Fix tests for executables: which is a builtin in zsh and output
redirestion does not work with it. Replace such tests with command -v,
for which POSIX defines behaviour and return values.

BUG: 442481
FIXED-IN: 5.7.0
parent 0aa6d824
......@@ -44,7 +44,7 @@ if [ "$(echo $KDEV_ATTACHED_PID | wc -w | sed 's/ //g')" != 1 ]; then
fi
# find qdbus, try also alternative name qdbus-qt5
if ! [ "$(which qdbus-qt5 2> /dev/null)$(which qdbus 2> /dev/null)" ]; then
if ! $(command -v qdbus-qt5 &> /dev/null) && ! $(command -v qdbus &> /dev/null); then
echo "Error: The qdbus (or qdbus-qt5) utility is missing."
exit 7
fi
......
#!/bin/bash
#!/bin/sh
# SPDX-FileCopyrightText: 2011 David Nolden <david.nolden.kdevelop@art-master.de>
#
# SPDX-License-Identifier: LGPL-2.0-or-later
if [ -z "$ZDOTDIR" ]; then _shell=bash; else _shell=zsh; fi
_shell=$(ps -cp $$ -o command="")
# Since this runs as a replacement for the init-files, we need to chain in the 'real' rcs.
# We ignore profile, login & logout rcs, as we want no login shells.
......@@ -47,9 +47,7 @@ fi
# Takes a list of tools, and prints a warning of one of them is not available in the path
function checkToolsInPath {
for TOOL in $@; do
if ! [ "$(which $TOOL 2> /dev/null)" ]; then
echo "The utility $TOOL is not in your path, the shell integration will not work properly."
fi
command -v $TOOL &> /dev/null || echo "The utility $TOOL is not in your path, the shell integration will not work properly."
done
}
......@@ -58,9 +56,9 @@ checkToolsInPath sed ls cut dirname mktemp basename readlink hostname
# special handling for qdbus variants
_qdbus=qdbus-qt5
if ! [ "$(which $_qdbus 2> /dev/null)" ]; then
if ! command -v $_qdbus &> /dev/null; then
_qdbus=qdbus
if ! [ "$(which $_qdbus 2> /dev/null)" ]; then
if ! command -v $_qdbus &> /dev/null; then
echo "The utility qdbus (or qdbus-qt5) is not in your path, the shell integration will not work properly."
fi
fi
......
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