I thought "pkg updating" would alert me about python...?
Ronald Klop
ronald-lists at klop.ws
Mon May 3 08:30:27 UTC 2021
Van: Tatsuki Makino <tatsuki_makino at hotmail.com>
Datum: 2 mei 2021 22:36
Aan: Ronald Klop <ronald-lists at klop.ws>, freebsd-ports at freebsd.org
Onderwerp: Re: I thought "pkg updating" would alert me about python...?
>
>
> Ronald Klop wrote on 2021/05/03 05:14:
> > The UPDATING entry should have said something like "users of lang/python*" to work.
>
> The behavior of this is strange.
> I have the following python* in my environment.
> python, python27, python3, python37 and python38
>
> AFFECTS: users of python : not match
> AFFECTS: users of pytho? : match
> AFFECTS: users of python3 : not match
> AFFECTS: users of python* : match
> AFFECTS: users of python3[7] : match
>
> package names are also comparable.
> Does it not pattern match if the pattern match symbol ?, [] or * is not included?
>
> Regards.
>
>
>
>
>
If I read the pkg source correctly it uses regex with some glob-like preparation like converting * to .*.https://github.com/freebsd/pkg/blob/62302ab4b4d69528e155ea7b68f058a05d6dffdd/src/updating.c#L71And it indeed checks if the word contains regex characters. If not it compares with strcmp.
strpbrk(words[i],"^$*|?") == NULL
What is remarkable is that it compares to "origin". I think origin is the full portname "lang/python". The regex match also matches a substring of origin.
This would explain why pytho? matches, but python didn't.
NB: this is by looking at the C code for a minute with my rusty C skills. I might have overlooked something. 😅
Regards,Ronald
More information about the freebsd-ports
mailing list