aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-10 04:30:51 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-10 04:30:51 +0000
commit09d0c74f87dc42d58bdc6b26fe4af12a19f86052 (patch)
treeefc963da8b9a77519ff14da94627cf71cc03e75c
parent6c9837567e10d1208af4b841588800c54e4d0979 (diff)
downloadpaludis-09d0c74f87dc42d58bdc6b26fe4af12a19f86052.tar.gz
paludis-09d0c74f87dc42d58bdc6b26fe4af12a19f86052.tar.xz
Set and use PALUDIS_HOME over HOME, if available, to avoid breaking has_version et al when HOME=T and our config directory is under HOME
-rw-r--r--ebuild/builtin_init.bash1
-rw-r--r--paludis/default_config.cc3
2 files changed, 3 insertions, 1 deletions
diff --git a/ebuild/builtin_init.bash b/ebuild/builtin_init.bash
index ad4fe88..959205b 100644
--- a/ebuild/builtin_init.bash
+++ b/ebuild/builtin_init.bash
@@ -42,6 +42,7 @@ builtin_init()
export T="${PALUDIS_TMPDIR}/${CATEGORY}/${PF}/temp/"
mkdir -p "${T}" || die "Couldn't create \$T (\"${T}\")"
declare -r T="${T}"
+ export PALUDIS_HOME="${HOME}"
export HOME="${T}"
export D="${PALUDIS_TMPDIR}/${CATEGORY}/${PF}/image/"
diff --git a/paludis/default_config.cc b/paludis/default_config.cc
index 02e5bbf..caac486 100644
--- a/paludis/default_config.cc
+++ b/paludis/default_config.cc
@@ -58,7 +58,8 @@ DefaultConfig::DefaultConfig() :
if (! _config_suffix.empty())
config_suffix = "-" + _config_suffix;
- FSEntry config_dir(FSEntry(getenv_or_error("HOME")) / (".paludis" + config_suffix));
+ FSEntry config_dir(FSEntry(getenv_with_default("PALUDIS_HOME", getenv_or_error("HOME"))) /
+ (".paludis" + config_suffix));
if (! config_dir.exists())
config_dir = (FSEntry(SYSCONFDIR) / ("paludis" + config_suffix));
if (! config_dir.exists())