Intégration de la branche release-2.20.0
This commit is contained in:
commit
e9fbe9d7c3
|
@ -1,3 +1,10 @@
|
|||
## Version 2.20.0 du 12/11/2015-15:41
|
||||
|
||||
16d95d2 apache_autoconf(): déploiement des certificats autorité
|
||||
775a021 nutools: ajout de cpvcs() pour copier avec la sémantique de cpnovcs() les fichiers de VCS aussi
|
||||
1ca0ee5 runs: ajout des options --force, --copy-links et --with-vcs à ref()
|
||||
91686fb templatectl: il n'est plus nécessaire de spécifier explicitement fichier.template
|
||||
|
||||
## Version 2.19.0 du 02/11/2015-11:03
|
||||
|
||||
37f3bff apacheconfig: diverses corrections de bugs
|
||||
|
|
|
@ -1 +1 @@
|
|||
2.19.0
|
||||
2.20.0
|
||||
|
|
|
@ -1 +1 @@
|
|||
009006000
|
||||
009007000
|
||||
|
|
|
@ -259,15 +259,6 @@ function apache_autoconf() {
|
|||
[ -n "$wwwdir" ] || wwwdir="$autoconfdir/www"
|
||||
[ -n "$certsconfdir" ] || certsconfdir="$autoconfdir/certsconf"
|
||||
[ -n "$rrdir" ] || rrdir="$autoconfdir/RewriteRules"
|
||||
if [ -d "$certsconfdir" ]; then
|
||||
if [ -z "$certsdir" ]; then
|
||||
eerror "CERTSDIR est requis si --certsconfdir est spécifié"
|
||||
return 1
|
||||
elif [ ! -d "$certsdir" ]; then
|
||||
eerror "$certsdir: répertoire invalide"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Faire un script sed pour remplacer les variables spécifiées par leur
|
||||
# valeur dans les fichiers
|
||||
|
@ -284,10 +275,10 @@ function apache_autoconf() {
|
|||
ac_set_tmpfile FILLTEMP
|
||||
|
||||
# Copie des certificats
|
||||
local modified conf
|
||||
local modified rehash conf
|
||||
if [ -d "$certsconfdir" ]; then
|
||||
local -a certsconfs
|
||||
local certsconf cert key ca
|
||||
local -a certsconfs certspems
|
||||
local certsconf certspem cert key ca
|
||||
array_addu FILLVARS cert
|
||||
array_addu FILLVARS key
|
||||
array_addu FILLVARS ca
|
||||
|
@ -295,10 +286,24 @@ function apache_autoconf() {
|
|||
etitle "Installation des certificats"
|
||||
array_lsfiles certsconfs "$certsconfdir" "*.conf"
|
||||
for certsconf in "${certsconfs[@]}"; do
|
||||
if [ -z "$certsdir" ]; then
|
||||
eerror "CERTSDIR est requis si --certsconfdir est spécifié"
|
||||
return 1
|
||||
elif [ ! -d "$certsdir" ]; then
|
||||
eerror "$certsdir: répertoire invalide"
|
||||
return 1
|
||||
fi
|
||||
apache_resolvecert "$certsconf" "$certsdir" cert key ca || return 1
|
||||
apache_addcert -y "$cert" "$key" "$ca"
|
||||
modified=1
|
||||
done
|
||||
array_lsfiles certspems "$certsconfdir" "*.crt" "*.pem"
|
||||
for certspem in "${certspems[@]}"; do
|
||||
if copy_update "$certspem" "$APACHESSLCERTSDIR/$(basename -- "$certspem")"; then
|
||||
modified=1
|
||||
rehash=1
|
||||
fi
|
||||
done
|
||||
eend
|
||||
fi
|
||||
|
||||
|
@ -499,8 +504,11 @@ s#@@ca@@#$APACHESSLCERTSDIR/$(basename "$ca")#g
|
|||
eend
|
||||
fi
|
||||
|
||||
if [ -n "$modified" -a -n "$restart" ]; then
|
||||
if [ -n "$modified" ]; then
|
||||
[ -n "$rehash" ] && elinedots "Hashage des certificats" c_rehash
|
||||
if [ -n "$restart" ]; then
|
||||
estep "Redémarrage d'apache"
|
||||
"$APACHECTL" restart
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
|
|
@ -1193,6 +1193,7 @@ function __cpdir() {
|
|||
}
|
||||
__CPNOVCS_RSYNC_SLOW=1 # synchro potentiellement plus lente, mais plus fidèle (option -c)
|
||||
__CPNOVCS_RSYNC_ARGS=(-q)
|
||||
__CPNOVCS_INCLUDE_VCS= # ne pas ignorer les répertoires de VCS
|
||||
function cpnovcs() {
|
||||
# copier le fichier/répertoire $1 *dans* le *répertoire* $2 avec rsync. Les
|
||||
# options du tableau __CPNOVCS_RSYNC_ARGS sont rajoutées aux options standard
|
||||
|
@ -1206,11 +1207,13 @@ function cpnovcs() {
|
|||
local src="$1" destdir="$2"
|
||||
[ -d "$destdir" ] || mkdir -p "$destdir" || return 1
|
||||
if progexists rsync; then
|
||||
local -a novcs
|
||||
if [ -z "$__CPNOVCS_INCLUDE_VCS" ]; then
|
||||
local gitexclude=/.git/
|
||||
if [ "${src%/}" == "$src" ]; then
|
||||
gitexclude="/$(basename -- "$src")$gitexclude"
|
||||
[ "${src%/}" == "$src" ] && gitexclude="/$(basename -- "$src")$gitexclude"
|
||||
novcs=(--exclude CVS/ --exclude .svn/ --exclude "$gitexclude")
|
||||
fi
|
||||
rsync -a ${__CPNOVCS_RSYNC_SLOW:+-c} --exclude CVS/ --exclude .svn/ --exclude "$gitexclude" "${__CPNOVCS_RSYNC_ARGS[@]}" "$src" "$destdir/"
|
||||
rsync -a ${__CPNOVCS_RSYNC_SLOW:+-c} "${novcs[@]}" "${__CPNOVCS_RSYNC_ARGS[@]}" "$src" "$destdir/"
|
||||
elif [ "${src%/}" != "$src" ]; then
|
||||
__cpdir "$src" "$destdir"
|
||||
else
|
||||
|
@ -1219,6 +1222,11 @@ function cpnovcs() {
|
|||
__cpdir "$src" "$destdir/$srcname"
|
||||
fi
|
||||
}
|
||||
function cpvcs() {
|
||||
# comme cpnovcs, mais ne pas ignorer les répertoires de VCS
|
||||
local __CPNOVCS_INCLUDE_VCS=1
|
||||
cpnovcs "$@"
|
||||
}
|
||||
function cpdirnovcs() {
|
||||
# Le pendant de cpdir, mais en ignorant les sous-répertoires de VCS: copier le
|
||||
# contenu du répertoire $1 dans le répertoire $2
|
||||
|
|
|
@ -1300,10 +1300,17 @@ function runs_action_desc() {
|
|||
function ref() {
|
||||
local -a __args
|
||||
parse_opts + \
|
||||
-r,--required,-m,--mandatory '$:' \
|
||||
-f,--required-file '$:' \
|
||||
-d,--required-dir '$:' \
|
||||
-s:,--sconf: '$:' \
|
||||
--rs,--rsconf,--required-sconf '$:' \
|
||||
-V:,--refvar: '$:' \
|
||||
-v:,--vars: '$:' \
|
||||
-l:,--lconf: '$:' \
|
||||
--force '$:' \
|
||||
--copy-links '$:' \
|
||||
--with-vcs '$:' \
|
||||
@ __args -- "$@" && set -- "${__args[@]}" || die "$__args"
|
||||
runs_var "$@"
|
||||
RUNSVARDESC=
|
||||
|
@ -1343,10 +1350,17 @@ function runs_action_dump() {
|
|||
function ref() {
|
||||
local -a __args
|
||||
parse_opts + \
|
||||
-r,--required,-m,--mandatory '$:' \
|
||||
-f,--required-file '$:' \
|
||||
-d,--required-dir '$:' \
|
||||
-s:,--sconf: '$:' \
|
||||
--rs,--rsconf,--required-sconf '$:' \
|
||||
-V:,--refvar: '$:' \
|
||||
-v:,--vars: '$:' \
|
||||
-l:,--lconf: '$:' \
|
||||
--force '$:' \
|
||||
--copy-links '$:' \
|
||||
--with-vcs '$:' \
|
||||
@ __args -- "$@" && set -- "${__args[@]}" || die "$__args"
|
||||
runs_var "$@"
|
||||
RUNSVARDESC=
|
||||
|
@ -1417,6 +1431,9 @@ function runs_action_run() {
|
|||
-V:,--refvar: __refvarname= \
|
||||
-v:,--vars: '$:' \
|
||||
-l:,--lconf: '$:' \
|
||||
--force '$:' \
|
||||
--copy-links '$:' \
|
||||
--with-vcs '$:' \
|
||||
@ __args -- "$@" && set -- "${__args[@]}" || die "$__args"
|
||||
|
||||
if [ -n "$__shellconf" ]; then
|
||||
|
@ -1584,8 +1601,8 @@ function runs_action_export() {
|
|||
local -a __args
|
||||
local __ref __name __value __copy __required __rdir __rfile __rsconf
|
||||
local __shellconfs __shellconf __refvarname=refdir __refvar __shellvars
|
||||
local __lineconfs __lineconf
|
||||
local __tmpconf __wildconf
|
||||
local __lineconfs __lineconf __force __copy_links __novcs=1
|
||||
local __tmpconf __wildconf __cpcmd
|
||||
parse_opts + \
|
||||
-r,--required,-m,--mandatory __required=1 \
|
||||
-f,--required-file '$__required=1; __rfile=1' \
|
||||
|
@ -1595,6 +1612,9 @@ function runs_action_export() {
|
|||
-V:,--refvar: __refvarname= \
|
||||
-v:,--vars: __shellvars= \
|
||||
-l:,--lconf: __lineconf= \
|
||||
--force __force=1 \
|
||||
--copy-links __copy_links=1 \
|
||||
--with-vcs __novcs= \
|
||||
@ __args -- "$@" && set -- "${__args[@]}" || die "$__args"
|
||||
|
||||
if [ -n "$__shellconf" ]; then
|
||||
|
@ -1665,6 +1685,16 @@ function runs_action_export() {
|
|||
[ -n "$__shellconf" -o -n "$__lineconf" ] && die "-f est incompatible avec -s et -l"
|
||||
fi
|
||||
|
||||
# utiliser par défaut cpnovcs pour la copie des fichiers sauf si
|
||||
# --with-vcs est utilisé
|
||||
[ -n "$__novcs" ] && __cpcmd=cpnovcs || __cpcmd=cpvcs
|
||||
local -a __CPNOVCS_RSYNC_ARGS
|
||||
if [ -n "$__copy_links" ]; then
|
||||
__CPNOVCS_RSYNC_ARGS=(--copy-links)
|
||||
else
|
||||
__CPNOVCS_RSYNC_ARGS=(--copy-unsafe-links)
|
||||
fi
|
||||
|
||||
for __ref in "$@"; do
|
||||
if [ -n "$__shellconf" -a -z "$__shellvars" ]; then
|
||||
ewarn "L'option -v n'a pas été spécifiée pour $__ref"
|
||||
|
@ -1702,6 +1732,9 @@ function runs_action_export() {
|
|||
RUNSVARDESC=
|
||||
array_add RUNSREFS "$__name"
|
||||
|
||||
# options de copie
|
||||
[ -n "$__force" ] && __copy=1
|
||||
|
||||
if [ -n "$__copy" ]; then
|
||||
if [ -n "$__shellconf" ]; then
|
||||
# copier les fichiers mentionnés dans le fichier de
|
||||
|
@ -1710,7 +1743,6 @@ function runs_action_export() {
|
|||
mkdirof "$RUNSROOTDIR$__value"
|
||||
if [ -n "$__shellvars" ]; then
|
||||
(
|
||||
__CPNOVCS_RSYNC_ARGS=(--copy-unsafe-links)
|
||||
array_split __shellvars "$__shellvars" ,
|
||||
splitwcs "$__shellconf" __tmpconf __wildconf
|
||||
if [ -n "$__wildconf" ]; then
|
||||
|
@ -1729,7 +1761,7 @@ function runs_action_export() {
|
|||
for __shellvar in "${__shellvars[@]}"; do
|
||||
[ -n "${!__shellvar}" ] || continue
|
||||
estep "... Copie de ${!__shellvar}"
|
||||
cpnovcs "$__value/${!__shellvar}" "$(dirname "$RUNSROOTDIR$__value/${!__shellvar}")"
|
||||
"$__cpcmd" "$__value/${!__shellvar}" "$(dirname "$RUNSROOTDIR$__value/${!__shellvar}")"
|
||||
done
|
||||
done
|
||||
)
|
||||
|
@ -1740,7 +1772,6 @@ function runs_action_export() {
|
|||
estep "Vérification du répertoire $(ppath "$__value")"
|
||||
mkdirof "$RUNSROOTDIR$__value"
|
||||
(
|
||||
__CPNOVCS_RSYNC_ARGS=(--copy-unsafe-links)
|
||||
splitwcs "$__lineconf" __tmpconf __wildconf
|
||||
if [ -n "$__wildconf" ]; then
|
||||
array_lsall __lineconfs "$__tmpconf" "$__wildconf"
|
||||
|
@ -1752,15 +1783,15 @@ function runs_action_export() {
|
|||
array_from_lines __relpaths "$(<"$__lineconf" filter_conf)"
|
||||
for __relpath in "${__relpaths[@]}"; do
|
||||
estep "... Copie de $__relpath"
|
||||
cpnovcs "$__value/$__relpath" "$(dirname "$RUNSROOTDIR$__value/$__relpath")"
|
||||
"$__cpcmd" "$__value/$__relpath" "$(dirname "$RUNSROOTDIR$__value/$__relpath")"
|
||||
done
|
||||
done
|
||||
)
|
||||
elif [ ! -e "$RUNSROOTDIR$__value" ]; then
|
||||
else
|
||||
# copie standard
|
||||
estep "Copie de $(ppath "$__value")"
|
||||
mkdirof "$RUNSROOTDIR$__value"
|
||||
cpnovcs "$__value" "$(dirname "$RUNSROOTDIR$__value")"
|
||||
"$__cpcmd" "$__value" "$(dirname "$RUNSROOTDIR$__value")"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -6,9 +6,11 @@ uprovide template
|
|||
urequire base
|
||||
|
||||
function __template_prel_abspath() {
|
||||
# afficher le chemin absolu du fichier $1 si on est dans le répertoire de
|
||||
# destination $2, sinon l'exprimer par rapport au répertoire de destination
|
||||
# $2 si c'est un chemin relatif.
|
||||
# afficher le chemin absolu du fichier $1. Si $1 est un chemin relatif, le
|
||||
# répertoire de référence pour le calcul du chemin absolu dépend du
|
||||
# répertoire courant: si l'on est dans un des sous-répertoires du répertoire
|
||||
# de destination $2, calculer le chemin absolu par rapport au répertoire
|
||||
# courant. Sinon, l'exprimer par rapport à $2.
|
||||
if withinpath "$2" "$(pwd)"; then
|
||||
abspath "$1"
|
||||
else
|
||||
|
@ -259,6 +261,10 @@ function template_merge() {
|
|||
srcspec="${srcspec#$destdir}"
|
||||
|
||||
for srcdir in "${srcdirs[@]}"; do
|
||||
if [ -z "$template" -a ! -e "$srcdir$srcspec" -a -e "$srcdir$srcspec.template" ]; then
|
||||
srcspec="$srcspec.template"
|
||||
template=1
|
||||
fi
|
||||
[ -e "$srcdir$srcspec" ] || continue
|
||||
ebegin "$(basename -- "$srcdir") --> $(ppath "$destdir$srcspec")"
|
||||
s=0
|
||||
|
|
0
lib/ulib/templates/runsconfig/script.template → lib/ulib/templates/runsconfig/script.rs.template
Executable file → Normal file
0
lib/ulib/templates/runsconfig/script.template → lib/ulib/templates/runsconfig/script.rs.template
Executable file → Normal file
Loading…
Reference in New Issue