summaryrefslogtreecommitdiffstats
path: root/mandriva/2010.2/dependencies/pinentry/pinentry-wrapper
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-10-14 23:31:33 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-10-14 23:31:33 -0500
commitd2587a8509c0e15c38d99fb4bcfa2b2fc3209e9b (patch)
tree86eec4e4a0f6ba88cc7e6fab9ec926bc93d72396 /mandriva/2010.2/dependencies/pinentry/pinentry-wrapper
parentf63b035a91cf5baff629f5e5dee4aeb7efe8d57b (diff)
parentec2515f058c60d2478a549f58376db628ba556b9 (diff)
downloadtde-packaging-d2587a8509c0e15c38d99fb4bcfa2b2fc3209e9b.tar.gz
tde-packaging-d2587a8509c0e15c38d99fb4bcfa2b2fc3209e9b.zip
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/tde-packaging
Diffstat (limited to 'mandriva/2010.2/dependencies/pinentry/pinentry-wrapper')
-rw-r--r--mandriva/2010.2/dependencies/pinentry/pinentry-wrapper70
1 files changed, 70 insertions, 0 deletions
diff --git a/mandriva/2010.2/dependencies/pinentry/pinentry-wrapper b/mandriva/2010.2/dependencies/pinentry/pinentry-wrapper
new file mode 100644
index 000000000..2d63a8744
--- /dev/null
+++ b/mandriva/2010.2/dependencies/pinentry/pinentry-wrapper
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2009 Fedora Project
+# This file and all modifications and additions to the pristine
+# package are under the same license as the package itself.
+#
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
+#
+# Anna Bernathova <anicka@novell.com> 2006
+# Pavel Nemec <pnemec@novell.com> 2006
+# Rex Dieter <rdieter@fedoraproject.org> 2009
+#
+# use proper binary (pinentry-qt, pinentry-gtk-2 or pinentry-curses)
+
+if [ -z "$PINENTRY_BINARY" ]; then
+
+kde_running=
+if [ -n "$KDE_FULL_SESSION" ]; then
+ kde_running=1
+elif [ -n "$DISPLAY" ]; then
+ xprop -root | grep "^KDE_FULL_SESSION" >/dev/null 2>/dev/null
+ if test $? -eq 0; then
+ kde_running=1
+ fi
+else
+ arg=
+ display=
+ for opt in "$@"; do
+ if [ "$opt" = "--display" ]; then
+ arg=1
+ elif [ -n "$arg" ]; then
+ display="$opt"
+ else
+ arg=
+ fi
+ done
+ if [ -n "$display" ]; then
+ DISPLAY="$display" xprop -root | grep "^KDE_FULL_SESSION" >/dev/null 2>/dev/null
+ if test $? -eq 0; then
+ kde_running=1
+ fi
+ fi
+fi
+
+# if KDE is detected and pinentry-qt exists, use pinentry-qt
+if [ -n "$kde_running" -a -x /usr/bin/pinentry-qt4 ]
+then
+ export PINENTRY_BINARY="/usr/bin/pinentry-qt4"
+# otherwise test if pinentry-gtk-2 is installed
+elif [ -x /usr/bin/pinentry-gtk-2 ]
+then
+ export PINENTRY_BINARY="/usr/bin/pinentry-gtk-2"
+# otherwise test if pinentry-qt4 is installed
+elif [ -x /usr/bin/pinentry-qt ]
+then
+ export PINENTRY_BINARY="/usr/bin/pinentry-qt"
+# otherwise test if pinentry-qt exists although KDE is not detected
+elif [ -x /usr/bin/pinentry-qt4 ]
+then
+ export PINENTRY_BINARY="/usr/bin/pinentry-qt4"
+# pinentry-curses is installed by default
+else
+ export PINENTRY_BINARY="/usr/bin/pinentry-curses"
+
+fi
+fi
+
+exec $PINENTRY_BINARY "$@"
+