On Tue, Jan 05, 2021 at 07:18:20AM -0700, Aaron Bieber wrote:
> Hi,
>
> This teaches portgen and go.port.mk how to handle module URLs that
> contain uppercase characters.
<SNIP>
> --- infrastructure/lib/OpenBSD/PortGen/Port/Go.pm
> +++ infrastructure/lib/OpenBSD/PortGen/Port/Go.pm
> @@ -31,6 +31,8 @@ use Carp;
> use Cwd;
> use File::Temp qw/ tempdir /;
>
> +use Data::Dumper;
> +
You probably don't need this
<SNIP>
> --- lang/go/go.port.mk
> +++ lang/go/go.port.mk
> @@ -14,6 +14,10 @@ MASTER_SITES${MODGO_MASTER_SITESN} ?= ${MASTER_SITE_AT
> MODGO_RUN_DEPENDS = lang/go
> MODGO_BUILD_DEPENDS = lang/go
>
> +.for l in a b c d e f g h i j k l m n o p q r s t u v w x y z
> +_subst := ${_subst}:S/${l:U}/!$l/g
> +.endfor
> +
> .if ${NO_BUILD:L} == "no" && ${MODGO_BUILDDEP:L} == "yes"
> BUILD_DEPENDS += ${MODGO_BUILD_DEPENDS}
> .endif
> @@ -57,13 +61,18 @@ MODGO_TEST_CMD += -ldflags="${MODGO_LDFLAGS}"
> .endif
>
> .if defined(MODGO_MODNAME)
> +.for _s in ${_subst}
> +MODGO_MODNAME_ESC = ${MODGO_MODNAME${_s}}
> +DISTNAME_ESC = ${DISTNAME${_s}}
> +.endfor
> +
I'm not really a make expert here, but wouldn't this logic throw away
all but the last $_subst? I would have expected something like this,
to repeatedly munge things. Then again, it's totally possible make does
something I don't expect.
+MODGO_MODNAME_ESC = ${MODGO_MODNAME}
+DISTNAME_ESC = ${DISTNAME}
+.for _s in ${_subst}
+MODGO_MODNAME_ESC = ${MODGO_MODNAME_ESC${_s}}
+DISTNAME_ESC = ${DISTNAME_ESC${_s}}
+.endfor
> EXTRACT_SUFX ?= .zip
> -PKGNAME ?= ${DISTNAME:S/-v/-/}
> +PKGNAME ?= ${DISTNAME_ESC:S/-v/-/}
Wouldn't this make the PKGNAME=my!fancy!tool if the DISTNAME was
myFancyTool? That's doesn't really meet my expectations, but I'm not a
go porter, so my expectations don't count much.
> ALL_TARGET ?= ${MODGO_MODNAME}
> MODGO_FLAGS += -modcacherw
> -DISTFILES =
> ${DISTNAME}${EXTRACT_SUFX}{${MODGO_VERSION}${EXTRACT_SUFX}}
> -EXTRACT_ONLY = ${DISTNAME}${EXTRACT_SUFX}
> -MASTER_SITES ?= ${MASTER_SITE_ATHENS}${MODGO_MODNAME}/@v/
> +DISTFILES =
> ${DISTNAME_ESC}${EXTRACT_SUFX}{${MODGO_VERSION}${EXTRACT_SUFX}}
> +EXTRACT_ONLY = ${DISTNAME_ESC}${EXTRACT_SUFX}
> +MASTER_SITES ?= ${MASTER_SITE_ATHENS}${MODGO_MODNAME_ESC}/@v/
> . for _modpath _modver in ${MODGO_MODULES}
> DISTFILES +=
> ${MODGO_DIST_SUBDIR}/${_modpath}/@v/${_modver}.zip{${_modpath}/@v/${_modver}.zip}:${MODGO_MASTER_SITESN}
> DISTFILES +=
> ${MODGO_DIST_SUBDIR}/${_modpath}/@v/${_modver}.mod{${_modpath}/@v/${_modver}.mod}:${MODGO_MASTER_SITESN}
l8rZ,
--
andrew - http://afresh1.com
Software doesn't do what you want it to do, it does what you tell it do.
-- Stefan G. Weichinger.