quelques corrections sur deploy

This commit is contained in:
Jephté Clain 2017-03-08 00:48:52 +04:00
parent 20df6c462f
commit 8fa58e24e3
1 changed files with 18 additions and 15 deletions

View File

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