aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--trunk/lib/common.sh9
-rwxr-xr-xtrunk/src/simplaret4
2 files changed, 9 insertions, 4 deletions
diff --git a/trunk/lib/common.sh b/trunk/lib/common.sh
index 39199ac..2425ca8 100644
--- a/trunk/lib/common.sh
+++ b/trunk/lib/common.sh
@@ -20,6 +20,7 @@
BASE_CONF="/etc/simplepkg"
CONF="$BASE_CONF/simplepkg.conf"
+HOME_CONF="$HOME/.simplepkg/simplepkg.conf"
DEFAULT_CONF="$BASE_CONF/defaults/simplepkg.conf"
JAIL_LIST="$BASE_CONF/jailist"
SIMPLARET="simplaret"
@@ -136,12 +137,14 @@ function remove_packages {
function eval_parameter {
- # usage: eval $1 parameter from $CONF or $DEFAULT_CONF
+ # usage: eval $1 parameter from $HOME_CONF, $CONF or $DEFAULT_CONF
# return the evaluated parameter if available or $2 $3 ... $n
- if grep -qe "^$1=" $CONF; then
+ if [ -e "$HOME_CONF" ] && grep -qe "^$1=" $HOME_CONF; then
+ grep -e "^$1=" $HOME_CONF | cut -d = -f 2 | sed -e 's/"//g' -e "s/'//g" | sed -e 's/ *#.*$//'
+ elif [ -e "$CONF" ] && grep -qe "^$1=" $CONF; then
grep -e "^$1=" $CONF | cut -d = -f 2 | sed -e 's/"//g' -e "s/'//g" | sed -e 's/ *#.*$//'
- elif grep -qe "^$1=" $DEFAULT_CONF; then
+ elif [ -e "$DEFAULT_CONF" ] && grep -qe "^$1=" $DEFAULT_CONF; then
grep -e "^$1=" $DEFAULT_CONF | cut -d = -f 2 | sed -e 's/"//g' -e "s/'//g" | sed -e 's/ *#.*$//'
else
shift
diff --git a/trunk/src/simplaret b/trunk/src/simplaret
index a1ffe2d..61ae7a4 100755
--- a/trunk/src/simplaret
+++ b/trunk/src/simplaret
@@ -28,7 +28,9 @@ else
exit 1
fi
-if [ -f "/etc/simplepkg/repos.conf" ]; then
+if [ -f "$HOME/.simplepkg/repos.conf" ]; then
+ REPOS_CONF="$HOME/.simplepkg/repos.conf"
+elif [ -f "/etc/simplepkg/repos.conf" ]; then
REPOS_CONF="/etc/simplepkg/repos.conf"
else
REPOS_CONF="/etc/simplepkg/defaults/repos.conf"