Date: Tue, 18 Apr 2023 13:37:16 +0100 From: Nuno Teixeira <eduardo@freebsd.org> To: Felix Palmen <zirias@freebsd.org> Cc: ports@freebsd.org Subject: Re: Get ${OSREL} at install time Message-ID: <CAFDf7UL7C2K%2BtmrPHsbedOT36Wm4SaQzfDRQg02sZhxYvd%2BdYQ@mail.gmail.com> In-Reply-To: <2su26bpfemilo52atij5i2focesm4iejrkrjry5dr7w4xlxe55@5rjqkjv3tzyk> References: <ff0dc458-76f6-0bc2-8560-0eea00744226@grosbein.net> <bbeaf874-8d0d-88b3-29d6-fcb081fb26cd@grosbein.net> <CAFDf7U%2BwOWBnW=bT8qM96_%2BWzCvgZ2dO2TD2LiJ=Gyc36Ft80A@mail.gmail.com> <oeuktukoy63y4f42sk3w3cel52g5zh3ng5rpjrn6rfoudksrkq@qiuzgeoqdmnn> <CAFDf7UK=-R6o2Q5o2ihsiD%2Bue_4L2j1tXEu2LiJSVp%2Br=uEwww@mail.gmail.com> <CAFDf7U%2BaV5rVQgcWz96v80tPWFH-9RXRmMbnrqEjv93xx9rvuw@mail.gmail.com> <CAFDf7ULnDW2w8O9WD%2BDMdT2ku0DtH9OWDBidfejJQ9BEhJHOUg@mail.gmail.com> <3gizlmiaz2h3qwk6xe64iik42vr6mtxyex4d2hjaymazz5nngt@3wm6jdrdxslm> <zrc4espwpzkt2ssauiz7gxz2zo6vzh2ms5j2kmqzbidoub4nc2@7yn7b6w25nkt> <CAFDf7UKS8LW6xJtaN%2Bud7-tGjxKQrSyMsnpy2ytCki7CKpOimg@mail.gmail.com> <2su26bpfemilo52atij5i2focesm4iejrkrjry5dr7w4xlxe55@5rjqkjv3tzyk>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <zirias@freebsd.org> escreveu no dia ter=C3=A7a, 18/04/2023 = =C3=A0(s) 13:33: > * Nuno Teixeira <eduardo@freebsd.org> [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 <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 > --=20 Nuno Teixeira FreeBSD Committer (ports) --000000000000fc8f9205f99b91f4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Forgot about it.</div><div><br></div><div>It works fi= ne with just `freebsd-version`, do you recommend '-u'?<br></div><di= v><br></div><div>---</div><div>#!/bin/sh -<br><br>osrel=3D$(${PKG_ROOTDIR}/= bin/freebsd-version)<br>releng=3D${osrel%%-*}<br>stable=3D${osrel%%.*}<br><= br>echo "Configuring gitup.conf for $osrel"<br><br>#sed -E -e &qu= ot;s|stable\/12|stable\/${stable}|" -e "s|releng\/11.4|releng\/${= releng}|" /usr/local/etc/gitup.conf<br>sed -E -e "s,stable/[0-9]+= ,stable/${osrel%%.*}," -e "s,releng/[0-9].+,releng/${osrel%%-*},&= quot; ${PKG_PREFIX}/etc/gitup.conf<br><br>echo debug:<br>echo osrel=3D${osr= el}<br>echo releng=3D${releng}<br>echo stable=3D${stable}<br>echo PREFIX=3D= ${PKG_PREFIX}</div><div>---</div><div>result:</div><div><br></div><div>---<= /div><div>debug:<br>osrel=3D13.2-RELEASE<br>releng=3D13.2<br>stable=3D13<br= >PREFIX=3D/usr/local</div><div><br></div><div>=C2=A0"release" : {= <br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "repositor= y_path" =C2=A0: "/src.git",<br>=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<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 "target_directory" : "/usr/src",<br>=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: [<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 "sys/[^\/]+/conf",<= br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ],<br>=C2=A0 =C2= =A0 =C2=A0 =C2=A0 },<br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 "stable" = : {<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "reposi= tory_path" =C2=A0: "/src.git",<br>=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",<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 "target_directory" : "/usr/src",<b= r>=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: [<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 "sys/[^\/]+/conf&= quot;,</div><div>---<br></div></div><br><div class=3D"gmail_quote"><div dir= =3D"ltr" class=3D"gmail_attr">Felix Palmen <<a href=3D"mailto:zirias@fre= ebsd.org">zirias@freebsd.org</a>> escreveu no dia ter=C3=A7a, 18/04/2023= =C3=A0(s) 13:33:<br></div><blockquote class=3D"gmail_quote" style=3D"margi= n:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex= ">* Nuno Teixeira <<a href=3D"mailto:eduardo@freebsd.org" target=3D"_bla= nk">eduardo@freebsd.org</a>> [20230418 13:26]:<br> > About ${PKG_ROOTDIR}/bin/freebsd-version it doesn't seem to be cal= led in<br> > pkg-post-install:<br> > osrel=3D${PKG_ROOTDIR}/bin/freebsd-version<br> > <br> > Am I missing something?<br> <br> Yes, actually executing it ;)<br> <br> | osrel=3D$(${PKG_ROOTDIR}/bin/freebsd-version -u)<br> <br> -- <br> =C2=A0Felix Palmen <zirias@FreeBSD.org>=C2=A0 =C2=A0 =C2=A0{private}= =C2=A0 =C2=A0<a href=3D"mailto:felix@palmen-it.de" target=3D"_blank">felix@= palmen-it.de</a><br> =C2=A0-- ports committer (mentee) --=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 {web}=C2=A0 <a href=3D"http://palmen-it.de" rel=3D"noreferrer" target= =3D"_blank">http://palmen-it.de</a><br> =C2=A0{pgp public key}=C2=A0 <a href=3D"http://palmen-it.de/pub.txt" rel=3D= "noreferrer" target=3D"_blank">http://palmen-it.de/pub.txt</a><br> =C2=A0{pgp fingerprint} 6936 13D5 5BBF 4837 B212=C2=A0 3ACC 54AD E006 9879 = F231<br> </blockquote></div><br clear=3D"all"><br><span class=3D"gmail_signature_pre= fix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature"><div dir=3D"l= tr"><span style=3D"color:rgb(102,102,102)">Nuno Teixeira<br>FreeBSD Committ= er (ports)</span></div></div> --000000000000fc8f9205f99b91f4--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFDf7UL7C2K%2BtmrPHsbedOT36Wm4SaQzfDRQg02sZhxYvd%2BdYQ>