Merge branch 'master' of vcs.univ.run:modules/nutools
This commit is contained in:
commit
763533eebe
|
@ -26,13 +26,17 @@ def display_help():
|
||||||
|
|
||||||
RE_NUMERIC = re.compile('\d+$')
|
RE_NUMERIC = re.compile('\d+$')
|
||||||
RE_QUOTED = re.compile(r'".*"$')
|
RE_QUOTED = re.compile(r'".*"$')
|
||||||
|
RE_STRING = re.compile(r'[A-Za-z][A-Za-z0-9]*$')
|
||||||
def fixvalue(v):
|
def fixvalue(v):
|
||||||
if RE_NUMERIC.match(v) is not None:
|
if RE_NUMERIC.match(v) is not None:
|
||||||
# Les valeurs numériques sont données telles quelles
|
# Les valeurs numériques sont données telles quelles
|
||||||
return v
|
return v
|
||||||
if RE_QUOTED.match(v) is not None:
|
elif RE_QUOTED.match(v) is not None:
|
||||||
# Les valeurs chaines sont entre guillemets
|
# Les valeurs chaines sont entre guillemets
|
||||||
return "'" + v[1:-1] + "'"
|
return "'" + v[1:-1] + "'"
|
||||||
|
elif RE_STRING.match(v) is not None:
|
||||||
|
# Certaines valeurs chaine ne sont pas entre guillemets
|
||||||
|
return "'" + v + "'"
|
||||||
# Sinon, on assume que c'est une date
|
# Sinon, on assume que c'est une date
|
||||||
return "to_date('" + v + "', 'YYYY-MM-DD HH24:MI:SS')"
|
return "to_date('" + v + "', 'YYYY-MM-DD HH24:MI:SS')"
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
007017000
|
007018000
|
||||||
|
|
|
@ -43,6 +43,7 @@ function uinst() {
|
||||||
local profiledir
|
local profiledir
|
||||||
local bashrcdir
|
local bashrcdir
|
||||||
local defaultdir
|
local defaultdir
|
||||||
|
local workdir_rsync_options
|
||||||
local workdir_excludes
|
local workdir_excludes
|
||||||
local workdir_includes
|
local workdir_includes
|
||||||
local copy_files
|
local copy_files
|
||||||
|
@ -182,6 +183,7 @@ function __uinst_init() {
|
||||||
profiledir='lib/profile.d'
|
profiledir='lib/profile.d'
|
||||||
bashrcdir='lib/bashrc.d'
|
bashrcdir='lib/bashrc.d'
|
||||||
defaultdir='lib/default'
|
defaultdir='lib/default'
|
||||||
|
workdir_rsync_options='()'
|
||||||
workdir_excludes='()'
|
workdir_excludes='()'
|
||||||
workdir_includes='()'
|
workdir_includes='()'
|
||||||
copy_files='true'
|
copy_files='true'
|
||||||
|
@ -365,7 +367,7 @@ Utilisez 'udir -e $(ppath "$srcdir")' pour modifier les paramètres."
|
||||||
function __uinst_defaultvars() {
|
function __uinst_defaultvars() {
|
||||||
eval "$(array_join UINST_DEFAULTS ';')"
|
eval "$(array_join UINST_DEFAULTS ';')"
|
||||||
UDIR_VARS=(uinc install_profiles profiledir bashrcdir defaultdir copy_files destdir srcdir owner)
|
UDIR_VARS=(uinc install_profiles profiledir bashrcdir defaultdir copy_files destdir srcdir owner)
|
||||||
UDIR_ARRAYS=(uinc_options uinc_args preconfig_scripts configure_variables configure_dest_for config_scripts workdir_excludes workdir_includes files modes root_scripts)
|
UDIR_ARRAYS=(uinc_options uinc_args preconfig_scripts configure_variables configure_dest_for config_scripts workdir_rsync_options workdir_excludes workdir_includes files modes root_scripts)
|
||||||
}
|
}
|
||||||
|
|
||||||
function __uinst_protectvars() {
|
function __uinst_protectvars() {
|
||||||
|
@ -605,6 +607,9 @@ function __uinst_prepare_workdir() {
|
||||||
# on a spécifié des inclusions ou exclusions pour le répertoire de
|
# on a spécifié des inclusions ou exclusions pour le répertoire de
|
||||||
# travail
|
# travail
|
||||||
(
|
(
|
||||||
|
if ! array_isempty workdir_rsync_options; then
|
||||||
|
array_copy __CPNOVCS_RSYNC_ARGS workdir_rsync_options
|
||||||
|
fi
|
||||||
for exclude in "${workdir_excludes[@]}"; do
|
for exclude in "${workdir_excludes[@]}"; do
|
||||||
array_add __CPNOVCS_RSYNC_ARGS --exclude "$exclude"
|
array_add __CPNOVCS_RSYNC_ARGS --exclude "$exclude"
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue