From: Philip Withnall Date: Wed, 22 Apr 2026 16:25:44 +0000 (+0100) Subject: sysupdate: Allow a partial version to be the candidate X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2babac90137ea4b6a70958133c783131d2619051;p=thirdparty%2Fsystemd.git sysupdate: Allow a partial version to be the candidate Previously we allowed a pending version to be the candidate — but if there are no better choices, then we might as well allow a partial version to be candidate as well. The alternative is having no update candidate when a new version is partially installed (i.e. downloaded but not moved into place). This would mean that an update which is interrupted then needs to be re-run with an explicit version number to progress, rather than being able to be re-run without a version number (as it was in the first place). Signed-off-by: Philip Withnall Helps: https://github.com/systemd/systemd/issues/41502 --- diff --git a/src/sysupdate/sysupdate.c b/src/sysupdate/sysupdate.c index 89efe36c857..cba7960f0be 100644 --- a/src/sysupdate/sysupdate.c +++ b/src/sysupdate/sysupdate.c @@ -505,8 +505,9 @@ static int context_discover_update_sets_by_flag(Context *c, UpdateSetFlags flags c->candidate && strverscmp_improved(c->newest_installed->version, c->candidate->version) >= 0) c->candidate = NULL; - /* Newest installed is still pending and no candidate is set? Then it becomes the candidate. */ - if (c->newest_installed && FLAGS_SET(c->newest_installed->flags, UPDATE_PENDING) && + /* Newest installed is still pending or partial and no candidate is set? Then it becomes the candidate. */ + if (c->newest_installed && + (c->newest_installed->flags & (UPDATE_PENDING|UPDATE_PARTIAL)) && !c->candidate) c->candidate = c->newest_installed;