Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Dec 2022 13:06:41 +0100
From:      Robert Clausecker <fuz@fuz.su>
To:        Nuno Teixeira <eduardo@freebsd.org>
Cc:        ports@freebsd.org
Subject:   Re: MASTER_SITES with DISTVERSION substitution "S:/./-/"
Message-ID:  <Y6rf0ZI2yvJfvZSj@fuz.su>
In-Reply-To: <CAFDf7UJ%2BsWG%2BEXj3jBG30E-EkOZ2_KG2De3mF9cmDaq5T3Ku%2BQ@mail.gmail.com>
References:  <CAFDf7UJ%2BsWG%2BEXj3jBG30E-EkOZ2_KG2De3mF9cmDaq5T3Ku%2BQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Y6rf0ZI2yvJfvZSj>