Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Aug 2018 13:46:16 +0100
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        freebsd-ports@freebsd.org
Subject:   Re: getting PKGNAME from CONFLICTS
Message-ID:  <16f81513-5324-001f-d1c7-45536835ef15@FreeBSD.org>
In-Reply-To: <9823D065-3FCC-4D69-9EB4-9C4CD01C7778@langille.org>
References:  <286CAC11-E9C6-42C4-8D41-97F51EFF1596@yahoo.com> <9823D065-3FCC-4D69-9EB4-9C4CD01C7778@langille.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--f7zgM0mPihkX6dCVYK5fGRr84vWbpY7fl
Content-Type: multipart/mixed; boundary="HrZPaAJqDcl7aA0isGXIZWqxLBv2jqz5H";
 protected-headers="v1"
From: Matthew Seaman <matthew@FreeBSD.org>
To: freebsd-ports@freebsd.org
Message-ID: <16f81513-5324-001f-d1c7-45536835ef15@FreeBSD.org>
Subject: Re: getting PKGNAME from CONFLICTS
References: <286CAC11-E9C6-42C4-8D41-97F51EFF1596@yahoo.com>
 <9823D065-3FCC-4D69-9EB4-9C4CD01C7778@langille.org>
In-Reply-To: <9823D065-3FCC-4D69-9EB4-9C4CD01C7778@langille.org>

--HrZPaAJqDcl7aA0isGXIZWqxLBv2jqz5H
Content-Type: text/plain; charset=utf-8
Content-Language: en-GB
Content-Transfer-Encoding: quoted-printable

On 15/08/2018 00:35, Dan Langille wrote:
>> On Aug 14, 2018, at 2:55 PM, Mark Millard via freebsd-ports <freebsd-p=
orts@freebsd.org> wrote:
>>
>>
>> Dan Langille dan at langille.org wrote on
>> Tue Aug 14 17:54:01 UTC 2018 :
>>
>>> . . .
>>> At https://dev.freshports.org/www/p5-CGI/ you can see:
>>>
>>>   CONFLICTS: p5-CGI.pm-[1-3]*
>>> . . .
>>> To extract the PKGNAME values from the CONFLICTS I will need to remov=
e everything after the trailing dash.
>>> . . .
>>
>> p5-
>> vs.
>> p5-CGI.pm-
>> vs.
>> p5-CGI.pm-[1-
>>
>> It looks to me like "trailing dash" probably has a
>> complicated definition where some "-"(s) may exist
>> that are to be ignored after the one of interest.
>> In the example I'm guessing that the middle
>> "-" is intended (so "p5-CGI.pm-").
>=20
> Agreed.  The hard part is identifying the regex and deleting it from co=
nsideration.
>=20

If you don't mind spawning a new process, you can just do:

% pkg search -qg 'p5-CGI.pm-[1-3]*'
p5-CGI.pm-3.63_1,1

This does assume your pkg(8) is configured to use a repository with all
possible packages available.  The default FreeBSD repositories are a
good choice in that regard.

Or if you already have a database table with all of the package names
and versions, then you'll presumably want to change the glob expression
into a regex match (in this case something like '^p5-CGI\.pm-[1-3].*')
Unless there's a PG extension that allows using glob(3) to match
strings?  I can't see one after a pretty cursory search.  (sqlite has
glob(3) support, which is what the pkg(8) command above is using under
the hood.)

	Cheers,

	Matthew


--HrZPaAJqDcl7aA0isGXIZWqxLBv2jqz5H--

--f7zgM0mPihkX6dCVYK5fGRr84vWbpY7fl
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEGfFU7L8RLlBUTj8wAFE/EOCp5OcFAlt0IJlfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDE5
RjE1NEVDQkYxMTJFNTA1NDRFM0YzMDAwNTEzRjEwRTBBOUU0RTcACgkQAFE/EOCp
5OeZeQ//beJoobaLTVpYu7a4xrYMgbs50ylJKhzwPv+AADTEc+6wupK5VXrhuEiP
aIFuboT3DfbHkbt2CWiYkdsr5x1yfCh+KSlX6hj1fGdSVao9PNXb/NoI0Hy8ecGL
Z52C1VbO1o50N7mQ2HhaxG+4l2dUOEhZmWUjF3N+o7EjIiJo9/XDkwIaoqBO3uhZ
K/WbjYxJFRUa8VY6bsxsy2KI2JoJvmk57xzk4w0M10UB1lVxpzIhqC3FPl8ofDaK
eLhvDFEdDUtEH18Qguo70t/VeKMgIuoDZeVr9hijyltwMQkZ47ZBs/xT+Iv7n2ES
6yI4gW+PRB7874I3CJSM8L3fjaW1CGw8BSPcV5wZrihUo9Q0YC5WBR7b5ETQdl/B
9hYwCKONdDxgcpbHk5BBhMZR5T4iHTud16d+WujHGaY45zmlK7gFM3IoUOWQKWDz
Hljhl/zKM3Tlr1a4Aqh3M19wqy6OESBhLlgMZTKH6a4Yuqj4FGhZDfNB1jWeoxwz
wFsCYjcOBfJxazGIz05ix1SLM3sbuocFbVxlIBIE68k1lX5RI1B+95totIAFqYPM
wsMoTMLkNi8XA3+a3sClb/OvI9l1o35O9uHYMFj/FDKf3Bv75P0TFFy/IeBw19aL
IhGjGerxiYEdFvcSQ/Mb36mYglHSMzq4TzDPv5SDq9N1uwX04Ps=
=IR4G
-----END PGP SIGNATURE-----

--f7zgM0mPihkX6dCVYK5fGRr84vWbpY7fl--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?16f81513-5324-001f-d1c7-45536835ef15>