Bug 994216 - ensure desktop INI file parent directory exists to fix bustage on CLOSED TREE; r=marco"
authorMyk Melez <myk@mozilla.org>
Wed, 09 Apr 2014 14:20:59 -0700
changeset 177692 690c810c8e3e3a07b6809688e56d1c3fa33b78a3
parent 177691 5a5ed08df529cd5137754b773d9035dface57825
child 177693 d68c74e48075af31479429959c65f2baf487d648
child 177698 7b59047948446553bbfa784b80d5852d47022ff8
child 177772 5127cc003ec8cc3199f21cb850e01ca155046381
child 177845 92c41f6da7c55cd2429e0b34182abdc938aab4c3
push id26562
push usermyk@mozilla.com
push dateWed, 09 Apr 2014 21:23:35 +0000
treeherdermozilla-central@690c810c8e3e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarco
bugs994216
milestone31.0a1
first release with
nightly linux32
690c810c8e3e / 31.0a1 / 20140410030200 / files
nightly linux64
690c810c8e3e / 31.0a1 / 20140410030200 / files
nightly mac
690c810c8e3e / 31.0a1 / 20140410030200 / files
nightly win32
690c810c8e3e / 31.0a1 / 20140410030200 / files
nightly win64
690c810c8e3e / 31.0a1 / 20140410030200 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 994216 - ensure desktop INI file parent directory exists to fix bustage on CLOSED TREE; r=marco"
toolkit/webapps/LinuxNativeApp.js
--- a/toolkit/webapps/LinuxNativeApp.js
+++ b/toolkit/webapps/LinuxNativeApp.js
@@ -272,16 +272,19 @@ NativeApp.prototype = {
 
   _createSystemFiles: function(aInstallDir) {
     let webappsBundle = Services.strings.createBundle("chrome://global/locale/webapps.properties");
 
     let webapprtPath = OS.Path.join(aInstallDir, this.webapprt);
 
     // $XDG_DATA_HOME/applications/owa-<webappuniquename>.desktop
     let desktopINIfile = getFile(this.desktopINI);
+    if (desktopINIfile.parent && !desktopINIfile.parent.exists()) {
+      desktopINIfile.parent.create(Ci.nsIFile.DIRECTORY_TYPE, PERMS_DIRECTORY);
+    }
 
     let writer = Cc["@mozilla.org/xpcom/ini-processor-factory;1"].
                  getService(Ci.nsIINIParserFactory).
                  createINIParser(desktopINIfile).
                  QueryInterface(Ci.nsIINIParserWriter);
     writer.setString("Desktop Entry", "Name", this.appName);
     writer.setString("Desktop Entry", "Comment", this.shortDescription);
     writer.setString("Desktop Entry", "Exec", '"' + webapprtPath + '"');