[pve-devel] [PATCH proxmox master stable-2 1/2] apt: repos: extend `Codename` by `Unknown` variant
Fiona Ebner
f.ebner at proxmox.com
Tue Feb 6 09:59:34 CET 2024
Am 06.02.24 um 09:48 schrieb Christian Ebner:
>
>>>
>>> - if Some(codename) == current_codename.next() {
>>> - add_info("ignore-pre-upgrade-warning", message_new(base_suite));
>>> - } else if codename > current_codename {
>>> - add_info("warning", message_new(base_suite));
>>> + match current_codename.next() {
>>> + name if name == codename => {
>>> + add_info("ignore-pre-upgrade-warning", message_new(base_suite));
>>> + }
>>> + DebianCodename::Unknown(_, _) if codename > current_codename => {
>>> + add_info("warning", message_new(base_suite));
>>> + }
>>> + _ => {}
>>
>> Like this, the warning is lost when we match a known codename that is
>> newer than the current one. What is the issue with the current code you
>> are trying to address?
>
> There is no issue with the current code, I just refactored it to use the newly introduced variant instead of the Option.
> Am I missing something? This should behave just like the code before.
>
You only match the current codename and DebianCodename::Unknown(_, _).
Any known newer codename will just fall through to the default arm (and
the default arm can/should be avoided by pulling in the check for the
older codename from above).
More information about the pve-devel
mailing list