From nobody Tue Dec 27 12:28:49 2022 X-Original-To: ports@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NhDV631y6z1Lflf for ; Tue, 27 Dec 2022 12:29:02 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NhDV62bR8z41Xw for ; Tue, 27 Dec 2022 12:29:02 +0000 (UTC) (envelope-from eduardo@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672144142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2teLg65R/Fo952mvNL9t9c3Hr5SCqpKsXmsXbMZJ+nE=; b=g9BJeGYdzI+wXEE3mo1iC9VzXodObfxWRaqkBA5go1ib47LU52vb9M/2IIOH++4mjPr3Fz PI0+g2Fqn9azfxHqbbIm/w8je5ViFl+HWAH4opMxnV0nh/9ICQum42D3bImRcDYdBaNG/A cWfBaUB34FwLHUtUDn3vkThKj93vZdgqSIvQ16WQ7G+P2h7RXa2QHkfPIsuqCs1GdEQPGi QRV2vUF4rqNqpNiLs/q4lP6V/MWHqKGHuROwOgoyoVQVN0f/OwqTrd8FQNU+69uofsMGP/ m/M9Qy79u5Jzs5FDlgzsLBPSln3Yfz66Ipix932vhYBZPiTgfjoqdFwAAugCnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672144142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2teLg65R/Fo952mvNL9t9c3Hr5SCqpKsXmsXbMZJ+nE=; b=yfPeCWa9KtSpXjy5s4us8Cx2HN+gaC0SQgoSmpyooniWmdHYtRowlNtd/xxXTGGllBV2Z3 sCnO9b+ZF2KaYTxz/9TN4Jz8F1EYssUsdj1OJ/mQ2ZS/dcnLQOFwV1VOUjgl/57FyyUONB X1x/TnokvoR81V5EDbRPIonH252oZq1lhXUFamsaxEz4gT7E5yXQkvh8AM/YVU5ZMJL1wa S8X0Vxm8viLtOR4EgM/BCFKBFkb8+tbbRL3kpqYbkhJ9SnPwtC9F4dtHIZFz3Ov27oMvy4 s5i+3DUhLTANYXx4mgpAZYqY5HiLQSRz5JuESdS6AYYlOsDWh+woJdBgt87zLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1672144142; a=rsa-sha256; cv=none; b=vgKZcdreYWqDMh452qdzhjl84yCLV4GqiU+bu2pTr73iX4jAuGfVBuFZHRXQZ9iIZ88iLv pNzID+p/rVT+424+wVV8Cy5FswSzQx7mGsyAm/qzvWlUOGGyP3umU7KGJgpTfqJjs6j+YM wnVkQZZMV12DjndxVDRQvjQjqXgdVmmw7OFDcKed+ozQUiy1nC4Ri6y+dyS3vXQu6w8AeM 2nWcxynVcrL8W+W4sePfQw/N1Zw3IqfBYSpd+7DNE52AtHZOKrrKZz0aIxr4rYxg1ECuDi f7SEWa75S7w/RYQsGr6QFch8N0aut2+t6cofAW7XOEc+IiRaRVWJmCKV2GIeOw== Received: from mail-ua1-f53.google.com (mail-ua1-f53.google.com [209.85.222.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) (Authenticated sender: eduardo) by smtp.freebsd.org (Postfix) with ESMTPSA id 4NhDV61Rszz1D2F for ; Tue, 27 Dec 2022 12:29:02 +0000 (UTC) (envelope-from eduardo@freebsd.org) Received: by mail-ua1-f53.google.com with SMTP id q3so2118544uao.2 for ; Tue, 27 Dec 2022 04:29:02 -0800 (PST) X-Gm-Message-State: AFqh2kp1lUflVWH6mOIn6VlV5cjBu/L6JlSqQbPgrgkpyxGbgsT7nSS5 AuW87e2hQgB3KxP0MIiTkZ2e1Li+0eS4vtfvi4w= X-Google-Smtp-Source: AMrXdXuUa1u9M2p/JSvK/NTbus1dpbhgv60SwKRR7enhPZyyrh8m/dNBTEzSKQgtlhPnsF/+g9pmnaUxB1iuNRheSFU= X-Received: by 2002:ab0:7a79:0:b0:408:c198:a734 with SMTP id c25-20020ab07a79000000b00408c198a734mr1981607uat.94.1672144141477; Tue, 27 Dec 2022 04:29:01 -0800 (PST) List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Nuno Teixeira Date: Tue, 27 Dec 2022 12:28:49 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: MASTER_SITES with DISTVERSION substitution "S:/./-/" To: Robert Clausecker Cc: ports@freebsd.org Content-Type: multipart/alternative; boundary="00000000000090eccf05f0ce6598" X-ThisMailContainsUnwantedMimeParts: N --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 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 > > ) 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
Hello Robert!

Thanks, I miss= ed that:

---
The value of flags in the s= ubstitute function is zero or more of
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0the following:

=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
=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
=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.
--= -

Works perfectly!

Cheers= ,

Hi Eduardo,

Just like with sed(1), append a g modifier to substitute each occurrence:
=C2=A0 =C2=A0 ${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:
>
> http= s://github.com/root-project/root/releases/download/v6-26-10/root_v6.26.10.s= ource.tar.gz
> ---
> PORTNAME=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0root
> DISTVERSION=3D=C2=A0 =C2=A0 6.26.10
> CATEGORIES=3D=C2=A0 =C2=A0 =C2=A0devel science math parallel python > MASTER_SITES=3D
> https:= //github.com/root-project/root/releases/download/v${DISTVERSION:S/./-/:S/./= -/}/
> DISTNAME=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0${PORTNAME}_v${DISTVERSION}.sour= ce
> ---
>
> Is there a better way of replacing "." with "-" wi= thout using "S:///" 2
> times:
> ${DISTVERSION:S/./-/:S/./-/}/
> Using only one :S/./-/ will substitute the first match "6-26.10&q= uot;
>
> Thanks,
>
>
> --
> Nuno Teixeira
> FreeBSD Committer (ports)

--
()=C2=A0 ascii ribbon campaign - for an 8-bit clean world
/\=C2=A0 - against html email=C2=A0 - against proprietary attachments


--
Nun= o Teixeira
FreeBSD Committer (ports)
--00000000000090eccf05f0ce6598--