dk: bug avec la synchro d'un fichier

This commit is contained in:
Jephté Clain 2020-04-16 22:44:38 +04:00
parent 74190f7264
commit f4f9b69257
1 changed files with 14 additions and 5 deletions

19
dk
View File

@ -719,7 +719,6 @@ function build_update_apps() {
DEST="${var}_DEST"; DEST="${!DEST}" DEST="${var}_DEST"; DEST="${!DEST}"
[ -n "$DEST" ] || DEST="$app/b" [ -n "$DEST" ] || DEST="$app/b"
mkdir -p "$DEST" || { eend; return 1; }
ORIGIN="${var}_${PROFILE}_ORIGIN"; ORIGIN="${!ORIGIN}" ORIGIN="${var}_${PROFILE}_ORIGIN"; ORIGIN="${!ORIGIN}"
[ -n "$ORIGIN" ] || { ORIGIN="${var}_ORIGIN"; ORIGIN="${!ORIGIN}"; } [ -n "$ORIGIN" ] || { ORIGIN="${var}_ORIGIN"; ORIGIN="${!ORIGIN}"; }
@ -733,6 +732,7 @@ function build_update_apps() {
TYPE="${var}_TYPE"; TYPE="${!TYPE}" TYPE="${var}_TYPE"; TYPE="${!TYPE}"
if [ -n "$BUILD_UPDATE_DEVEL" ]; then if [ -n "$BUILD_UPDATE_DEVEL" ]; then
mkdir -p "$DEST" || { eend; return 1; }
DEST="$DEST/$app" DEST="$DEST/$app"
# synchronisation en mode devel # synchronisation en mode devel
@ -760,6 +760,7 @@ function build_update_apps() {
done done
fi fi
elif [ -n "$URL" ]; then elif [ -n "$URL" ]; then
mkdir -p "$DEST" || { eend; return 1; }
DEST="$DEST/$app" DEST="$DEST/$app"
if [ -d "$DEST" -a -d "$DEST/.git" ]; then if [ -d "$DEST" -a -d "$DEST/.git" ]; then
@ -789,12 +790,20 @@ function build_update_apps() {
elif [ -n "$SRC" ]; then elif [ -n "$SRC" ]; then
if [ -d "$SRC" ]; then if [ -d "$SRC" ]; then
local -a rsync_opts; rsync_opts=(-a --delete --exclude .git/ --delete-excluded) local -a rsync_opts; rsync_opts=(-a --delete --exclude .git/ --delete-excluded)
estep "Synchro $SRC/ --> $DEST" SRC="${SRC%/}/"
rsync "${rsync_opts[@]}" "$SRC/" "$DEST/" || { eend; return 1; } DEST="${DEST%/}/"
estep "Synchro $SRC --> $DEST"
rsync "${rsync_opts[@]}" "$SRC" "$DEST" || { eend; return 1; }
elif [ -f "$SRC" ]; then elif [ -f "$SRC" ]; then
local -a rsync_opts; rsync_opts=(-a) local -a rsync_opts; rsync_opts=(-a)
estep "Synchro $SRC --> $DEST" if [ "${DEST%/}" != "$DEST" -o -d "$DEST" ]; then
rsync "${rsync_opts[@]}" "$SRC" "$DEST/" || { eend; return 1; } DEST="${DEST%/}/"
estep "Synchro $SRC --> $DEST"
rsync "${rsync_opts[@]}" "$SRC" "$DEST" || { eend; return 1; }
else
estep "Synchro $SRC --> $DEST"
rsync "${rsync_opts[@]}" "$SRC" "$DEST" || { eend; return 1; }
fi
else else
eerror "$app: $SRC: répertoire/fichier introuvable" eerror "$app: $SRC: répertoire/fichier introuvable"
eend; return 1 eend; return 1