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 <pwithnall@gnome.org> Helps: https://github.com/systemd/systemd/issues/41502
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user