From nobody Tue Apr 18 12:37:16 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 4Q13N85gwqz452jg for ; Tue, 18 Apr 2023 12:37:28 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q13N84hGlz3jMm; Tue, 18 Apr 2023 12:37:28 +0000 (UTC) (envelope-from eduardo@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681821448; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pKM/47NgoQce1fyeJyqAFffA8OrNQpBYAgROGp0y6TE=; b=g/AjQlAHa/ihPoXA2hWP5lYm5dkT3PFehQwlYolno1+R6yyXKZV0/lkQzYqf1RAY2rJRF3 gnUhIYmo67Wn1lORmRUI/owW/sx1/Sk43KA7iuZBNgPb6o9+JxqsIGZq8fElnVIWXiwiyq u5km91SWifrKOOJioOibQs7u8PP3C5fFzTNHiKsmmhd2RFU4kwvGKauN0utrs3dN1miW/q OlpRnQldUKNqUJV60qfyYEIOZDeavQyEX9tV+fJavhTNYiwdJQHEAQK3ZQBvjfMzGVXfhw agafe9DHi6s2LDmIyajLOdkkckwGi2WGKgmoUSuFgn3wZQ2ENfTg4ULrhT/65w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681821448; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pKM/47NgoQce1fyeJyqAFffA8OrNQpBYAgROGp0y6TE=; b=sutuXZyKi8BTfjj/AHhK+lEk26k1Lc+W9nDQfYrJRgLQmwjKHLkfWdLer8d1FUZPU778vU QP+eJwvow58cg5Dy595kbC8i74JBQpkeLgMJ9D/t1Kra8iy1cZhfu00gCufGrF9rpe81ch mkVjs3a4DfBNoseoRWiv813oTWJQGwWQVmFc7sBEjd/J1knGbjTGhUY5RaFZP6lSzdMwvB knkdkZuJvtwWyy7QZT4fci7RSEimiLfOA6FYRaecFL+AKbaDH61rLrB+OBlvHxszNCQcUw tH7ZP6ZZujM0zIzQxSex7vV9ZKQzWxg0B/u302qT4FQ3n4eVQezYDf8x1k31xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681821448; a=rsa-sha256; cv=none; b=rLes9uiMXScC+Abys2z7xd4/QNhDP6KY1M+vyW1VKt+EDKo5yQ3vBAVtSx8lJHuYSmJ4F0 qwDsjAX1mtEyLLFAwefG9JGKXr9M6Yq2FjVxGsvMM6dTES9rWd0upO1sQwtX1UdkNIH1b5 r3hXrIZ+u0lSe8CMVsxVYad/nkSdLycUCQFHncaX5L5r2bWPblG81+NZiDobhomLHat1p4 G2dlS9ah+u403X8hg12R8VBaDn9OXIpqwdJaMAeezRHkYcqazD43tLhEr5I7DtoYotxA44 /td4BwlLikWdlh6wVDBMfGRxsUyrl9ZC2Mv8c6/5D4L77hKhsV3lCchNqwP7xQ== Received: from mail-ua1-f48.google.com (mail-ua1-f48.google.com [209.85.222.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) (Authenticated sender: eduardo) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Q13N83XDMz13w8; Tue, 18 Apr 2023 12:37:28 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: by mail-ua1-f48.google.com with SMTP id o2so19508098uao.11; Tue, 18 Apr 2023 05:37:28 -0700 (PDT) X-Gm-Message-State: AAQBX9dfNPbVlXFv1mZJybo45PkVqB6KIOcHOtzGoCJFhHaEUEOihm/F 5bTg9zZj4UndjLeVmebLYWJyclrIxWnHmvgwvjA= X-Google-Smtp-Source: AKy350Z+COI0ft/WlynAgYMM6mzZHdmHTbcqIo8UvFzxyVzv5Y0cqsGTPu0de9phEP/Y8HUjJGIQPyuW8TRc+nG6+y0= X-Received: by 2002:a1f:2004:0:b0:40e:fee9:667a with SMTP id g4-20020a1f2004000000b0040efee9667amr9811258vkg.3.1681821448046; Tue, 18 Apr 2023 05:37:28 -0700 (PDT) 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 References: <3gizlmiaz2h3qwk6xe64iik42vr6mtxyex4d2hjaymazz5nngt@3wm6jdrdxslm> <2su26bpfemilo52atij5i2focesm4iejrkrjry5dr7w4xlxe55@5rjqkjv3tzyk> In-Reply-To: <2su26bpfemilo52atij5i2focesm4iejrkrjry5dr7w4xlxe55@5rjqkjv3tzyk> From: Nuno Teixeira Date: Tue, 18 Apr 2023 13:37:16 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Get ${OSREL} at install time To: Felix Palmen Cc: ports@freebsd.org Content-Type: multipart/alternative; boundary="000000000000fc8f9205f99b91f4" X-ThisMailContainsUnwantedMimeParts: N --000000000000fc8f9205f99b91f4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Forgot about it. It works fine with just `freebsd-version`, do you recommend '-u'? --- #!/bin/sh - osrel=3D$(${PKG_ROOTDIR}/bin/freebsd-version) releng=3D${osrel%%-*} stable=3D${osrel%%.*} echo "Configuring gitup.conf for $osrel" #sed -E -e "s|stable\/12|stable\/${stable}|" -e "s|releng\/11.4|releng\/${releng}|" /usr/local/etc/gitup.conf sed -E -e "s,stable/[0-9]+,stable/${osrel%%.*}," -e "s,releng/[0-9].+,releng/${osrel%%-*}," ${PKG_PREFIX}/etc/gitup.conf echo debug: echo osrel=3D${osrel} echo releng=3D${releng} echo stable=3D${stable} echo PREFIX=3D${PKG_PREFIX} --- result: --- debug: osrel=3D13.2-RELEASE releng=3D13.2 stable=3D13 PREFIX=3D/usr/local "release" : { "repository_path" : "/src.git", "branch" : "releng/13.2 "target_directory" : "/usr/src", "ignores" : [ "sys/[^\/]+/conf", ], }, "stable" : { "repository_path" : "/src.git", "branch" : "stable/13", "target_directory" : "/usr/src", "ignores" : [ "sys/[^\/]+/conf", --- Felix Palmen escreveu no dia ter=C3=A7a, 18/04/2023 = =C3=A0(s) 13:33: > * Nuno Teixeira [20230418 13:26]: > > About ${PKG_ROOTDIR}/bin/freebsd-version it doesn't seem to be called i= n > > pkg-post-install: > > osrel=3D${PKG_ROOTDIR}/bin/freebsd-version > > > > Am I missing something? > > Yes, actually executing it ;) > > | osrel=3D$(${PKG_ROOTDIR}/bin/freebsd-version -u) > > -- > Felix Palmen {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 > --=20 Nuno Teixeira FreeBSD Committer (ports) --000000000000fc8f9205f99b91f4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Forgot about it.

It works fi= ne with just `freebsd-version`, do you recommend '-u'?

---
#!/bin/sh -

osrel=3D$(${PKG_ROOTDIR}/= bin/freebsd-version)
releng=3D${osrel%%-*}
stable=3D${osrel%%.*}
<= br>echo "Configuring gitup.conf for $osrel"

#sed -E -e &qu= ot;s|stable\/12|stable\/${stable}|" -e "s|releng\/11.4|releng\/${= releng}|" /usr/local/etc/gitup.conf
sed -E -e "s,stable/[0-9]+= ,stable/${osrel%%.*}," -e "s,releng/[0-9].+,releng/${osrel%%-*},&= quot; ${PKG_PREFIX}/etc/gitup.conf

echo debug:
echo osrel=3D${osr= el}
echo releng=3D${releng}
echo stable=3D${stable}
echo PREFIX=3D= ${PKG_PREFIX}
---
result:

---<= /div>
debug:
osrel=3D13.2-RELEASE
releng=3D13.2
stable=3D13PREFIX=3D/usr/local

=C2=A0"release" : {=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "repositor= y_path" =C2=A0: "/src.git",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 "branch" =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 : "releng/13.2
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 "target_directory" : "/usr/src",
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "ignores" =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0: [
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "sys/[^\/]+/conf",<= br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ],
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 },

=C2=A0 =C2=A0 =C2=A0 =C2=A0 "stable" = : {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "reposi= tory_path" =C2=A0: "/src.git",
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "branch" =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 : "stable/13",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 "target_directory" : "/usr/src",=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "ignores&quo= t; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0: [
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "sys/[^\/]+/conf&= quot;,
---

Felix Palmen <zirias@freebsd.org> escreveu no dia ter=C3=A7a, 18/04/2023= =C3=A0(s) 13:33:
eduardo@freebsd.org> [20230418 13:26]:
> About ${PKG_ROOTDIR}/bin/freebsd-version it doesn't seem to be cal= led in
> pkg-post-install:
> osrel=3D${PKG_ROOTDIR}/bin/freebsd-version
>
> Am I missing something?

Yes, actually executing it ;)

| osrel=3D$(${PKG_ROOTDIR}/bin/freebsd-version -u)

--
=C2=A0Felix Palmen <zirias@FreeBSD.org>=C2=A0 =C2=A0 =C2=A0{private}= =C2=A0 =C2=A0felix@= palmen-it.de
=C2=A0-- ports committer (mentee) --=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 {web}=C2=A0 http://palmen-it.de
=C2=A0{pgp public key}=C2=A0 http://palmen-it.de/pub.txt
=C2=A0{pgp fingerprint} 6936 13D5 5BBF 4837 B212=C2=A0 3ACC 54AD E006 9879 = F231


--
Nuno Teixeira
FreeBSD Committ= er (ports)
--000000000000fc8f9205f99b91f4--