Date: Tue, 18 Apr 2023 12:28:44 +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: <CAFDf7U%2BaV5rVQgcWz96v80tPWFH-9RXRmMbnrqEjv93xx9rvuw@mail.gmail.com> In-Reply-To: <CAFDf7UK=-R6o2Q5o2ihsiD%2Bue_4L2j1tXEu2LiJSVp%2Br=uEwww@mail.gmail.com> References: <CAFDf7UKJ%2BSy0f9xJZ8oc8fcaejhT1LFgjspVTHDt4E99z2sz3w@mail.gmail.com> <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>
next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000e9605705f99a9c9c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable pkg-plist: @postexec env osrel=3D$(freebsd-version -u) sed -E -e "s|stable\/12|stable\/${osrel%%.*}|" -e "s|releng\/11.4|releng\/${osrel%%-*}|" %%PREFIX%%/etc/gitup.conf result: --- "branch" : "releng/", "branch" : "stable/", --- For sure I'm doing something wrong with syntax. Nuno Teixeira <eduardo@freebsd.org> escreveu no dia ter=C3=A7a, 18/04/2023 = =C3=A0(s) 12:02: > Fixed! > > (on 13.2-RELEASE) > > gitup.conf: > --- > "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", > --- > > Nice! I have now a working pkg-post-install. > Need to have a pkg-plist method working too so it can be discussed the > best method to use. > > Felix Palmen <zirias@freebsd.org> escreveu no dia ter=C3=A7a, 18/04/2023 = =C3=A0(s) > 11:58: > >> * Nuno Teixeira <eduardo@freebsd.org> [20230418 11:55]: >> > sed -E -e 's|stable\/12|stable\/${stable}|' -e >> [...] >> > sed doesn't subtitute as it uses literal variables >> >> The shell doesn't subsitute variables inside single quotes. Try double >> quotes instead. >> >> -- >> 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 >> > > > -- > Nuno Teixeira > FreeBSD Committer (ports) > --=20 Nuno Teixeira FreeBSD Committer (ports) --000000000000e9605705f99a9c9c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>pkg-plist:<br></div><div>@postexec env osrel=3D$(free= bsd-version -u) sed -E -e "s|stable\/12|stable\/${osrel%%.*}|" -e= "s|releng\/11.4|releng\/${osrel%%-*}|" %%PREFIX%%/etc/gitup.conf= </div><div><br></div><div>result:</div><div>---</div><div>"branch"= ; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 : "releng/",</div><div>"= ;branch" =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 : "stable/",</di= v><div>---</div><div><br></div><div>For sure I'm doing something wrong = with syntax.<br></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr"= class=3D"gmail_attr">Nuno Teixeira <<a href=3D"mailto:eduardo@freebsd.o= rg">eduardo@freebsd.org</a>> escreveu no dia ter=C3=A7a, 18/04/2023 =C3= =A0(s) 12:02:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0p= x 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><d= iv dir=3D"ltr"><div>Fixed!</div><div><br></div><div>(on 13.2-RELEASE)</div>= <div><br></div><div>gitup.conf:</div><div>---<br></div><div>"release&q= uot; : {<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "r= epository_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/[^\/]+/c= onf",<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 "st= able" : {<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &= quot;repository_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/s= rc",<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",</div><div>---</div><div><br></div><div>Nice! I have now a= working pkg-post-install.</div><div>Need to have a pkg-plist method workin= g too so it can be discussed the best method to use.<br></div></div><br><di= v class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">Felix Palmen = <<a href=3D"mailto:zirias@freebsd.org" target=3D"_blank">zirias@freebsd.= org</a>> escreveu no dia ter=C3=A7a, 18/04/2023 =C3=A0(s) 11:58:<br></di= v><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;borde= r-left:1px solid rgb(204,204,204);padding-left:1ex">* Nuno Teixeira <<a = href=3D"mailto:eduardo@freebsd.org" target=3D"_blank">eduardo@freebsd.org</= a>> [20230418 11:55]:<br> > sed -E -e 's|stable\/12|stable\/${stable}|' -e<br> [...]<br> > sed doesn't subtitute as it uses literal variables<br> <br> The shell doesn't subsitute variables inside single quotes. Try double<= br> quotes instead.<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>-- </span><br><div dir=3D"lt= r"><div dir=3D"ltr"><span style=3D"color:rgb(102,102,102)">Nuno Teixeira<br= >FreeBSD Committer (ports)</span></div></div> </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> --000000000000e9605705f99a9c9c--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFDf7U%2BaV5rVQgcWz96v80tPWFH-9RXRmMbnrqEjv93xx9rvuw>