am 8f4b307e: Merge "releasetools: Fix the bug when deleting files."

* commit '8f4b307e56ea73153f249b44dc2b15de77e058f7':
  releasetools: Fix the bug when deleting files.
This commit is contained in:
Tao Bao 2015-09-04 17:56:22 +00:00 committed by Android Git Automerger
commit 2f44006a4b

View file

@ -1072,11 +1072,13 @@ class FileDifference(object):
script.FileCheck(tf.name, tf.sha1)
def RemoveUnneededFiles(self, script, extras=()):
script.DeleteFiles(
["/" + i[0] for i in self.verbatim_targets] +
["/" + i for i in sorted(self.source_data)
if i not in self.target_data and i not in self.renames] +
list(extras))
file_list = ["/" + i[0] for i in self.verbatim_targets]
file_list += ["/" + i for i in self.source_data
if i not in self.target_data and i not in self.renames]
file_list += list(extras)
# Sort the list in descending order, which removes all the files first
# before attempting to remove the folder. (Bug: 22960996)
script.DeleteFiles(sorted(file_list, reverse=True))
def TotalPatchSize(self):
return sum(i[1].size for i in self.patch_list)