Mac v2 signing - Bug 1071465 - old precomplete file is not removed on update. r=spohl
authorRobert Strong <robert.bugzilla@gmail.com>
Mon, 29 Sep 2014 11:52:48 -0700
changeset 207891 4932dbbc1cc8bbcff91175c7bb49f00cafb627bc
parent 207890 818b73513ce25c0d39c77f1cf892fac7ba42646d
child 207892 4f0a10f05200de7a59c4f4a0f94c68831ad702cb
push id27569
push usercbook@mozilla.com
push dateTue, 30 Sep 2014 13:14:19 +0000
treeherdermozilla-central@2ae57957e4bb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersspohl
bugs1071465
milestone35.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
Mac v2 signing - Bug 1071465 - old precomplete file is not removed on update. r=spohl
browser/installer/removed-files.in
toolkit/mozapps/update/updater/updater.cpp
--- a/browser/installer/removed-files.in
+++ b/browser/installer/removed-files.in
@@ -76,17 +76,16 @@
   @DIR_MACOS@chrome.manifest
   #ifdef XP_MACOSX
     @DIR_RESOURCES@chrome.manifest
   #endif
 #endif
 
 # Mac OS X v2 signing removals
 #ifdef XP_MACOSX
-  precomplete
   @DIR_MACOS@active-update.xml
   @DIR_MACOS@update-settings.ini
   @DIR_MACOS@updates.xml
   @DIR_MACOS@defaults/*
   @DIR_MACOS@updates/*
 #endif
 
 # Common Directory removals
--- a/toolkit/mozapps/update/updater/updater.cpp
+++ b/toolkit/mozapps/update/updater/updater.cpp
@@ -3009,20 +3009,26 @@ int NS_main(int argc, NS_tchar **argv)
   }
 #endif /* XP_WIN */
 
 #if defined(MOZ_WIDGET_GONK)
   } // end the extra level of scope for the GonkAutoMounter
 #endif
 
 #ifdef XP_MACOSX
-  // When the update is successful move the distribution directory from
+  // When the update is successful remove the precomplete file in the root of
+  // the application bundle and move the distribution directory from
   // Contents/MacOS to Contents/Resources and if both exist delete the
   // directory under Contents/MacOS (see Bug 1068439).
-  if (gSucceeded) {
+  if (gSucceeded && !sStagedUpdate) {
+    NS_tchar oldPrecomplete[MAXPATHLEN];
+    NS_tsnprintf(oldPrecomplete, sizeof(oldPrecomplete)/sizeof(oldPrecomplete[0]),
+                 NS_T("%s/precomplete"), gInstallDirPath);
+    NS_tremove(oldPrecomplete);
+
     NS_tchar oldDistDir[MAXPATHLEN];
     NS_tsnprintf(oldDistDir, sizeof(oldDistDir)/sizeof(oldDistDir[0]),
                  NS_T("%s/Contents/MacOS/distribution"), gInstallDirPath);
     int rv = NS_taccess(oldDistDir, F_OK);
     if (!rv) {
       NS_tchar newDistDir[MAXPATHLEN];
       NS_tsnprintf(newDistDir, sizeof(newDistDir)/sizeof(newDistDir[0]),
                    NS_T("%s/Contents/Resources/distribution"), gInstallDirPath);