diff options
author | Vaxry <[email protected]> | 2024-01-29 10:30:31 +0000 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-01-29 10:30:31 +0000 |
commit | 91e8c428431deac1e5eb8e537f002ab960777174 (patch) | |
tree | 05b0fedfe78628a1d265e388bbff5e1549615519 /hyprpm | |
parent | 4b4bd90b1450cbfc01d9ac429363cc7cecd6be8b (diff) | |
download | Hyprland-91e8c428431deac1e5eb8e537f002ab960777174.tar.gz Hyprland-91e8c428431deac1e5eb8e537f002ab960777174.zip |
hyprpm: don't update headers if they are up-to-date, only recompile
will not update headers if plugins are compiled for different ones, and instead only compile.
ref #4284
Diffstat (limited to 'hyprpm')
-rw-r--r-- | hyprpm/src/core/PluginManager.cpp | 9 | ||||
-rw-r--r-- | hyprpm/src/main.cpp | 7 |
2 files changed, 8 insertions, 8 deletions
diff --git a/hyprpm/src/core/PluginManager.cpp b/hyprpm/src/core/PluginManager.cpp index f07c8645..e9429814 100644 --- a/hyprpm/src/core/PluginManager.cpp +++ b/hyprpm/src/core/PluginManager.cpp @@ -310,9 +310,7 @@ eHeadersErrors CPluginManager::headersValid() { hash = hash.substr(hash.find_first_of('"') + 1); hash = hash.substr(0, hash.find_first_of('"')); - auto GLOBALSTATE = DataState::getGlobalState(); - - if (hash != HLVER.hash || hash != GLOBALSTATE.headersHashCompiled) + if (hash != HLVER.hash) return HEADERS_MISMATCHED; return HEADERS_OK; @@ -328,10 +326,7 @@ bool CPluginManager::updateHeaders(bool force) { } if (!force && headersValid() == HEADERS_OK) { - std::cout << "\n" << std::string{Colors::GREEN} + "✔" + Colors::RESET + " Your headers are already up-to-date.\n"; - auto GLOBALSTATE = DataState::getGlobalState(); - GLOBALSTATE.headersHashCompiled = HLVER.hash; - DataState::updateGlobalState(GLOBALSTATE); + std::cout << "\n" << std::string{Colors::GREEN} + "✔" + Colors::RESET + " Headers up to date.\n"; return true; } diff --git a/hyprpm/src/main.cpp b/hyprpm/src/main.cpp index cf52db0c..37972443 100644 --- a/hyprpm/src/main.cpp +++ b/hyprpm/src/main.cpp @@ -1,6 +1,7 @@ #include "progress/CProgressBar.hpp" #include "helpers/Colors.hpp" #include "core/PluginManager.hpp" +#include "core/DataState.hpp" #include <iostream> #include <vector> @@ -88,7 +89,11 @@ int main(int argc, char** argv, char** envp) { bool headersValid = g_pPluginManager->headersValid() == HEADERS_OK; bool headers = g_pPluginManager->updateHeaders(force); if (headers) { - bool ret1 = g_pPluginManager->updatePlugins(!headersValid || force); + const auto HLVER = g_pPluginManager->getHyprlandVersion(); + auto GLOBALSTATE = DataState::getGlobalState(); + const auto COMPILEDOUTDATED = HLVER.hash != GLOBALSTATE.headersHashCompiled; + + bool ret1 = g_pPluginManager->updatePlugins(!headersValid || force || COMPILEDOUTDATED); if (!ret1) return 1; |