[core] Check variant_path when updating config file (#89)
This commit is contained in:
parent
4a96345b21
commit
5c1997f64d
|
|
@ -214,12 +214,17 @@ namespace lspd {
|
|||
}
|
||||
|
||||
fs::file_time_type ConfigManager::GetLastWriteTime() const {
|
||||
auto config_path = GetConfigPath();
|
||||
auto list_path = GetConfigPath("modules.list");
|
||||
return std::max({path_exists<true>(config_path) ? fs::last_write_time(config_path)
|
||||
: fs::file_time_type{},
|
||||
path_exists<true>(list_path) ? fs::last_write_time(list_path)
|
||||
: fs::file_time_type{},});
|
||||
auto last_write_time = [](std::string_view path) __attribute__((always_inline)) {
|
||||
return path_exists<true>(path) ? fs::last_write_time(path) : fs::file_time_type{};
|
||||
};
|
||||
std::string config_path = GetConfigPath();
|
||||
std::string list_path = GetConfigPath("modules.list");
|
||||
std::string variant_path = GetVariantPath();
|
||||
return std::max({
|
||||
last_write_time(config_path),
|
||||
last_write_time(list_path),
|
||||
last_write_time(variant_path)
|
||||
});
|
||||
}
|
||||
|
||||
bool ConfigManager::InitConfigPath() const {
|
||||
|
|
|
|||
|
|
@ -130,8 +130,6 @@ namespace lspd {
|
|||
|
||||
ConfigManager(uid_t uid, bool initialized = false);
|
||||
|
||||
static std::unordered_set<std::string> GetAppList(const std::filesystem::path &dir);
|
||||
|
||||
std::string RetrieveInstallerPkgName() const;
|
||||
|
||||
static std::string GetPackageNameFromBaseApkPath(const std::filesystem::path &path);
|
||||
|
|
|
|||
Loading…
Reference in New Issue