Bug 266567 - textproc/termshot: incorrect --version
Summary: textproc/termshot: incorrect --version
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Loïc Bartoletti
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-23 16:08 UTC by Nuno Teixeira
Modified: 2022-10-27 09:50 UTC (History)
0 users

See Also:
lbartoletti: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nuno Teixeira freebsd_committer freebsd_triage 2022-09-23 16:08:34 UTC
Hello!

>`termshot --version`:
> termshot version (development)

It seams that -X ${GO_MODULE}/internal.Version=${DISTVERSION}" isn't working.

internal/cmd/root.go:
---
if showVersion, err := cmd.Flags().GetBool("version"); showVersion && err == nil {
                        if len(version) == 0 {
                                version = "(development)"
                        }
---

Sometimes I have similar problems geting "version" to work properly.
I have tried several combinations without success.

Any clues?

Thanks,
Nuno
Comment 1 commit-hook freebsd_committer freebsd_triage 2022-10-27 09:36:16 UTC
A commit in branch main references this bug:

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

commit 3f210ce0ecfca8d2a52e778404338f5bcee2bdd8
Author:     Loïc Bartoletti <lbartoletti@FreeBSD.org>
AuthorDate: 2022-10-27 09:33:46 +0000
Commit:     Loïc Bartoletti <lbartoletti@FreeBSD.org>
CommitDate: 2022-10-27 09:34:38 +0000

    textproc/termshot: Update to 0.2.5

    fix --version

    PR:             266567
    Reported by:    eduardo

 textproc/termshot/Makefile |  5 ++---
 textproc/termshot/distinfo | 10 +++++-----
 2 files changed, 7 insertions(+), 8 deletions(-)
Comment 2 Loïc Bartoletti freebsd_committer freebsd_triage 2022-10-27 09:37:20 UTC
Updated and fixed.

The variable was in internal/cmd.version and not internal.Version ...
Comment 3 Nuno Teixeira freebsd_committer freebsd_triage 2022-10-27 09:50:27 UTC
(In reply to Loïc Bartoletti from comment #2)

Nice, I think I understand how it works!

Thanks