Bug 281716

Summary: sysutils/loki: Output version number on `loki --version`
Product: Ports & Packages Reporter: Michael Gmelin <grembo>
Component: Individual Port(s)Assignee: Christopher Beppler <freebsd>
Status: Closed FIXED    
Severity: Affects Some People CC: freebsd
Priority: --- Flags: freebsd: maintainer-feedback+
grembo: maintainer-feedback? (freebsd)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Patch to add version information to sysutils/loki grembo: maintainer-approval? (freebsd)

Description Michael Gmelin freebsd_committer freebsd_triage 2024-09-25 16:59:48 UTC
Created attachment 253821 [details]
Patch to add version information to sysutils/loki

When running `loki --version`, no version is shown:

    loki, version  (branch: , revision: unknown)
      build user:       
      build date:       
      go version:       go1.21.13
      platform:         freebsd/amd64
      tags:             unknown

The attached patch changes this (inspired by how other go ports
like node_exporter handle the situation):

    loki, version 2.9.2 (branch: HEAD, revision: 9)
      build user:       root
      build date:       2024-09-25T16:51:36Z
      go version:       go1.21.13
      platform:         freebsd/amd64
      tags:             unknown

The patch also moves SUB_LIST around to pacify portclippy.
Comment 1 Christopher Beppler 2024-09-26 09:30:29 UTC
Very nice. Thank you.
Comment 2 Christopher Beppler 2024-09-26 09:30:42 UTC
Very nice. Thank you!
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-09-26 13:50:03 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d5c8853a4766cee2f6c45ea0e5ee296685ee76c4

commit d5c8853a4766cee2f6c45ea0e5ee296685ee76c4
Author:     Michael Gmelin <grembo@FreeBSD.org>
AuthorDate: 2024-09-26 12:22:09 +0000
Commit:     Michael Gmelin <grembo@FreeBSD.org>
CommitDate: 2024-09-26 13:48:10 +0000

    sysutils/loki: Add version information to build

    This way, `loki --version` actually shows the version that
    is installed.

    PR:             281716
    Approved by:    freebsd@funzi.org (maintainer)

 sysutils/loki/Makefile | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)