fix(update): report the newest known version, not just the compiled one

Trusting the version compiled into the binary alone made the app report a stale
release whenever the build predated a version bump: `version` is read at
configure time, and bumping it is not by itself a reason to configure again, so
`cmake --build` kept the previous number compiled in while the marker it
installed next to the binary said otherwise. The update was then offered again
even though it had just been applied.

The version file is now a configure dependency, so a bump reconfigures the
build, and the reported version is the newest of the two sources, so neither
side can drag the app backwards.

Generated with Codebuff 🤖
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
BlackAngelTV committed 2026-09-12 23:05:23 +02:00
1 parent fb5c11e153
commit 5216480d81
6 files changed
+75 -31

No files matched your search

+6 -3
View File
@@ -139,9 +139,12 @@ binary (and plugins) needs `sudo`, and only when the target directory is owned
by root. PacManager then restarts automatically on the new version.
All four methods install to the same place — the running binary's directory —
and rewrite the `version` file there. On top of that, the app reports the
version **compiled into the binary** (from the repo's `version` file) first, so
the same update is never offered again once it has been applied.
and rewrite the `version` file there. To know which release is really installed,
PacManager keeps the **newest** of two sources: the version compiled into the
binary (read from the repo's `version` file at configure time) and the one in the
`version` file next to the executable. An applied update is therefore never
offered again, even when one of the two lags behind (a binary rebuilt without
configuring again, an install older than the binary).
## Graphical interface