Date: Tue, 27 Dec 2022 12:28:49 +0000 From: Nuno Teixeira <eduardo@freebsd.org> To: Robert Clausecker <fuz@fuz.su> Cc: ports@freebsd.org Subject: Re: MASTER_SITES with DISTVERSION substitution "S:/./-/" Message-ID: <CAFDf7U%2BB_Rov6O3NjiPf%2BAk4jYnwwVvLZ7FUKRwAcCPSebBVwA@mail.gmail.com> In-Reply-To: <Y6rf0ZI2yvJfvZSj@fuz.su> References: <CAFDf7UJ%2BsWG%2BEXj3jBG30E-EkOZ2_KG2De3mF9cmDaq5T3Ku%2BQ@mail.gmail.com> <Y6rf0ZI2yvJfvZSj@fuz.su>
next in thread | previous in thread | raw e-mail | index | archive | help
--00000000000090eccf05f0ce6598 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Robert! Thanks, I missed that: --- The value of flags in the substitute function is zero or more of the following: g Make the substitution for all non-overlapping matches of the regular expression, not just the first one. --- Works perfectly! Cheers, Robert Clausecker <fuz@fuz.su> escreveu no dia ter=C3=A7a, 27/12/2022 =C3= =A0(s) 12:06: > Hi Eduardo, > > Just like with sed(1), append a g modifier to substitute each occurrence: > > ${DISTVERSION:S/./-/g} > > Yours, > Robert Clausecker > > Am Tue, Dec 27, 2022 at 12:03:04PM +0000 schrieb Nuno Teixeira: > > Hello all, > > > > I'm working in a port (267717 > > <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267717>) with a > source > > tarball hosted in github: > > > > > https://github.com/root-project/root/releases/download/v6-26-10/root_v6.2= 6.10.source.tar.gz > > --- > > PORTNAME=3D root > > DISTVERSION=3D 6.26.10 > > CATEGORIES=3D devel science math parallel python > > MASTER_SITES=3D > > > https://github.com/root-project/root/releases/download/v${DISTVERSION:S/.= /-/:S/./-/}/ > > DISTNAME=3D ${PORTNAME}_v${DISTVERSION}.source > > --- > > > > Is there a better way of replacing "." with "-" without using "S:///" 2 > > times: > > ${DISTVERSION:S/./-/:S/./-/}/ > > Using only one :S/./-/ will substitute the first match "6-26.10" > > > > Thanks, > > > > > > -- > > Nuno Teixeira > > FreeBSD Committer (ports) > > -- > () ascii ribbon campaign - for an 8-bit clean world > /\ - against html email - against proprietary attachments > --=20 Nuno Teixeira FreeBSD Committer (ports) --00000000000090eccf05f0ce6598 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Hello Robert!</div><div><br></div><div>Thanks, I miss= ed that:</div><div><br></div><div>---</div><div>The value of flags in the s= ubstitute function is zero or more of<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0the following:<br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0g =C2=A0 =C2=A0 =C2=A0 Make the substitution= for all non-overlapping<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=A0matches of the regular = expression, not just the<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=A0first one.</div><div>--= -</div><div><br></div><div>Works perfectly!</div><div><br></div><div>Cheers= ,<br></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"g= mail_attr">Robert Clausecker <<a href=3D"mailto:fuz@fuz.su">fuz@fuz.su</= a>> escreveu no dia ter=C3=A7a, 27/12/2022 =C3=A0(s) 12:06:<br></div><bl= ockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-lef= t:1px solid rgb(204,204,204);padding-left:1ex">Hi Eduardo,<br> <br> Just like with sed(1), append a g modifier to substitute each occurrence:<b= r> <br> =C2=A0 =C2=A0 ${DISTVERSION:S/./-/g}<br> <br> Yours,<br> Robert Clausecker<br> <br> Am Tue, Dec 27, 2022 at 12:03:04PM +0000 schrieb Nuno Teixeira:<br> > Hello all,<br> > <br> > I'm working in a port (267717<br> > <<a href=3D"https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267= 717" rel=3D"noreferrer" target=3D"_blank">https://bugs.freebsd.org/bugzilla= /show_bug.cgi?id=3D267717</a>>) with a source<br> > tarball hosted in github:<br> > <br> > <a href=3D"https://github.com/root-project/root/releases/download/v6-2= 6-10/root_v6.26.10.source.tar.gz" rel=3D"noreferrer" target=3D"_blank">http= s://github.com/root-project/root/releases/download/v6-26-10/root_v6.26.10.s= ource.tar.gz</a><br> > ---<br> > PORTNAME=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0root<br> > DISTVERSION=3D=C2=A0 =C2=A0 6.26.10<br> > CATEGORIES=3D=C2=A0 =C2=A0 =C2=A0devel science math parallel python<br= > > MASTER_SITES=3D<br> > <a href=3D"https://github.com/root-project/root/releases/download/v$%7= BDISTVERSION:S/./-/:S/./-/%7D/" rel=3D"noreferrer" target=3D"_blank">https:= //github.com/root-project/root/releases/download/v${DISTVERSION:S/./-/:S/./= -/}/</a><br> > DISTNAME=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0${PORTNAME}_v${DISTVERSION}.sour= ce<br> > ---<br> > <br> > Is there a better way of replacing "." with "-" wi= thout using "S:///" 2<br> > times:<br> > ${DISTVERSION:S/./-/:S/./-/}/<br> > Using only one :S/./-/ will substitute the first match "6-26.10&q= uot;<br> > <br> > Thanks,<br> > <br> > <br> > -- <br> > Nuno Teixeira<br> > FreeBSD Committer (ports)<br> <br> -- <br> ()=C2=A0 ascii ribbon campaign - for an 8-bit clean world <br> /\=C2=A0 - against html email=C2=A0 - against proprietary attachments<br> </blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr" class=3D"g= mail_signature"><div dir=3D"ltr"><span style=3D"color:rgb(102,102,102)">Nun= o Teixeira<br>FreeBSD Committer (ports)</span></div></div> --00000000000090eccf05f0ce6598--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFDf7U%2BB_Rov6O3NjiPf%2BAk4jYnwwVvLZ7FUKRwAcCPSebBVwA>