SC2166: Avoid using -a in test

This commit is contained in:
Jakub Jelen 2021-04-14 17:34:59 +02:00
parent ef5476b7db
commit caf43c1c53

View File

@ -32,7 +32,7 @@ done
# export DISPLAY if pinentry is meant to be run on a different display
# check the KDE_FULL_SESSION variable otherwise
if [ -n "$display" -a "$DISPLAY" != "$display" ]; then
if [ -n "$display" ] && [ "$DISPLAY" != "$display" ]; then
export DISPLAY="$display"
elif [ -n "$KDE_FULL_SESSION" ]; then
kde_running=1
@ -43,7 +43,7 @@ fi
type xprop >/dev/null 2>/dev/null
XPROP=$?
if [ -n "$DISPLAY" -a $XPROP -eq 0 ]; then
if [ -n "$DISPLAY" ] && [ $XPROP -eq 0 ]; then
xprop -root | grep "^KDE_FULL_SESSION" >/dev/null 2>/dev/null
if test $? -eq 0; then
kde_running=1
@ -56,19 +56,19 @@ if [ -n "$PINENTRY_BINARY" ];
then
export PINENTRY_BINARY="$PINENTRY_BINARY"
# if KDE is detected and pinentry-qt exists, use pinentry-qt
elif [ -n "$kde_running" -a -x /usr/bin/pinentry-qt ]
elif [ -n "$kde_running" ] && [ -x /usr/bin/pinentry-qt ]
then
export PINENTRY_BINARY="/usr/bin/pinentry-qt"
# otherwise test if pinentry-gnome3 is installed
elif [ -n "$DISPLAY" -a -x /usr/bin/pinentry-gnome3 ]
elif [ -n "$DISPLAY" ] && [ -x /usr/bin/pinentry-gnome3 ]
then
export PINENTRY_BINARY="/usr/bin/pinentry-gnome3"
# otherwise test if pinentry-gtk-2 is installed
elif [ -n "$DISPLAY" -a -x /usr/bin/pinentry-gtk-2 ]
elif [ -n "$DISPLAY" ] && [ -x /usr/bin/pinentry-gtk-2 ]
then
export PINENTRY_BINARY="/usr/bin/pinentry-gtk-2"
# otherwise test if pinentry-qt exists although KDE is not detected
elif [ -n "$DISPLAY" -a -x /usr/bin/pinentry-qt ]
elif [ -n "$DISPLAY" ] && [ -x /usr/bin/pinentry-qt ]
then
export PINENTRY_BINARY="/usr/bin/pinentry-qt"
# use pinentry-tty if installed