feat(update): self-update from a cloned repo wherever the app is installed
Self-update assumed a conventional install prefix (silently reinstalling into ~/.local when the binary lived elsewhere) and needed a release tarball to do anything. Pick the strategy from what the machine actually has -- a local checkout, git+cmake+compiler for a clone, the prebuilt archive, or the release sources -- and always write the fresh binary next to the running one, building in a temp directory so sudo is only needed for the final copy. Bundles the UI work that depends on it (tray, shortcuts, log filter, CSV exports, cached package details), the structured log categories, and the new test targets (update-manager, AUR, plugins) wired into CTest. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
1 parent
6d5b4274c4
commit
54bff16369
9 files changed
+1123
-200
No files matched your search
+15
-2
@@ -1,16 +1,25 @@
|
||||
#include "plugin-manager.h"
|
||||
#include "app-logging.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QCoreApplication>
|
||||
|
||||
// Plugin directories, checked in order. Bundled plugins ship next to the
|
||||
// executable; user plugins live under the standard data directory so they
|
||||
// survive application updates.
|
||||
// executable (<prefix>/bin/plugins after install); user plugins live under
|
||||
// the standard data directory so they survive application updates.
|
||||
static QStringList pluginSearchPaths() {
|
||||
QStringList paths;
|
||||
paths << QCoreApplication::applicationDirPath() + "/plugins";
|
||||
paths << QDir::homePath() + "/.local/share/PacManager/plugins";
|
||||
// System-wide plugins: <prefix>/lib/PacManager/plugins for installs to
|
||||
// /usr or /usr/local (covers both lib and lib64 layouts).
|
||||
const QString appDir = QCoreApplication::applicationDirPath();
|
||||
QDir prefix(appDir);
|
||||
if (prefix.dirName() == QLatin1String("bin") && prefix.cdUp()) {
|
||||
paths << prefix.absoluteFilePath("lib/PacManager/plugins");
|
||||
paths << prefix.absoluteFilePath("lib64/PacManager/plugins");
|
||||
}
|
||||
return paths;
|
||||
}
|
||||
|
||||
@@ -59,6 +68,8 @@ bool PluginManager::loadPluginFile(const QString& filePath) {
|
||||
// as long as the addon/manager instance created from it exists.
|
||||
QLibrary* library = new QLibrary(filePath);
|
||||
if (!library->load()) {
|
||||
qCWarning(pacmgrPlugin) << "not a loadable plugin, skipping" << filePath
|
||||
<< library->errorString();
|
||||
delete library;
|
||||
return false;
|
||||
}
|
||||
@@ -124,6 +135,8 @@ bool PluginManager::loadPluginFile(const QString& filePath) {
|
||||
info.available = manager->isAvailable();
|
||||
m_plugins.push_back({std::move(info), nullptr, manager, library});
|
||||
}
|
||||
qCDebug(pacmgrPlugin) << "loaded" << (isAddon ? "addon" : "provider")
|
||||
<< filePath << "available" << m_plugins.back().info.available;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user