Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #71 from Pehrsons/b2g-4.4.2_r1_bug1058511
Browse files Browse the repository at this point in the history
Bug 1058511 - Clear Gecko HTTP cache before checking free cache space. r=gerard-majax
  • Loading branch information
rvandermeulen committed Sep 4, 2014
2 parents 4b4336c + fede904 commit fe92ddd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/releasetools/edify_generator.py
Expand Up @@ -184,6 +184,12 @@ def DeleteFiles(self, file_list):
cmd = "delete(" + ",\0".join(['"%s"' % (i,) for i in file_list]) + ");"
self.script.append(self._WordWrap(cmd))

def DeleteFilesRecursive(self, file_list):
"""Recursively delete all files and folders in file_list."""
if not file_list: return
cmd = "delete_recursive(" + ",\0".join(['"%s"' % (i,) for i in file_list]) + ");"
self.script.append(self._WordWrap(cmd))

def RenameFile(self, srcfile, tgtfile):
"""Moves a file from one location to another."""
if self.info.get("update_rename_support", False):
Expand Down
7 changes: 7 additions & 0 deletions tools/releasetools/ota_from_target_files
Expand Up @@ -650,6 +650,13 @@ def WriteIncrementalOTAPackage(target_zip, source_zip, output_zip):
script.SetProgress(so_far / total_verify_size)

if patch_list or updating_recovery or updating_boot:
# We clear Gecko's HTTP cache before the regular space check.
# During CacheFreeSpaceCheck(), the update-binary tries to clear files in
# /cache to free up the desired space. However, update-binary does not
# see the Gecko HTTP cache as safe to delete so it won't be touched.
script.Print("Clearing Gecko HTTP cache...")
script.DeleteFilesRecursive(["/cache/Cache"])
script.DeleteFilesRecursive(["/cache/cache2"])
script.CacheFreeSpaceCheck(largest_source_size)

device_specific.IncrementalOTA_VerifyEnd()
Expand Down

0 comments on commit fe92ddd

Please sign in to comment.