From f8ace3b4d0959aa84212fe2c81ff8e5d8735da52 Mon Sep 17 00:00:00 2001 From: Jephte CLAIN Date: Fri, 28 Mar 2014 10:30:20 +0400 Subject: [PATCH] =?UTF-8?q?synchro=20plus=20lente=20mais=20plus=20fid?= =?UTF-8?q?=C3=A8le=20par=20d=C3=A9faut?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ulib/.ulib_version | 2 +- ulib/base | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ulib/.ulib_version b/ulib/.ulib_version index 64bb6b7..e85087a 100644 --- a/ulib/.ulib_version +++ b/ulib/.ulib_version @@ -1 +1 @@ -30 +31 diff --git a/ulib/base b/ulib/base index 5c0c868..9b9a120 100644 --- a/ulib/base +++ b/ulib/base @@ -1364,6 +1364,7 @@ function rm_maybe() { done [ -n "$rm" ] && /bin/rm "$@" } +__CPDIR_RSYNC_SLOW=1 # synchro potentiellement plus lente, mais plus fidèle (option -c) __CPDIR_RSYNC_ARGS=(-q) function cpdir() { # copier un fichier dans un répertoire, ou le contenu d'un répertoire dans un @@ -1378,9 +1379,9 @@ function cpdir() { if progexists rsync; then [ -d "$2" ] || mkdir -p "$2" || return 1 if [ -d "$1" ]; then - rsync -a "${__CPDIR_RSYNC_ARGS[@]}" "$1/" "$2/" + rsync -a ${__CPDIR_RSYNC_SLOW:+-c} "${__CPDIR_RSYNC_ARGS[@]}" "$1/" "$2/" else - rsync -a "${__CPDIR_RSYNC_ARGS[@]}" "$1" "$2/" + rsync -a ${__CPDIR_RSYNC_SLOW:+-c} "${__CPDIR_RSYNC_ARGS[@]}" "$1" "$2/" fi else __cpdir "$@" @@ -1429,7 +1430,7 @@ function __cpdir() { fi fi } -CPNOVCS_OPTS=() # deprecated +__CPNOVCS_RSYNC_SLOW=1 # synchro potentiellement plus lente, mais plus fidèle (option -c) __CPNOVCS_RSYNC_ARGS=(-q) function cpnovcs() { # copier le fichier/répertoire $1 *dans* le *répertoire* $2 avec rsync. Les @@ -1448,7 +1449,7 @@ function cpnovcs() { if [ "${src%/}" != "$src" ]; then gitexclude="/$(basename -- "$src")$gitexclude" fi - rsync -a --exclude CVS --exclude .svn --exclude "$gitexclude" "${CPNOVCS_OPTS[@]}" "${__CPNOVCS_RSYNC_ARGS[@]}" "$src" "$destdir/" + rsync -a ${__CPNOVCS_RSYNC_SLOW:+-c} --exclude CVS --exclude .svn --exclude "$gitexclude" "${__CPNOVCS_RSYNC_ARGS[@]}" "$src" "$destdir/" elif [ "${src%/}" != "$src" ]; then __cpdir "$src" "$destdir" else