From: Philip Withnall Date: Wed, 22 Apr 2026 16:28:31 +0000 (+0100) Subject: sysupdate: Allow a partial version to be vacuumed X-Git-Tag: v260.2~186 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91bcaef53839e7e16b9e8d31bfc702b8e090e8b0;p=thirdparty%2Fsystemd.git sysupdate: Allow a partial version to be vacuumed Previously we prevented partial and pending versions from being vacuumed. But until we support resuming downloads, there’s nothing else which can be done with a partial version except to vacuum it and try again. Accordingly, allow partial versions (but not pending versions) to be vacuumed. This behaviour can be changed again once resuming downloads is supported — at that point I expect we’ll want to try resuming the partial download rather than throwing it all away and trying again. Signed-off-by: Philip Withnall Helps: https://github.com/systemd/systemd/issues/41502 (cherry picked from commit e1146fe710d0d1bbe0fdca974f66edd7f6c573cc) --- diff --git a/src/sysupdate/sysupdate-transfer.c b/src/sysupdate/sysupdate-transfer.c index 35c0e05083b..231b7cc5ba0 100644 --- a/src/sysupdate/sysupdate-transfer.c +++ b/src/sysupdate/sysupdate-transfer.c @@ -816,10 +816,13 @@ int transfer_vacuum( continue; } - /* If this is listed among the protected versions, then let's not remove it */ - if (strv_contains(t->protected_versions, instance->metadata.version) || - (extra_protected_version && streq(extra_protected_version, instance->metadata.version))) { - log_debug("Version '%s' is pending/partial but protected, not removing.", instance->metadata.version); + /* If this is pending and listed among the protected versions, then let's not remove it. + * In future, we will also want to keep partial protected versions, but that’s only useful + * once we support resuming downloads. */ + if (instance->is_pending && + (strv_contains(t->protected_versions, instance->metadata.version) || + (extra_protected_version && streq(extra_protected_version, instance->metadata.version)))) { + log_debug("Version '%s' is pending but protected, not removing.", instance->metadata.version); i++; continue; }