diff options
Diffstat (limited to 'xdg-basedir.patch')
-rw-r--r-- | xdg-basedir.patch | 62 |
1 files changed, 32 insertions, 30 deletions
diff --git a/xdg-basedir.patch b/xdg-basedir.patch index b5d14a3ffee1..708dab17882d 100644 --- a/xdg-basedir.patch +++ b/xdg-basedir.patch @@ -2,34 +2,6 @@ # builds to follow the XDG Base Directory Specification. For details, refer to # https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html ---- a/base/nix/xdg_util.cc -+++ b/base/nix/xdg_util.cc -@@ -30,6 +30,8 @@ const char kDotConfigDir[] = ".config"; - const char kXdgConfigHomeEnvVar[] = "XDG_CONFIG_HOME"; - const char kXdgCurrentDesktopEnvVar[] = "XDG_CURRENT_DESKTOP"; - const char kXdgSessionTypeEnvVar[] = "XDG_SESSION_TYPE"; -+const char kDotDataDir[] = ".local/share"; -+const char kXdgDataHomeEnvVar[] = "XDG_DATA_HOME"; - - FilePath GetXDGDirectory(Environment* env, const char* env_name, - const char* fallback_dir) { - ---- a/base/nix/xdg_util.h -+++ b/base/nix/xdg_util.h -@@ -61,6 +61,12 @@ BASE_EXPORT extern const char kXdgCurrentDesktopEnvVar[]; - // The XDG session type environment variable. - BASE_EXPORT extern const char kXdgSessionTypeEnvVar[]; - -+// The default XDG data directory name. -+BASE_EXPORT extern const char kDotDataDir[]; -+ -+// The XDG data directory environment variable. -+BASE_EXPORT extern const char kXdgDataHomeEnvVar[]; -+ - // Utility function for getting XDG directories. - // |env_name| is the name of an environment variable that we want to use to get - // a directory path. |fallback_dir| is the directory relative to $HOME that we - --- a/crypto/nss_util.cc +++ b/crypto/nss_util.cc @@ -30,6 +30,9 @@ @@ -42,7 +14,7 @@ namespace crypto { -@@ -45,12 +48,21 @@ static const base::FilePath::CharType kReadOnlyCertDB[] = +@@ -45,12 +48,25 @@ static const base::FilePath::CharType kReadOnlyCertDB[] = base::FilePath GetDefaultConfigDirectory() { base::FilePath dir; @@ -53,8 +25,11 @@ base::PathService::Get(base::DIR_HOME, &dir); +#endif if (dir.empty()) { -- LOG(ERROR) << "Failed to get home directory."; ++#if defined(OS_LINUX) + LOG(ERROR) << "Failed to get $HOME or $XDG_DATA_HOME directory."; ++#else + LOG(ERROR) << "Failed to get home directory."; ++#endif return dir; } +#if defined(OS_LINUX) @@ -65,3 +40,30 @@ if (!base::CreateDirectory(dir)) { LOG(ERROR) << "Failed to create " << dir.value() << " directory."; dir.clear(); +--- a/base/nix/xdg_util.cc ++++ b/base/nix/xdg_util.cc +@@ -41,6 +41,9 @@ std::optional<std::string>& GetXdgActivationToken() { + + namespace base::nix { + ++const char kDotDataDir[] = ".local/share"; ++const char kXdgDataHomeEnvVar[] = "XDG_DATA_HOME"; ++ + const char kDotConfigDir[] = ".config"; + const char kXdgConfigHomeEnvVar[] = "XDG_CONFIG_HOME"; + const char kXdgCurrentDesktopEnvVar[] = "XDG_CURRENT_DESKTOP"; +--- a/base/nix/xdg_util.h ++++ b/base/nix/xdg_util.h +@@ -72,6 +72,12 @@ BASE_EXPORT extern const char kXdgConfigHomeEnvVar[]; + // The XDG current desktop environment variable. + BASE_EXPORT extern const char kXdgCurrentDesktopEnvVar[]; + ++// The default XDG data directory name. ++BASE_EXPORT extern const char kDotDataDir[]; ++ ++// The XDG data directory environment variable. ++BASE_EXPORT extern const char kXdgDataHomeEnvVar[]; ++ + // The XDG session type environment variable. + BASE_EXPORT extern const char kXdgSessionTypeEnvVar[]; + |