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 <pwithnall@gnome.org>

Helps: https://github.com/systemd/systemd/issues/41502
This commit is contained in:
Philip Withnall
2026-04-24 15:29:34 +01:00
parent 2babac9013
commit e1146fe710
+7 -4
View File
@@ -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;
}