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
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;