[tor-commits] [tor-messenger-build/master] profile patch: update levelsToRemove

boklm at torproject.org boklm at torproject.org
Tue Jun 30 12:03:52 UTC 2015


commit b0b788cc149d7a9353e95d810f94a7d08189a9ef
Author: Nicolas Vigier <boklm at torproject.org>
Date:   Tue Jun 30 14:01:12 2015 +0200

    profile patch: update levelsToRemove
    
    1 on OS X, 0 on Linux and Windows
---
 ...e-the-default-Firefox-profile-director.mozpatch |   44 +++++++++++---------
 1 file changed, 25 insertions(+), 19 deletions(-)

diff --git a/projects/instantbird/Bug-9173-Change-the-default-Firefox-profile-director.mozpatch b/projects/instantbird/Bug-9173-Change-the-default-Firefox-profile-director.mozpatch
index d531b91..11ba270 100644
--- a/projects/instantbird/Bug-9173-Change-the-default-Firefox-profile-director.mozpatch
+++ b/projects/instantbird/Bug-9173-Change-the-default-Firefox-profile-director.mozpatch
@@ -1,4 +1,4 @@
-From 37cc1ee63479d97b6605ff86e0a99bcb1be14121 Mon Sep 17 00:00:00 2001
+From e40c55e5d4c8ea9e354f00277478accae84970de Mon Sep 17 00:00:00 2001
 From: Kathy Brade <brade at pearlcrescent.com>
 Date: Fri, 18 Oct 2013 15:20:06 -0400
 Subject: [PATCH] Bug #9173: Change the default Firefox profile directory to be
@@ -7,14 +7,14 @@ Subject: [PATCH] Bug #9173: Change the default Firefox profile directory to be
 This should eliminate our need to rely on a wrapper script that sets $HOME and
 launches Firefox with -profile.
 ---
- toolkit/xre/nsXREDirProvider.cpp       | 150 +++++++--------------------------
+ toolkit/xre/nsXREDirProvider.cpp       | 153 ++++++++-------------------------
  toolkit/xre/nsXREDirProvider.h         |  10 +--
  xpcom/io/moz.build                     |   4 +
- xpcom/io/nsAppFileLocationProvider.cpp |  93 ++++++++------------
- 4 files changed, 73 insertions(+), 184 deletions(-)
+ xpcom/io/nsAppFileLocationProvider.cpp |  96 ++++++++-------------
+ 4 files changed, 79 insertions(+), 184 deletions(-)
 
 diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp
-index c496a14ce84a..c3cb676f7184 100644
+index c496a14ce84a..689cb0f8ecb1 100644
 --- a/toolkit/xre/nsXREDirProvider.cpp
 +++ b/toolkit/xre/nsXREDirProvider.cpp
 @@ -33,6 +33,7 @@
@@ -45,7 +45,7 @@ index c496a14ce84a..c3cb676f7184 100644
      // We must create the profile directory here if it does not exist.
      nsresult tmp = EnsureDirectoryExists(file);
      if (NS_FAILED(tmp)) {
-@@ -1212,82 +1207,42 @@ nsresult
+@@ -1212,82 +1207,45 @@ nsresult
  nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile, bool aLocal)
  {
    // Copied from nsAppFileLocationProvider (more or less)
@@ -74,7 +74,10 @@ index c496a14ce84a..c3cb676f7184 100644
  
 -  nsCOMPtr<nsILocalFileMac> dirFileMac = do_QueryInterface(localDir);
 -  NS_ENSURE_TRUE(dirFileMac, NS_ERROR_UNEXPECTED);
-+  int levelsToRemove = 1; // In FF21+, appDir points to browser subdirectory.
++  int levelsToRemove = 0;
++#if defined(XP_MACOSX)
++  levelsToRemove += 1;
++#endif
 +  while (localDir && (levelsToRemove > 0)) {
 +    // When crawling up the hierarchy, components named "." do not count.
 +    nsAutoCString removedName;
@@ -97,16 +100,16 @@ index c496a14ce84a..c3cb676f7184 100644
 -    rv = GetShellFolderPath(CSIDL_LOCAL_APPDATA, path);
 -    if (NS_FAILED(rv))
 -      rv = GetRegWindowsAppDataFolder(aLocal, path);
--  }
++    if (didRemove)
++      --levelsToRemove;
+   }
 -  if (!aLocal || NS_FAILED(rv)) {
 -    rv = GetShellFolderPath(CSIDL_APPDATA, path);
 -    if (NS_FAILED(rv)) {
 -      if (!aLocal)
 -        rv = GetRegWindowsAppDataFolder(aLocal, path);
 -    }
-+    if (didRemove)
-+      --levelsToRemove;
-   }
+-  }
 -  NS_ENSURE_SUCCESS(rv, rv);
  
 -  rv = NS_NewLocalFile(path, true, getter_AddRefs(localDir));
