author | Ehsan Akhgari <ehsan@mozilla.com> |
Wed, 13 Jun 2012 22:00:03 -0400 | |
changeset 96689 | 15aaf2a0cb1dd5ff30223cbae6fc80bee120cf65 |
parent 96688 | 12e5dbd60ed8e0e3b2471795e564ad9f8bf0357b |
child 96690 | 983b91e5aa1715332f78d09a6035382d968c03d2 |
push id | 10660 |
push user | eakhgari@mozilla.com |
push date | Thu, 14 Jun 2012 13:37:41 +0000 |
treeherder | mozilla-inbound@3d4982f32837 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | rstrong |
bugs | 764587 |
milestone | 16.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/toolkit/mozapps/update/nsUpdateService.js +++ b/toolkit/mozapps/update/nsUpdateService.js @@ -1009,31 +1009,32 @@ function handleUpdateFailure(update, err return false; } /** * Fall back to downloading a complete update in case an update has failed. * * @param update the update object that has failed to apply. + * @param postStaging true if we have just attempted to stage an update. */ -function handleFallbackToCompleteUpdate(update) { +function handleFallbackToCompleteUpdate(update, postStaging) { cleanupActiveUpdate(); update.statusText = gUpdateBundle.GetStringFromName("patchApplyFailure"); var oldType = update.selectedPatch ? update.selectedPatch.type : "complete"; if (update.selectedPatch && oldType == "partial" && update.patchCount == 2) { // Partial patch application failed, try downloading the complete // update in the background instead. LOG("UpdateService:_postUpdateProcessing - install of partial patch " + "failed, downloading complete patch"); var status = Cc["@mozilla.org/updates/update-service;1"]. getService(Ci.nsIApplicationUpdateService). - downloadUpdate(update, true); + downloadUpdate(update, !postStaging); if (status == STATE_NONE) cleanupActiveUpdate(); } else { LOG("handleFallbackToCompleteUpdate - install of complete or " + "only one patch offered failed."); } update.QueryInterface(Ci.nsIWritablePropertyBag); @@ -1616,17 +1617,17 @@ UpdateService.prototype = { update.state = ary[0]; if (update.state == STATE_FAILED && ary[1]) { if (handleUpdateFailure(update, ary[1])) { return; } } // Something went wrong with the patch application process. - handleFallbackToCompleteUpdate(update); + handleFallbackToCompleteUpdate(update, false); prompter.showUpdateError(update); } }, /** * Submit the results of applying the update via telemetry. * @@ -2431,17 +2432,17 @@ UpdateManager.prototype = { refreshUpdateStatus: function UM_refreshUpdateStatus(update) { var updateSucceeded = true; var status = readStatusFile(getUpdatesDir()); var ary = status.split(":"); update.state = ary[0]; if (update.state == STATE_FAILED && ary[1]) { updateSucceeded = false; if (!handleUpdateFailure(update, ary[1])) { - handleFallbackToCompleteUpdate(update); + handleFallbackToCompleteUpdate(update, true); } } if (update.state == STATE_APPLIED && shouldUseService()) { writeStatusFile(getUpdatesDir(), update.state = STATE_APPLIED_SVC); } var um = Cc["@mozilla.org/updates/update-manager;1"]. getService(Ci.nsIUpdateManager); um.saveUpdates();