Date: Wed, 12 Jul 2023 23:15:13 +0100 From: Nuno Teixeira <eduardo@freebsd.org> To: Felix Palmen <zirias@freebsd.org> Cc: ports-committers@freebsd.org, dev-commits-ports-all@freebsd.org, dev-commits-ports-main@freebsd.org Subject: Re: git: 16bde072b16d - main - bsd.sites.mk: Support tag names with USE_GITLAB Message-ID: <CAFDf7UJnC2843njwmLGJ1HKxy6g4ukfAeDSxr1qKZVvkPM8GBA@mail.gmail.com> In-Reply-To: <202307121858.36CIw4aK074024@gitrepo.freebsd.org> References: <202307121858.36CIw4aK074024@gitrepo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--0000000000006883f80600518dc5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Felix, Nice work! Thats nice to see clean distnames with this change: -SHA256 (libinput-libei-xxx*_GL0*.tar.gz) =3D xxx +SHA256 (libei-1.0.0.tar.bz2) =3D yyy Isn't possible to have same result with USE_GITHUB? SHA256 (ib-xarchiver-0.5.4.21*_GH0*.tar.gz) =3D xxx like we have when github static tarballs are available and we use MASTER_SITES instead of USE_GITHUB: MASTER_SITES=3D https://github.com/juzzlin/Heimer/releases/download/${DISTVERSION}/ SHA256 (heimer-4.2.0.tar.gz) =3D xxx (without *_GH0*) Thanks, Felix Palmen <zirias@freebsd.org> escreveu no dia quarta, 12/07/2023 =C3=A0= (s) 19:58: > The branch main has been updated by zirias: > > URL: > https://cgit.FreeBSD.org/ports/commit/?id=3D16bde072b16daca1c886116e602c9= 4b5fa99c20f > > commit 16bde072b16daca1c886116e602c94b5fa99c20f > Author: Felix Palmen <zirias@FreeBSD.org> > AuthorDate: 2022-10-21 07:10:41 +0000 > Commit: Felix Palmen <zirias@FreeBSD.org> > CommitDate: 2023-07-12 18:55:08 +0000 > > bsd.sites.mk: Support tag names with USE_GITLAB > > Since quite some time, it's possible to download generated tarballs > from > gitlab for a tag name without knowing the corresponding git hash. Thi= s > is preferable because you have a single source of truth about the > software version. > > Support this by replacing GL_COMMIT with GL_TAGNAME which also accept= s > a > commit hash, similar to USE_GITHUB. Unfortunately, there's a catch, t= he > DISTFILE must be named exactly: ${GL_PROJECT}-${GL_TAGNAME}.tar.bz2, > otherwise it extracts in a directory that contains the commit hash. S= o, > we can't add the gitlab account or the revision suffix to make it wor= k. > > Therefore, detect whether GL_TAGNAME contains a commit hash, and if i= t > does, use the old behavior of deriving DISTNAME and DISTFILES. > > Document in CHANGES, also add a DEV_WARNING similar to USE_GITHUB whe= n > there's an URL in MASTER_SITES that looks like a gitlab URL. With > support for tags, there shouldn't be any reason left to hardcode such > an > URL in MASTER_SITES. > > PR: 248967 > Approved by: portmgr (tcberner, mentor) > Differential Revision: https://reviews.freebsd.org/D37077 > --- > CHANGES | 16 ++++++++++++++ > Mk/Uses/kde.mk | 2 +- > Mk/Uses/xorg-cat.mk | 2 +- > Mk/bsd.options.mk | 2 +- > Mk/bsd.port.mk | 8 +------ > Mk/bsd.sites.mk | 61 > +++++++++++++++++++++++++++++++++++++---------------- > 6 files changed, 63 insertions(+), 28 deletions(-) > > diff --git a/CHANGES b/CHANGES > index 5e98b3ee86a4..25c7d5fa12a9 100644 > --- a/CHANGES > +++ b/CHANGES > @@ -10,6 +10,22 @@ in the release notes and/or placed into UPDATING. > > All ports committers are allowed to commit to this file. > > +20230712: > +AUTHOR: zirias@FreeBSD.org > + > + USE_GITLAB has been changed to allow fetching by tag name. This was > done by > + removing the GL_COMMIT variable and introducing GL_TAGNAME instead. > + > + Similar to USE_GITHUB/GH_TAGNAME, you can still use a commit hash with > + GL_TAGNAME (the full 40-character hash is required for that). If not > + specified, GL_TAGNAME defaults to DISTVERSIONFULL. > + > + Note fetching by tag name might not work on gitlab installations runni= ng > + very old versions; in that case, you must still specify a commit hash. > + > + For now, GL_COMMIT is still recognized but deprecated, using it will > issue > + a warning in developer mode. > + > 20230712: > AUTHOR: 0mp@FreeBSD.org > > diff --git a/Mk/Uses/kde.mk b/Mk/Uses/kde.mk > index aa9e2f39fbc4..863fe85d0c17 100644 > --- a/Mk/Uses/kde.mk > +++ b/Mk/Uses/kde.mk > @@ -134,7 +134,7 @@ USE_GITLAB=3D yes > GL_SITE=3D https://invent.kde.org > GL_ACCOUNT=3D ${_invent_category} > GL_PROJECT=3D ${_invent_name} > -GL_COMMIT=3D ${_invent_hash} > +GL_TAGNAME=3D ${_invent_hash} > . endif > . endif > > diff --git a/Mk/Uses/xorg-cat.mk b/Mk/Uses/xorg-cat.mk > index 3b64eecad9ae..0853fd6b3e3c 100644 > --- a/Mk/Uses/xorg-cat.mk > +++ b/Mk/Uses/xorg-cat.mk > @@ -26,7 +26,7 @@ > # * meson (experimental) > # > # > -# By defining USE_GITLAB and GL_COMMIT, it is possible to pull code > straight > +# By defining USE_GITLAB and GL_TAGNAME, it is possible to pull code > straight > # from the freedesktop.org gitlab, instead of official release tarballs. > # > #.MAINTAINER: x11@FreeBSD.org > diff --git a/Mk/bsd.options.mk b/Mk/bsd.options.mk > index 90af39e1bed5..09656bb0e1e9 100644 > --- a/Mk/bsd.options.mk > +++ b/Mk/bsd.options.mk > @@ -184,7 +184,7 @@ _OPTIONS_FLAGS=3D ALL_TARGET BROKEN > CABAL_EXECUTABLES CATEGORIES CFLAGS CONFIGURE_ > CONFLICTS CONFLICTS_BUILD CONFLICTS_INSTALL CPPFLAGS > CXXFLAGS \ > DESKTOP_ENTRIES DISTFILES EXTRA_PATCHES EXTRACT_ONLY \ > GH_ACCOUNT GH_PROJECT GH_SUBDIR GH_TAGNAME GH_TUPLE \ > - GL_ACCOUNT GL_COMMIT GL_PROJECT GL_SITE GL_SUBDIR GL_TUPL= E > \ > + GL_ACCOUNT GL_PROJECT GL_SITE GL_SUBDIR GL_TAGNAME > GL_TUPLE \ > IGNORE INFO INSTALL_TARGET LDFLAGS LIBS MAKE_ARGS MAKE_EN= V > \ > MASTER_SITES PATCHFILES PATCH_SITES PLIST_DIRS PLIST_FILE= S > \ > PLIST_SUB PORTDOCS PORTEXAMPLES SUB_FILES SUB_LIST \ > diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk > index 5e3c2e7fad2f..9f6dfb0452c1 100644 > --- a/Mk/bsd.port.mk > +++ b/Mk/bsd.port.mk > @@ -1725,7 +1725,7 @@ WRKSRC?=3D > ${WRKDIR}/${GH_PROJECT_DEFAULT}-${GH_TAGNAME_EXTRACT} > . if defined(WRKSRC) > DEV_WARNING+=3D "You are using USE_GITLAB and WRKSRC is set which is > wrong. Set GL_PROJECT, GL_ACCOUNT correctly, and/or set WRKSRC_SUBDIR an= d > remove WRKSRC entirely." > . endif > -WRKSRC?=3D ${WRKDIR}/${GL_PROJECT}-${GL_COMMIT} > +WRKSRC?=3D ${WRKDIR}/${GL_PROJECT}-${GL_TAGNAME} > . endif > > # If the distname is not extracting into a specific subdirectory, have t= he > @@ -2963,12 +2963,6 @@ DEPENDS_ARGS+=3D NOCLEANDEPENDS=3Dyes > . endif > . endif > > -. if defined(USE_GITLAB) && !${USE_GITLAB:Mnodefault} && > empty(GL_COMMIT_DEFAULT) > -check-makevars:: > - @${ECHO_MSG} "GL_COMMIT is a required 40 character hash for use > USE_GITLAB" > - @${FALSE} > -. endif > - > ################################################################ > # > # Do preliminary work to detect if we need to run the config > diff --git a/Mk/bsd.sites.mk b/Mk/bsd.sites.mk > index 78cb71593c4f..c6bee3798d56 100644 > --- a/Mk/bsd.sites.mk > +++ b/Mk/bsd.sites.mk > @@ -268,10 +268,10 @@ IGNORE?=3D Using master as GH_TAGNAME is invalid. = \ > . if defined(GH_TUPLE) > . for _tuple in ${GH_TUPLE} > _t_tmp=3D${_tuple} > -. if ${_t_tmp:C@^([^:]*):([^:]*):([^:]*)((:[^:/]*)?)((/.*)?)@\4@ > :S/://:C/[a-zA-Z0-9_]//g} > +. if ${_t_tmp:C@^([^:]*):([^:]*):([^:]*)((:[^:/]*)?)((/.*)?)@\4@ > :S/://:C/[a-zA-Z0-9_.+-]//g} > check-makevars:: > @${ECHO_MSG} "The ${_tuple} GH_TUPLE line has" > - @${ECHO_MSG} "a tag containing something else than [a-zA-Z0-9_]" > + @${ECHO_MSG} "a tag containing something else than [a-zA-Z0-9_.+-= ]" > @${FALSE} > . endif > . endfor > @@ -405,6 +405,11 @@ WWW?=3D > https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/ > . endif # defined(USE_GITHUB) > .endif # !defined(IGNORE_MASTER_SITE_GITHUB) > > +# Keep this before USE_GITLAB > +.if !empty(MASTER_SITES:M*//*/*/*/-/archive/${DISTVERSIONFULL}/) > +DEV_WARNING+=3D "MASTER_SITES contains > ${MASTER_SITES:M*//*/*/*/-/archive/${DISTVERSIONFULL}/}, please use > USE_GITLAB instead." > +.endif > + > .if !defined(IGNORE_MASTER_SITE_GITLAB) > # > # In order to use GitLab your port must define USE_GITLAB and the > following > @@ -419,34 +424,40 @@ WWW?=3D > https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/ > # GL_PROJECT - name of the project on GitLab > # default: ${PORTNAME} > # > -# GL_COMMIT - the commit hash of the repository, must be the full > hash and > -# is a required variable for GitLab. > +# GL_TAGNAME - name of the tag to download (2.0.1, hash, ...) > +# Using the name of a branch here is incorrect. It is > +# possible to do GL_TAGNAME=3D GIT_HASH to do a snapshot= . > +# default: ${DISTVERSIONFULL} > # > # GL_SUBDIR - directory relative to WRKSRC where to move this > distfile's > # content after extracting. > # > -# GL_TUPLE - above shortened to > [site[:port][/webroot]:]account:project:commit:group[/subdir] > +# GL_TUPLE - above shortened to > [site[:port][/webroot]:]account:project:tagname:group[/subdir] > # > . if defined(USE_GITLAB) > +. if !defined(GL_TAGNAME) && defined(GL_COMMIT) > +GL_TAGNAME=3D ${GL_COMMIT} > +DEV_WARNING+=3D "GL_COMMIT is deprecated, please use GL_TAGNAME instead= " > +. endif > . if defined(GL_TUPLE) > . for _tuple in ${GL_TUPLE} > -. if ${_tuple:C@ > ^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:= [^:/]*)((/.*)?)@\7@ > :S/^://:C/[a-f0-9]{40}//g} > +. if ${_tuple:C@ > ^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:= [^:/]*)((/.*)?)@\7@ > :S/^://:C/[a-zA-Z0-9_.+-]//g} > check-makevars:: > @${ECHO_MSG} "The ${_tuple}" > - @${ECHO_MSG} "GL_TUPLE is improperly formatted or, the commit" > - @${ECHO_MSG} "section contains something other than [a-f0-9]" > + @${ECHO_MSG} "GL_TUPLE is improperly formatted or, the tagname" > + @${ECHO_MSG} "section contains something other than > [a-zA-Z0-9_.+-]" > @${FALSE} > . endif > . endfor > GL_SITE+=3D ${GL_TUPLE:C@ > ^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:= [^:/]*)((/.*)?)@\1\8@ > :S@::@:@} > GL_ACCOUNT+=3D ${GL_TUPLE:C@ > ^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:= [^:/]*)((/.*)?)@\5\8@ > } > GL_PROJECT+=3D ${GL_TUPLE:C@ > ^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:= [^:/]*)((/.*)?)@\6\8@ > } > -GL_COMMIT+=3D ${GL_TUPLE:C@ > ^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:= [^:/]*)((/.*)?)@\7\8@ > } > +GL_TAGNAME+=3D ${GL_TUPLE:C@ > ^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:= [^:/]*)((/.*)?)@\7\8@ > } > GL_SUBDIR+=3D ${GL_TUPLE:C@ > ^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:= [^:/]*)((/.*)?)@\9\8@ > :M/*:S/^\///} > . endif > > . if empty(USE_GITLAB:Mnodefault) > -MASTER_SITES+=3D > ${GL_SITE}/${GL_ACCOUNT}/${GL_PROJECT}/-/archive/${GL_COMMIT}.tar.gz?dumm= y=3D/ > +MASTER_SITES+=3D > ${GL_SITE}/${GL_ACCOUNT}/${GL_PROJECT}/-/archive/${GL_TAGNAME:C@ > ^[a-f0-9]{40}$@\0.tar.gz?dummy=3D@}/ > . endif > GL_SITE_DEFAULT=3D https://gitlab.com > GL_SITE?=3D ${GL_SITE_DEFAULT} > @@ -454,8 +465,10 @@ GL_ACCOUNT_DEFAULT=3D ${PORTNAME} > GL_ACCOUNT?=3D ${GL_ACCOUNT_DEFAULT} > GL_PROJECT_DEFAULT=3D ${PORTNAME} > GL_PROJECT?=3D ${GL_PROJECT_DEFAULT} > +GL_TAGNAME_DEFAULT=3D ${DISTVERSIONFULL} > +GL_TAGNAME?=3D ${GL_TAGNAME_DEFAULT} > _GITLAB_GROUPS=3D DEFAULT > -. for _gl_v in GL_SITE GL_ACCOUNT GL_PROJECT GL_COMMIT GL_SUBDIR > +. for _gl_v in GL_SITE GL_ACCOUNT GL_PROJECT GL_TAGNAME GL_SUBDIR > . for _v_ex in ${${_gl_v}} > _GL_GROUPS=3D ${_v_ex:S/^${_v_ex:C@:[^/:]+$@@}//:S/^://} > . if !empty(_GL_GROUPS) > @@ -479,18 +492,24 @@ ${_gl_v}_DEFAULT=3D ${_v_ex:C@^(.*):[^/:]+$@\1@} > GL_SITE:=3D ${GL_SITE_DEFAULT} > GL_ACCOUNT:=3D ${GL_ACCOUNT_DEFAULT} > GL_PROJECT:=3D ${GL_PROJECT_DEFAULT} > -GL_COMMIT:=3D ${GL_COMMIT_DEFAULT} > +GL_TAGNAME:=3D ${GL_TAGNAME_DEFAULT} > GL_SUBDIR:=3D ${GL_SUBDIR_DEFAULT} > > _GITLAB_REV=3D 0 > > -_GITLAB_EXTRACT_SUFX=3D .tar.gz > +_GITLAB_EXTRACT_SUFX=3D .tar.gz > +_GITLAB_TAG_EXTRACT_SUFX=3D .tar.bz2 > > _GITLAB_CLONE_DIR?=3D ${WRKDIR}/git-clone > _PORTS_DIRECTORIES+=3D ${_GITLAB_CLONE_DIR} > . if !${USE_GITLAB:Mnodefault} > -DISTNAME:=3D ${GL_ACCOUNT}-${GL_PROJECT}-${GL_COMMIT}_GL${_GITLAB_RE= V} > +. if ${GL_TAGNAME:C/^[a-f0-9]{40}$//} > +DISTNAME:=3D ${GL_PROJECT}-${GL_TAGNAME} > +DISTFILES+=3D ${DISTNAME}${_GITLAB_TAG_EXTRACT_SUFX} > +. else > +DISTNAME:=3D ${GL_ACCOUNT}-${GL_PROJECT}-${GL_TAGNAME}_GL${_GITLAB_R= EV} > DISTFILES+=3D ${DISTNAME}${_GITLAB_EXTRACT_SUFX} > +. endif > git-clone: git-clone-DEFAULT > git-clone-DEFAULT: ${_GITLAB_CLONE_DIR} > @git clone > ${GL_SITE_DEFAULT}/${GL_ACCOUNT_DEFAULT}/${GL_PROJECT_DEFAULT}.git > ${_GITLAB_CLONE_DIR}/${GL_PROJECT_DEFAULT} > @@ -512,12 +531,18 @@ GL_SITE_${_group}=3D ${GL_SITE_DEFAULT} > GL_ACCOUNT_${_group}?=3D ${GL_ACCOUNT_DEFAULT} > GL_PROJECT_${_group}?=3D ${GL_PROJECT_DEFAULT} > > -_GL_TUPLE_OUT:=3D ${_GL_TUPLE_OUT} > ${GL_SITE_${_group}}:${GL_ACCOUNT_${_group}}:${GL_PROJECT_${_group}}:${GL= _COMMIT_${_group}}:${_group}/${GL_SUBDIR_${_group}} > -DISTNAME_${_group}:=3D > ${GL_ACCOUNT_${_group}}-${GL_PROJECT_${_group}}-${GL_COMMIT_${_group}}_G= L${_GITLAB_REV} > +_GL_TUPLE_OUT:=3D ${_GL_TUPLE_OUT} > ${GL_SITE_${_group}}:${GL_ACCOUNT_${_group}}:${GL_PROJECT_${_group}}:${GL= _TAGNAME_${_group}}:${_group}/${GL_SUBDIR_${_group}} > +. if ${GL_TAGNAME_${_group}:C/^[a-f0-9]{40}$//} > +DISTNAME_${_group}:=3D ${GL_PROJECT_${_group}}-${GL_TAGNAME_${_group}} > +DISTFILE_${_group}:=3D ${DISTNAME_${_group}}${_GITLAB_TAG_EXTRACT_SUFX= } > +MASTER_SITES:=3D ${MASTER_SITES} > ${GL_SITE_${_group}}/${GL_ACCOUNT_${_group}}/${GL_PROJECT_${_group}}/-/ar= chive/${GL_TAGNAME_${_group}}/:${_group} > +. else > +DISTNAME_${_group}:=3D > ${GL_ACCOUNT_${_group}}-${GL_PROJECT_${_group}}-${GL_TAGNAME_${_group}}_= GL${_GITLAB_REV} > DISTFILE_${_group}:=3D ${DISTNAME_${_group}}${_GITLAB_EXTRACT_SUFX} > +MASTER_SITES:=3D ${MASTER_SITES} > ${GL_SITE_${_group}}/${GL_ACCOUNT_${_group}}/${GL_PROJECT_${_group}}/-/ar= chive/${GL_TAGNAME_${_group}}.tar.gz?dummy=3D/:${_group} > +. endif > DISTFILES:=3D ${DISTFILES} ${DISTFILE_${_group}}:${_group} > -MASTER_SITES:=3D ${MASTER_SITES} > ${GL_SITE_${_group}}/${GL_ACCOUNT_${_group}}/${GL_PROJECT_${_group}}/-/ar= chive/${GL_COMMIT_${_group}}.tar.gz?dummy=3D/:${_group} > -WRKSRC_${_group}:=3D > ${WRKDIR}/${GL_PROJECT_${_group}}-${GL_COMMIT_${_group}} > +WRKSRC_${_group}:=3D > ${WRKDIR}/${GL_PROJECT_${_group}}-${GL_TAGNAME_${_group}} > . if !empty(GL_SUBDIR_${_group}) > _SITES_extract:=3D ${_SITES_extract} 690:post-extract-gl-${_group} > post-extract-gl-${_group}: > --=20 Nuno Teixeira FreeBSD Committer (ports) --0000000000006883f80600518dc5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Hello Felix,</div><div><br></div><div>Nice work!</div= ><div><br></div><div>Thats nice to see clean distnames with this change: <b= r></div><div><br></div><div>-SHA256 (libinput-libei-xxx<b>_GL0</b>.tar.gz) = =3D xxx</div><div>+SHA256 (libei-1.0.0.tar.bz2) =3D yyy</div><div><br></div= ><div>Isn't possible to have same result with USE_GITHUB?</div><div><br= ></div><div>SHA256 (ib-xarchiver-0.5.4.21<b>_GH0</b>.tar.gz) =3D xxx</div><= div><br></div><div>like we have when github static tarballs are available a= nd we use MASTER_SITES instead of USE_GITHUB:</div><div><br></div><div>MAST= ER_SITES=3D =C2=A0 <a href=3D"https://github.com/juzzlin/Heimer/releases/do= wnload/${DISTVERSION}/">https://github.com/juzzlin/Heimer/releases/download= /${DISTVERSION}/</a></div><div>SHA256 (heimer-4.2.0.tar.gz) =3D xxx (withou= t <b>_GH0</b>)</div><div><br></div><div>Thanks,<br></div><div><br></div><di= v><br></div><div><br></div><br></div><br><div class=3D"gmail_quote"><div di= r=3D"ltr" class=3D"gmail_attr">Felix Palmen <<a href=3D"mailto:zirias@fr= eebsd.org">zirias@freebsd.org</a>> escreveu no dia quarta, 12/07/2023 = =C3=A0(s) 19:58:<br></div><blockquote class=3D"gmail_quote" style=3D"margin= :0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"= >The branch main has been updated by zirias:<br> <br> URL: <a href=3D"https://cgit.FreeBSD.org/ports/commit/?id=3D16bde072b16daca= 1c886116e602c94b5fa99c20f" rel=3D"noreferrer" target=3D"_blank">https://cgi= t.FreeBSD.org/ports/commit/?id=3D16bde072b16daca1c886116e602c94b5fa99c20f</= a><br> <br> commit 16bde072b16daca1c886116e602c94b5fa99c20f<br> Author:=C2=A0 =C2=A0 =C2=A0Felix Palmen <zirias@FreeBSD.org><br> AuthorDate: 2022-10-21 07:10:41 +0000<br> Commit:=C2=A0 =C2=A0 =C2=A0Felix Palmen <zirias@FreeBSD.org><br> CommitDate: 2023-07-12 18:55:08 +0000<br> <br> =C2=A0 =C2=A0 <a href=3D"http://bsd.sites.mk" rel=3D"noreferrer" target=3D"= _blank">bsd.sites.mk</a>: Support tag names with USE_GITLAB<br> <br> =C2=A0 =C2=A0 Since quite some time, it's possible to download generate= d tarballs from<br> =C2=A0 =C2=A0 gitlab for a tag name without knowing the corresponding git h= ash. This<br> =C2=A0 =C2=A0 is preferable because you have a single source of truth about= the<br> =C2=A0 =C2=A0 software version.<br> <br> =C2=A0 =C2=A0 Support this by replacing GL_COMMIT with GL_TAGNAME which als= o accepts a<br> =C2=A0 =C2=A0 commit hash, similar to USE_GITHUB. Unfortunately, there'= s a catch, the<br> =C2=A0 =C2=A0 DISTFILE must be named exactly: ${GL_PROJECT}-${GL_TAGNAME}.t= ar.bz2,<br> =C2=A0 =C2=A0 otherwise it extracts in a directory that contains the commit= hash. So,<br> =C2=A0 =C2=A0 we can't add the gitlab account or the revision suffix to= make it work.<br> <br> =C2=A0 =C2=A0 Therefore, detect whether GL_TAGNAME contains a commit hash, = and if it<br> =C2=A0 =C2=A0 does, use the old behavior of deriving DISTNAME and DISTFILES= .<br> <br> =C2=A0 =C2=A0 Document in CHANGES, also add a DEV_WARNING similar to USE_GI= THUB when<br> =C2=A0 =C2=A0 there's an URL in MASTER_SITES that looks like a gitlab U= RL. With<br> =C2=A0 =C2=A0 support for tags, there shouldn't be any reason left to h= ardcode such an<br> =C2=A0 =C2=A0 URL in MASTER_SITES.<br> <br> =C2=A0 =C2=A0 PR:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0248967<br> =C2=A0 =C2=A0 Approved by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 portmgr= (tcberner, mentor)<br> =C2=A0 =C2=A0 Differential Revision:=C2=A0 <a href=3D"https://reviews.freeb= sd.org/D37077" rel=3D"noreferrer" target=3D"_blank">https://reviews.freebsd= .org/D37077</a><br> ---<br> =C2=A0CHANGES=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 16 +++++++++= +++++<br> =C2=A0Mk/Uses/<a href=3D"http://kde.mk" rel=3D"noreferrer" target=3D"_blank= ">kde.mk</a>=C2=A0 =C2=A0 =C2=A0 |=C2=A0 2 +-<br> =C2=A0Mk/Uses/<a href=3D"http://xorg-cat.mk" rel=3D"noreferrer" target=3D"_= blank">xorg-cat.mk</a> |=C2=A0 2 +-<br> =C2=A0Mk/<a href=3D"http://bsd.options.mk" rel=3D"noreferrer" target=3D"_bl= ank">bsd.options.mk</a>=C2=A0 =C2=A0|=C2=A0 2 +-<br> =C2=A0Mk/<a href=3D"http://bsd.port.mk" rel=3D"noreferrer" target=3D"_blank= ">bsd.port.mk</a>=C2=A0 =C2=A0 =C2=A0 |=C2=A0 8 +------<br> =C2=A0Mk/<a href=3D"http://bsd.sites.mk" rel=3D"noreferrer" target=3D"_blan= k">bsd.sites.mk</a>=C2=A0 =C2=A0 =C2=A0| 61 +++++++++++++++++++++++++++++++= ++++++----------------<br> =C2=A06 files changed, 63 insertions(+), 28 deletions(-)<br> <br> diff --git a/CHANGES b/CHANGES<br> index 5e98b3ee86a4..25c7d5fa12a9 100644<br> --- a/CHANGES<br> +++ b/CHANGES<br> @@ -10,6 +10,22 @@ in the release notes and/or placed into UPDATING.<br> <br> =C2=A0All ports committers are allowed to commit to this file.<br> <br> +20230712:<br> +AUTHOR: zirias@FreeBSD.org<br> +<br> +=C2=A0 USE_GITLAB has been changed to allow fetching by tag name. This was= done by<br> +=C2=A0 removing the GL_COMMIT variable and introducing GL_TAGNAME instead.= <br> +<br> +=C2=A0 Similar to USE_GITHUB/GH_TAGNAME, you can still use a commit hash w= ith<br> +=C2=A0 GL_TAGNAME (the full 40-character hash is required for that). If no= t<br> +=C2=A0 specified, GL_TAGNAME defaults to DISTVERSIONFULL.<br> +<br> +=C2=A0 Note fetching by tag name might not work on gitlab installations ru= nning<br> +=C2=A0 very old versions; in that case, you must still specify a commit ha= sh.<br> +<br> +=C2=A0 For now, GL_COMMIT is still recognized but deprecated, using it wil= l issue<br> +=C2=A0 a warning in developer mode.<br> +<br> =C2=A020230712:<br> =C2=A0AUTHOR: 0mp@FreeBSD.org<br> <br> diff --git a/Mk/Uses/<a href=3D"http://kde.mk" rel=3D"noreferrer" target=3D= "_blank">kde.mk</a> b/Mk/Uses/<a href=3D"http://kde.mk" rel=3D"noreferrer" = target=3D"_blank">kde.mk</a><br> index aa9e2f39fbc4..863fe85d0c17 100644<br> --- a/Mk/Uses/<a href=3D"http://kde.mk" rel=3D"noreferrer" target=3D"_blank= ">kde.mk</a><br> +++ b/Mk/Uses/<a href=3D"http://kde.mk" rel=3D"noreferrer" target=3D"_blank= ">kde.mk</a><br> @@ -134,7 +134,7 @@ USE_GITLAB=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0yes<br> =C2=A0GL_SITE=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<a h= ref=3D"https://invent.kde.org" rel=3D"noreferrer" target=3D"_blank">https:/= /invent.kde.org</a><br> =C2=A0GL_ACCOUNT=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ${_invent_cate= gory}<br> =C2=A0GL_PROJECT=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ${_invent_name= }<br> -GL_COMMIT=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0${_invent_hash= }<br> +GL_TAGNAME=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ${_invent_hash}<br> =C2=A0.=C2=A0 =C2=A0 =C2=A0 endif<br> =C2=A0.=C2=A0 =C2=A0 endif<br> <br> diff --git a/Mk/Uses/<a href=3D"http://xorg-cat.mk" rel=3D"noreferrer" targ= et=3D"_blank">xorg-cat.mk</a> b/Mk/Uses/<a href=3D"http://xorg-cat.mk" rel= =3D"noreferrer" target=3D"_blank">xorg-cat.mk</a><br> index 3b64eecad9ae..0853fd6b3e3c 100644<br> --- a/Mk/Uses/<a href=3D"http://xorg-cat.mk" rel=3D"noreferrer" target=3D"_= blank">xorg-cat.mk</a><br> +++ b/Mk/Uses/<a href=3D"http://xorg-cat.mk" rel=3D"noreferrer" target=3D"_= blank">xorg-cat.mk</a><br> @@ -26,7 +26,7 @@<br> =C2=A0#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * meson (experiment= al)<br> =C2=A0#<br> =C2=A0#<br> -# By defining USE_GITLAB and GL_COMMIT, it is possible to pull code straig= ht<br> +# By defining USE_GITLAB and GL_TAGNAME, it is possible to pull code strai= ght<br> =C2=A0# from the <a href=3D"http://freedesktop.org" rel=3D"noreferrer" targ= et=3D"_blank">freedesktop.org</a> gitlab, instead of official release tarba= lls.<br> =C2=A0#<br> =C2=A0#.MAINTAINER:=C2=A0 x11@FreeBSD.org<br> diff --git a/Mk/<a href=3D"http://bsd.options.mk" rel=3D"noreferrer" target= =3D"_blank">bsd.options.mk</a> b/Mk/<a href=3D"http://bsd.options.mk" rel= =3D"noreferrer" target=3D"_blank">bsd.options.mk</a><br> index 90af39e1bed5..09656bb0e1e9 100644<br> --- a/Mk/<a href=3D"http://bsd.options.mk" rel=3D"noreferrer" target=3D"_bl= ank">bsd.options.mk</a><br> +++ b/Mk/<a href=3D"http://bsd.options.mk" rel=3D"noreferrer" target=3D"_bl= ank">bsd.options.mk</a><br> @@ -184,7 +184,7 @@ _OPTIONS_FLAGS=3D=C2=A0 =C2=A0 =C2=A0ALL_TARGET BROKEN = CABAL_EXECUTABLES CATEGORIES CFLAGS CONFIGURE_<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 CONFLICTS CONFLICTS= _BUILD CONFLICTS_INSTALL CPPFLAGS CXXFLAGS \<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 DESKTOP_ENTRIES DIS= TFILES EXTRA_PATCHES EXTRACT_ONLY \<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 GH_ACCOUNT GH_PROJE= CT GH_SUBDIR GH_TAGNAME GH_TUPLE \<br> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0GL_ACCOUNT GL_COMMI= T GL_PROJECT GL_SITE GL_SUBDIR GL_TUPLE \<br> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0GL_ACCOUNT GL_PROJE= CT GL_SITE GL_SUBDIR GL_TAGNAME GL_TUPLE \<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 IGNORE INFO INSTALL= _TARGET LDFLAGS LIBS MAKE_ARGS MAKE_ENV \<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 MASTER_SITES PATCHF= ILES PATCH_SITES PLIST_DIRS PLIST_FILES \<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 PLIST_SUB PORTDOCS = PORTEXAMPLES SUB_FILES SUB_LIST \<br> diff --git a/Mk/<a href=3D"http://bsd.port.mk" rel=3D"noreferrer" target=3D= "_blank">bsd.port.mk</a> b/Mk/<a href=3D"http://bsd.port.mk" rel=3D"norefer= rer" target=3D"_blank">bsd.port.mk</a><br> index 5e3c2e7fad2f..9f6dfb0452c1 100644<br> --- a/Mk/<a href=3D"http://bsd.port.mk" rel=3D"noreferrer" target=3D"_blank= ">bsd.port.mk</a><br> +++ b/Mk/<a href=3D"http://bsd.port.mk" rel=3D"noreferrer" target=3D"_blank= ">bsd.port.mk</a><br> @@ -1725,7 +1725,7 @@ WRKSRC?=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ${WRKDIR= }/${GH_PROJECT_DEFAULT}-${GH_TAGNAME_EXTRACT}<br> =C2=A0.=C2=A0 =C2=A0 =C2=A0 if defined(WRKSRC)<br> =C2=A0DEV_WARNING+=3D=C2=A0 "You are using USE_GITLAB and WRKSRC is se= t which is wrong.=C2=A0 Set GL_PROJECT, GL_ACCOUNT correctly, and/or set WR= KSRC_SUBDIR and remove WRKSRC entirely."<br> =C2=A0.=C2=A0 =C2=A0 =C2=A0 endif<br> -WRKSRC?=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0${WRKDIR}= /${GL_PROJECT}-${GL_COMMIT}<br> +WRKSRC?=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0${WRKDIR}= /${GL_PROJECT}-${GL_TAGNAME}<br> =C2=A0.=C2=A0 =C2=A0 endif<br> <br> =C2=A0# If the distname is not extracting into a specific subdirectory, hav= e the<br> @@ -2963,12 +2963,6 @@ DEPENDS_ARGS+=3D=C2=A0 =C2=A0NOCLEANDEPENDS=3Dyes<br= > =C2=A0.=C2=A0 =C2=A0 =C2=A0 endif<br> =C2=A0.=C2=A0 =C2=A0 endif<br> <br> -.=C2=A0 =C2=A0 if defined(USE_GITLAB) && !${USE_GITLAB:Mnodefault}= && empty(GL_COMMIT_DEFAULT)<br> -check-makevars::<br> -=C2=A0 =C2=A0 =C2=A0 =C2=A0@${ECHO_MSG} "GL_COMMIT is a required 40 c= haracter hash for use USE_GITLAB"<br> -=C2=A0 =C2=A0 =C2=A0 =C2=A0@${FALSE}<br> -.=C2=A0 =C2=A0 endif<br> -<br> =C2=A0################################################################<br> =C2=A0#<br> =C2=A0# Do preliminary work to detect if we need to run the config<br> diff --git a/Mk/<a href=3D"http://bsd.sites.mk" rel=3D"noreferrer" target= =3D"_blank">bsd.sites.mk</a> b/Mk/<a href=3D"http://bsd.sites.mk" rel=3D"no= referrer" target=3D"_blank">bsd.sites.mk</a><br> index 78cb71593c4f..c6bee3798d56 100644<br> --- a/Mk/<a href=3D"http://bsd.sites.mk" rel=3D"noreferrer" target=3D"_blan= k">bsd.sites.mk</a><br> +++ b/Mk/<a href=3D"http://bsd.sites.mk" rel=3D"noreferrer" target=3D"_blan= k">bsd.sites.mk</a><br> @@ -268,10 +268,10 @@ IGNORE?=3D=C2=A0 Using master as GH_TAGNAME is invali= d. \<br> =C2=A0.=C2=A0 =C2=A0 if defined(GH_TUPLE)<br> =C2=A0.=C2=A0 =C2=A0 =C2=A0 for _tuple in ${GH_TUPLE}<br> =C2=A0_t_tmp=3D${_tuple}<br> -.=C2=A0 =C2=A0 =C2=A0 =C2=A0 if ${_t_tmp:C@^([^:]*):([^:]*):([^:]*)((:[^:/= ]*)?)((/.*)?)@\4@:S/://:C/[a-zA-Z0-9_]//g}<br> +.=C2=A0 =C2=A0 =C2=A0 =C2=A0 if ${_t_tmp:C@^([^:]*):([^:]*):([^:]*)((:[^:/= ]*)?)((/.*)?)@\4@:S/://:C/[a-zA-Z0-9_.+-]//g}<br> =C2=A0check-makevars::<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 @${ECHO_MSG} "The ${_tuple} GH_TUPLE line = has"<br> -=C2=A0 =C2=A0 =C2=A0 =C2=A0@${ECHO_MSG} "a tag containing something e= lse than [a-zA-Z0-9_]"<br> +=C2=A0 =C2=A0 =C2=A0 =C2=A0@${ECHO_MSG} "a tag containing something e= lse than [a-zA-Z0-9_.+-]"<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 @${FALSE}<br> =C2=A0.=C2=A0 =C2=A0 =C2=A0 =C2=A0 endif<br> =C2=A0.=C2=A0 =C2=A0 =C2=A0 endfor<br> @@ -405,6 +405,11 @@ WWW?=3D=C2=A0 =C2=A0 =C2=A0 <a href=3D"https://github.= com/$%7BGH_ACCOUNT%7D/$%7BGH_PROJECT%7D/" rel=3D"noreferrer" target=3D"_bla= nk">https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/</a><br> =C2=A0.=C2=A0 endif # defined(USE_GITHUB)<br> =C2=A0.endif # !defined(IGNORE_MASTER_SITE_GITHUB)<br> <br> +# Keep this before USE_GITLAB<br> +.if !empty(MASTER_SITES:M*//*/*/*/-/archive/${DISTVERSIONFULL}/)<br> +DEV_WARNING+=3D=C2=A0 "MASTER_SITES contains ${MASTER_SITES:M*//*/*/*= /-/archive/${DISTVERSIONFULL}/}, please use USE_GITLAB instead."<br> +.endif<br> +<br> =C2=A0.if !defined(IGNORE_MASTER_SITE_GITLAB)<br> =C2=A0#<br> =C2=A0# In order to use GitLab your port must define USE_GITLAB and the fol= lowing<br> @@ -419,34 +424,40 @@ WWW?=3D=C2=A0 =C2=A0 =C2=A0<a href=3D"https://github.= com/$%7BGH_ACCOUNT%7D/$%7BGH_PROJECT%7D/" rel=3D"noreferrer" target=3D"_bla= nk">https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/</a><br> =C2=A0# GL_PROJECT=C2=A0 =C2=A0 - name of the project on GitLab<br> =C2=A0#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0defaul= t: ${PORTNAME}<br> =C2=A0#<br> -# GL_COMMIT=C2=A0 =C2=A0 =C2=A0- the commit hash of the repository, must b= e the full hash and<br> -#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0is a requir= ed variable for GitLab.<br> +# GL_TAGNAME=C2=A0 =C2=A0 - name of the tag to download (2.0.1, hash, ...)= <br> +#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Using the n= ame of a branch here is incorrect. It is<br> +#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0possible to= do GL_TAGNAME=3D GIT_HASH to do a snapshot.<br> +#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0default: ${= DISTVERSIONFULL}<br> =C2=A0#<br> =C2=A0# GL_SUBDIR=C2=A0 =C2=A0 =C2=A0- directory relative to WRKSRC where t= o move this distfile's<br> =C2=A0#=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0conten= t after extracting.<br> =C2=A0#<br> -# GL_TUPLE=C2=A0 =C2=A0 =C2=A0 - above shortened to [site[:port][/webroot]= :]account:project:commit:group[/subdir]<br> +# GL_TUPLE=C2=A0 =C2=A0 =C2=A0 - above shortened to [site[:port][/webroot]= :]account:project:tagname:group[/subdir]<br> =C2=A0#<br> =C2=A0.=C2=A0 if defined(USE_GITLAB)<br> +.=C2=A0 =C2=A0 if !defined(GL_TAGNAME) && defined(GL_COMMIT)<br> +GL_TAGNAME=3D=C2=A0 =C2=A0 ${GL_COMMIT}<br> +DEV_WARNING+=3D=C2=A0 "GL_COMMIT is deprecated, please use GL_TAGNAME= instead"<br> +.=C2=A0 =C2=A0 endif<br> =C2=A0.=C2=A0 =C2=A0 if defined(GL_TUPLE)<br> =C2=A0.=C2=A0 =C2=A0 =C2=A0 for _tuple in ${GL_TUPLE}<br> -.=C2=A0 =C2=A0 =C2=A0 =C2=A0 if ${_tuple:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?= (/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\7@:S/^://:C/[a-f= 0-9]{40}//g}<br> +.=C2=A0 =C2=A0 =C2=A0 =C2=A0 if ${_tuple:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?= (/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\7@:S/^://:C/[a-z= A-Z0-9_.+-]//g}<br> =C2=A0check-makevars::<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 @${ECHO_MSG} "The ${_tuple}"<br> -=C2=A0 =C2=A0 =C2=A0 =C2=A0@${ECHO_MSG} "GL_TUPLE is improperly forma= tted or, the commit"<br> -=C2=A0 =C2=A0 =C2=A0 =C2=A0@${ECHO_MSG} "section contains something o= ther than [a-f0-9]"<br> +=C2=A0 =C2=A0 =C2=A0 =C2=A0@${ECHO_MSG} "GL_TUPLE is improperly forma= tted or, the tagname"<br> +=C2=A0 =C2=A0 =C2=A0 =C2=A0@${ECHO_MSG} "section contains something o= ther than [a-zA-Z0-9_.+-]"<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 @${FALSE}<br> =C2=A0.=C2=A0 =C2=A0 =C2=A0 =C2=A0 endif<br> =C2=A0.=C2=A0 =C2=A0 =C2=A0 endfor<br> =C2=A0GL_SITE+=3D=C2=A0 =C2=A0 =C2=A0 ${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]= {1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\1\8@:S@::= @:@}<br> =C2=A0GL_ACCOUNT+=3D=C2=A0 =C2=A0${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5}= )?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\5\8@}<br> =C2=A0GL_PROJECT+=3D=C2=A0 =C2=A0${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5}= )?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\6\8@}<br> -GL_COMMIT+=3D=C2=A0 =C2=A0 ${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[= ^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\7\8@}<br> +GL_TAGNAME+=3D=C2=A0 =C2=A0${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[= ^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\7\8@}<br> =C2=A0GL_SUBDIR+=3D=C2=A0 =C2=A0 ${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5}= )?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\9\8@:M/*:S/^\/= //}<br> =C2=A0.=C2=A0 =C2=A0 endif<br> <br> =C2=A0.=C2=A0 =C2=A0 if empty(USE_GITLAB:Mnodefault)<br> -MASTER_SITES+=3D ${GL_SITE}/${GL_ACCOUNT}/${GL_PROJECT}/-/archive/${GL_COM= MIT}.tar.gz?dummy=3D/<br> +MASTER_SITES+=3D ${GL_SITE}/${GL_ACCOUNT}/${GL_PROJECT}/-/archive/${GL_TAG= NAME:C@^[a-f0-9]{40}$@\0.tar.gz?dummy=3D@}/<br> =C2=A0.=C2=A0 =C2=A0 endif<br> =C2=A0GL_SITE_DEFAULT=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0<a href=3D"https://gitla= b.com" rel=3D"noreferrer" target=3D"_blank">https://gitlab.com</a><br> =C2=A0GL_SITE?=3D=C2=A0 =C2=A0 =C2=A0 ${GL_SITE_DEFAULT}<br> @@ -454,8 +465,10 @@ GL_ACCOUNT_DEFAULT=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 ${POR= TNAME}<br> =C2=A0GL_ACCOUNT?=3D=C2=A0 =C2=A0${GL_ACCOUNT_DEFAULT}<br> =C2=A0GL_PROJECT_DEFAULT=3D=C2=A0 =C2=A0 ${PORTNAME}<br> =C2=A0GL_PROJECT?=3D=C2=A0 =C2=A0${GL_PROJECT_DEFAULT}<br> +GL_TAGNAME_DEFAULT=3D=C2=A0 =C2=A0 ${DISTVERSIONFULL}<br> +GL_TAGNAME?=3D=C2=A0 =C2=A0${GL_TAGNAME_DEFAULT}<br> =C2=A0_GITLAB_GROUPS=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 DEFAULT<br> -.=C2=A0 =C2=A0 for _gl_v in GL_SITE GL_ACCOUNT GL_PROJECT GL_COMMIT GL_SUB= DIR<br> +.=C2=A0 =C2=A0 for _gl_v in GL_SITE GL_ACCOUNT GL_PROJECT GL_TAGNAME GL_SU= BDIR<br> =C2=A0.=C2=A0 =C2=A0 =C2=A0 for _v_ex in ${${_gl_v}}<br> =C2=A0_GL_GROUPS=3D=C2=A0 =C2=A0 ${_v_ex:S/^${_v_ex:C@:[^/:]+$@@}//:S/^://}= <br> =C2=A0.=C2=A0 =C2=A0 =C2=A0 =C2=A0 if !empty(_GL_GROUPS)<br> @@ -479,18 +492,24 @@ ${_gl_v}_DEFAULT=3D ${_v_ex:C@^(.*):[^/:]+$@\1@}<br> =C2=A0GL_SITE:=3D=C2=A0 =C2=A0 =C2=A0 ${GL_SITE_DEFAULT}<br> =C2=A0GL_ACCOUNT:=3D=C2=A0 =C2=A0${GL_ACCOUNT_DEFAULT}<br> =C2=A0GL_PROJECT:=3D=C2=A0 =C2=A0${GL_PROJECT_DEFAULT}<br> -GL_COMMIT:=3D=C2=A0 =C2=A0 ${GL_COMMIT_DEFAULT}<br> +GL_TAGNAME:=3D=C2=A0 =C2=A0${GL_TAGNAME_DEFAULT}<br> =C2=A0GL_SUBDIR:=3D=C2=A0 =C2=A0 ${GL_SUBDIR_DEFAULT}<br> <br> =C2=A0_GITLAB_REV=3D=C2=A0 =C2=A00<br> <br> -_GITLAB_EXTRACT_SUFX=3D=C2=A0 .tar.gz<br> +_GITLAB_EXTRACT_SUFX=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .tar.gz<br> +_GITLAB_TAG_EXTRACT_SUFX=3D=C2=A0 =C2=A0 =C2=A0 .tar.bz2<br> <br> =C2=A0_GITLAB_CLONE_DIR?=3D=C2=A0 =C2=A0 ${WRKDIR}/git-clone<br> =C2=A0_PORTS_DIRECTORIES+=3D=C2=A0 =C2=A0${_GITLAB_CLONE_DIR}<br> =C2=A0.=C2=A0 =C2=A0 if !${USE_GITLAB:Mnodefault}<br> -DISTNAME:=3D=C2=A0 =C2=A0 =C2=A0${GL_ACCOUNT}-${GL_PROJECT}-${GL_COMMIT}_G= L${_GITLAB_REV}<br> +.=C2=A0 =C2=A0 =C2=A0 if ${GL_TAGNAME:C/^[a-f0-9]{40}$//}<br> +DISTNAME:=3D=C2=A0 =C2=A0 =C2=A0${GL_PROJECT}-${GL_TAGNAME}<br> +DISTFILES+=3D=C2=A0 =C2=A0 ${DISTNAME}${_GITLAB_TAG_EXTRACT_SUFX}<br> +.=C2=A0 =C2=A0 =C2=A0 else<br> +DISTNAME:=3D=C2=A0 =C2=A0 =C2=A0${GL_ACCOUNT}-${GL_PROJECT}-${GL_TAGNAME}_= GL${_GITLAB_REV}<br> =C2=A0DISTFILES+=3D=C2=A0 =C2=A0 ${DISTNAME}${_GITLAB_EXTRACT_SUFX}<br> +.=C2=A0 =C2=A0 =C2=A0 endif<br> =C2=A0git-clone: git-clone-DEFAULT<br> =C2=A0git-clone-DEFAULT: ${_GITLAB_CLONE_DIR}<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 @git clone ${GL_SITE_DEFAULT}/${GL_ACCOUNT_DEFA= ULT}/${GL_PROJECT_DEFAULT}.git ${_GITLAB_CLONE_DIR}/${GL_PROJECT_DEFAULT}<b= r> @@ -512,12 +531,18 @@ GL_SITE_${_group}=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 ${GL_= SITE_DEFAULT}<br> =C2=A0GL_ACCOUNT_${_group}?=3D ${GL_ACCOUNT_DEFAULT}<br> =C2=A0GL_PROJECT_${_group}?=3D ${GL_PROJECT_DEFAULT}<br> <br> -_GL_TUPLE_OUT:=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 ${_GL_TUPLE_OUT} ${GL_SITE_${= _group}}:${GL_ACCOUNT_${_group}}:${GL_PROJECT_${_group}}:${GL_COMMIT_${_gro= up}}:${_group}/${GL_SUBDIR_${_group}}<br> -DISTNAME_${_group}:=3D=C2=A0 =C2=A0${GL_ACCOUNT_${_group}}-${GL_PROJECT_${= _group}}-${GL_COMMIT_${_group}}_GL${_GITLAB_REV}<br> +_GL_TUPLE_OUT:=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 ${_GL_TUPLE_OUT} ${GL_SITE_${= _group}}:${GL_ACCOUNT_${_group}}:${GL_PROJECT_${_group}}:${GL_TAGNAME_${_gr= oup}}:${_group}/${GL_SUBDIR_${_group}}<br> +.=C2=A0 =C2=A0 =C2=A0 =C2=A0 if ${GL_TAGNAME_${_group}:C/^[a-f0-9]{40}$//}= <br> +DISTNAME_${_group}:=3D=C2=A0 =C2=A0${GL_PROJECT_${_group}}-${GL_TAGNAME_${= _group}}<br> +DISTFILE_${_group}:=3D=C2=A0 =C2=A0${DISTNAME_${_group}}${_GITLAB_TAG_EXTR= ACT_SUFX}<br> +MASTER_SITES:=3D ${MASTER_SITES} ${GL_SITE_${_group}}/${GL_ACCOUNT_${_grou= p}}/${GL_PROJECT_${_group}}/-/archive/${GL_TAGNAME_${_group}}/:${_group}<br= > +.=C2=A0 =C2=A0 =C2=A0 =C2=A0 else<br> +DISTNAME_${_group}:=3D=C2=A0 =C2=A0${GL_ACCOUNT_${_group}}-${GL_PROJECT_${= _group}}-${GL_TAGNAME_${_group}}_GL${_GITLAB_REV}<br> =C2=A0DISTFILE_${_group}:=3D=C2=A0 =C2=A0${DISTNAME_${_group}}${_GITLAB_EXT= RACT_SUFX}<br> +MASTER_SITES:=3D ${MASTER_SITES} ${GL_SITE_${_group}}/${GL_ACCOUNT_${_grou= p}}/${GL_PROJECT_${_group}}/-/archive/${GL_TAGNAME_${_group}}.tar.gz?dummy= =3D/:${_group}<br> +.=C2=A0 =C2=A0 =C2=A0 =C2=A0 endif<br> =C2=A0DISTFILES:=3D=C2=A0 =C2=A0 ${DISTFILES} ${DISTFILE_${_group}}:${_grou= p}<br> -MASTER_SITES:=3D ${MASTER_SITES} ${GL_SITE_${_group}}/${GL_ACCOUNT_${_grou= p}}/${GL_PROJECT_${_group}}/-/archive/${GL_COMMIT_${_group}}.tar.gz?dummy= =3D/:${_group}<br> -WRKSRC_${_group}:=3D=C2=A0 =C2=A0 =C2=A0${WRKDIR}/${GL_PROJECT_${_group}}-= ${GL_COMMIT_${_group}}<br> +WRKSRC_${_group}:=3D=C2=A0 =C2=A0 =C2=A0${WRKDIR}/${GL_PROJECT_${_group}}-= ${GL_TAGNAME_${_group}}<br> =C2=A0.=C2=A0 =C2=A0 =C2=A0 =C2=A0 if !empty(GL_SUBDIR_${_group})<br> =C2=A0_SITES_extract:=3D=C2=A0 =C2=A0 =C2=A0 =C2=A0${_SITES_extract} 690:po= st-extract-gl-${_group}<br> =C2=A0post-extract-gl-${_group}:<br> </blockquote></div><br clear=3D"all"><br><span class=3D"gmail_signature_pre= fix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature"><div dir=3D"l= tr"><span style=3D"color:rgb(102,102,102)">Nuno Teixeira<br>FreeBSD Committ= er (ports)</span></div></div> --0000000000006883f80600518dc5--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFDf7UJnC2843njwmLGJ1HKxy6g4ukfAeDSxr1qKZVvkPM8GBA>