[pve-devel] [PATCH proxmox master stable-2 1/2] apt: repos: extend `Codename` by `Unknown` variant
    Christian Ebner 
    c.ebner at proxmox.com
       
    Tue Feb  6 09:48:29 CET 2024
    
    
  
> >  
> > -                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.
> 
> As for the match, you could pull in the case where the suite is older
> (the if block just above this code) and rather do an exhaustive match.
    
    
More information about the pve-devel
mailing list