diff --git a/lib/ulib/deploy b/lib/ulib/deploy index 868151a..275f496 100644 --- a/lib/ulib/deploy +++ b/lib/ulib/deploy @@ -19,8 +19,7 @@ function deploy_query() { ;; esac if [ -n "$ltype" ]; then deploy_is_link "$ltype" || return 4; fi - deploy_is_profile "$profile" || return 5 - [ -n "$term" ] || return 6 + [ -n "$term" ] || return 5 case "$qtype" in DEST) @@ -56,20 +55,24 @@ function deploy_query() { } function deploy_setconf() { - local confname="$1" confdir="${2:-$scriptdir}" + local confname="$1" confdir="$(abspath "${2:-$scriptdir}")" IFILE="$confdir/init.conf" - if [ -f "$confname" ]; then - CONFNAME="$confname" - SFILE="$CONFNAME" - DFILE="${CONFNAME%.conf}.vars" - else - CONFNAME="${confname:-deploy}" - SFILE="$confdir/$CONFNAME.conf" - if is_root; then - DFILE="/var/local/deploy/$CONFNAME.vars" - else - DFILE="$HOME/etc/deploy/$CONFNAME.vars" + if [[ "$confname" == */* ]] || [[ "$confname" == *.* ]]; then + local d="$(abspath "$(dirname -- "$confname")")" + if [ "$d" != "$confdir" ]; then + CONFNAME="$confname" + SFILE="$CONFNAME" + DFILE="${CONFNAME%.conf}.vars" + return fi + confname="$(basename -- "$confname" .conf)" + fi + CONFNAME="${confname:-deploy}" + SFILE="$confdir/$CONFNAME.conf" + if is_root; then + DFILE="/var/local/deploy/$CONFNAME.vars" + else + DFILE="$HOME/etc/deploy/$CONFNAME.vars" fi } @@ -80,7 +83,7 @@ function deploy_loadconf() { [ -n "$DEPLOY_SRCDIR" ] || DEPLOY_SRCDIR=~/wop/deploy [ -x "$DEPLOY_SRCDIR/query" ] && "$DEPLOY_SRCDIR/query" --nop -c "$CONFNAME" ); fi - [ -f "$DFILE" ] && source "$DFILE" + [ -f "$DFILE" ] && source "$DFILE" || return 1 } function deploy_search_artifact() {