[pbs-devel] [pve-devel] [PATCH v6 proxmox-apt 04/11] add check_repositories function

Wolfgang Bumiller w.bumiller at proxmox.com
Fri Jun 18 08:44:29 CEST 2021


> On 06/18/2021 8:42 AM Fabian Ebner <f.ebner at proxmox.com> wrote:
> >> +            Some((last, rest)) => match rest.split_last() {
> >> +                Some((second_to_last, _rest)) => {
> >> +                    (*last == "org" && *second_to_last == "debian")
> >> +                        || (*last == "com" && *second_to_last == "proxmox")
> >> +                }
> >> +                None => false,
> >> +            },
> >> +            None => false,
> >> +        };
> >> +
> >> +        for uri in self.uris.iter() {
> >> +            if let Some(host) = host_from_uri(uri) {
> >> +                let domains = host.split('.').collect();
> > 
> > ^ But instead of building a vector here, why not just do:
> > 
> >      if host == "proxmox.com" || host.ends_with(".proxmox.com")
> >          || host == "debian.org" || host.ends_with(".debian.org")
> >      {
> >          ...
> >      }
> > 
> 
> Misses FQDNs?

Such as?





More information about the pbs-devel mailing list