Merge branch 'master' of vcs.univ.run:modules/nutools

This commit is contained in:
Jephte CLAIN 2015-01-14 15:31:21 +04:00
commit 763533eebe
3 changed files with 12 additions and 3 deletions

View File

@ -26,13 +26,17 @@ def display_help():
RE_NUMERIC = re.compile('\d+$')
RE_QUOTED = re.compile(r'".*"$')
RE_STRING = re.compile(r'[A-Za-z][A-Za-z0-9]*$')
def fixvalue(v):
if RE_NUMERIC.match(v) is not None:
# Les valeurs numériques sont données telles quelles
return v
if RE_QUOTED.match(v) is not None:
elif RE_QUOTED.match(v) is not None:
# Les valeurs chaines sont entre guillemets
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
return "to_date('" + v + "', 'YYYY-MM-DD HH24:MI:SS')"

View File

@ -1 +1 @@
007017000
007018000

View File

@ -43,6 +43,7 @@ function uinst() {
local profiledir
local bashrcdir
local defaultdir
local workdir_rsync_options
local workdir_excludes
local workdir_includes
local copy_files
@ -182,6 +183,7 @@ function __uinst_init() {
profiledir='lib/profile.d'
bashrcdir='lib/bashrc.d'
defaultdir='lib/default'
workdir_rsync_options='()'
workdir_excludes='()'
workdir_includes='()'
copy_files='true'
@ -365,7 +367,7 @@ Utilisez 'udir -e $(ppath "$srcdir")' pour modifier les paramètres."
function __uinst_defaultvars() {
eval "$(array_join UINST_DEFAULTS ';')"
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() {
@ -605,6 +607,9 @@ function __uinst_prepare_workdir() {
# on a spécifié des inclusions ou exclusions pour le répertoire de
# travail
(
if ! array_isempty workdir_rsync_options; then
array_copy __CPNOVCS_RSYNC_ARGS workdir_rsync_options
fi
for exclude in "${workdir_excludes[@]}"; do
array_add __CPNOVCS_RSYNC_ARGS --exclude "$exclude"
done