From nobody Tue Apr 18 09:07:37 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 4Q0yk83clmz44n9L for ; Tue, 18 Apr 2023 09:07:44 +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) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q0yk80CnJz4F9Q for ; Tue, 18 Apr 2023 09:07:43 +0000 (UTC) (envelope-from yuri@aetern.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=aetern.org header.s=fm2 header.b=Np654VS3; dkim=pass header.d=messagingengine.com header.s=fm3 header.b="i 63xAIA"; spf=pass (mx1.freebsd.org: domain of yuri@aetern.org designates 64.147.123.20 as permitted sender) smtp.mailfrom=yuri@aetern.org Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 08F7732007E8 for ; Tue, 18 Apr 2023 05:07:40 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 18 Apr 2023 05:07:41 -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= 1681808860; x=1681895260; bh=NaXj1EeWiqdL8UrHdrUO0X+6ZJbmKvs5Je5 k+49pAfI=; b=Np654VS3RERrhuiodDGFbZyy5LPqnZa2cTZ5LfMZY4gvYeTB7+K aVwdqhKxOINbM9KMZH2RziAFSRYSdWCVdQDg5H6UHynOM+qqrLbUh+SWnuvYd2eO XPU/80adErbX8yzBpvru3QVA+t5/2aawbTJXlCdVziycRHcZkLKADQKdg9FwI6ZQ bTFoyIxDS8ylfoMmVi+2UXDz1cf0rdPnUKtM1zrVcA9RsWTM7k/VppO3iPnwkxiK qBFKPB1zBv9P21cEQm9t/a/ma7JQaCKBhR7mYvMmGicDNTkK0YzV86apeV7PGN+/ O2RvAZg23sxb7tulVlNKmxvbWSbLihzexVg== 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=1681808860; x= 1681895260; bh=NaXj1EeWiqdL8UrHdrUO0X+6ZJbmKvs5Je5k+49pAfI=; b=i 63xAIAKC/TXR/KNl+vVtcPDpZkp8ln9SNZ2oDrhgaXBEVYehlq9tmiqYfnGdAqBx 6Euj/5cnqXhyR/zBZuV3AY2L1ybcf3fWUwyy6zpBXpR+cPmatis0qjP1ty2UJFed /8ik3RS8gb9hj0k43CsKbGBY4jFDQvvFCCaFTcnHoeGlsk48lDy6pDWTAspoXur6 4PRDtvpcl80UMbCSXBzHlDoCr+WyyHjLtpIbzSxB53Opp4xlzOEKpstsQunHoQrL XJQ9uy60paHUukNza5buIjBZ+NKSt5HxIdQnDeZuFVj4rSZgcLXirjnMzQKc+0Hv Ox6prXOYTCg4OJ26hFnWw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdelkedguddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtje ertddtfeejnecuhfhrohhmpegjuhhrihcuoeihuhhrihesrggvthgvrhhnrdhorhhgqeen ucggtffrrghtthgvrhhnpeejhfetffdtveejkefhleeklefgtefhveeihffhteevkeehue egkeetuddvuddtheenucffohhmrghinhepfhhrvggvsghsugdrohhrghdpphhorhhtrdhm khenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeihuh hrihesrggvthgvrhhnrdhorhhg X-ME-Proxy: Feedback-ID: i0d79475b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 18 Apr 2023 05:07:40 -0400 (EDT) Message-ID: <250f83f2-dc05-b9c9-b429-ac463da436f9@aetern.org> Date: Tue, 18 Apr 2023 11:07:37 +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 To: ports@freebsd.org References: From: Yuri In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Q0yk80CnJz4F9Q X-Spamd-Bar: / X-Spamd-Result: default: False [0.60 / 15.00]; SUBJECT_HAS_CURRENCY(1.00)[]; R_DKIM_ALLOW(-0.20)[aetern.org:s=fm2,messagingengine.com:s=fm3]; R_SPF_ALLOW(-0.20)[+ip4:64.147.123.20]; PREVIOUSLY_DELIVERED(0.00)[ports@freebsd.org]; local_wl_from(0.00)[yuri@aetern.org]; DKIM_TRACE(0.00)[aetern.org:+,messagingengine.com:+]; ASN(0.00)[asn:29838, ipnet:64.147.123.0/24, country:US] X-Rspamd-Pre-Result: action=no action; module=multimap; Matched map: local_wl_from X-ThisMailContainsUnwantedMimeParts: N 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. > 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