Bug 760577 - Part 1: Keep the update files around when an update has been staged; r=rstrong

This commit is contained in:
Ehsan Akhgari 2012-06-14 09:21:13 -04:00
parent 43be615ba1
commit 14e077ce86

View File

@ -769,18 +769,22 @@ function cleanUpUpdatesDir(aBackgroundUpdate) {
}
}
f.moveTo(dir, FILE_LAST_LOG);
continue;
if (aBackgroundUpdate) {
// We're not going to delete any files, so we can just
// bail out of the loop right now.
break;
} else {
continue;
}
}
catch (e) {
LOG("cleanUpUpdatesDir - failed to move file " + f.path + " to " +
dir.path + " and rename it to " + FILE_LAST_LOG);
}
} else if (f.leafName == FILE_UPDATE_STATUS && aBackgroundUpdate) {
// Leave the update.status file alone when a background update
// has been performed. We don't remove this file here because
// after the application directory gets replaced by the staged
// update, this will end up being the update.status file which
// represents the status of the update performed.
} else if (aBackgroundUpdate) {
// Don't delete any files when an update has been staged, as
// we need to keep them around in case we would have to fall
// back to applying the update on application restart.
continue;
}
// Now, recursively remove this file. The recursive removal is really