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