Bug 281716 - sysutils/loki: Output version number on `loki --version`
Summary: sysutils/loki: Output version number on `loki --version`
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Christopher Beppler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-25 16:59 UTC by Michael Gmelin
Modified: 2024-09-26 13:50 UTC (History)
1 user (show)

See Also:
freebsd: maintainer-feedback+
grembo: maintainer-feedback? (freebsd)


Attachments
Patch to add version information to sysutils/loki (1.42 KB, patch)
2024-09-25 16:59 UTC, Michael Gmelin
grembo: maintainer-approval? (freebsd)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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(-)