Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 May 2021 10:30:23 +0200 (CEST)
From:      Ronald Klop <ronald-lists@klop.ws>
To:        freebsd-ports@freebsd.org, Tatsuki Makino <tatsuki_makino@hotmail.com>
Subject:   Re: I thought "pkg updating" would alert me about python...?
Message-ID:  <71613459.703.1620030623950@localhost>
In-Reply-To: <PSAPR03MB56392A926125C1AB54DB264DFA5C9@PSAPR03MB5639.apcprd03.prod.outlook.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Van: Tatsuki Makino <tatsuki_makino@hotmail.com>
Datum: 2 mei 2021 22:36
Aan: Ronald Klop <ronald-lists@klop.ws>, freebsd-ports@freebsd.org
Onderwerp: Re: I thought "pkg updating" would alert me about python...?

>=20
>=20
> Ronald Klop wrote on 2021/05/03 05:14:
> > The UPDATING entry should have said something like "users of lang/pytho=
n*" to work.
>=20
> The behavior of this is strange.
> I have the following python* in my environment.
> python, python27, python3, python37 and python38
>=20
> 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
>=20
> package names are also comparable.
> Does it not pattern match if the pattern match symbol ?, [] or * is not i=
ncluded?
>=20
> Regards.
>=20
>=20
>=20
>=20
>=20


If I read the pkg source correctly it uses regex with some glob-like prepar=
ation like converting * to .*.https://github.com/freebsd/pkg/blob/62302ab4b=
4d69528e155ea7b68f058a05d6dffdd/src/updating.c#L71And it indeed checks if t=
he word contains regex characters. If not it compares with strcmp.
strpbrk(words[i],"^$*|?") =3D=3D NULL



What is remarkable is that it compares to "origin". I think origin is the f=
ull portname "lang/python". The regex match also matches a substring of ori=
gin.


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. =F0=9F=98=85

Regards,Ronald



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?71613459.703.1620030623950>