diff options
author | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2009-01-03 21:55:14 +0000 |
---|---|---|
committer | rhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58> | 2009-01-03 21:55:14 +0000 |
commit | 12ecae94ad6930d9d36374c0175dfb9762acfb26 (patch) | |
tree | 7f766ccc143344268dfb2900d278cd71bfc94526 | |
parent | 9f274cf7c39767b51655f695ea01344024aca78a (diff) | |
download | simplepkg-12ecae94ad6930d9d36374c0175dfb9762acfb26.tar.gz simplepkg-12ecae94ad6930d9d36374c0175dfb9762acfb26.tar.bz2 |
attempting to fix #65
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@729 04377dda-e619-0410-9926-eae83683ac58
-rw-r--r-- | trunk/lib/common.sh | 9 | ||||
-rwxr-xr-x | trunk/src/simplaret | 4 |
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" |