diff options
author | Gabriele M <moto.falcon.git@gmail.com> | 2017-02-26 21:01:38 +0100 |
---|---|---|
committer | Jason Riordan <jriordan001@gmail.com> | 2017-02-27 23:33:02 -0500 |
commit | cf276aa7cda379b93a38f8e6251fa4fe51eb96d9 (patch) | |
tree | 259dc7362414ea4c453d53df9734758a39ba65c4 | |
parent | 70e53042eb33d1d02e8ac918db9c90093bb996f6 (diff) | |
download | vendor_replicant-cf276aa7cda379b93a38f8e6251fa4fe51eb96d9.zip vendor_replicant-cf276aa7cda379b93a38f8e6251fa4fe51eb96d9.tar.gz vendor_replicant-cf276aa7cda379b93a38f8e6251fa4fe51eb96d9.tar.bz2 |
backuptool: Don't rely on the order of the elements in the list
We should not test symlinks using -e or -f, otherwise the order in
which the files are backed up and restored matters.
Change-Id: I9b87972b27a63ef562c0c5f46f943eafd0a08ce1
-rw-r--r-- | prebuilt/common/bin/backuptool.functions | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/prebuilt/common/bin/backuptool.functions b/prebuilt/common/bin/backuptool.functions index 9598f23..d9b2fc0 100644 --- a/prebuilt/common/bin/backuptool.functions +++ b/prebuilt/common/bin/backuptool.functions @@ -8,7 +8,7 @@ export S=/system export V=13.0 backup_file() { - if [ -e "$1" ]; then + if [ -e "$1" -o -L "$1" ]; then local F=`basename "$1"` local D=`dirname "$1"` # dont backup any apps that have odex files, they are useless @@ -24,7 +24,7 @@ backup_file() { restore_file() { local FILE=`basename "$1"` local DIR=`dirname "$1"` - if [ -e "$C/$DIR/$FILE" ]; then + if [ -e "$C/$DIR/$FILE" -o -L "$C/$DIR/$FILE" ]; then if [ ! -d "$DIR" ]; then mkdir -p "$DIR"; fi |