@@ -151,7 +154,7 @@ index c496a14ce84a..c3cb676f7184 100644
  
    NS_IF_ADDREF(*aFile = localDir);
    return rv;
-@@ -1500,48 +1455,25 @@ nsXREDirProvider::AppendProfilePath(nsIFile* aFile,
+@@ -1500,48 +1458,25 @@ nsXREDirProvider::AppendProfilePath(nsIFile* aFile,
    }
  
    nsAutoCString profile;
@@ -203,7 +206,7 @@ index c496a14ce84a..c3cb676f7184 100644
  
  #elif defined(ANDROID)
    // The directory used for storing profiles
-@@ -1553,12 +1485,6 @@ nsXREDirProvider::AppendProfilePath(nsIFile* aFile,
+@@ -1553,12 +1488,6 @@ nsXREDirProvider::AppendProfilePath(nsIFile* aFile,
    rv = aFile->AppendNative(nsDependentCString("mozilla"));
    NS_ENSURE_SUCCESS(rv, rv);
  #elif defined(XP_UNIX)
@@ -216,7 +219,7 @@ index c496a14ce84a..c3cb676f7184 100644
    if (!profile.IsEmpty()) {
      // Skip any leading path characters
      const char* profileStart = profile.get();
-@@ -1567,31 +1493,17 @@ nsXREDirProvider::AppendProfilePath(nsIFile* aFile,
+@@ -1567,31 +1496,17 @@ nsXREDirProvider::AppendProfilePath(nsIFile* aFile,
  
      // On the off chance that someone wanted their folder to be hidden don't
      // let it become ".."
@@ -301,7 +304,7 @@ index b4dfc03b4683..6e1936fe8666 100644
 +
  GENERATED_INCLUDES += ['..']
 diff --git a/xpcom/io/nsAppFileLocationProvider.cpp b/xpcom/io/nsAppFileLocationProvider.cpp
-index a5c71e723907..e71e653b08ab 100644
+index a5c71e723907..f93e7f430996 100644
 --- a/xpcom/io/nsAppFileLocationProvider.cpp
 +++ b/xpcom/io/nsAppFileLocationProvider.cpp
 @@ -14,6 +14,7 @@
@@ -324,7 +327,7 @@ index a5c71e723907..e71e653b08ab 100644
  //----------------------------------------------------------------------------------------
  NS_METHOD
  nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
-@@ -295,48 +295,42 @@ nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
+@@ -295,48 +295,45 @@ nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
    bool exists;
    nsCOMPtr<nsIFile> localDir;
  
@@ -338,7 +341,10 @@ index a5c71e723907..e71e653b08ab 100644
 +  rv = CloneMozBinDirectory(getter_AddRefs(localDir));
 +  NS_ENSURE_SUCCESS(rv, rv);
 +
-+  int levelsToRemove = 1; // In FF21+, bin dir points to browser subdirectory.
++  int levelsToRemove = 0;
++#if defined(XP_MACOSX)
++  levelsToRemove += 1;
++#endif
 +  while (localDir && (levelsToRemove > 0)) {
 +    // When crawling up the hierarchy, components named "." do not count.
 +    nsAutoCString removedName;
@@ -403,7 +409,7 @@ index a5c71e723907..e71e653b08ab 100644
    rv = localDir->Exists(&exists);
  
    if (NS_SUCCEEDED(rv) && !exists) {
-@@ -356,10 +350,6 @@ nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
+@@ -356,10 +353,6 @@ nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
  
  //----------------------------------------------------------------------------------------
  // GetDefaultUserProfileRoot - Gets the directory which contains each user profile dir
@@ -414,7 +420,7 @@ index a5c71e723907..e71e653b08ab 100644
  //----------------------------------------------------------------------------------------
  NS_METHOD
  nsAppFileLocationProvider::GetDefaultUserProfileRoot(nsIFile** aLocalFile,
-@@ -377,23 +367,6 @@ nsAppFileLocationProvider::GetDefaultUserProfileRoot(nsIFile** aLocalFile,
+@@ -377,23 +370,6 @@ nsAppFileLocationProvider::GetDefaultUserProfileRoot(nsIFile** aLocalFile,
      return rv;
    }
  



More information about the tor-commits mailing list