On 2021/04/13 23:55, Denis Fondras wrote:
> -V =          2019-03-20T21-29-03Z
> -GH_PROJECT = mc
> -GH_TAGNAME = RELEASE.${V}
> +V =          2021-03-22T20-27-01Z
> +CID =                c3cae160b35d53056e454386c09850a158c049ec
> +MODGO_MODNAME =      github.com/minio/mc

The shell `` are not ideal, how about using make substs instead and
introducing a variable here to reuse in the places where you have them?

> +MODGO_VERSION = "v0.0.0-${V:C/-//g:C/T//:C/Z//}-`echo ${CID} | cut -b 1-12`"

That can be simplified too, e.g.

::::::::::::
V =             2021-03-22T20-27-01Z
CID =           c3cae160b35d53056e454386c09850a158c049ec
SHORTCID =      ${CID:C/(............).*/\1/}

MODGO_MODNAME = github.com/minio/mc
MODGO_VERSION = v0.0.0-${V:C/[-TZ]//g}-${SHORTCID}

DISTNAME =      mc-${MODGO_VERSION}
PKGNAME =       minioc-0.${V:C/T.*//:S/-//g}

MODGO_LDFLAGS = -s -w \
                -X 
github.com/minio/mc/cmd.Version=${V:C/T([0-9]+)-([0-9]+)-([0-9]+)/T\1:\2:\3/} \
                -X github.com/minio/mc/cmd.ReleaseTag=RELEASE.${V} \
                -X github.com/minio/mc/cmd.CommitID=${CID} \
                -X github.com/minio/mc/cmd.ShortCommitID=${SHORTCID}
::::::::::::

There is also a duplicate MODGO_MODNAME in mc tucked in between the MODFILES
and MODULES.

Reply via email to