Page MenuHomeFreeBSD

Mk/bsd.sites.mk: Fix fetch with GL_TUPLE site:account:project:commit:group style entries
ClosedPublic

Authored by tobik on Tue, Aug 6, 4:11 PM.

Details

Summary

With something like

GL_TUPLE=	https://gitlab.redox-os.org:redox-os:calc:afba9c5d184ddb9db5e4e71dc357da0499e212cf:calculate

in a port (I changed shells/ion to look like that as a test case), it fails to fetch

=> Attempting to fetch https://gitlab.redox-os.org:/redox-os/calc/repository/afba9c5d184ddb9db5e4e71dc357da0499e212cf/archive.tar.gz?dummy=/redox-os-calc-afba9c5d184ddb9db5e4e71dc357da0499e212cf_GL0.tar.gz
fetch: https://gitlab.redox-os.org:/redox-os/calc/repository/afba9c5d184ddb9db5e4e71dc357da0499e212cf/archive.tar.gz?dummy=/redox-os-calc-afba9c5d184ddb9db5e4e71dc357da0499e212cf_GL0.tar.gz: parse error

Indeed GL_SITE_calculate still has the colon left after parsing

$ make -V GL_SITE_calculate
https://gitlab.redox-os.org:

so it is no wonder that it does not work.

I have no idea how to properly fix this, so sorry for the hack.

As I have recently changed cargo-crates.awk to maybe output entries like this and the Porter's Handbook also shows this as supported [1], it would be nice if this could just work.

[1] https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/makefile-distfiles.html#makefile-master_sites-gitlab-multi2

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

tobik created this revision.Tue, Aug 6, 4:11 PM
tobik added a subscriber: ultima.Fri, Aug 9, 7:03 AM

Alternative approach might be to sanitize the :: that appears in GL_SITE after processing GL_TUPLE:

Index: bsd.sites.mk
===================================================================
--- bsd.sites.mk        (revision 508298)
+++ bsd.sites.mk        (working copy)
@@ -544,7 +544,7 @@
        @${FALSE}
 .      endif
 .    endfor
-GL_SITE+=      ${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\1\8@}
+GL_SITE+=      ${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\1\8@:S@::@:@}
 GL_ACCOUNT+=   ${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\5\8@}
 GL_PROJECT+=   ${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\6\8@}
 GL_COMMIT+=    ${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\7\8@}

@ultima can you look at this? You touched this code last. bsd.sites.mk has no clear maintainer.

mat added a comment.Tue, Aug 13, 1:27 PM

This could be fixed by changing the regexp, but it would probably make it way more complicated. I like this better:

Alternative approach might be to sanitize the :: that appears in GL_SITE after processing GL_TUPLE:

Index: bsd.sites.mk
===================================================================
--- bsd.sites.mk        (revision 508298)
+++ bsd.sites.mk        (working copy)
@@ -544,7 +544,7 @@
        @${FALSE}
 .      endif
 .    endfor
-GL_SITE+=      ${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\1\8@}
+GL_SITE+=      ${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\1\8@:S@::@:@}
 GL_ACCOUNT+=   ${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\5\8@}
 GL_PROJECT+=   ${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\6\8@}
 GL_COMMIT+=    ${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\7\8@}

@ultima can you look at this? You touched this code last. bsd.sites.mk has no clear maintainer.

Well, the maintainer is portmgr ;-)

tobik added a comment.Tue, Aug 13, 3:48 PM
In D21171#461807, @mat wrote:

This could be fixed by changing the regexp, but it would probably make it way more complicated. I like this better:

@ultima can you look at this? You touched this code last. `bsd.sites.mk` has no clear maintainer.

Well, the maintainer is portmgr ;-)

Ok, sure :). But it could be made clearer IMO

$ rg "MAINTAINER|portmgr" Mk/bsd.sites.mk
3:# Sites_MAINTAINER=		ports@FreeBSD.org

No mention of portmgr anywhere in that file.

tobik updated this revision to Diff 60736.Tue, Aug 13, 3:48 PM
  • Use approach #2
mat accepted this revision.Tue, Aug 13, 4:04 PM

Looks good to me, but please, do test it a bit further, to make sure it does not break anything 0:-)

This revision is now accepted and ready to land.Tue, Aug 13, 4:04 PM