* commit '2f44006a4bbfe6eb7af4d69a24bd068a0875a304': releasetools: Fix the bug when deleting files.
This commit is contained in:
commit
276a4f4512
1 changed files with 7 additions and 5 deletions
|
@ -1075,11 +1075,13 @@ class FileDifference(object):
|
||||||
script.FileCheck(tf.name, tf.sha1)
|
script.FileCheck(tf.name, tf.sha1)
|
||||||
|
|
||||||
def RemoveUnneededFiles(self, script, extras=()):
|
def RemoveUnneededFiles(self, script, extras=()):
|
||||||
script.DeleteFiles(
|
file_list = ["/" + i[0] for i in self.verbatim_targets]
|
||||||
["/" + i[0] for i in self.verbatim_targets] +
|
file_list += ["/" + i for i in self.source_data
|
||||||
["/" + i for i in sorted(self.source_data)
|
if i not in self.target_data and i not in self.renames]
|
||||||
if i not in self.target_data and i not in self.renames] +
|
file_list += list(extras)
|
||||||
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):
|
def TotalPatchSize(self):
|
||||||
return sum(i[1].size for i in self.patch_list)
|
return sum(i[1].size for i in self.patch_list)
|
||||||
|
|
Loading…
Reference in a new issue