Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 556246b2 authored by Gabriele M's avatar Gabriele M
Browse files

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
parent 2aad96bf
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ export S=/system
export V=14.1

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