diff --git a/dk b/dk index 43e7a17..fda926e 100755 --- a/dk +++ b/dk @@ -273,8 +273,11 @@ OPTIONS build PROFILE_APPS=() # ou... spécifique au profil 'PROFILE' app_URL= # url du dépôt app_DEVEL_SRCDIR= # répertoire source du dépôt en mode devel - app_SRC= # répertoire/fichier source (si URL pas renseigné) + app_SRC= # répertoire/fichier source (si URL='') app_DEST= # répertoire dans lequel faire le checkout + # ou destination si synchro avec app_SRC + app_RSYNC_OPTS= # options de rsync si synchro (avec app_SRC + # ou app_DEVEL_SRCDIR) app_PROFILE_ORIGIN= # origine spécifique au profil 'PROFILE' app_ORIGIN= # ou... origine par défaut de la branche app_PROFILE_BRANCH= # branche spécifique au profil 'PROFILE' @@ -324,8 +327,11 @@ VARIABLES de update-apps.conf projet. Les variables suivantes sont disponibles: URL= # url du dépôt DEVEL_SRCDIR= # répertoire source en mode devel - SRC= # répertoire/fichier source (si URL pas renseigné) + SRC= # répertoire/fichier source (si URL='') DEST= # répertoire dans lequel faire le checkout + # ou destination si URL='' + RSYNC_OPTS= # options de rsync si synchro avec SRC ou + # DEVEL_SRCDIR ORIGIN= # origine de la branche BRANCH= # branche sélectionnée dans le dépôt TYPE= # type de projet (composer|none) @@ -699,7 +705,7 @@ function build_update_apps() { fi etitle "Mise à jour des dépendances" - local app var URL SRC DEVEL_SRCDIR DEST ORIGIN BRANCH TYPE after_update after_updates composer_action + local app var URL SRC DEVEL_SRCDIR DEST have_RSYNC_OPTS RSYNC_OPTS ORIGIN BRANCH TYPE after_update after_updates composer_action for app in "${APPS[@]}"; do etitle "$app" @@ -720,6 +726,14 @@ function build_update_apps() { DEST="${var}_DEST"; DEST="${!DEST}" [ -n "$DEST" ] || DEST="$app/b" + if is_defined "${var}_RSYNC_OPTS"; then + have_RSYNC_OPTS=1 + RSYNC_OPTS="${var}_RSYNC_OPTS[@]"; RSYNC_OPTS=("${!RSYNC_OPTS}") + else + have_RSYNC_OPTS= + RSYNC_OPTS=() + fi + ORIGIN="${var}_${PROFILE}_ORIGIN"; ORIGIN="${!ORIGIN}" [ -n "$ORIGIN" ] || { ORIGIN="${var}_ORIGIN"; ORIGIN="${!ORIGIN}"; } [ -n "$ORIGIN" ] || ORIGIN="$DEFAULT_ORIGIN" @@ -736,7 +750,8 @@ function build_update_apps() { DEST="$DEST/$app" # synchronisation en mode devel - local -a rsync_opts; rsync_opts=(-a --delete --exclude .git/ --delete-excluded) + [ -n "$have_RSYNC_OPTS" ] || RSYNC_OPTS=(--delete --delete-excluded) + local -a rsync_opts; rsync_opts=(-a --exclude .git/ "${RSYNC_OPTS[@]}") estep "Synchro $DEVEL_SRCDIR --> $DEST" rsync "${rsync_opts[@]}" "$DEVEL_SRCDIR/" "$DEST" || { eend; return 1; } @@ -789,13 +804,15 @@ function build_update_apps() { elif [ -n "$SRC" ]; then if [ -d "$SRC" ]; then - local -a rsync_opts; rsync_opts=(-a --delete --exclude .git/ --delete-excluded) + [ -n "$have_RSYNC_OPTS" ] || RSYNC_OPTS=(--delete --delete-excluded) + local -a rsync_opts; rsync_opts=(-a --exclude .git/ "${RSYNC_OPTS[@]}") SRC="${SRC%/}/" DEST="${DEST%/}/" estep "Synchro $SRC --> $DEST" rsync "${rsync_opts[@]}" "$SRC" "$DEST" || { eend; return 1; } elif [ -f "$SRC" ]; then - local -a rsync_opts; rsync_opts=(-a) + [ -n "$have_RSYNC_OPTS" ] || RSYNC_OPTS=() + local -a rsync_opts; rsync_opts=(-a "${RSYNC_OPTS[@]}") if [ "${DEST%/}" != "$DEST" -o -d "$DEST" ]; then DEST="${DEST%/}/" estep "Synchro $SRC --> $DEST"