From nobody Tue Apr 18 09:11:03 2023 X-Original-To: ports@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q0yp340x4z44nG2 for ; Tue, 18 Apr 2023 09:11:07 +0000 (UTC) (envelope-from yuri@aetern.org) Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q0yp308QSz4Kq0 for ; Tue, 18 Apr 2023 09:11:07 +0000 (UTC) (envelope-from yuri@aetern.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=aetern.org header.s=fm2 header.b=Fl2IhhPZ; dkim=pass header.d=messagingengine.com header.s=fm3 header.b="k TCmRop"; spf=pass (mx1.freebsd.org: domain of yuri@aetern.org designates 64.147.123.20 as permitted sender) smtp.mailfrom=yuri@aetern.org; dmarc=none Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 38B4A320016F for ; Tue, 18 Apr 2023 05:11:06 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 18 Apr 2023 05:11:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aetern.org; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1681809065; x=1681895465; bh=YvUEbKMGfJbEtNZeOXB/RpeFNIO6x9reaxp 9qwFW6Z4=; b=Fl2IhhPZ5lNN8SUn5ux8Y6B9qZ00QeK3EEfu7uaik+E24wLm+Ab 0K4Byu3JJ3+gpjoWr1X8u2lwubxIkzi4Q+Ogpn5vPlLuMKoefRhCmlj36cvoNYlK q5gQAkK/q0xyMAbXRQ2/8zLoT+5Z7hrl66vcKU9r9tW3q2ajFJabcUhOOFinxwSp EjJ0/8a0eizaqrPUPpkAJwnsyrnDjMqOoHDdtM/CaG3wKnPwDoDgujeobNbs3cRq iDHfWDeDm7MiilpeNA+qZRFQxxSJrz890lAZT8/rhYdqihyVXhkDPyHFkl47wywn i5w5FFqCw8NQbyDZGxW6qJqJACrAVCglrqA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1681809065; x= 1681895465; bh=YvUEbKMGfJbEtNZeOXB/RpeFNIO6x9reaxp9qwFW6Z4=; b=k TCmRopLfjn+gdxzrjA1Wr05S5zDaGUWi+bHIrfFw3YaWoTolNFYIU3V7F17drK1h 0OG23qOED6rsybRsfGcn1A5Hi6bephkmlLxkaCbpt4u8UUXvlfg79Hzr5qktRGup qbZgSNuyjfrzuskOTcO1D42x+n9DWOngKtqbBMZ1TF9aegEeJquzPketxFaTlD9x WjkpF/J7+JDDMulnBm7WNasPTLx/j/GJNHtwWcZx20gPYW6wwpjCVBCQhBjQqbtX 6WMbOwPrOzqbFcQn1KLPyYGIsYcf2YACtFo0UJUy/mwBMDrenA04V3TSWDYjEAAl 5xFqh3Ci4pzMRjNOC6kbA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdelkedgudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuhffvfhgjtgfgsehtje ertddtfeejnecuhfhrohhmpegjuhhrihcuoeihuhhrihesrggvthgvrhhnrdhorhhgqeen ucggtffrrghtthgvrhhnpeeukeekudeugfeitdduteefjeegvdevuddujefghfduueduud fgueekheetgffhheenucffohhmrghinhepfhhrvggvsghsugdrohhrghdpphhorhhtrdhm khenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeihuh hrihesrggvthgvrhhnrdhorhhg X-ME-Proxy: Feedback-ID: i0d79475b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 18 Apr 2023 05:11:05 -0400 (EDT) Message-ID: <7068cd8f-9a2b-1bc1-c745-4cc1bf56ee9c@aetern.org> Date: Tue, 18 Apr 2023 11:11:03 +0200 List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: Get ${OSREL} at install time Content-Language: en-US From: Yuri To: ports@freebsd.org References: <250f83f2-dc05-b9c9-b429-ac463da436f9@aetern.org> In-Reply-To: <250f83f2-dc05-b9c9-b429-ac463da436f9@aetern.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Q0yp308QSz4Kq0 X-Spamd-Bar: / X-Spamd-Result: default: False [-0.50 / 15.00]; SUBJECT_HAS_CURRENCY(1.00)[]; DWL_DNSWL_LOW(-1.00)[messagingengine.com:dkim]; R_SPF_ALLOW(-0.20)[+ip4:64.147.123.20:c]; R_DKIM_ALLOW(-0.20)[aetern.org:s=fm2,messagingengine.com:s=fm3]; RCVD_IN_DNSWL_LOW(-0.10)[64.147.123.20:from]; ASN(0.00)[asn:29838, ipnet:64.147.123.0/24, country:US]; PREVIOUSLY_DELIVERED(0.00)[ports@freebsd.org]; DMARC_NA(0.00)[aetern.org]; local_wl_from(0.00)[yuri@aetern.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[64.147.123.20:from]; DKIM_TRACE(0.00)[aetern.org:+,messagingengine.com:+]; ARC_NA(0.00)[] X-Rspamd-Pre-Result: action=no action; module=multimap; Matched map: local_wl_from X-ThisMailContainsUnwantedMimeParts: N Yuri wrote: > Felix Palmen wrote: >> * Nuno Teixeira [20230418 09:05]: >>> Any sugestion or example that permits to get OSREL at install time? >> >> Not really OSREL, but when I needed to know the FreeBSD version at >> install time, this is what I did: >> >> https://cgit.freebsd.org/ports/tree/security/unix-selfauth-helper/pkg-post-install.lua > > Took a look at this and now I'm wondering if it gets run at all, you > don't seem to specify PKGPOSTINSTALL in the Makefile, and bsd.port.mk > has it as just pkg-post-install, not handling .lua? It's also is not in > the .pkg file contents. Sorry if I'm missing something. Nevermind me, I see that it's there, sorry for the noise. >> It's not exactly nice, just parsing the version manually... > > I was going to suggest something similar with using kern.osreldate and > parsing it according to > https://docs.freebsd.org/en/books/porters-handbook/versions/, e.g. > > 1301000 <= value < 1301500 - 13.1-RELEASE > 1301500 <= value < 1302000 - outdated 13.1-STABLE > 1302000 <= value < 1302500 - 13.2-RELEASE > 1302500 <= value < 1303000 - current 13.2-STABLE > 1400000 <= value - 14.0-CURRENT >