On main: cline checkpoint session=1789068735674_bk9xf run=1
This commit is contained in:
commit
f894c2a69c
11 files changed
+700
-112
No files matched your search
@@ -5,6 +5,7 @@
|
||||
#include <QNetworkReply>
|
||||
#include <QDateTime>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QProcess>
|
||||
|
||||
// Checks the Gitea repository for new releases and tracks the last check
|
||||
@@ -49,6 +50,15 @@ public:
|
||||
QString tarballUrl() const;
|
||||
QString releasePageUrl() const;
|
||||
|
||||
// Prebuilt binary archive attached to the release
|
||||
// (PacManager-<version>-x86_64.tar.gz), when the release workflow
|
||||
// uploaded one. Preferred over the source tarball: no compiler needed.
|
||||
QString prebuiltUrl() const;
|
||||
|
||||
// True when the pending update can be applied by unpacking a prebuilt
|
||||
// archive instead of recompiling from source.
|
||||
bool hasPrebuiltUpdate() const;
|
||||
|
||||
// Install prefix the running binary was installed to (e.g. ~/.local,
|
||||
// /usr/local, /usr). Used to reinstall the fresh build at the same place.
|
||||
QString installPrefix() const;
|
||||
@@ -62,6 +72,11 @@ public:
|
||||
// `sudo` will prompt on its own if needed). Emits selfUpdateFinished.
|
||||
void performSelfUpdate(const QString& sudoPassword = QString());
|
||||
|
||||
// Pre-flight: missing tools that would make the source path fail
|
||||
// (e.g. "cmake", "g++"). Empty when a prebuilt archive is available
|
||||
// (no compiler needed) or every tool is present.
|
||||
QStringList missingSelfUpdateTools() const;
|
||||
|
||||
signals:
|
||||
// Emitted after a check completes. hasUpdate is true when a newer
|
||||
// release exists; errorMessage is non-empty when the request failed.
|
||||
@@ -76,6 +91,12 @@ private:
|
||||
void saveState(const QString& remoteVersion);
|
||||
void loadState();
|
||||
void runShell(const QString& script, const QString& workingDir);
|
||||
void performPrebuiltUpdate(const QString& sudoPassword);
|
||||
void performTarballUpdate(const QString& sudoPassword);
|
||||
QString installCommand(const QString& quotedPassword,
|
||||
const QString& action) const;
|
||||
static QString quoteShell(const QString& s);
|
||||
static QString quotedPassword(const QString& sudoPassword);
|
||||
|
||||
QNetworkAccessManager m_network;
|
||||
QProcess m_process; // runs the git pull + build script
|
||||
@@ -83,6 +104,7 @@ private:
|
||||
QString m_lastKnownRemoteVersion; // latest version seen on the server
|
||||
QString m_latestVersion; // version of the pending update
|
||||
QString m_tarballUrl; // source tarball for the pending update
|
||||
QString m_prebuiltUrl; // prebuilt binary archive, when attached
|
||||
QString m_releasePageUrl; // human-readable release page
|
||||
QString m_repoPath; // source repo dir when found
|
||||
};
|
||||
Reference in new issue
Block a user