From 2aad96bf6e45d0533bd8a9aed594cc5147fa96b9 Mon Sep 17 00:00:00 2001 From: Gabriele M Date: Sun, 26 Feb 2017 09:31:23 +0100 Subject: [PATCH] backuptool: Preserve symlinks Without -d, we copy the file sysmlinked rather than the symlink. Change-Id: Ie0fdd43f29e53334464188c846dd7a3b7bb770cc --- prebuilt/common/bin/backuptool.functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prebuilt/common/bin/backuptool.functions b/prebuilt/common/bin/backuptool.functions index 6d128d70..71a648ce 100644 --- a/prebuilt/common/bin/backuptool.functions +++ b/prebuilt/common/bin/backuptool.functions @@ -16,7 +16,7 @@ backup_file() { echo "Skipping odexed apk $1"; else mkdir -p "$C/$D" - cp -p $1 "$C/$D/$F" + cp -dp $1 "$C/$D/$F" fi fi } @@ -28,7 +28,7 @@ restore_file() { if [ ! -d "$DIR" ]; then mkdir -p "$DIR"; fi - cp -p "$C/$DIR/$FILE" "$1"; + cp -dp "$C/$DIR/$FILE" "$1"; if [ -n "$2" ]; then echo "Deleting obsolete file $2" rm "$2";