cesser d'utiliser des fonctions obsolètes
This commit is contained in:
parent
9a777b3307
commit
2177e6acc6
|
@ -161,11 +161,11 @@ $(qvals "./$scriptname" ${pkstring:+-s "$pkstring"} ${luser:+-l} "$user")" >"$wo
|
|||
|
||||
estep "Exécution du script"
|
||||
"${ssh[@]}" "$remoteuser@$host" "\
|
||||
__estack=$(quoted_arg "$__estack")
|
||||
__tlevel=$(quoted_arg "$__tlevel")
|
||||
__estack=$(qval "$__estack")
|
||||
__tlevel=$(qval "$__tlevel")
|
||||
export __estack __tlevel
|
||||
${UTOOLS_LANG:+UTOOLS_LANG='$UTOOLS_LANG'; export UTOOLS_LANG
|
||||
}$(quoted_args "./$archivename" ${tmproot:+--tmproot "$tmproot"})"
|
||||
}$(qvals "./$archivename" ${tmproot:+--tmproot "$tmproot"})"
|
||||
r=$?
|
||||
ac_clean "$workdir"
|
||||
|
||||
|
|
2
cssh
2
cssh
|
@ -23,7 +23,7 @@ vars="$("$scriptdir/ussh" --parse "$@")" || die
|
|||
eval "$vars"
|
||||
[ "${#hosts[*]}" -gt 0 ] || die "Vous devez spécifier l'hôte sur lequel se connecter"
|
||||
|
||||
cmd="'$(quoted_args "${args[@]}")
|
||||
cmd="'$(qvals "${args[@]}")
|
||||
"'
|
||||
function __ask() {
|
||||
local r
|
||||
|
|
|
@ -224,7 +224,7 @@ found_element && $0 ~ /<\/element/ {
|
|||
|
||||
local instance notfirst=
|
||||
for instance in "$@"; do
|
||||
script="$script${notfirst:+|| }name == \"$(quote_awk "$instance")\""
|
||||
script="$script${notfirst:+|| }name == $(qawk "$instance")"
|
||||
notfirst=1
|
||||
done
|
||||
script="$script"') {
|
||||
|
@ -304,7 +304,7 @@ found_element && $0 ~ /<\/element/ {
|
|||
|
||||
local instance notfirst=
|
||||
for instance in "$@"; do
|
||||
script="$script${notfirst:+|| }name == \"$(quote_awk "$instance")\""
|
||||
script="$script${notfirst:+|| }name == $(qawk "$instance")"
|
||||
notfirst=1
|
||||
done
|
||||
script="$script"') {
|
||||
|
|
|
@ -63,8 +63,8 @@ fi
|
|||
|
||||
# identification du système
|
||||
echo "##@before *" >lib/profile.d/0nutools
|
||||
set_var_cmd UNAME_SYSTEM "$UNAME_SYSTEM" >>lib/profile.d/0nutools
|
||||
set_var_cmd UNAME_MACHINE "$UNAME_MACHINE" >>lib/profile.d/0nutools
|
||||
echo_setv UNAME_SYSTEM "$UNAME_SYSTEM" >>lib/profile.d/0nutools
|
||||
echo_setv UNAME_MACHINE "$UNAME_MACHINE" >>lib/profile.d/0nutools
|
||||
|
||||
# installer les profils
|
||||
destdir="@@dest@@"
|
||||
|
|
|
@ -8,8 +8,8 @@ uprovide apache.tools
|
|||
urequire base sysinfos template apache
|
||||
|
||||
function __apache_rc_destdir() {
|
||||
[ -z "$3" ] && set_var "${1:-certsdir}" "$(get_APACHESSLCERTSDIR_prefix)"
|
||||
[ -z "$4" ] && set_var "${2:-keysdir}" "$(get_APACHESSLKEYSDIR_prefix)"
|
||||
[ -z "$3" ] && setv "${1:-certsdir}" "$(get_APACHESSLCERTSDIR_prefix)"
|
||||
[ -z "$4" ] && setv "${2:-keysdir}" "$(get_APACHESSLKEYSDIR_prefix)"
|
||||
}
|
||||
|
||||
function __apache_rc_loadconf() {
|
||||
|
@ -134,9 +134,9 @@ function apache_resolvecert() {
|
|||
__apache_rc_loadconf
|
||||
__apache_rc_resolveprefix "$__certsdir" "$__keysdir"
|
||||
__apache_rc_checkvars "$__certsdir" "$__keysdir" || return 1
|
||||
set_var "${3:-cert}" "$__rc_cert"
|
||||
set_var "${4:-key}" "$__rc_key"
|
||||
set_var "${5:-ca}" "$__rc_ca"
|
||||
setv "${3:-cert}" "$__rc_cert"
|
||||
setv "${4:-key}" "$__rc_key"
|
||||
setv "${5:-ca}" "$__rc_ca"
|
||||
}
|
||||
|
||||
function apache_addcert() {
|
||||
|
|
133
lib/ulib/base
133
lib/ulib/base
|
@ -58,19 +58,19 @@ fi
|
|||
## valeurs
|
||||
function setyesval() {
|
||||
# mettre la valeur normalisée de la valeur "oui" de $2 dans la variable $1
|
||||
is_yes "$2" && set_var "$1" 1 || set_var "$1" ""
|
||||
is_yes "$2" && _setv "$1" 1 || _setv "$1" ""
|
||||
}
|
||||
function normyesval() {
|
||||
# remplacer la valeur de la variable $1 par la valeur normalisée de sa valeur "oui"
|
||||
# Si $2 est non vide, prendre cette valeur plutôt que la valeur de la variable $1
|
||||
is_yes "${2:-"${!1}"}" && set_var "$1" 1 || set_var "$1" ""
|
||||
is_yes "${2:-"${!1}"}" && _setv "$1" 1 || _setv "$1" ""
|
||||
}
|
||||
function normyesvals() {
|
||||
# remplacer les valeur des variables $1..* par les valeurs normalisées
|
||||
# respectives de leur valeur "oui"
|
||||
local __nyv_yesvar
|
||||
for __nyv_yesvar in "$@"; do
|
||||
is_yes "${!__nyv_yesvar}" && set_var "$__nyv_yesvar" 1 || set_var "$__nyv_yesvar" ""
|
||||
is_yes "${!__nyv_yesvar}" && _setv "$__nyv_yesvar" 1 || _setv "$__nyv_yesvar" ""
|
||||
done
|
||||
}
|
||||
function quote_in() {
|
||||
|
@ -102,7 +102,7 @@ function quoted_sargs() {
|
|||
for a in "$@"; do
|
||||
s="${s:+$s }$(quoted_sarg "$a")"
|
||||
done
|
||||
rawecho "$s"
|
||||
recho "$s"
|
||||
}
|
||||
|
||||
## variables tableaux
|
||||
|
@ -122,7 +122,7 @@ function set_array_cmd() {
|
|||
__sac_f=1
|
||||
for __sac_v in "$@"; do
|
||||
[ -n "$__sac_f" ] && __sac_f= || __sac_s="$__sac_s "
|
||||
__sac_s="$__sac_s$(quoted_arg "$__sac_v")"
|
||||
__sac_s="$__sac_s$(qvalm "$__sac_v")"
|
||||
done
|
||||
__sac_s="$__sac_s)"
|
||||
echo "$__sac_s"
|
||||
|
@ -151,20 +151,20 @@ function array_add() {
|
|||
# ajouter les valeurs $2..@ au tableau dont le nom est $1
|
||||
local __aa_a="$1"; shift
|
||||
eval "$__aa_a=(\"\${$__aa_a[@]}\" \"\$@\")"
|
||||
#eval "$1=(\"\${$1[@]}\" \"$(quote_arg "$2")\")"
|
||||
#eval "$1=(\"\${$1[@]}\" $(qval "$2"))"
|
||||
}
|
||||
function array_ins() {
|
||||
# insérer les valeurs $2..@ au début du tableau dont le nom est $1
|
||||
local __aa_a="$1"; shift
|
||||
eval "$__aa_a=(\"\$@\" \"\${$__aa_a[@]}\")"
|
||||
#eval "$1=(\"$(quote_arg "$2")\" \"\${$1[@]}\")"
|
||||
#eval "$1=($(qval "$2") \"\${$1[@]}\")"
|
||||
}
|
||||
function array_del() {
|
||||
# supprimer *les* valeurs $2 du tableau dont le nom est $1
|
||||
local __ad_v
|
||||
local -a __ad_vs
|
||||
eval 'for __ad_v in "${'"$1"'[@]}"; do
|
||||
if [ "$__ad_v" != '"$(quoted_arg "$2")"' ]; then
|
||||
if [ "$__ad_v" != '"$(qval "$2")"' ]; then
|
||||
array_add __ad_vs "$__ad_v"
|
||||
fi
|
||||
done'
|
||||
|
@ -175,7 +175,7 @@ function array_addu() {
|
|||
# déjà. Retourner vrai si la valeur a été ajoutée
|
||||
local __as_v
|
||||
eval 'for __as_v in "${'"$1"'[@]}"; do
|
||||
if [ "$__as_v" == '"$(quoted_arg "$2")"' ]; then
|
||||
if [ "$__as_v" == '"$(qval "$2")"' ]; then
|
||||
return 1
|
||||
fi
|
||||
done'
|
||||
|
@ -190,7 +190,7 @@ function array_insu() {
|
|||
# valeur n'y est pas déjà. Retourner vrai si la valeur a été ajoutée.
|
||||
local __as_v
|
||||
eval 'for __as_v in "${'"$1"'[@]}"; do
|
||||
if [ "$__as_v" == '"$(quoted_arg "$2")"' ]; then
|
||||
if [ "$__as_v" == '"$(qval "$2")"' ]; then
|
||||
return 1
|
||||
fi
|
||||
done'
|
||||
|
@ -224,7 +224,7 @@ function array_contains() {
|
|||
# tester si le tableau dont le nom est $1 contient la valeur $2
|
||||
local __ac_v
|
||||
eval 'for __ac_v in "${'"$1"'[@]}"; do
|
||||
if [ "$__ac_v" == '"$(quoted_arg "$2")"' ]; then
|
||||
if [ "$__ac_v" == '"$(qvalm "$2")"' ]; then
|
||||
return 0
|
||||
fi
|
||||
done'
|
||||
|
@ -235,7 +235,7 @@ function array_icontains() {
|
|||
# compte de la casse
|
||||
local __ac_v
|
||||
eval 'for __ac_v in "${'"$1"'[@]}"; do
|
||||
if [ "$(strlower "$__ac_v")" == '"$(strlower "$(quoted_arg "$2")")"' ]; then
|
||||
if [ "$(strlower "$__ac_v")" == '"$(strlower "$(qval "$2")")"' ]; then
|
||||
return 0
|
||||
fi
|
||||
done'
|
||||
|
@ -247,7 +247,7 @@ function array_find() {
|
|||
local __af_i __af_v
|
||||
__af_i=0
|
||||
eval 'for __af_v in "${'"$1"'[@]}"; do
|
||||
if [ "$__af_v" == '"$(quoted_arg "$2")"' ]; then
|
||||
if [ "$__af_v" == '"$(qval "$2")"' ]; then
|
||||
if [ -n "$3" ]; then
|
||||
echo "${'"$3"'[$__af_i]}"
|
||||
else
|
||||
|
@ -313,11 +313,11 @@ function array_map() {
|
|||
}
|
||||
function first_value() {
|
||||
# retourner la première valeur du tableau $1
|
||||
eval "rawecho \"\${$1[@]:0:1}\""
|
||||
eval "recho \"\${$1[@]:0:1}\""
|
||||
}
|
||||
function last_value() {
|
||||
# retourner la dernière valeur du tableau $1
|
||||
eval "rawecho \"\${$1[@]:\$((-1)):1}\""
|
||||
eval "recho \"\${$1[@]:\$((-1)):1}\""
|
||||
}
|
||||
function array_copy() {
|
||||
# copier le contenu du tableau $2 dans le tableau $1
|
||||
|
@ -418,9 +418,9 @@ function array_join() {
|
|||
__aj_j="${__aj_j:+$__aj_j'"$__aj_s"'}$__aj_pf$__aj_l$__aj_sf"
|
||||
done'
|
||||
if [ -n "$__aj_j" ]; then
|
||||
rawecho "$__aj_j"
|
||||
recho "$__aj_j"
|
||||
elif [ "$__aj_an" != "\$@" -a -n "$3" ]; then
|
||||
rawecho "$3"
|
||||
recho "$3"
|
||||
fi
|
||||
}
|
||||
function array_mapjoin() {
|
||||
|
@ -482,26 +482,21 @@ function parse_date() {
|
|||
local value="$1" type="${2:-date}"
|
||||
local now="$(awk 'BEGIN { print mktime(strftime("%Y %m %d 00 00 00 +0400")) }')"
|
||||
case "$value" in
|
||||
+*)
|
||||
value="$(($now + ${value#+} * 86400))"
|
||||
;;
|
||||
*)
|
||||
value="$(<<<"$value" awk -F/ '{
|
||||
nd = strftime("%d"); nm = strftime("%m"); ny = strftime("%Y")
|
||||
d = $1 + 0; if (d < 1) d = nd;
|
||||
m = $2 + 0; if (m < 1) m = nm;
|
||||
if ($3 == "") y = ny;
|
||||
else { y = $3 + 0; if (y < 100) y = y + 2000; }
|
||||
print mktime(sprintf("%04i %02i %02i 00 00 00 +0400", y, m, d));
|
||||
}')"
|
||||
+*) value="$(($now + ${value#+} * 86400))";;
|
||||
*) value="$(<<<"$value" awk -F/ '{
|
||||
nd = strftime("%d"); nm = strftime("%m"); ny = strftime("%Y")
|
||||
d = $1 + 0; if (d < 1) d = nd;
|
||||
m = $2 + 0; if (m < 1) m = nm;
|
||||
if ($3 == "") y = ny;
|
||||
else { y = $3 + 0; if (y < 100) y = y + 2000; }
|
||||
print mktime(sprintf("%04i %02i %02i 00 00 00 +0400", y, m, d));
|
||||
}')";;
|
||||
esac
|
||||
case "$type" in
|
||||
d|date) awk '{ print strftime("%d/%m/%Y", $0 + 0) }' <<<"$value";;
|
||||
l|ldap) awk '{ print strftime("%Y%m%d%H%M%S+0400", $0 + 0) }' <<<"$value";;
|
||||
m|mysql) awk '{ print strftime("%Y-%m-%d", $0 + 0) }' <<<"$value";;
|
||||
*)
|
||||
rawecho "$value"
|
||||
;;
|
||||
*) recho "$value";;
|
||||
esac
|
||||
}
|
||||
|
||||
|
@ -563,7 +558,7 @@ function normpath() {
|
|||
ap="$ap$part"
|
||||
fi
|
||||
done
|
||||
rawecho "$ap"
|
||||
recho "$ap"
|
||||
}
|
||||
function abspath() {
|
||||
# Retourner un chemin absolu vers $1. Si $2 est non nul et si $1 est un chemin
|
||||
|
@ -640,7 +635,7 @@ function ppath() {
|
|||
[ "$cwd" != "/" -a "$cwd" != "$HOME" ] && path="${path#$cwd/}"
|
||||
[ "${path#$HOME/}" != "$path" ] && path="~${path#$HOME}"
|
||||
|
||||
rawecho "$path"
|
||||
recho "$path"
|
||||
}
|
||||
function relpath() {
|
||||
# Afficher le chemin relatif de $1 par rapport à $2. Si $2 n'est pas spécifié,
|
||||
|
@ -656,7 +651,7 @@ function relpath() {
|
|||
if [ "$p" == "$cwd" ]; then
|
||||
echo ""
|
||||
elif [ "${p#$cwd/}" != "$p" ]; then
|
||||
rawecho "${p#$cwd/}"
|
||||
recho "${p#$cwd/}"
|
||||
else
|
||||
local rp
|
||||
while [ -n "$cwd" -a "${p#$cwd/}" == "$p" ]; do
|
||||
|
@ -752,8 +747,8 @@ function splitwcs() {
|
|||
fi
|
||||
done
|
||||
[ "${__sw_p#/}" != "$__sw_p" ] && __sw_d="/$__sw_d"
|
||||
set_var "$__sw_dd" "$__sw_d"
|
||||
set_var "$__sw_df" "$__sw_f"
|
||||
_setv "$__sw_dd" "$__sw_d"
|
||||
_setv "$__sw_df" "$__sw_f"
|
||||
}
|
||||
function deref() {
|
||||
# Retourner un chemin absolu vers le fichier $1, dans lequel toutes les
|
||||
|
@ -824,9 +819,9 @@ function path_if_test() {
|
|||
local basedir="$1"
|
||||
if [ $op "$basedir/$file" ]; then
|
||||
if [ -n "$rel" ]; then
|
||||
rawecho "$reldir$file"
|
||||
recho "$reldir$file"
|
||||
else
|
||||
rawecho "$basedir/$file"
|
||||
recho "$basedir/$file"
|
||||
fi
|
||||
break
|
||||
fi
|
||||
|
@ -1338,7 +1333,7 @@ function list_all() {
|
|||
cd "$b" 2>/dev/null || return
|
||||
eval "$(__la_cmd "$@")" | while read f; do
|
||||
[ "$f" == "." -o "$f" == ".." ] && continue
|
||||
rawecho "$f"
|
||||
recho "$f"
|
||||
done
|
||||
cd "$curdir"
|
||||
}
|
||||
|
@ -1363,7 +1358,7 @@ function list_files() {
|
|||
|
||||
cd "$b" 2>/dev/null || return
|
||||
eval "$(__la_cmd "$@")" | while read f; do
|
||||
[ -f "$f" ] && rawecho "$f"
|
||||
[ -f "$f" ] && recho "$f"
|
||||
done
|
||||
cd "$curdir"
|
||||
}
|
||||
|
@ -1379,7 +1374,7 @@ function list_dirs() {
|
|||
cd "$b" 2>/dev/null || return
|
||||
eval "$(__la_cmd "$@")" | while read f; do
|
||||
[ "$f" == "." -o "$f" == ".." ] && continue
|
||||
[ -d "$f" ] && rawecho "$f"
|
||||
[ -d "$f" ] && recho "$f"
|
||||
done
|
||||
cd "$curdir"
|
||||
}
|
||||
|
@ -1631,10 +1626,10 @@ function runscript_as() {
|
|||
|
||||
local cmd
|
||||
cmd="\
|
||||
__estack=$(quoted_arg "$__estack")
|
||||
__tlevel=$(quoted_args "$__tlevel")
|
||||
__estack=$(qval "$__estack")
|
||||
__tlevel=$(qval "$__tlevel")
|
||||
export __estack __tlevel
|
||||
exec ${BASH:-/bin/sh} $(quoted_args "$@")"
|
||||
exec ${BASH:-/bin/sh} $(qvals "$@")"
|
||||
|
||||
if is_yes "$UTOOLS_USES_SU" || ! progexists sudo; then
|
||||
eecho "Entrez le mot de passe de root"
|
||||
|
@ -1818,8 +1813,8 @@ En l'occurence, ce script est accédé par le chemin $script et ce chemin doit e
|
|||
|
||||
estep "Lancement de la commande sur l'hôte distant $user@$host"
|
||||
local cmd
|
||||
[ -n "$path" ] && cmd="$(quoted_args cd "$path"); "
|
||||
cmd="$cmd$(quoted_args "$script" "$@")"
|
||||
[ -n "$path" ] && cmd="$(qvals cd "$path"); "
|
||||
cmd="$cmd$(qvals "$script" "$@")"
|
||||
ssh -qt "${UTOOLS_ENSURE_HOSTNAME_SSH_OPTS[@]}" "$user@$host" "$cmd"
|
||||
[ $? -eq 255 ] && return 12
|
||||
return 1
|
||||
|
@ -2506,15 +2501,15 @@ function awkdef() {
|
|||
__ad_value="${1:$__ad_vpos}"
|
||||
if [ -n "$__ad_int" ]; then
|
||||
# valeur entière
|
||||
echo "$__ad_name = int($(quoted_awk "$__ad_value") + 0)"
|
||||
echo "$__ad_name = int($(qawk "$__ad_value") + 0)"
|
||||
elif [ -n "$__ad_str" ]; then
|
||||
# valeur chaine
|
||||
echo "$__ad_name = $(quoted_awk "$__ad_value")"
|
||||
echo "$__ad_name = $(qawk "$__ad_value")"
|
||||
elif [ ${#__ad_value} -lt 256 ] && isnum "$__ad_value"; then
|
||||
# considérer qu'une nombre fait moins de 256 chiffres
|
||||
echo "$__ad_name = $__ad_value"
|
||||
else
|
||||
echo "$__ad_name = $(quoted_awk "$__ad_value")"
|
||||
echo "$__ad_name = $(qawk "$__ad_value")"
|
||||
fi
|
||||
else
|
||||
# fin de l'analyse des définitions de variable
|
||||
|
@ -2530,7 +2525,7 @@ function awkdef() {
|
|||
local __ad_i=1
|
||||
echo "$__ad_name[0] = 0; delete $__ad_name"
|
||||
for __ad_arg in "${!__ad_value}"; do
|
||||
echo "$__ad_name[$__ad_i]=$(quoted_awk "$__ad_arg")"
|
||||
echo "$__ad_name[$__ad_i]=$(qawk "$__ad_arg")"
|
||||
__ad_i=$(($__ad_i + 1))
|
||||
done
|
||||
eval "echo \"\${__ad_name}_count = \${#$__ad_value}\""
|
||||
|
@ -2539,7 +2534,7 @@ function awkdef() {
|
|||
done
|
||||
echo "}"
|
||||
for __ad_arg in "$@"; do
|
||||
rawecho "$__ad_arg"
|
||||
recho "$__ad_arg"
|
||||
done
|
||||
fi
|
||||
|
||||
|
@ -2967,7 +2962,7 @@ function tooenc() {
|
|||
# $3=($UTOOLS_OUTPUT_ENCODING)
|
||||
local src="$1" from="${2:-$OENC}" to="${3:-$UTOOLS_OUTPUT_ENCODING}"
|
||||
if [ "$from" == "$to" ]; then
|
||||
rawecho "$src"
|
||||
recho "$src"
|
||||
else
|
||||
iconv -f "$from" -t "$to" <<<"$src"
|
||||
fi
|
||||
|
@ -2980,9 +2975,9 @@ function tooenc_() {
|
|||
# $3=($UTOOLS_OUTPUT_ENCODING)
|
||||
local src="$1" from="${2:-$OENC}" to="${3:-$UTOOLS_OUTPUT_ENCODING}"
|
||||
if [ "$from" == "$to" ]; then
|
||||
rawecho_ "$src"
|
||||
recho_ "$src"
|
||||
else
|
||||
rawecho_ "$src" | iconv -f "$from" -t "$to"
|
||||
recho_ "$src" | iconv -f "$from" -t "$to"
|
||||
fi
|
||||
}
|
||||
function uecho_() {
|
||||
|
@ -2993,7 +2988,7 @@ function toienc() {
|
|||
# $3(=$UTOOLS_INPUT_ENCODING)
|
||||
local __tie_var="$1" __tie_to="${2:-$IENC}" __tie_from="${3:-$UTOOLS_INPUT_ENCODING}"
|
||||
if [ "$__tie_from" != "$__tie_to" ]; then
|
||||
set_var "$__tie_var" "$(iconv -f "$__tie_from" -t "$__tie_to" <<<"${!__tie_var}")"
|
||||
_setv "$__tie_var" "$(iconv -f "$__tie_from" -t "$__tie_to" <<<"${!__tie_var}")"
|
||||
fi
|
||||
}
|
||||
function uread() {
|
||||
|
@ -3075,7 +3070,7 @@ function __indent() {
|
|||
/}" != "$1" ]; then
|
||||
sed "2,\$s/^/${__tlevel}/g" <<<"$1"
|
||||
else
|
||||
rawecho "$1"
|
||||
recho "$1"
|
||||
fi
|
||||
}
|
||||
# fonctions à surcharger pour modifier la façon dont les messages sont affichés
|
||||
|
@ -3163,7 +3158,7 @@ function get_interaction_option() { :;}
|
|||
__epending=
|
||||
function eflush() {
|
||||
# Afficher les messages en attente
|
||||
if [ -n "$__epending" ]; then rawecho "$__epending" 1>&2; __epending=; fi
|
||||
if [ -n "$__epending" ]; then recho "$__epending" 1>&2; __epending=; fi
|
||||
}
|
||||
function eclearp() {
|
||||
# Supprimer les message en attente
|
||||
|
@ -3211,7 +3206,7 @@ function edebug() {
|
|||
function trace() {
|
||||
# Afficher la commande $1..@, la lancer, puis afficher son code d'erreur si une
|
||||
# erreur se produit
|
||||
local r cmd="$(quoted_args "$@")"
|
||||
local r cmd="$(qvals "$@")"
|
||||
show_info && { eflush; __eecho "\$ $cmd" 1>&2; }
|
||||
"$@"; r=$?
|
||||
if [ $r -ne 0 ]; then
|
||||
|
@ -3230,7 +3225,7 @@ function trace_error() {
|
|||
local r
|
||||
"$@"; r=$?
|
||||
if [ $r -ne 0 ]; then
|
||||
local cmd="$(quoted_args "$@")"
|
||||
local cmd="$(qvals "$@")"
|
||||
show_error && { eflush; __eecho "^ $cmd [EC #$r]" 1>&2; }
|
||||
fi
|
||||
return $r
|
||||
|
@ -3649,7 +3644,7 @@ function __rv_read() {
|
|||
OENC="$UTF8" eerror "La valeur par défaut de $__rv_v doit être non vide"
|
||||
return 1
|
||||
fi
|
||||
set_var "$__rv_v" "$__rv_d"
|
||||
_setv "$__rv_v" "$__rv_d"
|
||||
return 0
|
||||
fi
|
||||
|
||||
|
@ -3678,7 +3673,7 @@ function __rv_read() {
|
|||
fi
|
||||
__rv_r="${__rv_r:-$__rv_d}"
|
||||
if [ -n "$__rv_r" ] || ! is_yes "$__rv_re"; then
|
||||
set_var "$__rv_v" "$__rv_r"
|
||||
_setv "$__rv_v" "$__rv_r"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
@ -3755,7 +3750,7 @@ function simple_menu() {
|
|||
__sm_c=0
|
||||
fi
|
||||
done
|
||||
set_var "$__sm_option_var" "$__sm_option"
|
||||
_setv "$__sm_option_var" "$__sm_option"
|
||||
}
|
||||
|
||||
function actions_menu() {
|
||||
|
@ -3801,8 +3796,8 @@ function actions_menu() {
|
|||
|
||||
eerror_unless [ ${#__am_action_descs[*]} -gt 0 ] "Vous devez spécifier le tableau des actions" || return
|
||||
__actions_menu || return 1
|
||||
setv "${1:-action}" "$__am_select_action"
|
||||
setv "${2:-option}" "$__am_select_option"
|
||||
_setv "${1:-action}" "$__am_select_action"
|
||||
_setv "${2:-option}" "$__am_select_option"
|
||||
}
|
||||
function __actions_menu() {
|
||||
local title="$__am_title"
|
||||
|
@ -4091,12 +4086,12 @@ function ac_set_tmpfile() {
|
|||
fi
|
||||
fi
|
||||
if [ -n "$__acst_d" -a -n "$3" ]; then
|
||||
set_var "$1" "$3"
|
||||
_setv "$1" "$3"
|
||||
[ -f "$3" -a "$4" == keep ] || >"$3"
|
||||
else
|
||||
local __acst_t="$(mktempf "$2")"
|
||||
autoclean "$__acst_t"
|
||||
set_var "$1" "$__acst_t"
|
||||
_setv "$1" "$__acst_t"
|
||||
fi
|
||||
}
|
||||
function ac_set_tmpdir() {
|
||||
|
@ -4115,12 +4110,12 @@ function ac_set_tmpdir() {
|
|||
fi
|
||||
fi
|
||||
if [ -n "$__acst_d" -a -n "$3" ]; then
|
||||
set_var "$1" "$3"
|
||||
_setv "$1" "$3"
|
||||
mkdir -p "$3"
|
||||
else
|
||||
local __acst_t="$(mktempd "$2")"
|
||||
autoclean "$__acst_t"
|
||||
set_var "$1" "$__acst_t"
|
||||
_setv "$1" "$__acst_t"
|
||||
fi
|
||||
}
|
||||
function debug_tee() {
|
||||
|
|
|
@ -270,7 +270,7 @@ if check_sysinfos -s macosx; then
|
|||
done
|
||||
args=("${args[@]}" "$@")
|
||||
fi
|
||||
quoted_args "${options[@]}" -- "${args[@]}"
|
||||
qvals "${options[@]}" -- "${args[@]}"
|
||||
return 0
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ function conf_enable() {
|
|||
fi
|
||||
if [ "$name" != "$param" ]; then
|
||||
# Ensuite, mettre à jour le fichier avec la valeur spécifiée
|
||||
to="$(quote_seds "$value")"
|
||||
to="$(qseds "$value")"
|
||||
sedi "\
|
||||
/^[ $TAB]*export[ $TAB]*$name[ $TAB]*=/s/^\([ $TAB]*export[ $TAB]*$name[ $TAB]*=[ $TAB]*\).*\$/\\1$to/
|
||||
/^[ $TAB]*$name[ $TAB]*=/s/^\([ $TAB]*$name[ $TAB]*=[ $TAB]*\).*\$/\\1$to/
|
||||
|
@ -61,14 +61,14 @@ function conf_enable() {
|
|||
}
|
||||
|
||||
function conf_enableq() {
|
||||
# Comme conf_enable(), mais s'assure que les valeurs sont quotées dans le
|
||||
# fichier. Ceci permet de stocker des valeurs avec des espaces ou des
|
||||
# caractères spéciaux.
|
||||
# Comme conf_enable(), mais s'assure que les valeurs sont quotées si
|
||||
# nécessaire dans le fichier. Ceci permet de stocker des valeurs avec des
|
||||
# espaces ou des caractères spéciaux.
|
||||
local args arg name value
|
||||
args=("$1"); shift
|
||||
for arg in "$@"; do
|
||||
splitvar "$arg" name value
|
||||
array_add args "$name=$(quoted_arg "$value")"
|
||||
array_add args "$name=$(qvalm "$value")"
|
||||
done
|
||||
conf_enable "${args[@]}"
|
||||
}
|
||||
|
@ -94,8 +94,8 @@ function conf_disable() {
|
|||
from0="^[ $TAB]*export[ $TAB]*$name[ $TAB]*="
|
||||
from1="^[ $TAB]*$name[ $TAB]*="
|
||||
if [ "$name" != "$param" ]; then
|
||||
from0="$from0$(quote_seds "$value")\$"
|
||||
from1="$from1$(quote_seds "$value")\$"
|
||||
from0="$from0$(qseds "$value")\$"
|
||||
from1="$from1$(qseds "$value")\$"
|
||||
fi
|
||||
if quietgrep "$from" "$conf"; then
|
||||
sedi "\
|
||||
|
@ -131,7 +131,7 @@ function conf_append() {
|
|||
local param name value from
|
||||
for param in "$@"; do
|
||||
splitvar "$param" name value
|
||||
echo "$name=\"\${$name:+\$$name$CONF_APPEND_SEP}$(quote_arg "$value")\"" >>"$conf"
|
||||
echo "$name=\"\${$name:+\$$name$CONF_APPEND_SEP}$(_qval "$value")\"" >>"$conf"
|
||||
modified=0
|
||||
done
|
||||
|
||||
|
@ -160,11 +160,11 @@ function conf_array_append() {
|
|||
if quietgrep "^[ $TAB]*\(export[ $TAB]*\)\?$name=(" "$conf"; then
|
||||
# variable déjà existante
|
||||
[ "$name" != "$param" ] || continue
|
||||
echo "$name=(\"\${$name[@]}\" $(quoted_arg "$value"))" >>"$conf"
|
||||
echo "$name=(\"\${$name[@]}\" $(qvalm "$value"))" >>"$conf"
|
||||
else
|
||||
# nouvelle variable
|
||||
if [ "$name" != "$param" ]; then
|
||||
echo "$name=($(quoted_arg "$value"))" >>"$conf"
|
||||
echo "$name=($(qvalm "$value"))" >>"$conf"
|
||||
else
|
||||
echo "$name=()" >>"$conf"
|
||||
fi
|
||||
|
@ -191,7 +191,7 @@ function conf_check() {
|
|||
splitvar "$param" name value
|
||||
from="^[ $TAB]*\(export[ $TAB]*\)\?$name[ $TAB]*="
|
||||
if [ "$name" != "$param" ]; then
|
||||
from="$from$(quote_seds "$value")\$"
|
||||
from="$from$(qseds "$value")\$"
|
||||
fi
|
||||
quietgrep "$from" "$conf" || return 1
|
||||
done
|
||||
|
@ -232,7 +232,7 @@ function aconf_enable() {
|
|||
fi
|
||||
if [ "$name" != "$param" ]; then
|
||||
# Ensuite, mettre à jour le fichier avec la valeur spécifiée
|
||||
to="$(quote_seds "$value")"
|
||||
to="$(qseds "$value")"
|
||||
sedi "\
|
||||
/^[ $TAB]*$name[ $TAB][ $TAB]*/s/^\([ $TAB]*$name[ $TAB]*\).*$/\\1$to/
|
||||
/^[ $TAB]*$name\$/s/^\([ $TAB]*$name\)\$/\\1 $to/" "$conf"
|
||||
|
@ -265,7 +265,7 @@ function aconf_disable() {
|
|||
# Essayer simplement de commenter la valeur dans le fichier
|
||||
from="^[ $TAB]*$name[ $TAB]*"
|
||||
if [ "$name" != "$param" ]; then
|
||||
from="$from$(quote_seds "$value")\$"
|
||||
from="$from$(qseds "$value")\$"
|
||||
fi
|
||||
if quietgrep "$from" "$conf"; then
|
||||
sedi "/$from/"'s/^/#/g' "$conf"
|
||||
|
@ -317,7 +317,7 @@ function aconf_check() {
|
|||
splitvar "$param" name value
|
||||
from="^[ $TAB]*$name[ $TAB]*"
|
||||
if [ "$name" != "$param" ]; then
|
||||
from="$from$(quote_seds "$value")\$"
|
||||
from="$from$(qseds "$value")\$"
|
||||
fi
|
||||
quietgrep "$from" "$conf" || return 1
|
||||
done
|
||||
|
@ -350,17 +350,17 @@ function mconf_enable() {
|
|||
local script i param name value
|
||||
script="BEGIN {
|
||||
modified = 1
|
||||
section = $(quoted_awk "$section")
|
||||
section = $(qawk "$section")
|
||||
in_section = 0"
|
||||
i=0
|
||||
for param in "$@"; do
|
||||
splitvar "$param" name value
|
||||
script="$script
|
||||
names[$i] = $(quoted_awk "$name")"
|
||||
names[$i] = $(qawk "$name")"
|
||||
if [ "$name" != "$param" ]; then
|
||||
script="$script
|
||||
hasvalues[$i] = 1
|
||||
values[$i] = $(quoted_awk "$value")"
|
||||
values[$i] = $(qawk "$value")"
|
||||
else
|
||||
script="$script
|
||||
hasvalues[$i] = 0
|
||||
|
@ -445,7 +445,7 @@ function mconf_disable() {
|
|||
local script match
|
||||
script="BEGIN {
|
||||
modified = 1
|
||||
section = $(quoted_awk "$section")
|
||||
section = $(qawk "$section")
|
||||
in_section = 0
|
||||
"
|
||||
local param name value
|
||||
|
@ -453,7 +453,7 @@ function mconf_disable() {
|
|||
splitvar "$param" name value
|
||||
match="${match:+$match || }\$0 ~ /^[ $TAB]*$name[ $TAB]*="
|
||||
if [ "$name" != "$param" ]; then
|
||||
match="$match[ $TAB]*$(quote_seds "$value")\$"
|
||||
match="$match[ $TAB]*$(qseds "$value")\$"
|
||||
fi
|
||||
match="$match/"
|
||||
done
|
||||
|
@ -501,15 +501,15 @@ function mconf_append() {
|
|||
local script match
|
||||
script="BEGIN {
|
||||
modified = 1
|
||||
section=$(quoted_awk "$section")
|
||||
section=$(qawk "$section")
|
||||
in_section=0
|
||||
"
|
||||
i=0
|
||||
for param in "$@"; do
|
||||
splitvar "$param" name value
|
||||
script="$script
|
||||
names[$i] = $(quoted_awk "$name")
|
||||
values[$i] = $(quoted_awk "$value")
|
||||
names[$i] = $(qawk "$name")
|
||||
values[$i] = $(qawk "$value")
|
||||
seen[$i] = 0"
|
||||
let i=$i+1
|
||||
done
|
||||
|
@ -569,14 +569,14 @@ function mconf_check() {
|
|||
|
||||
local script i param name value
|
||||
script="BEGIN {
|
||||
section = $(quoted_awk "$section")
|
||||
section = $(qawk "$section")
|
||||
in_section = 0"
|
||||
i=0
|
||||
for param in "$@"; do
|
||||
splitvar "$param" name value
|
||||
script="$script
|
||||
names[$i] = $(quoted_awk "$name")
|
||||
values[$i] = $(quoted_awk "$value")
|
||||
names[$i] = $(qawk "$name")
|
||||
values[$i] = $(qawk "$value")
|
||||
seen[$i] = 0"
|
||||
let i=$i+1
|
||||
done
|
||||
|
@ -593,7 +593,7 @@ function mconf_check() {
|
|||
script="$script
|
||||
in_section && \$0 ~ /^[ $TAB]*$name[ $TAB]*="
|
||||
if [ "$name" != "$param" ]; then
|
||||
script="$script$(quote_seds "$value")\$"
|
||||
script="$script$(qseds "$value")\$"
|
||||
fi
|
||||
script="$script/ {
|
||||
seen[$i] = 1
|
||||
|
|
|
@ -15,11 +15,11 @@ function ipcalc_splitipmask() {
|
|||
# la variable $2(=ip) et le masque, qui est placée dans la variable
|
||||
# $3(=mask)
|
||||
if [[ "$1" == */* ]]; then
|
||||
set_var "${2:-ip}" "${1%%/*}"
|
||||
set_var "${3:-mask}" "${1#*/}"
|
||||
_setv "${2:-ip}" "${1%%/*}"
|
||||
_setv "${3:-mask}" "${1#*/}"
|
||||
else
|
||||
set_var "${2:-ip}" "$1"
|
||||
set_var "${3:-mask}"
|
||||
_setv "${2:-ip}" "$1"
|
||||
_setv "${3:-mask}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -241,7 +241,7 @@ function network_parse_confbr() {
|
|||
local __npc_destbr; local -a __npc_destifaces
|
||||
__network_parse_confbr "$1"
|
||||
|
||||
set_var "${2:-br}" "$__npc_destbr"
|
||||
_setv "${2:-br}" "$__npc_destbr"
|
||||
array_copy "${3:-ifaces}" __npc_destifaces
|
||||
}
|
||||
|
||||
|
@ -265,8 +265,8 @@ function network_parse_confip() {
|
|||
local __npc_destiface __npc_destgateway; local -a __npc_destipsuffixes
|
||||
__network_parse_confip "$1"
|
||||
|
||||
set_var "${2:-iface}" "$__npc_destiface"
|
||||
set_var "${3:-gateway}" "$__npc_destgateway"
|
||||
_setv "${2:-iface}" "$__npc_destiface"
|
||||
_setv "${3:-gateway}" "$__npc_destgateway"
|
||||
array_copy "${4:-ipsuffixes}" __npc_destipsuffixes
|
||||
}
|
||||
|
||||
|
@ -339,7 +339,7 @@ function __network_fix_confips() {
|
|||
eval "local ${iface}_gateway $network; local -a ${iface}_ipsuffixes"
|
||||
fi
|
||||
if [ -z "${!network}" -a -n "${ipsuffixes[0]}" ]; then
|
||||
setv "$network" "$(ipcalc_network "${ipsuffixes[0]}")"
|
||||
_setv "$network" "$(ipcalc_network "${ipsuffixes[0]}")"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
@ -390,7 +390,7 @@ function __network_fix_confips() {
|
|||
# spécifier la passerelle: elle sera fournie par le serveur DHCP.
|
||||
# Utiliser le marqueur "none" pour que la valeur ne soit pas modifiée.
|
||||
[ "${ipsuffixes[0]}" == "dhcp" ] && gateway=none
|
||||
set_var "${iface}_gateway" "$gateway"
|
||||
_setv "${iface}_gateway" "$gateway"
|
||||
done
|
||||
# puis construire le tableau final
|
||||
array_new confips
|
||||
|
|
|
@ -44,9 +44,9 @@ function read_property() {
|
|||
__rp_name="${2//./_}"
|
||||
fi
|
||||
if [ -n "$__rp_found" ]; then
|
||||
set_var "$__rp_name" "$(tooenc "$__rp_value" "$LATIN1")"
|
||||
_setv "$__rp_name" "$(tooenc "$__rp_value" "$LATIN1")"
|
||||
else
|
||||
set_var "$__rp_name" "$4"
|
||||
_setv "$__rp_name" "$4"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -77,33 +77,33 @@ function split_ldapuri() {
|
|||
local ldapuri="$1" protoname="${2:-proto}" hostname="${3:-host}" portname="${4:-port}"
|
||||
local tmp
|
||||
if [ -z "$ldapuri" ]; then
|
||||
set_var "$protoname" ""
|
||||
set_var "$hostname" ""
|
||||
set_var "$portname" ""
|
||||
_setv "$protoname" ""
|
||||
_setv "$hostname" ""
|
||||
_setv "$portname" ""
|
||||
return 0
|
||||
fi
|
||||
tmp="$ldapuri"
|
||||
if [ "${tmp#ldap://}" != "$tmp" ]; then
|
||||
set_var "$protoname" ldap
|
||||
_setv "$protoname" ldap
|
||||
tmp="${tmp#ldap://}"
|
||||
elif [ "${tmp#ldaps://}" != "$tmp" ]; then
|
||||
set_var "$protoname" ldaps
|
||||
_setv "$protoname" ldaps
|
||||
tmp="${tmp#ldaps://}"
|
||||
elif [ "${tmp#ldapi://}" != "$tmp" ]; then
|
||||
set_var "$protoname" ldapi
|
||||
_setv "$protoname" ldapi
|
||||
tmp="${tmp#ldapi://}"
|
||||
else
|
||||
set_var "$protoname" ""
|
||||
set_var "$hostname" ""
|
||||
set_var "$portname" ""
|
||||
_setv "$protoname" ""
|
||||
_setv "$hostname" ""
|
||||
_setv "$portname" ""
|
||||
eerror "invalid ldapuri: $ldapuri"
|
||||
return 1
|
||||
fi
|
||||
tmp="${tmp%%/*}"
|
||||
local tmphost="${tmp%%:*}"
|
||||
set_var "$hostname" "$tmphost"
|
||||
_setv "$hostname" "$tmphost"
|
||||
tmp="${tmp#$tmphost}"
|
||||
set_var "$portname" "${tmp#:}"
|
||||
_setv "$portname" "${tmp#:}"
|
||||
return 0
|
||||
}
|
||||
|
||||
|
|
|
@ -422,7 +422,7 @@ BEGIN {
|
|||
let i=0
|
||||
for value in "$@"; do
|
||||
script="$script
|
||||
values[$i] = $(quoted_awk "$value")"
|
||||
values[$i] = $(qawk "$value")"
|
||||
let i=$i+1
|
||||
done
|
||||
script="$script
|
||||
|
@ -450,13 +450,13 @@ function print_values() {
|
|||
}
|
||||
BEGIN {
|
||||
add=0
|
||||
attr=fix_attr($(quoted_awk "$attr"))
|
||||
attr=fix_attr($(qawk "$attr"))
|
||||
count=$#"
|
||||
local i value
|
||||
let i=0
|
||||
for value in "$@"; do
|
||||
script="$script
|
||||
values[$i] = $(quoted_awk "$value")"
|
||||
values[$i] = $(qawk "$value")"
|
||||
let i=$i+1
|
||||
done
|
||||
script="$script
|
||||
|
@ -505,13 +505,13 @@ function print_values() {
|
|||
BEGIN {
|
||||
add = 0
|
||||
found = 0
|
||||
attr = fix_attr($(quoted_awk "$attr"))
|
||||
attr = fix_attr($(qawk "$attr"))
|
||||
count = $#"
|
||||
local i value
|
||||
let i=0
|
||||
for value in "$@"; do
|
||||
script="$script
|
||||
values[$i] = $(quoted_awk "$value")"
|
||||
values[$i] = $(qawk "$value")"
|
||||
let i=$i+1
|
||||
done
|
||||
script="$script
|
||||
|
@ -539,13 +539,13 @@ function tl_ensureval() {
|
|||
local script="$(def_match_attr "$attr")
|
||||
BEGIN {
|
||||
resetp()
|
||||
attr = fix_attr($(quoted_awk "$attr"))
|
||||
attr = fix_attr($(qawk "$attr"))
|
||||
ensure_count = $#"
|
||||
local i value
|
||||
let i=0
|
||||
for value in "$@"; do
|
||||
script="$script
|
||||
ensure_values[$i] = $(quoted_awk "$value")"
|
||||
ensure_values[$i] = $(qawk "$value")"
|
||||
let i=$i+1
|
||||
done
|
||||
script="$script
|
||||
|
@ -1330,7 +1330,7 @@ function get_transform_cmd() {
|
|||
shift
|
||||
continue
|
||||
fi
|
||||
cmd="${cmd:+"$cmd "}$(quoted_arg "$1")"
|
||||
cmd="${cmd:+"$cmd "}$(qvalm "$1")"
|
||||
shift
|
||||
done
|
||||
[ -n "$cmd" ] && cmds=("${cmds[@]}" "$cmd")
|
||||
|
@ -1427,7 +1427,7 @@ function get_transform_cmd() {
|
|||
;;
|
||||
esac
|
||||
[ -n "$auto_uncut" ] && dest="${dest:+"$dest | "}"'uncut_lines'
|
||||
dest="${dest:+"$dest | "}$(quoted_args "${cmdparts[@]}")"
|
||||
dest="${dest:+"$dest | "}$(qvals "${cmdparts[@]}")"
|
||||
[ -n "$xempty" ] && dest="${dest:+"$dest | "}"'ensure_complete_objects'
|
||||
[ -n "$xdel" ] && dest="${dest:+"$dest | "}"'delete_marked_objects'
|
||||
first=
|
||||
|
|
|
@ -45,7 +45,7 @@ function file_get_vars() {
|
|||
while [ -n "$1" ]; do
|
||||
var_="$1"; shift
|
||||
vars_="${vars_:+$vars_ }$var_"
|
||||
set_var "$var_" "$1"; shift
|
||||
_setv "$var_" "$1"; shift
|
||||
done
|
||||
|
||||
# puis parcourir le fichier pour initialiser la valeur définitive des
|
||||
|
@ -258,13 +258,13 @@ function file_get_java_properties() {
|
|||
awkre_var_="${var_//./\\.}" # nom de la variable pour une expression régulière awk
|
||||
|
||||
# initialiser la valeur par défaut
|
||||
set_var "$sh_var_" "$1"; shift
|
||||
_setv "$sh_var_" "$1"; shift
|
||||
|
||||
# et créer le script qui affichera sa valeur
|
||||
script="$script"'
|
||||
$0 ~ "^[ \t]*'"$(quote_awk "$awkre_var_")"'=" {
|
||||
$0 ~ "^[ \t]*'"$(_qawk "$awkre_var_")"'=" {
|
||||
# enlever les caractères de début
|
||||
sub("^[ \t]*'"$(quote_awk "$awkre_var_")"'=", "")
|
||||
sub("^[ \t]*'"$(_qawk "$awkre_var_")"'=", "")
|
||||
value = $0
|
||||
# éventuellement ajouter les lignes de continuation
|
||||
while (substr(value, length(value), 1) == "\\") {
|
||||
|
@ -439,7 +439,7 @@ function file_get_xml_properties() {
|
|||
awkre_var_="${var_//./\\.}" # nom de la variable pour une expression régulière awk
|
||||
|
||||
# initialiser la valeur par défaut
|
||||
set_var "$sh_var_" "$1"; shift
|
||||
_setv "$sh_var_" "$1"; shift
|
||||
|
||||
# et créer le script qui affichera sa valeur
|
||||
script="$script"'
|
||||
|
|
|
@ -910,7 +910,7 @@ function runs_initworkdir() {
|
|||
cp "$RUNSSRCDIR/uinst" "$RUNSEXPORTDIR"
|
||||
|
||||
# faire les scripts
|
||||
args_def="args=($(quoted_args ./runs --runsscriptspath "$RUNSSCRIPTSPATH" --runsmodulespath "$RUNSMODULESPATH" --runshostspath "$RUNSHOSTSPATH" --runsexportdir . --runsvarsfile varsfile -h "$RUNSHOST" ${RUNSRESET:+-z}))"
|
||||
args_def="args=($(qvals ./runs --runsscriptspath "$RUNSSCRIPTSPATH" --runsmodulespath "$RUNSMODULESPATH" --runshostspath "$RUNSHOSTSPATH" --runsexportdir . --runsvarsfile varsfile -h "$RUNSHOST" ${RUNSRESET:+-z}))"
|
||||
echo '#!/bin/bash
|
||||
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
||||
cd "$(dirname "$0")"
|
||||
|
@ -939,7 +939,7 @@ exit 0
|
|||
array_from_path runsdirs "${!runspath}"
|
||||
array_map runsdirs abspath
|
||||
array_map runsdirs __runs_add_runsroot
|
||||
set_var "$runspath" "$(array_join runsdirs :)"
|
||||
_setv "$runspath" "$(array_join runsdirs :)"
|
||||
done
|
||||
# XXX quelles autres variables doivent être corrigées?
|
||||
# XXX ==> il faut rajouter rscripts et recipes
|
||||
|
@ -995,11 +995,11 @@ function __runs_check_notref() {
|
|||
}
|
||||
function __runs_splitref() {
|
||||
if [[ "$1" == *=* ]]; then
|
||||
set_var "${2:-__name}" "${1%%=*}"
|
||||
set_var "${3:-__value}" "${1#*=}"
|
||||
_setv "${2:-__name}" "${1%%=*}"
|
||||
_setv "${3:-__value}" "${1#*=}"
|
||||
else
|
||||
set_var "${2:-__name}" "$1"
|
||||
set_var "${3:-__value}" "$1"
|
||||
_setv "${2:-__name}" "$1"
|
||||
_setv "${3:-__value}" "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -1046,7 +1046,7 @@ function runs_var() {
|
|||
array_set RUNSVARS "$__name"
|
||||
array_del RUNSARRAYS "$__name"
|
||||
array_set RUNSVARSINDIRECT "$__name"
|
||||
set_var "$__name" "$__value"
|
||||
_setv "$__name" "$__value"
|
||||
fi
|
||||
elif [[ "$1" == *@=* ]]; then
|
||||
__name="${1%%@=*}"
|
||||
|
@ -1055,7 +1055,7 @@ function runs_var() {
|
|||
array_set RUNSVARS "$__name"
|
||||
array_set RUNSARRAYS "$__name"
|
||||
array_set RUNSVARSINDIRECT "$__name"
|
||||
set_var "$__name" "$__value"
|
||||
_setv "$__name" "$__value"
|
||||
fi
|
||||
elif [[ "$1" == *=* ]]; then
|
||||
__name="${1%%=*}"
|
||||
|
@ -1064,12 +1064,12 @@ function runs_var() {
|
|||
array_set RUNSVARS "$__name"
|
||||
array_del RUNSARRAYS "$__name"
|
||||
array_del RUNSVARSINDIRECT "$__name"
|
||||
set_var "$__name" "$__value"
|
||||
_setv "$__name" "$__value"
|
||||
fi
|
||||
else
|
||||
break
|
||||
fi
|
||||
[ -n "$RUNSVARDESC" ] && set_var "RUNSVARDESC_$__name" "$RUNSVARDESC"
|
||||
[ -n "$RUNSVARDESC" ] && _setv "RUNSVARDESC_$__name" "$RUNSVARDESC"
|
||||
shift
|
||||
done
|
||||
# variables tableau
|
||||
|
@ -1149,12 +1149,12 @@ function runs_set_lang() {
|
|||
if check_sysinfos -d debianlike; then
|
||||
eval "$(LANG=
|
||||
source_ifexists /etc/default/locale
|
||||
set_var_cmd LANG "$LANG"
|
||||
echo_setv LANG "$LANG"
|
||||
)"
|
||||
elif check_sysinfos -d redhatlike; then
|
||||
eval "$(LANG=
|
||||
source_ifexists /etc/locale.conf
|
||||
set_var_cmd LANG "$LANG"
|
||||
echo_setv LANG "$LANG"
|
||||
)"
|
||||
fi
|
||||
export LANG
|
||||
|
@ -1168,9 +1168,9 @@ function runs_set_proxy() {
|
|||
if check_sysinfos -d debianlike; then
|
||||
eval "$(http_proxy=; ftp_proxy=; no_proxy=
|
||||
source_ifexists /etc/environment
|
||||
set_var_cmd http_proxy "$http_proxy"
|
||||
set_var_cmd ftp_proxy "$ftp_proxy"
|
||||
set_var_cmd no_proxy "$no_proxy"
|
||||
echo_setv http_proxy "$http_proxy"
|
||||
echo_setv ftp_proxy "$ftp_proxy"
|
||||
echo_setv no_proxy "$no_proxy"
|
||||
)"
|
||||
fi
|
||||
export http_proxy ftp_proxy no_proxy
|
||||
|
@ -1223,7 +1223,7 @@ function runs_after() {
|
|||
if array_contains RUNSARRAYS "$__var"; then
|
||||
eval "array_copy __tmp $__var; local -a $__var; array_copy $__var __tmp"
|
||||
else
|
||||
eval "set_var __tmp \"\${!__var}\"; local $__var; $__var=\"\$__tmp\""
|
||||
eval "_setv __tmp \"\${!__var}\"; local $__var; $__var=\"\$__tmp\""
|
||||
fi
|
||||
done
|
||||
runs_clvars "${RUNSCLVARS[@]}"
|
||||
|
@ -1237,7 +1237,7 @@ function runs_after() {
|
|||
if [[ "$__arg" == *!=* ]]; then
|
||||
__name="${__arg%%!=*}"
|
||||
__value="${__arg#*!=}"
|
||||
__args=("${__args[@]}" "$__name=$(quoted_arg "${!__value}")")
|
||||
__args=("${__args[@]}" "$__name=$(qvalm "${!__value}")")
|
||||
elif [[ "$__arg" == *@=* ]]; then
|
||||
__name="${__arg%%@=*}"
|
||||
__value="${__arg#*@=}[@]"
|
||||
|
@ -1301,7 +1301,7 @@ function runs_indvars() {
|
|||
else
|
||||
# variable scalaire
|
||||
__ind="${!__var}"
|
||||
set_var "$__var" "${!__ind}"
|
||||
_setv "$__var" "${!__ind}"
|
||||
fi
|
||||
done
|
||||
RUNSVARSINDIRECT=()
|
||||
|
@ -1314,7 +1314,7 @@ function runs_clvars_cmd() {
|
|||
__vars=()
|
||||
while [ -n "$1" ]; do
|
||||
if [ "$1" == ";" ]; then
|
||||
echo "$__prefix$(quoted_args "${__vars[@]}")"
|
||||
echo "$__prefix$(qvals "${__vars[@]}")"
|
||||
__vars=()
|
||||
__prefix=" "
|
||||
else
|
||||
|
@ -1322,7 +1322,7 @@ function runs_clvars_cmd() {
|
|||
fi
|
||||
shift
|
||||
done
|
||||
[ -n "${__vars[*]}" ] && echo "$__prefix$(quoted_args "${__vars[@]}")"
|
||||
[ -n "${__vars[*]}" ] && echo "$__prefix$(qvals "${__vars[@]}")"
|
||||
}
|
||||
|
||||
function runs_loadconfs() {
|
||||
|
@ -1458,10 +1458,10 @@ function runs_action_dump() {
|
|||
eval "__count=\"\${#$__var[@]}\""
|
||||
if [ "$__count" -eq 1 ]; then
|
||||
# variable scalaire
|
||||
eecho "$__var=$(quoted_args "${!__values}")"
|
||||
eecho "$__var=$(qvals "${!__values}")"
|
||||
else
|
||||
# variable tableau
|
||||
eecho "$__var=($(quoted_args "${!__values}"))"
|
||||
eecho "$__var=($(qvals "${!__values}"))"
|
||||
fi
|
||||
done
|
||||
exit 0
|
||||
|
@ -1535,7 +1535,7 @@ function runs_action_run() {
|
|||
# configuration dans le fichier $__shellconf
|
||||
|
||||
__runs_check_varname "$__refvarname" || die
|
||||
set_var "$__refvarname" ""
|
||||
_setv "$__refvarname" ""
|
||||
|
||||
splitwcs "$__shellconf" __tmpconf __wildconf
|
||||
if [ -n "$__wildconf" ]; then
|
||||
|
@ -1638,7 +1638,7 @@ function runs_action_run() {
|
|||
runs_indvars
|
||||
for __name in "${RUNSVARS[@]}"; do
|
||||
__value="$(array_join "$__name" ":")"
|
||||
__vars=("${__vars[@]}" "$(set_var_cmd "$__name" "$__value")")
|
||||
__vars=("${__vars[@]}" "$(echo_setv "$__name" "$__value")")
|
||||
done
|
||||
|
||||
if [ -n "$RUNS_REMOTE_SET_Y" ]; then
|
||||
|
@ -1724,7 +1724,7 @@ function runs_action_export() {
|
|||
# configuration dans le fichier $__shellconf
|
||||
|
||||
__runs_check_varname "$__refvarname" || die
|
||||
set_var "$__refvarname" ""
|
||||
_setv "$__refvarname" ""
|
||||
|
||||
splitwcs "$__shellconf" __tmpconf __wildconf
|
||||
if [ -n "$__wildconf" ]; then
|
||||
|
@ -1834,7 +1834,7 @@ function runs_action_export() {
|
|||
for __shellvar in "${__shellvars[@]}"; do
|
||||
# s'assurer que la variables sont vides
|
||||
# avant de sourcer $__shellconf
|
||||
set_var "$__shellvar"
|
||||
_setv "$__shellvar"
|
||||
done
|
||||
source "$__shellconf"
|
||||
for __shellvar in "${__shellvars[@]}"; do
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -270,8 +270,8 @@ function __fix_sysinfos_upward() {
|
|||
array_copy sysvers_ "${sysdist_}_SYSVERS"
|
||||
for sysver_ in "${sysvers_[@]}"; do
|
||||
if [ "$sysver_" == "${!sysvervar_}" ]; then
|
||||
set_var "$sysdistvar_" "$sysdist_"
|
||||
set_var "$sysnamevar_" "$sysname_"
|
||||
_setv "$sysdistvar_" "$sysdist_"
|
||||
_setv "$sysnamevar_" "$sysname_"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
@ -284,7 +284,7 @@ function __fix_sysinfos_upward() {
|
|||
array_copy sysdists_ "${sysname_}_SYSDISTS"
|
||||
for sysdist_ in "${sysdists_[@]}"; do
|
||||
if [ "$sysdist_" == "${!sysdistvar_}" ]; then
|
||||
set_var "$sysnamevar_" "$sysname_"
|
||||
_setv "$sysnamevar_" "$sysname_"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
@ -301,7 +301,7 @@ function __fix_sysinfos_downward() {
|
|||
# essayer de déterminer !sysdistvar_ à partir de !sysnamevar_
|
||||
array_copy sysdists_ "${!sysnamevar_}_SYSDISTS"
|
||||
for sysdist_ in "${sysdists_[@]}"; do
|
||||
set_var "$sysdistvar_" "$sysdist_"
|
||||
_setv "$sysdistvar_" "$sysdist_"
|
||||
break
|
||||
done
|
||||
fi
|
||||
|
@ -311,7 +311,7 @@ function __fix_sysinfos_downward() {
|
|||
# essayer de déterminer !sysvervar_ à partir de !sysdistvar_
|
||||
array_copy sysvers_ "${sysdistvar_}_SYSVERS"
|
||||
for sysver_ in "${sysvers_[@]}"; do
|
||||
set_var "$sysvervar_" "$sysver_"
|
||||
_setv "$sysvervar_" "$sysver_"
|
||||
break
|
||||
done
|
||||
fi
|
||||
|
@ -325,8 +325,8 @@ function ensure_sysinfos() {
|
|||
local sysnamevar_="${1:-SYSNAME}"
|
||||
local sysdistvar_="${2:-SYSDIST}"
|
||||
local sysvervar_="${3:-SYSVER}"
|
||||
[ -n "${!sysdistvar_}" ] && set_var "$sysdistvar_" "$(__get_sysdist_alias "${!sysdistvar_}")"
|
||||
[ -n "${!sysvervar_}" ] && set_var "$sysvervar_" "$(__get_sysver_alias "${!sysvervar_}")"
|
||||
[ -n "${!sysdistvar_}" ] && _setv "$sysdistvar_" "$(__get_sysdist_alias "${!sysdistvar_}")"
|
||||
[ -n "${!sysvervar_}" ] && _setv "$sysvervar_" "$(__get_sysver_alias "${!sysvervar_}")"
|
||||
__fix_sysinfos_upward
|
||||
__fix_sysinfos_downward
|
||||
}
|
||||
|
|
|
@ -35,8 +35,8 @@ function udir_dump() {
|
|||
local udirf="$(abspath "${1:-.}")"
|
||||
[ -d "$udirf" ] && udirf="$udirf/.udir"
|
||||
if [ -f "$udirf" ]; then
|
||||
set_var_cmd udir "$(dirname "$udirf")"
|
||||
set_var_cmd udirf "$udirf"
|
||||
echo_setv udir "$(dirname "$udirf")"
|
||||
echo_setv udirf "$udirf"
|
||||
<"$udirf" filter_comment -m
|
||||
fi
|
||||
}
|
||||
|
@ -140,11 +140,11 @@ function udir_update() {
|
|||
for param in "$@"; do
|
||||
name="${param%%=*}"
|
||||
script="$script
|
||||
names[$i] = $(quoted_awk "$name")"
|
||||
names[$i] = $(qawk "$name")"
|
||||
if [ "$name" != "$param" ]; then
|
||||
value="${param#*=}"
|
||||
script="$script
|
||||
values[$i] = $(quoted_awk "$value")"
|
||||
values[$i] = $(qawk "$value")"
|
||||
else
|
||||
script="$script
|
||||
values[$i] = \"\""
|
||||
|
|
|
@ -290,7 +290,7 @@ Utilisez 'udir -e $(ppath "$srcdir")' pour modifier les paramètres qui ont ét
|
|||
__uinst_migrate_legacy "$srcdir"
|
||||
__uinst_varcmds=()
|
||||
for __uinst_v in "${UDIR_VARS[@]}"; do
|
||||
__uinst_varcmds=("${__uinst_varcmds[@]}" "$(set_var_cmd "$__uinst_v" "${!__uinst_v}")")
|
||||
__uinst_varcmds=("${__uinst_varcmds[@]}" "$(echo_setv "$__uinst_v" "${!__uinst_v}")")
|
||||
done
|
||||
for __uinst_a in "${UDIR_ARRAYS[@]}"; do
|
||||
__uinst_varcmds=("${__uinst_varcmds[@]}" "$(set_array_cmd "$__uinst_a")")
|
||||
|
@ -310,7 +310,7 @@ Utilisez 'udir -e $(ppath "$srcdir")' pour modifier les paramètres qui ont ét
|
|||
local udir_desc udir_note udir_types
|
||||
local profiles conf rootconf ulibsync copy_files
|
||||
|
||||
eval "$(udir_eval "$srcdir" 'set_var_cmd udir_desc "$udir_desc"; set_var_cmd udir_note "$udir_note"')"
|
||||
eval "$(udir_eval "$srcdir" 'echo_setv udir_desc "$udir_desc"; echo_setv udir_note "$udir_note"')"
|
||||
|
||||
etitle "Description du projet"
|
||||
check_interaction -c && estepn "La description courte de l'objet de ce projet est affichée avec udir -i"
|
||||
|
@ -319,7 +319,7 @@ Utilisez 'udir -e $(ppath "$srcdir")' pour modifier les paramètres qui ont ét
|
|||
Elle peut être utilisée pour diriger le visiteur vers des informations importantes."
|
||||
read_value "Entrez une note associée au répertoire de ce projet" udir_note "$udir_note" N
|
||||
eend
|
||||
udir_update "$srcdir" "udir_desc=$(quoted_arg "$udir_desc")" "udir_note=$(quoted_arg "$udir_note")"
|
||||
udir_update "$srcdir" "udir_desc=$(qval "$udir_desc")" "udir_note=$(qval "$udir_note")"
|
||||
|
||||
estepn "La configuration par défaut permet de créer un projet qui utilise les outils et librairies de nutools.
|
||||
Ce projet pourra ensuite être installé avec uinst"
|
||||
|
@ -351,7 +351,7 @@ Ce projet pourra ensuite être installé avec uinst"
|
|||
mkdirof "$genfile"
|
||||
[ -f "$genfile" ] || echo '# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
||||
__uaddpath "@@dest@@" PATH' >"$genfile"
|
||||
udir_update "$srcdir" "configure_dest_for=($(quoted_arg "${genfile#"$srcdir/"}"))"
|
||||
udir_update "$srcdir" "configure_dest_for=($(qvalm "${genfile#"$srcdir/"}"))"
|
||||
fi
|
||||
if [ -n "$conf" ]; then
|
||||
genfile="$srcdir/lib/uinst/conf"
|
||||
|
@ -525,12 +525,12 @@ function __uinst_addvarnf() {
|
|||
eerror "La variable $1 est protégée"
|
||||
return 1
|
||||
else
|
||||
array_add UINST_CONFIG_VARCMDS "$(set_var_cmd "$1" "$2")"
|
||||
set_var "$1" "$2"
|
||||
array_add UINST_CONFIG_VARCMDS "$(echo_setv "$1" "$2")"
|
||||
_setv "$1" "$2"
|
||||
if [ "$1" == "MYHOST" ]; then
|
||||
# cas particulier: initialiser aussi MYHOSTNAME
|
||||
set_var "MYHOSTNAME" "${2%%.*}"
|
||||
array_add UINST_CONFIG_VARCMDS "$(set_var_cmd "MYHOSTNAME" "$MYHOSTNAME")"
|
||||
_setv "MYHOSTNAME" "${2%%.*}"
|
||||
array_add UINST_CONFIG_VARCMDS "$(echo_setv "MYHOSTNAME" "$MYHOSTNAME")"
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
|
@ -683,7 +683,7 @@ function __uinst_prepare_conf() {
|
|||
# prepare_name=$srcdir
|
||||
# srcdir est un chemin relatif à $UINST_PREPARE_DIR (si la source était une
|
||||
# archive, il est possible que ce chemin soit en plusieurs parties
|
||||
set_var_cmd prepare_name "$(relpath "$srcdir" "$UINST_PREPARE_DIR")" >"$UINST_PREPARE_CONF"
|
||||
echo_setv prepare_name "$(relpath "$srcdir" "$UINST_PREPARE_DIR")" >"$UINST_PREPARE_CONF"
|
||||
}
|
||||
|
||||
################################################################################
|
||||
|
@ -796,28 +796,28 @@ function __uinst_udir2s() {
|
|||
__uinst_config="$__uinst_configdir/config"
|
||||
__uinst_abort="$__uinst_configdir/abort"
|
||||
__uinst_updateconfig="$__uinst_configdir/updateconfig"
|
||||
set_var_cmd ABORT "$__uinst_abort" >>"$__uinst_config"
|
||||
set_var_cmd CONFIG "$__uinst_updateconfig" >>"$__uinst_config"
|
||||
set_var_cmd __verbosity "$__verbosity" >>"$__uinst_config"
|
||||
set_var_cmd __interaction "$__interaction" >>"$__uinst_config"
|
||||
echo_setv ABORT "$__uinst_abort" >>"$__uinst_config"
|
||||
echo_setv CONFIG "$__uinst_updateconfig" >>"$__uinst_config"
|
||||
echo_setv __verbosity "$__verbosity" >>"$__uinst_config"
|
||||
echo_setv __interaction "$__interaction" >>"$__uinst_config"
|
||||
for __uinst_var in "${__uinst_vars[@]}"; do
|
||||
set_var_cmd "$__uinst_var" "${!__uinst_var}" >>"$__uinst_config"
|
||||
echo_setv "$__uinst_var" "${!__uinst_var}" >>"$__uinst_config"
|
||||
done
|
||||
for __uinst_var in "${__uinst_arrays[@]}"; do
|
||||
set_array_cmd "$__uinst_var" >>"$__uinst_config"
|
||||
done
|
||||
set_var_cmd "UINST_LOCAL_PROFILES" "$UINST_LOCAL_PROFILES" >>"$__uinst_config"
|
||||
set_var_cmd "UINST_ISTMPDIR" "$UINST_ISTMPDIR" >>"$__uinst_config"
|
||||
set_var_cmd "UINST_ORIGSRC" "$UINST_ORIGSRC" >>"$__uinst_config"
|
||||
set_var_cmd "UINST_SRCDIR" "$UINST_SRCDIR" >>"$__uinst_config"
|
||||
set_var_cmd "ULIBDIR" "$ULIBDIR" >>"$__uinst_config"
|
||||
set_var_cmd "UINST" "$UINST" >>"$__uinst_config"
|
||||
echo_setv "UINST_LOCAL_PROFILES" "$UINST_LOCAL_PROFILES" >>"$__uinst_config"
|
||||
echo_setv "UINST_ISTMPDIR" "$UINST_ISTMPDIR" >>"$__uinst_config"
|
||||
echo_setv "UINST_ORIGSRC" "$UINST_ORIGSRC" >>"$__uinst_config"
|
||||
echo_setv "UINST_SRCDIR" "$UINST_SRCDIR" >>"$__uinst_config"
|
||||
echo_setv "ULIBDIR" "$ULIBDIR" >>"$__uinst_config"
|
||||
echo_setv "UINST" "$UINST" >>"$__uinst_config"
|
||||
# ulib recalcule systématiquement la valeur de ULIBDIR. Pareil pour
|
||||
# pyulib/pyulib. Mais cela ne fonctionne pas si nous déployons sur une
|
||||
# machine avec bash 2.x. Il faut donc forcer l'utilisation de la valeur
|
||||
# calculée.
|
||||
set_var_cmd "FORCED_ULIBDIR" "$ULIBDIR" >>"$__uinst_config"
|
||||
set_var_cmd "FORCED_PYULIBDIR" "$PYULIBDIR" >>"$__uinst_config"
|
||||
echo_setv "FORCED_ULIBDIR" "$ULIBDIR" >>"$__uinst_config"
|
||||
echo_setv "FORCED_PYULIBDIR" "$PYULIBDIR" >>"$__uinst_config"
|
||||
|
||||
## Lancer les scripts de préconfiguration
|
||||
function __uinst_preconfig_scripts() {
|
||||
|
@ -1241,13 +1241,13 @@ function __uinst_python() {
|
|||
local __uinst_config __uinst_var
|
||||
ac_set_tmpfile __uinst_config
|
||||
for __uinst_var in srcdir; do
|
||||
set_var_cmd "$__uinst_var" "${!__uinst_var}" >>"$__uinst_config"
|
||||
echo_setv "$__uinst_var" "${!__uinst_var}" >>"$__uinst_config"
|
||||
done
|
||||
set_var_cmd "UINST_ISTMPDIR" "$UINST_ISTMPDIR" >>"$__uinst_config"
|
||||
set_var_cmd "UINST_ORIGSRC" "$UINST_ORIGSRC" >>"$__uinst_config"
|
||||
set_var_cmd "UINST_SRCDIR" "$UINST_SRCDIR" >>"$__uinst_config"
|
||||
set_var_cmd "ULIBDIR" "$ULIBDIR" >>"$__uinst_config"
|
||||
set_var_cmd "UINST" "$UINST" >>"$__uinst_config"
|
||||
echo_setv "UINST_ISTMPDIR" "$UINST_ISTMPDIR" >>"$__uinst_config"
|
||||
echo_setv "UINST_ORIGSRC" "$UINST_ORIGSRC" >>"$__uinst_config"
|
||||
echo_setv "UINST_SRCDIR" "$UINST_SRCDIR" >>"$__uinst_config"
|
||||
echo_setv "ULIBDIR" "$ULIBDIR" >>"$__uinst_config"
|
||||
echo_setv "UINST" "$UINST" >>"$__uinst_config"
|
||||
runscript_as_root "$uinst2s" "$__uinst_config"
|
||||
}
|
||||
|
||||
|
@ -1354,16 +1354,16 @@ function __uinst_file() {
|
|||
local __uinst_config __uinst_var
|
||||
ac_set_tmpfile __uinst_config
|
||||
for __uinst_var in copy_files destdir srcdir owner modes; do
|
||||
set_var_cmd "$__uinst_var" "${!__uinst_var}" >>"$__uinst_config"
|
||||
echo_setv "$__uinst_var" "${!__uinst_var}" >>"$__uinst_config"
|
||||
done
|
||||
for __uinst_var in files modes; do
|
||||
set_array_cmd "$__uinst_var" >>"$__uinst_config"
|
||||
done
|
||||
set_var_cmd "UINST_ISTMPDIR" "$UINST_ISTMPDIR" >>"$__uinst_config"
|
||||
set_var_cmd "UINST_ORIGSRC" "$UINST_ORIGSRC" >>"$__uinst_config"
|
||||
set_var_cmd "UINST_SRCDIR" "$UINST_SRCDIR" >>"$__uinst_config"
|
||||
set_var_cmd "ULIBDIR" "$ULIBDIR" >>"$__uinst_config"
|
||||
set_var_cmd "UINST" "$UINST" >>"$__uinst_config"
|
||||
echo_setv "UINST_ISTMPDIR" "$UINST_ISTMPDIR" >>"$__uinst_config"
|
||||
echo_setv "UINST_ORIGSRC" "$UINST_ORIGSRC" >>"$__uinst_config"
|
||||
echo_setv "UINST_SRCDIR" "$UINST_SRCDIR" >>"$__uinst_config"
|
||||
echo_setv "ULIBDIR" "$ULIBDIR" >>"$__uinst_config"
|
||||
echo_setv "UINST" "$UINST" >>"$__uinst_config"
|
||||
runscript_as_root "$uinst2s" "$__uinst_config"
|
||||
}
|
||||
|
||||
|
|
|
@ -177,8 +177,8 @@ function read_infofile() {
|
|||
# Retourner 1 si un erreur s'est produite, par exemple si le fichier $1
|
||||
# n'existe pas ou n'est pas accessible en lecture
|
||||
[ -f "$1" -a -r "$1" ] || return 1
|
||||
set_var "${2:-version}" "$(grep -A 1 CFBundleShortVersionString "$1" | tail -1 | sed 's/^.*<string>\(.*\)<\/string>.*$/\1/')"
|
||||
set_var "${3:-release}" "$(grep -A 1 CFBundleVersion "$1" | tail -1 | sed 's/^.*<string>\(.*\)<\/string>.*$/\1/')"
|
||||
_setv "${2:-version}" "$(grep -A 1 CFBundleShortVersionString "$1" | tail -1 | sed 's/^.*<string>\(.*\)<\/string>.*$/\1/')"
|
||||
_setv "${3:-release}" "$(grep -A 1 CFBundleVersion "$1" | tail -1 | sed 's/^.*<string>\(.*\)<\/string>.*$/\1/')"
|
||||
}
|
||||
|
||||
function write_infofile() {
|
||||
|
@ -525,7 +525,7 @@ function woraurl() {
|
|||
5*) _status=3;;
|
||||
*) _status=11;;
|
||||
esac
|
||||
set_var "${4:-http_code}" "$_http_code"
|
||||
_setv "${4:-http_code}" "$_http_code"
|
||||
return $_status
|
||||
}
|
||||
function wogeturl() { woraurl GET "$@"; }
|
||||
|
@ -540,28 +540,28 @@ function splitins() {
|
|||
# Si $1==App, type=app et name=App
|
||||
# si $1==App-N, type=ins et name=App-N
|
||||
if [ -z "$1" ]; then
|
||||
set_var "${2:-type}" all
|
||||
set_var "${3:-name}"
|
||||
_setv "${2:-type}" all
|
||||
_setv "${3:-name}"
|
||||
elif [ "${1%.woa}" != "$1" ]; then
|
||||
set_var "${2:-type}" woa
|
||||
set_var "${3:-name}" "$1"
|
||||
_setv "${2:-type}" woa
|
||||
_setv "${3:-name}" "$1"
|
||||
elif [ "${1%.framework}" != "$1" ]; then
|
||||
set_var "${2:-type}" fwk
|
||||
set_var "${3:-name}" "$1"
|
||||
_setv "${2:-type}" fwk
|
||||
_setv "${3:-name}" "$1"
|
||||
elif [[ "$1" == *-* ]]; then
|
||||
local __si_name __si_num
|
||||
__si_name="${1%-*}"
|
||||
__si_num="${1##*-}"
|
||||
if [ -z "${__si_num//[0-9]/}" ]; then
|
||||
set_var "${2:-type}" ins
|
||||
set_var "${3:-name}" "$1"
|
||||
_setv "${2:-type}" ins
|
||||
_setv "${3:-name}" "$1"
|
||||
else
|
||||
set_var "${2:-type}" app
|
||||
set_var "${3:-name}" "$1"
|
||||
_setv "${2:-type}" app
|
||||
_setv "${3:-name}" "$1"
|
||||
fi
|
||||
elif [ -n "$1" ]; then
|
||||
set_var "${2:-type}" app
|
||||
set_var "${3:-name}" "$1"
|
||||
_setv "${2:-type}" app
|
||||
_setv "${3:-name}" "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ COMMANDES
|
|||
while [ -n "$1" ]; do
|
||||
if [ "$1" == // ]; then
|
||||
if [ -n "${cmd[*]}" ]; then
|
||||
cmds=("${cmds[@]}" "$(quoted_args "${cmd[@]}")")
|
||||
cmds=("${cmds[@]}" "$(qvals "${cmd[@]}")")
|
||||
fi
|
||||
cmd=()
|
||||
else
|
||||
|
@ -111,7 +111,7 @@ COMMANDES
|
|||
shift
|
||||
done
|
||||
if [ -n "${cmd[*]}" ]; then
|
||||
cmds=("${cmds[@]}" "$(quoted_args "${cmd[@]}")")
|
||||
cmds=("${cmds[@]}" "$(qvals "${cmd[@]}")")
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -458,7 +458,7 @@ OPTIONS
|
|||
if [[ "$src" == *=* ]]; then
|
||||
splitvar "$src" name value
|
||||
array_add variables "$name"
|
||||
set_var "$name" "$value"
|
||||
_setv "$name" "$value"
|
||||
else
|
||||
src="$(abspath "$src")"
|
||||
valid=
|
||||
|
@ -543,14 +543,14 @@ dans NEXT_ROOT = ${NEXT_ROOT:-/}
|
|||
local configfile variable
|
||||
ac_set_tmpfile configfile
|
||||
for variable in "${variables[@]}" bounce webinst ULIBDIR __estack __tlevel; do
|
||||
set_var_cmd "$variable" "${!variable}" >>"$configfile"
|
||||
echo_setv "$variable" "${!variable}" >>"$configfile"
|
||||
done
|
||||
for array in variables scripts applications frameworks; do
|
||||
set_array_cmd "$array" >>"$configfile"
|
||||
done
|
||||
# pour les serveurs qui ont une vieille version de bash, forcer la valeur de
|
||||
# ULIBDIR
|
||||
set_var_cmd "FORCED_ULIBDIR" "$ULIBDIR" >>"$configfile"
|
||||
echo_setv "FORCED_ULIBDIR" "$ULIBDIR" >>"$configfile"
|
||||
|
||||
runscript_as_root "$ULIBDIR/support/woinst2s" "$configfile"
|
||||
|
||||
|
|
|
@ -18,9 +18,9 @@ function wosign_setup_maybe() {
|
|||
storepass=
|
||||
keyalias=
|
||||
source "$WOSIGN_CONF"
|
||||
set_var_cmd WOSIGN_KEYSTORE "$keystore"
|
||||
set_var_cmd WOSIGN_STOREPASS "$storepass"
|
||||
set_var_cmd WOSIGN_KEYALIAS "$keyalias"
|
||||
echo_setv WOSIGN_KEYSTORE "$keystore"
|
||||
echo_setv WOSIGN_STOREPASS "$storepass"
|
||||
echo_setv WOSIGN_KEYALIAS "$keyalias"
|
||||
)"
|
||||
|
||||
[ -n "$WOSIGN_XTMPDIR" ] || ac_set_tmpdir WOSIGN_XTMPDIR
|
||||
|
|
2
mysqlcsv
2
mysqlcsv
|
@ -132,7 +132,7 @@ if [ "$password" != "--NOT-SET--" ]; then
|
|||
fi
|
||||
|
||||
if [ -z "$query" -a -n "$input" -a "$input" != "-" ]; then
|
||||
mysqlcmd="<$(quoted_arg "$input") $mysqlcmd"
|
||||
mysqlcmd="<$(qval "$input") $mysqlcmd"
|
||||
fi
|
||||
|
||||
eval "$mysqlcmd" |
|
||||
|
|
|
@ -340,7 +340,7 @@ if [ "$method" == load ]; then
|
|||
[ -n "$truncate" ] && echo "$truncate"
|
||||
echo "$loadcsv"
|
||||
echo "-- Commande à lancer pour importer la table dans MySQL:"
|
||||
echo "-- $(quoted_args "${cmd[@]}")"
|
||||
echo "-- $(qvals "${cmd[@]}")"
|
||||
else
|
||||
"${cmd[@]}"; r=$?
|
||||
fi
|
||||
|
|
2
pdev
2
pdev
|
@ -298,7 +298,7 @@ if [ "$action" == delete ]; then
|
|||
eimportant "\
|
||||
La branche $origin/$feature n'a plus lieu d'être, mais la configuration actuelle interdit de la supprimer.
|
||||
Veuillez le faire manuellement avec la commande suivante:
|
||||
$(quoted_args git push "$origin" ":$feature")"
|
||||
$(qvals git push "$origin" ":$feature")"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
|
6
rruns
6
rruns
|
@ -419,11 +419,11 @@ for userhost in "${hosts[@]}"; do
|
|||
if scp -S "$SSH" "$archive" "$user@$host:"; then
|
||||
estep "Lancement du script de déploiement"
|
||||
"$SSH" -qt "$user@$host" "\
|
||||
__estack=$(quoted_arg "$__estack")
|
||||
__tlevel=$(quoted_arg "$__tlevel")
|
||||
__estack=$(qval "$__estack")
|
||||
__tlevel=$(qval "$__tlevel")
|
||||
export __estack __tlevel
|
||||
${UTOOLS_LANG:+UTOOLS_LANG='$UTOOLS_LANG'; export UTOOLS_LANG
|
||||
}$(quoted_args "./$archivename" ${tmproot:+--tmproot "$tmproot"})"
|
||||
}$(qvals "./$archivename" ${tmproot:+--tmproot "$tmproot"})"
|
||||
if [ -n "$init_sysinfos" ]; then
|
||||
estep "Calcul des informations de l'hôte distant"
|
||||
sysinfos_script='
|
||||
|
|
6
ruinst
6
ruinst
|
@ -258,11 +258,11 @@ for host in "${hosts[@]}"; do
|
|||
scp -S "$SSH" "$archive" "$user@$host:" || die
|
||||
estep "Lancement du script de déploiement"
|
||||
"$SSH" -qt "$user@$host" "\
|
||||
__estack=$(quoted_arg "$__estack")
|
||||
__tlevel=$(quoted_arg "$__tlevel")
|
||||
__estack=$(qval "$__estack")
|
||||
__tlevel=$(qval "$__tlevel")
|
||||
export __estack __tlevel
|
||||
${UTOOLS_LANG:+UTOOLS_LANG='$UTOOLS_LANG'; export UTOOLS_LANG
|
||||
}$(quoted_args "./$archivename" ${tmproot:+--tmproot "$tmproot"} -- MYHOST="$host" "$@")"
|
||||
}$(qvals "./$archivename" ${tmproot:+--tmproot "$tmproot"} -- MYHOST="$host" "$@")"
|
||||
eend
|
||||
fi
|
||||
done
|
||||
|
|
6
rwoinst
6
rwoinst
|
@ -164,11 +164,11 @@ for host in "${hosts[@]}"; do
|
|||
scp -S "$SSH" "$archive" "$user@$host:" || die
|
||||
estep "Lancement du script de déploiement"
|
||||
"$SSH" -qt "$user@$host" "\
|
||||
__estack=$(quoted_arg "$__estack")
|
||||
__tlevel=$(quoted_arg "$__tlevel")
|
||||
__estack=$(qval "$__estack")
|
||||
__tlevel=$(qval "$__tlevel")
|
||||
export __estack __tlevel
|
||||
${UTOOLS_LANG:+UTOOLS_LANG='$UTOOLS_LANG'; export UTOOLS_LANG
|
||||
}$(quoted_args "./$archivename" ${tmproot:+--tmproot "$tmproot"} -- MYHOST="$host" "$@")"
|
||||
}$(qvals "./$archivename" ${tmproot:+--tmproot "$tmproot"} -- MYHOST="$host" "$@")"
|
||||
eend
|
||||
fi
|
||||
done
|
||||
|
|
|
@ -349,7 +349,7 @@ Voulez-vous continuer?" O || return 1
|
|||
if [ -n "$edit" -a -n "$DWCOMMIT" ]; then
|
||||
__commit "$dwdir" "newpage $title --> $ns$name" newfiles modfiles || return
|
||||
else
|
||||
estepi "dwci $(quoted_args "dwci newpage $title --> $ns$name")"
|
||||
estepi "dwci $(qvals "dwci newpage $title --> $ns$name")"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
@ -453,7 +453,7 @@ function edit_cmd() {
|
|||
if [ -n "$DWCOMMIT" ]; then
|
||||
__commit "$dwdir" "edit ${page//\//:}" newfiles modfiles || return
|
||||
else
|
||||
estepi "dwci $(quoted_args "edit ${page//\//:}")"
|
||||
estepi "dwci $(qvals "edit ${page//\//:}")"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
@ -780,7 +780,7 @@ print tolower($0)
|
|||
if [ -n "$DWCOMMIT" ]; then
|
||||
__commit "$dwdir" "generate $srcdir" newfiles modfiles
|
||||
else
|
||||
estepi "dwci $(quoted_args "generate $srcdir")"
|
||||
estepi "dwci $(qvals "generate $srcdir")"
|
||||
fi
|
||||
)
|
||||
}
|
||||
|
|
|
@ -237,7 +237,7 @@ function init_cmd() {
|
|||
read_value "URL du site MediaWiki" MWSITEURL http://localhost/mediawiki
|
||||
local var
|
||||
for var in MWDBHOST MWDBPORT MWDBUSER MWDBPASS MWDBNAME MWPREFIX MWSITEURL; do
|
||||
set_var_cmd "$var" "${!var}" >>"$mwdir/.mediawiki"
|
||||
echo_setv "$var" "${!var}" >>"$mwdir/.mediawiki"
|
||||
done
|
||||
fi
|
||||
|
||||
|
@ -351,7 +351,7 @@ Voulez-vous continuer?" N || return 1
|
|||
if [ -n "$edit" -a -n "$MWCOMMIT" ]; then
|
||||
__commit "$mwdir" "newpage $title --> $name" newfiles modfiles || return
|
||||
else
|
||||
estepi "mwci $(quoted_args "mwci newpage $title --> $name")"
|
||||
estepi "mwci $(qvals "mwci newpage $title --> $name")"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
@ -440,7 +440,7 @@ function edit_cmd() {
|
|||
if [ -n "$MWCOMMIT" ]; then
|
||||
__commit "$mwdir" "edit ${page//\//:}" newfiles modfiles || return
|
||||
else
|
||||
estepi "mwci $(quoted_args "edit ${page//\//:}")"
|
||||
estepi "mwci $(qvals "edit ${page//\//:}")"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
@ -926,7 +926,7 @@ print tolower($0)
|
|||
if [ -n "$MWCOMMIT" ]; then
|
||||
__commit "$mwdir" "generate $srcdir" newfiles modfiles
|
||||
else
|
||||
estepi "mwci $(quoted_args "generate $srcdir")"
|
||||
estepi "mwci $(qvals "generate $srcdir")"
|
||||
fi
|
||||
)
|
||||
}
|
||||
|
|
10
udist
10
udist
|
@ -237,10 +237,10 @@ function __load_udist_nolocal() { (
|
|||
[ -d "$udistf" ] && udistf="$udistf/.udist"
|
||||
source "$udistf"
|
||||
|
||||
set_var_cmd "${2}VERSION" "$VERSION"
|
||||
echo_setv "${2}VERSION" "$VERSION"
|
||||
set_array_cmd "${2}VERSIONS" VERSIONS
|
||||
set_array_cmd "${2}TAGS" TAGS
|
||||
set_var_cmd "${2}ORIGIN" "$ORIGIN"
|
||||
echo_setv "${2}ORIGIN" "$ORIGIN"
|
||||
set_array_cmd "${2}LOCALS" LOCALS
|
||||
); }
|
||||
|
||||
|
@ -264,10 +264,10 @@ function __save_udist() {
|
|||
splitpair "$__su_dest" __su_dest __su_varname
|
||||
[ -n "$__su_varname" ] || __su_varname="$__su_dest"
|
||||
case "$__su_dest" in
|
||||
VERSION) array_add __su_cmd "$(set_var_cmd VERSION "${!__su_varname}")";;
|
||||
VERSION) array_add __su_cmd "$(echo_setv VERSION "${!__su_varname}")";;
|
||||
VERSIONS) array_add __su_cmd "$(set_array_cmd VERSIONS "${__su_varname}")";;
|
||||
TAGS) array_add __su_cmd "$(set_array_cmd TAGS "${__su_varname}")";;
|
||||
ORIGIN) array_add __su_cmd "$(set_var_cmd ORIGIN "${!__su_varname}")";;
|
||||
ORIGIN) array_add __su_cmd "$(echo_setv ORIGIN "${!__su_varname}")";;
|
||||
LOCALS) array_add __su_cmd "$(set_array_cmd LOCALS "${__su_varname}")";;
|
||||
esac
|
||||
done
|
||||
|
@ -1306,7 +1306,7 @@ function local_put_cmd() {
|
|||
local script=
|
||||
for localfile in "${localfiles[@]}"; do
|
||||
[ -n "$script" ] && script="$script; "
|
||||
script="$script$(quoted_args chown "$owner" "$destdir/$localfile")"
|
||||
script="$script$(qvals chown "$owner" "$destdir/$localfile")"
|
||||
done
|
||||
"${ssh:-ssh}" -qt "$userhost:$destdir" "$script"
|
||||
fi
|
||||
|
|
12
uldap
12
uldap
|
@ -41,7 +41,7 @@ function split_cmds() {
|
|||
fi
|
||||
done
|
||||
if [ -n "$__sc_addtocmd" ]; then
|
||||
__sc_cmd="${__sc_cmd:+$__sc_cmd }$(quoted_arg "$__sc_arg")"
|
||||
__sc_cmd="${__sc_cmd:+$__sc_cmd }$(qvalm "$__sc_arg")"
|
||||
__sc_arg=
|
||||
fi
|
||||
if [ -n "$__sc_foundsep" ]; then
|
||||
|
@ -150,7 +150,7 @@ function set_values() {
|
|||
if array_contains VARIABLES "$uname" || array_contains SPECIAL_VARIABLES "$uname"; then
|
||||
"set_$lname" "$value" || s=1
|
||||
elif ! array_contains PROTECTED_VARIABLES "$name"; then
|
||||
set_var "$name" "$value"
|
||||
_setv "$name" "$value"
|
||||
else
|
||||
s=1
|
||||
fi
|
||||
|
@ -321,7 +321,7 @@ function __push() {
|
|||
local __varcmd __name
|
||||
for __name in "$@"; do
|
||||
__varcmd="${__varcmd:+$__varcmd
|
||||
}$(set_var_cmd "$__name" "${!__name}")"
|
||||
}$(echo_setv "$__name" "${!__name}")"
|
||||
done
|
||||
WSSTACK=("${WSSTACK[@]}" "$__varcmd")
|
||||
}
|
||||
|
@ -1349,7 +1349,7 @@ function uldap_undo() {
|
|||
|
||||
function uldap_ifok() {
|
||||
if [ "$EXITCODE" -eq 0 ]; then
|
||||
eval_cmdline "$(quoted_args "$@")"
|
||||
eval_cmdline "$(qvals "$@")"
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
|
@ -1357,7 +1357,7 @@ function uldap_ifok() {
|
|||
|
||||
function uldap_iferror() {
|
||||
if [ "$EXITCODE" -ne 0 ]; then
|
||||
eval_cmdline "$(quoted_args "$@")"
|
||||
eval_cmdline "$(qvals "$@")"
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
|
@ -1464,7 +1464,7 @@ if [ -n "$*" ]; then
|
|||
INTERACTIVE=
|
||||
[ "$EXIT_ON_ERROR" == auto ] && set_values exit_on_error=true
|
||||
# splitter sur les lignes
|
||||
array_from_lines lcmds "$(quoted_args "$@")"
|
||||
array_from_lines lcmds "$(qvals "$@")"
|
||||
[ -n "$AUTOPRINT" ] && array_add lcmds print
|
||||
elif [ -n "$lscriptfile" ]; then
|
||||
[ -f "$lscriptfile" ] || die "$lscriptfile: fichier introuvable"
|
||||
|
|
10
ulib
10
ulib
|
@ -343,18 +343,18 @@ if ! grep -q '$scriptdir/profile' ~/.bash_profile; then
|
|||
fi
|
||||
|
||||
# Modifier le PATH. Ajouter aussi le chemin vers les uapps python
|
||||
PATH=$(quoted_args "$scriptdir:$scriptdir/lib/pyulib/src/uapps:$PATH")
|
||||
PATH=$(qval "$scriptdir:$scriptdir/lib/pyulib/src/uapps:$PATH")
|
||||
|
||||
if [ -n '$DEFAULT_PS1' ]; then
|
||||
DEFAULT_PS1=$(quoted_args "[ulibshell] $DEFAULT_PS1")
|
||||
DEFAULT_PS1=$(qval "[ulibshell] $DEFAULT_PS1")
|
||||
else
|
||||
if [ -z '$PS1' ]; then
|
||||
PS1='\\u@\\h \\w \\$ '
|
||||
fi
|
||||
PS1=\"[ulibshell] \$PS1\"
|
||||
fi
|
||||
$(quoted_args source "$scriptdir/lib/ulib/ulib")
|
||||
__ULIB_FORCE_RELOAD=$(quoted_args "$__ULIB_FORCE_RELOAD")
|
||||
$(qvals source "$scriptdir/lib/ulib/ulib")
|
||||
__ULIB_FORCE_RELOAD=$(qval "$__ULIB_FORCE_RELOAD")
|
||||
urequire DEFAULTS" >"$bashrc"
|
||||
|
||||
array_fix_paths modules
|
||||
|
@ -362,7 +362,7 @@ urequire DEFAULTS" >"$bashrc"
|
|||
etitle "Chargement des modules"
|
||||
for module in "${modules[@]}"; do
|
||||
estep "$module"
|
||||
quoted_args urequire "$module" >>"$bashrc"
|
||||
qvals urequire "$module" >>"$bashrc"
|
||||
done
|
||||
eend
|
||||
fi
|
||||
|
|
8
umatch
8
umatch
|
@ -120,14 +120,14 @@ case "$regexp" in
|
|||
ip) regexp='[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+';;
|
||||
esac
|
||||
|
||||
cmd="$(quoted_args match "$regexp" "$sep")"
|
||||
cmd="$(qvals match "$regexp" "$sep")"
|
||||
[ -n "$sort" ] && cmd="$cmd | sort"
|
||||
[ -n "$count" ] && cmd="$cmd | $(quoted_args count "$count" "$sep" "$all_lines")"
|
||||
[ -n "$count" ] && cmd="$cmd | $(qvals count "$count" "$sep" "$all_lines")"
|
||||
if [ -n "$multiple" ]; then
|
||||
if [ -n "$all_lines" ]; then
|
||||
cmd="$cmd | $(quoted_args grep -v -B 1 "^1$sep")"
|
||||
cmd="$cmd | $(qvals grep -v -B 1 "^1$sep")"
|
||||
else
|
||||
cmd="$cmd | $(quoted_args grep -v "^1$sep")"
|
||||
cmd="$cmd | $(qvals grep -v "^1$sep")"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
@ -484,12 +484,12 @@ fi
|
|||
|
||||
if [ "$action" == "install" ]; then
|
||||
ctline="$USCRONTAB_CTLINE"
|
||||
[ -n "$uscrontab" ] && ctline="$ctline $(quoted_arg "$uscrontab")"
|
||||
[ -n "$uscrontab" ] && ctline="$ctline $(qvalm "$uscrontab")"
|
||||
enable_in_crontab "$ctline" && estep "add_to_crontab $ctline"
|
||||
|
||||
elif [ "$action" == "uninstall" ]; then
|
||||
ctline="$USCRONTAB_CTLINE"
|
||||
[ -n "$uscrontab" ] && ctline="$ctline $(quoted_arg "$uscrontab")"
|
||||
[ -n "$uscrontab" ] && ctline="$ctline $(qvalm "$uscrontab")"
|
||||
if [ -n "$disable_only" ]; then
|
||||
disable_in_crontab "$ctline" && estep "disable_in_crontab $ctline"
|
||||
else
|
||||
|
@ -655,7 +655,7 @@ puis supprimez le cas échéant le fichier $pidfile"
|
|||
for __var in "$@"; do
|
||||
splitvar "$__var" __name __value
|
||||
edebug "$__name=$__value"
|
||||
set_var "$__name" "$__value"
|
||||
_setv "$__name" "$__value"
|
||||
done
|
||||
eval "$__ctscript"
|
||||
ac_cleanall
|
||||
|
|
6
ussh
6
ussh
|
@ -369,13 +369,13 @@ function show_vars() {
|
|||
local -a sshopts
|
||||
[ "${#hosts[*]}" -gt 1 ] && exec=
|
||||
set_array_cmd hosts
|
||||
set_var_cmd ssh "$SSH"
|
||||
set_var_cmd exec "$exec"
|
||||
echo_setv ssh "$SSH"
|
||||
echo_setv exec "$exec"
|
||||
set_array_cmd args @ "$@"
|
||||
for host in "${hosts[@]}"; do
|
||||
array_copy sshopts SSHOPTS
|
||||
__update_sshopts "$host" "$@"
|
||||
set_var_cmd host "$host"
|
||||
echo_setv host "$host"
|
||||
set_array_cmd options sshopts
|
||||
done
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue