From 80056e1a52b9528701fb265f880c819dc92641aa Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 26 Jun 2012 16:03:41 -0300 Subject: Initial packaging support --- keyringer | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'keyringer') diff --git a/keyringer b/keyringer index 8a6eeb1..7089a08 100755 --- a/keyringer +++ b/keyringer @@ -134,14 +134,30 @@ CONFIG="$HOME/.$NAME/config" BASENAME="`basename $0`" KEYRING="$1" ACTION="$2" -ACTIONS="`dirname $(readlink -f $0)`/share/$NAME" # Export preferences and version for other scripts export PREFERENCES="`dirname $CONFIG`/$KEYRING" export KEYRINGER_VERSION +# Set functions location +if [ -e "`dirname $(readlink -f $0)`/lib/$NAME/functions" ]; then + # Development or local installation layout + LIB="`dirname $(readlink -f $0)`/lib/$NAME/functions" +else + # System installation layout + LIB="`dirname $(readlink -f $0)`/../lib/$NAME/functions" +fi + +# Set actions location +if [ -e "`dirname $(readlink -f $0)`/share/$NAME" ]; then + # Development or local installation layout + ACTIONS="`dirname $(readlink -f $0)`/share/$NAME" +else + # System installation layout + ACTIONS="`dirname $(readlink -f $0)`/../share/$NAME" +fi + # Load functions -LIB="`dirname $(readlink -f $0)`/lib/$NAME/functions" source "$LIB" || exit 1 # Setup main configuration and load preferences -- cgit v1.2.3