aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-08-21 15:04:52 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-08-21 15:04:52 -0300
commitbfd718703aac6fe706ee751f232b0e80601913d1 (patch)
treeb7541fdd334d1a02e3405654a11d9ec61f0ee129
parentdf97a807e2c13a5d020d72f07058904b60f19cfd (diff)
downloadkeyringer-bfd718703aac6fe706ee751f232b0e80601913d1.tar.gz
keyringer-bfd718703aac6fe706ee751f232b0e80601913d1.tar.bz2
Moving editors' files to shared folder
-rw-r--r--Makefile4
-rwxr-xr-xkeyringer24
-rwxr-xr-xlib/keyringer/functions2
-rw-r--r--share/keyringer/editors/vim (renamed from lib/keyringer/editors/vim)0
4 files changed, 20 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index c1e50e9..07513f2 100644
--- a/Makefile
+++ b/Makefile
@@ -27,8 +27,8 @@ install_lib:
$(INSTALL) -D --mode=0755 lib/keyringer/functions $(DESTDIR)/$(PREFIX)/lib/$(PACKAGE)/functions
$(INSTALL) -D --mode=0755 -d lib/keyringer/actions $(DESTDIR)/$(PREFIX)/lib/$(PACKAGE)/actions
$(INSTALL) -D --mode=0755 lib/keyringer/actions/* $(DESTDIR)/$(PREFIX)/lib/$(PACKAGE)/actions
- $(INSTALL) -D --mode=0755 -d lib/keyringer/editors $(DESTDIR)/$(PREFIX)/lib/$(PACKAGE)/editors
- $(INSTALL) -D --mode=0644 lib/keyringer/editors/* $(DESTDIR)/$(PREFIX)/lib/$(PACKAGE)/editors
+ $(INSTALL) -D --mode=0755 -d share/keyringer/editors $(DESTDIR)/$(PREFIX)/lib/$(PACKAGE)/editors
+ $(INSTALL) -D --mode=0644 share/keyringer/editors/* $(DESTDIR)/$(PREFIX)/lib/$(PACKAGE)/editors
install_bin:
$(INSTALL) -D --mode=0755 keyringer $(DESTDIR)/$(PREFIX)/bin/keyringer
diff --git a/keyringer b/keyringer
index b8edc8e..a32f15b 100755
--- a/keyringer
+++ b/keyringer
@@ -149,13 +149,6 @@ ACTION="$2"
# Turn off pathname expansion so expansion can work properly
set -f
-# Export globals for other scripts
-export PREFERENCES="`dirname $CONFIG`/$KEYRING"
-export KEYRINGER_VERSION
-export CONFIG_VERSION
-export KEYRING
-export CONFIG
-
# Set functions location
if [ -e "`dirname $(readlink -f $0)`/lib/$NAME/functions" ]; then
# Development or local installation layout
@@ -165,6 +158,15 @@ else
LIB="`dirname $(readlink -f $0)`/../lib/$NAME/functions"
fi
+# Set shared files location
+if [ -e "`dirname $(readlink -f $0)`/share/$NAME" ]; then
+ # Development or local installation layout
+ SHARE="`dirname $(readlink -f $0)`/share/$NAME"
+else
+ # System installation layout
+ SHARE="`dirname $(readlink -f $0)`/../share/$NAME"
+fi
+
# Set actions location
if [ -e "`dirname $(readlink -f $0)`/lib/$NAME/actions" ]; then
# Development or local installation layout
@@ -174,6 +176,14 @@ else
ACTIONS="`dirname $(readlink -f $0)`/../lib/$NAME/actions"
fi
+# Export globals for other scripts
+export PREFERENCES="`dirname $CONFIG`/$KEYRING"
+export KEYRINGER_VERSION
+export CONFIG_VERSION
+export KEYRING
+export CONFIG
+export SHARE
+
# Load functions
source "$LIB" || exit 1
diff --git a/lib/keyringer/functions b/lib/keyringer/functions
index 5dbb6b4..42c047d 100755
--- a/lib/keyringer/functions
+++ b/lib/keyringer/functions
@@ -287,7 +287,7 @@ function keyringer_set_env {
# Avoid viminfo, see https://keyringer.pw/trac/ticket/50
if $EDITOR --help | grep -q -e "^VIM"; then
if ! echo $EDITOR | grep -q -- "-i NONE"; then
- EDITOR="$EDITOR -S `dirname $LIB`/editors/vim"
+ EDITOR="$EDITOR -S $SHARE/editors/vim"
fi
fi
diff --git a/lib/keyringer/editors/vim b/share/keyringer/editors/vim
index 0f877df..0f877df 100644
--- a/lib/keyringer/editors/vim
+++ b/share/keyringer/editors/vim