On Wed, Jul 13, 2022 at 01:49:46PM +0100, Stuart Henderson wrote:
> On 2022/07/13 12:37, Klemens Nanni wrote:
> > On Wed, Jul 13, 2022 at 12:27:18PM +0000, Klemens Nanni wrote:
> > > No functional change, but this hurts less while reading and would reduce
> > > the initial diff about MASTER_SITES_GITHUB handling.
> > > 
> > > I might as well become
> > >   GH_DISTNAME = 
> > > ${GH_TAGNAME:C/^(v|V|ver|[Rr]el|[Rr]elease)[-._]?([0-9])/\2/}
> > >   DISTNAME ?=   ${GH_DISTNAME}
> > >   GH_DISTFILE = ${GH_DISTNAME}-${EXTRACT_SUFX}
> > > 
> > > and GH_DISTNAME might be useful for porters, but then I had to a)
> > > document the new variable and b) do the same for the GH_COMMIT case as
> > > well (this part is only about GH_TAGNAME ports).
> > > 
> > > So just go with an internal variable to reduce duplication (until
> > > someone finds GH_DISTNAME useful enough).
> > > 
> > > OK?
> > 
> > correct diff this time.
> > 
> > 
> > Index: bsd.port.mk
> > ===================================================================
> > RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
> > retrieving revision 1.1576
> > diff -u -p -r1.1576 bsd.port.mk
> > --- bsd.port.mk     6 Jul 2022 09:30:41 -0000       1.1576
> > +++ bsd.port.mk     13 Jul 2022 12:36:44 -0000
> > @@ -612,8 +612,9 @@ GH_ACCOUNT ?=
> >  GH_PROJECT ?=
> >  
> >  .if !empty(GH_PROJECT) && !empty(GH_TAGNAME)
> > -DISTNAME ?=        
> > ${GH_PROJECT}-${GH_TAGNAME:C/^(v|V|ver|[Rr]el|[Rr]elease)[-._]?([0-9])/\2/}
> > -GH_DISTFILE = 
> > ${GH_PROJECT}-${GH_TAGNAME:C/^(v|V|ver|[Rr]el|[Rr]elease)[-._]?([0-9])/\2/}${EXTRACT_SUFX}
> > +_GH_TAG_DIST = 
> > ${GH_TAGNAME:C/^(v|V|ver|[Rr]el|[Rr]elease)[-._]?([0-9])/\2/}
> > +DISTNAME ?=   ${GH_PROJECT}-${_GH_TAG_DIST}
> > +GH_DISTFILE = ${GH_PROJECT}-${_GH_TAG_DIST}${EXTRACT_SUFX}
> >  .endif
> >  
> >  PKGNAME ?= ${DISTNAME}
> > 
> 
> that's better.  ok, or you could do
> 
> +_GH_TAG_DIST = 
> ${GH_PROJECT}-${GH_TAGNAME:C/^(v|V|ver|[Rr]el|[Rr]elease)[-._]?([0-9])/\2/}
> +DISTNAME ?=   ${_GH_TAG_DIST}
> +GH_DISTFILE = ${_GH_TAG_DIST}${EXTRACT_SUFX}

Thanks.

a tad shorter but since it's called _GH_TAG_DIST it'd stick with just
the tagname in there.

Yours is basically _GH_DISTNAME;  if that's wanted I'd do it the proper
GH_DISTNAME way.

Reply via email to