Date: Mon, 1 Jul 2024 20:42:47 +0200 From: DutchDaemon - FreeBSD Forums Administrator <DutchDaemon@FreeBSD.org> To: ports@freebsd.org Subject: Re: Can `pkg prime-origins` be "trained" to pick up flavors? Message-ID: <748eaf90-6c2d-41e3-8334-88458c21b7c3@FreeBSD.org> In-Reply-To: <20240702022215.86f678352bf5d7c6bf3dea4d@dec.sakura.ne.jp> References: <d5795604-0255-4992-8ba2-189fe6318134@FreeBSD.org> <20240702022215.86f678352bf5d7c6bf3dea4d@dec.sakura.ne.jp>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------R98uWw006MN2MhwsQ8pT93Fb Content-Type: multipart/mixed; boundary="------------3M9H87J3oHWHN7zSiDV6hkI9"; protected-headers="v1" From: DutchDaemon - FreeBSD Forums Administrator <DutchDaemon@FreeBSD.org> To: ports@freebsd.org Message-ID: <748eaf90-6c2d-41e3-8334-88458c21b7c3@FreeBSD.org> Subject: Re: Can `pkg prime-origins` be "trained" to pick up flavors? References: <d5795604-0255-4992-8ba2-189fe6318134@FreeBSD.org> <20240702022215.86f678352bf5d7c6bf3dea4d@dec.sakura.ne.jp> In-Reply-To: <20240702022215.86f678352bf5d7c6bf3dea4d@dec.sakura.ne.jp> --------------3M9H87J3oHWHN7zSiDV6hkI9 Content-Type: multipart/alternative; boundary="------------i8sWCidfIJDIsEFkMqnEe0qn" --------------i8sWCidfIJDIsEFkMqnEe0qn Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 T24gMS03LTIwMjQgMTk6MjIsIFRvbW9ha2kgQU9LSSB3cm90ZToNCj4gT24gTW9uLCAxIEp1 bCAyMDI0IDE1OjQ2OjE4ICswMjAwDQo+IER1dGNoRGFlbW9uIC0gRnJlZUJTRCBGb3J1bXMg QWRtaW5pc3RyYXRvcjxEdXRjaERhZW1vbkBGcmVlQlNELm9yZz4NCj4gd3JvdGU6DQo+DQo+ PiBIZXksDQo+Pg0KPj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CB0byBwb3B1bGF0ZSB0aGUgYnVpbGQgbGlzdHMgZm9yIA0KUG91ZHJp ZXJlLCB3aGljaCB0aGVuIGZpcmVzIHVwIHRoZSBqYWlscyBhbmQgYnVpbGRzIHRoZSBhc3Nv Y2lhdGVkIHJlcG9zLg0KDQpmb3IgcG9ydCBpbiAkKCAvdXNyL2xvY2FsL3NiaW4vcGtnIHBy aW1lLW9yaWdpbnMgKQ0KZG8NCmZsYXZvcj0kKCAvdXNyL2xvY2FsL3NiaW4vcGtnIGluZm8g LUEgIiR7cG9ydH0iIHwgL3Vzci9iaW4vZ3JlcCAiZmxhdm9yIiANCnwgL3Vzci9iaW4vYXdr ICd7cHJpbnQgJE5GfScgfCAvdXNyL2Jpbi9ncmVwIC12ICJkZWZhdWx0IiApDQpbICJ4JHtm bGF2b3J9IiA9ICJ4IiBdICYmIGVjaG8gIiR7cG9ydH0iIHx8IGVjaG8gIiR7cG9ydH1AJHtm bGF2b3J9Ig0KZG9uZQ0KDQpUaGF0IGdpdmVzIG1lIGV4YWN0bHkgdGhlIG91dHB1dCBJIG5l ZWQuDQoNClRoYW5rcyENCg0KREQNCg0K --------------i8sWCidfIJDIsEFkMqnEe0qn Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <!DOCTYPE html> <html> <head> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF= -8"> </head> <body text=3D"#000000" bgcolor=3D"#FFFFFF"> <div class=3D"moz-cite-prefix">On 1-7-2024 19:22, Tomoaki AOKI wrote:= <br> </div> <blockquote type=3D"cite" cite=3D"mid:20240702022215.86f678352bf5d7c6bf3dea4d@dec.sakura.ne.jp"> <pre class=3D"moz-quote-pre" wrap=3D"">On Mon, 1 Jul 2024 15:46:18 = +0200 DutchDaemon - FreeBSD Forums Administrator <a class=3D"moz-txt-link-rfc23= 96E" href=3D"mailto:DutchDaemon@FreeBSD.org"><DutchDaemon@FreeBSD.org&= gt;</a> wrote: </pre> <blockquote type=3D"cite"> <pre class=3D"moz-quote-pre" wrap=3D"">Hey, I use `pkg prime-origins` on my servers to pick up the ports that=20 Poudriere needs to build for that (cluster of) server(s). This doesn't work for flavors, or I'm missing a trick. E.g.: I have installed the "guestagent" flavor of emulators/qemu=20 ("qemu-guest-agent" in pkg terms), which gets built in Poudriere as=20 "emulators/qemu@guestagent". All good and well. But `pkg prime-origins` picks it up as "emulators/qemu", which, of=20 course, triggers Poudriere to build the whole thing,=20 "emulators/qemu@default". Which I don't need. So either pkg needs to be amended to be able to recognize and report a=20 flavor, or I have to put this in the jail's make.conf on Poudriere. I'm not sure if there's a place for that in a generic make.conf for all=20 ports in that specific jail; you know, one that contains=20 all-encompassing lines like DEFAULT_VERSIONS=3D php=3D82 apache=3D2.4 mysql=3D80 ssl=3Dopenssl python= =3D3.9=20 python3=3D3.9 Anyone? </pre> </blockquote> <pre class=3D"moz-quote-pre" wrap=3D""> Hi. pkg records informations about FLAVORs in annotations only. You should search output from `pkg -A <packagename>` for each pkg. Does the script on brew.bsd.cafe [1] help understanding/usable? [1] <a class=3D"moz-txt-link-freetext" href=3D"https://brew.bsd.cafe/TomAoki/= sh_scripts/src/branch/main/poudlist-all">https://brew.bsd.cafe/TomAoki/sh= _scripts/src/branch/main/poudlist-all</a> Regards.</pre> </blockquote> <p>That actually put me on a path forward, but I decided to sort of brute-force it, so I could run the script anywhere.=C2=A0</p> <p>In fact, Ansible runs it on all servers (grouped by build jail names on Poudriere) and gathers/sorts the output to populate the build lists for Poudriere, which then fires up the jails and builds the associated repos.<br> </p> <p><font face=3D"monospace">for port in $( /usr/local/sbin/pkg prime-origins )<br> do<br> flavor=3D$( /usr/local/sbin/pkg info -A "${port}" | /usr/bin/grep= "flavor" | /usr/bin/awk '{print $NF}' | /usr/bin/grep -v "default" ) <br> [ "x${flavor}" =3D "x" ] && echo "${port}" || echo "${port}@${flavor}"<br> done</font><span style=3D"white-space: pre-wrap"> </span></p> <p></p> <p>That gives me exactly the output I need.</p> <p>Thanks!</p> <p>DD<br> </p> </body> </html> --------------i8sWCidfIJDIsEFkMqnEe0qn-- --------------3M9H87J3oHWHN7zSiDV6hkI9-- --------------R98uWw006MN2MhwsQ8pT93Fb Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQSDIpfQllw48uFsWk/r4FMJZEPckQUCZoL4qAUDAAAAAAAKCRDr4FMJZEPckcFs AP0WlKLQ1LJZQ4YwDVAfycORiAl66F1HhT7muJtFmMm8XgEArVqq7uPdayRcqEQkrUvhivQMuu3c v6WhjRXfe3i9jg8= =RtdM -----END PGP SIGNATURE----- --------------R98uWw006MN2MhwsQ8pT93Fb--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?748eaf90-6c2d-41e3-8334-88458c21b7c3>