Page MenuHomeFreeBSD

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

Authored by tobik on Aug 6 2019, 4:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Mar 20, 2:36 AM
Unknown Object (File)
Feb 19 2024, 3:14 AM
Unknown Object (File)
Dec 23 2023, 12:19 PM
Unknown Object (File)
Nov 4 2023, 11:16 PM
Unknown Object (File)
Oct 31 2023, 9:40 PM
Unknown Object (File)
Oct 28 2023, 6:49 AM
Unknown Object (File)
Oct 25 2023, 12:38 AM
Unknown Object (File)
Oct 3 2023, 11:14 PM
Subscribers

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
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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.

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 ;-)

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.

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.Aug 13 2019, 4:04 PM