Date: Tue, 18 Apr 2023 11:51:31 +0200 From: Felix Palmen <zirias@FreeBSD.org> To: ports@freebsd.org Subject: Re: Get ${OSREL} at install time Message-ID: <ak37anl42jqbsi2dwyzou2y2j5kskq5z32dqmhl7whoe2kke72@7nxmswengrmh> In-Reply-To: <fbff43f7-f90f-e36d-aa17-b81dcd9eecfa@grosbein.net> References: <CAFDf7UKJ%2BSy0f9xJZ8oc8fcaejhT1LFgjspVTHDt4E99z2sz3w@mail.gmail.com> <ff0dc458-76f6-0bc2-8560-0eea00744226@grosbein.net> <vzkhiyn7tlkmiltx5nlzwfssdn7zwg55sqyfwdmbjkicei3f6s@gsrxpc2g62dz> <fbff43f7-f90f-e36d-aa17-b81dcd9eecfa@grosbein.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--a242t6x5zr7bnig2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Eugene Grosbein <eugen@grosbein.net> [20230418 16:41]: > 18.04.2023 16:34, Felix Palmen wrote: >=20 > > * Eugene Grosbein <eugen@grosbein.net> [20230418 16:26]: > >> 18.04.2023 15:05, Nuno Teixeira wrote: > >>> Any sugestion or example that permits to get OSREL at install time? > >> > >> # osrel=3D$(sysctl -n kern.osrelease) > >=20 > > Obtaining the information from the running kernel has the drawback of > > possibly giving wrong results with pkg -c / pkg -r (installing in an > > alternative root, e.g. a jail or boot environment). > >=20 > > Therefore, parsing /etc/os-release should be preferred. >=20 > Even better, we have freebsd-version -u Actually not better but older ;) IIRC, /etc/os-release was only introduced in 13. But then, it's probably "better" just as long as 12 is still supported... With lua scripts, you can't even use freebsd-version because execution is very restricted for them in pkg. And for some features (like e.g. dynamically creating a pkg-message output), you need lua... --=20 Felix Palmen <zirias@FreeBSD.org> {private} felix@palmen-it.de -- ports committer (mentee) -- {web} http://palmen-it.de {pgp public key} http://palmen-it.de/pub.txt {pgp fingerprint} 6936 13D5 5BBF 4837 B212 3ACC 54AD E006 9879 F231 --a242t6x5zr7bnig2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iNUEABYKAH0WIQRpNhPVW79IN7ISOsxUreAGmHnyMQUCZD5oI18UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0Njkz NjEzRDU1QkJGNDgzN0IyMTIzQUNDNTRBREUwMDY5ODc5RjIzMQAKCRBUreAGmHny MXd6AQDTTqgmzFBxS+xmYgYzigsFL6i62qPFLWLjk6lefit3XQD/WxuiI2u2rydR DgOQSOXWy4GqJc829t/W18WytOnIqgE= =vV0O -----END PGP SIGNATURE----- --a242t6x5zr7bnig2--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ak37anl42jqbsi2dwyzou2y2j5kskq5z32dqmhl7whoe2kke72>