}
std::string
-Config::default_temporary_dir(const std::string& cache_dir)
+Config::default_temporary_dir() const
{
static const std::string run_user_tmp_dir = [] {
#ifdef HAVE_GETEUID
#endif
return std::string();
}();
- return !run_user_tmp_dir.empty() ? run_user_tmp_dir : cache_dir + "/tmp";
+ return !run_user_tmp_dir.empty() ? run_user_tmp_dir : m_cache_dir + "/tmp";
}
// Return true for MSVC (cl.exe) and clang-cl.
bool is_compiler_group_msvc() const;
+ std::string default_temporary_dir() const;
+
void set_base_dir(const std::string& value);
void set_cache_dir(const std::string& value);
void set_compiler(const std::string& value);
const nonstd::optional<std::string>& env_var_key,
bool negate,
const std::string& origin);
-
- static std::string default_temporary_dir(const std::string& cache_dir);
};
inline bool
{
m_cache_dir = value;
if (!m_temporary_dir_configured_explicitly) {
- m_temporary_dir = default_temporary_dir(m_cache_dir);
+ m_temporary_dir = default_temporary_dir();
}
}
{
MTR_SCOPE("primary_storage", "clean_internal_tempdir");
- if (m_config.temporary_dir() == m_config.cache_dir() + "/tmp") {
+ if (m_config.temporary_dir() == m_config.default_temporary_dir()) {
clean_internal_tempdir();
}
}