Re: MASTER_SITES with DISTVERSION substitution "S:/./-/"

From: Nuno Teixeira <eduardo_at_freebsd.org>
Date: Tue, 27 Dec 2022 12:28:49 UTC
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ça, 27/12/2022 à(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=267717>) with a
> source
> > tarball hosted in github:
> >
> >
> https://github.com/root-project/root/releases/download/v6-26-10/root_v6.26.10.source.tar.gz
> > ---
> > PORTNAME=       root
> > DISTVERSION=    6.26.10
> > CATEGORIES=     devel science math parallel python
> > MASTER_SITES=
> >
> https://github.com/root-project/root/releases/download/v${DISTVERSION:S/./-/:S/./-/}/
> > DISTNAME=       ${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
>


-- 
Nuno Teixeira
FreeBSD Committer (ports)