Bug 994216 - Ensure desktop INI file parent directory exists to fix bustage on CLOSED TREE. r=marco, a=test-only
authorMyk Melez <myk@mozilla.org>
Wed, 09 Apr 2014 14:20:59 -0700
changeset 192670 3770f546df84fc334334df55ded241ff476f28fe
parent 192669 52592df52d9aa37ea34c4628b197efa0f86198cf
child 192671 520e29f0c1cb937188343716d594702c2aafc6eb
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarco, test-only
bugs994216
milestone30.0a2
Bug 994216 - Ensure desktop INI file parent directory exists to fix bustage on CLOSED TREE. r=marco, a=test-only
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 + '"');