Date: Thu, 31 Oct 2024 18:06:17 -0700 From: Mark Millard <marklmi@yahoo.com> To: Ed Maste <emaste@freebsd.org> Cc: dev-commits-src-main@freebsd.org Subject: Re: git: cf1aba2857c1 - main - freebsd-update: refuse to operate on a pkgbase system Message-ID: <4A23041D-4BDC-4F8E-BB20-2D6C5619A08C@yahoo.com> In-Reply-To: <22FC2477-98CF-419D-95EF-C999F8841525@yahoo.com> References: <7FF78752-80EB-47CA-9E60-515607D3CFE5.ref@yahoo.com> <7FF78752-80EB-47CA-9E60-515607D3CFE5@yahoo.com> <CAPyFy2A-nRCmA%2BT%2BovdxcrKS-bDrGF8E-dmCJZ%2BNuYnCmekuqQ@mail.gmail.com> <22FC2477-98CF-419D-95EF-C999F8841525@yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Oct 31, 2024, at 17:53, Mark Millard <marklmi@yahoo.com> wrote:
> On Oct 31, 2024, at 16:37, Ed Maste <emaste@freebsd.org> wrote:
>=20
>> On Thu, 31 Oct 2024 at 15:17, Mark Millard <marklmi@yahoo.com> wrote:
>>>=20
>>>> + # Presence of FreeBSD-* package(s) indicates packaged base.
>>>> + if ! pkg -c ${BASEDIR} info -q -x '^FreeBSD' 2>/dev/null; then
>>>=20
>>> Slight difference in the comment vs. the code's behavior? :
>>>=20
>>> Comment: FreeBSD-*
>>> Code:    FreeBSD*
>>=20
>> The code is a regex ^FreeBSD while I wrote the comment thinking of a
>> shell glob - it's fine that they're not identical (except for this
>> confusion).
>=20
> FYI in case it is not clear:
>=20
> I understood the 2 distinct notations. I was only trying to
> indicate that the matching text sequences for the 2
> notations used are different.
>=20
> FreeBSD-* does not match: FreeBSDPkgBase
> ^FreeBSD  does     match: FreeBSDPkgBase
>=20
> Do you want FreeBSDPkgBase to be a match in actual operation?
>=20
>> That said there is room for improvement here - we'll want
>> to detect pkgbase installs in downstream projects that use a =
different
>> package naming scheme (e.g. packages starting with CheriBSD).
>>=20
>> I'll keep a note of this comment for any potential iteration on this.
Hmm. I see another potential issue:
# pkg info -x ^FreeBSD
FreeBSD-acct-15.snap20241023235252
. . .
FreeBSD-zoneinfo-15.snap20241009162208
freebsd-release-manifests-20240809
The capitalization in "freebsd-release-manifests-20240809"
matches the existing pkg -x text: capitalization appears
to be ignored for -x by itself. Loooking:
     -C, --case-sensitive
             Make the standard or the regular expression (-x) matching =
against
             pkg-name case sensitive.
So:
# pkg info -C -x ^FreeBSD
FreeBSD-acct-15.snap20241023235252
. . .
FreeBSD-zoneinfo-15.snap20241009162208
avoids the issue. As does:
# pkg info -x ^FreeBSD-
FreeBSD-acct-15.snap20241023235252
. . .
FreeBSD-zoneinfo-15.snap20241009162208
if the "-" is to be required.
=3D=3D=3D
Mark Millard
marklmi at yahoo.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A23041D-4BDC-4F8E-BB20-2D6C5619A08C>
