summaryrefslogtreecommitdiff
path: root/rvs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'rvs.sh')
-rw-r--r--rvs.sh50
1 files changed, 30 insertions, 20 deletions
diff --git a/rvs.sh b/rvs.sh
index c124116..b9ff973 100644
--- a/rvs.sh
+++ b/rvs.sh
@@ -1,13 +1,23 @@
#!@SHELL@
name='@name@'
-ver='0.7.2'
-# Copyright (C) 2009 Luke Shumaker
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# Originally written by Luke Shumaker <lukeshu@sbcglobal.net>.
+ver='0.7.3'
+# Copyright (C) 2009 Luke Shumaker
+#
+# This file is part of rvs.
+#
+# rvs is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2, or (at your option) any later version.
+#
+# rvs is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with rvs; see the file COPYING.
+# If not, write to the Free Software Foundation,
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
RVS="$0" #RVS="@rvs@"
libexecdir="@libexecdir@/$name"
@@ -40,13 +50,13 @@ _init() {
if [ -z "$repo" ]; then
repo=".$name"
install -d "$repo"
- install -T $RVSDIR/plugins $repo/plugins
+ install -T $libexecdir/plugins $repo/plugins
while read plugin; do
echo "initializing plugin \`$plugin'"
install -d "$repo/$plugin"
export REPO=.rvs/$plugin
- if [ -e "$RVSDIR/$plugin/init" ]; then
- "$RVSDIR/$plugin/init"
+ if [ -e "$libexecdir/$plugin/init" ]; then
+ "$libexecdir/$plugin/init"
fi
done < $repo/plugins
else
@@ -58,21 +68,21 @@ _install() {
id=$1
dir=${2-$id}
name=`echo $id | sed 's/-.*$//'`
- if (grep "^$name-" "$RVSDIR/plugins" &> /dev/null); then
+ if (grep "^$name-" "$libexecdir/plugins" &> /dev/null); then
# an entry for this plugin already exists, though possibly a
# different version
- sed -i "s/^$name-.*$/$id/" "$RVSDIR/plugins"
+ sed -i "s/^$name-.*$/$id/" "$libexecdir/plugins"
else
- echo "$id" >> "$RVSDIR/plugins"
+ echo "$id" >> "$libexecdir/plugins"
fi
- rm -rf "$RVSDIR/$id"
- cp -rpT "$dir" "$RVSDIR/$id"
+ rm -rf "$libexecdir/$id"
+ cp -rpT "$dir" "$libexecdir/$id"
}
_uninstall() {
id=$1
- sed -i "/^$id$/ d" "$RVSDIR/plugins"
- rm -rf "$RVSDIR/$id"
+ sed -i "/^$id$/ d" "$libexecdir/plugins"
+ rm -rf "$libexecdir/$id"
}
# START OPTION HANDLING #
@@ -87,12 +97,12 @@ case "$com" in
*) repo=`_repo`
if [ "$?" = '0' ]; then
while read plugin; do
- if [ -f "$RVSDIR/$plugin/$com" ]; then
+ if [ -f "$libexecdir/$plugin/$com" ]; then
done='yes'
export libexecdir=$libexecdir/$plugin
export REPO=$repo/$plugin
export RVS
- $RVSDIR/$@
+ $libexecdir/$@
exit $?
break
fi