summaryrefslogtreecommitdiff
path: root/src/toru/toru-path
diff options
context:
space:
mode:
Diffstat (limited to 'src/toru/toru-path')
-rwxr-xr-xsrc/toru/toru-path15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/toru/toru-path b/src/toru/toru-path
index f2445a6..611a857 100755
--- a/src/toru/toru-path
+++ b/src/toru/toru-path
@@ -54,11 +54,7 @@ usage() {
main() {
setup_traps
- load_files libretools
- load_files abs
-
# TODO: better option parsing
- TORUPATH=${T:-${TORUPATH}}
VERBOSE=${V:-false}
FORCE=${F:-false}
# TODO: add an option to override/augment libretools.conf:REPOS
@@ -71,8 +67,15 @@ main() {
return 2
fi
- check_vars libretools TORUPATH REPOS || return 1
- check_vars abs ABSROOT || return 1
+ declare -i ret=0
+ if [[ -n "${T:-}" ]]; then
+ load_conf libretools.conf REPOS || ret=$?
+ TORUPATH=$T
+ else
+ load_conf libretools.conf TORUPATH REPOS || ret=$?
+ fi
+ load_conf abs.conf ABSROOT || ret=$?
+ [[ $ret = 0 ]] || exit $ret
if [ ! -w "$TORUPATH" ]; then
error "Toru's path isn't writable. Please check your TORUPATH: %q" "$TORUPATH"