tldr-pages / tldr-c-client

C command-line client for tldr pages
MIT License
293 stars 50 forks source link

Version information looks wrong #67

Closed glawrence closed 2 years ago

glawrence commented 2 years ago

Reproduction Rate

This happens every time.

Steps to Reproduce

Run tldr -v

Result

Xxxxs-MacBook-Pro:~ $ tldr -v
tldr v1.3.0 (v1.3.0)
Copyright (C) 2016 Arvid Gerstmann
Source available at https://github.com/tldr-pages/tldr-c-client

Expected Result

Xxxxs-MacBook-Pro:~ $ tldr -v
tldr v1.4.1 (v1.4.1)
Copyright (C) 2016-2021 Arvid Gerstmann
Source available at https://github.com/tldr-pages/tldr-c-client

Although I am not sure why the version number is displayed twice, to be honest.

Additional Information

I am using macOS Catalina (10.15.7) and Homebrew (3.3.3) to install, here's an example, showing 1.4.1 is downloaded but it displays 1.3.0:

Xxxxs-MacBook-Pro:~ $ brew install tldr
==> Downloading https://ghcr.io/v2/homebrew/core/tldr/manifests/1.4.1
Already downloaded: /Users/xxxxx/Library/Caches/Homebrew/downloads/7d2e739c6a1c2d56d0a50d3ef21d580d8248fd9e45ed004b29b473047d617d4c--tldr-1.4.1.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/tldr/blobs/sha256:6cfce860468cd9b2aa4a1db7d03cc989421666cdc2b55a041e1eb5f032fb2e80
Already downloaded: /Users/xxxxx/Library/Caches/Homebrew/downloads/166628835251bdf52acd52f3511292aa64930b2a8459d9e503f161255bda95e5--tldr--1.4.1.catalina.bottle.tar.gz
==> Pouring tldr--1.4.1.catalina.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/tldr/1.4.1: 10 files, 82.1KB
Xxxxs-MacBook-Pro:~ $ tldr -v
tldr v1.3.0 (v1.3.0)
Copyright (C) 2016 Arvid Gerstmann
Source available at https://github.com/tldr-pages/tldr-c-client
Xxxxs-MacBook-Pro:~ $ 
glawrence commented 2 years ago

I should have added that I only noticed this after installing 1.4.1, I think it was all fine in 1.4.0

machale commented 2 years ago

I see the same problem on macOS Big Sur 11.6.1, also installed tldr using Homebrew 3.3.3.

I'm confident I saw the same tldr -v issue with tldr 1.4.0 yesterday.

% brew info tldr
tldr: stable 1.4.1 (bottled), HEAD
Simplified and community-driven man pages
https://tldr.sh/
Conflicts with:
  tealdeer (because both install `tldr` binaries)
/usr/local/Cellar/tldr/1.4.1 (10 files, 82.1KB) *
  Poured from bottle on 2021-11-12 at 13:49:19
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/tldr.rb
License: MIT
==> Dependencies
Build: pkg-config ✔
Required: libzip ✔
==> Options
--HEAD
    Install HEAD version
==> Caveats
zsh completions have been installed to:
  /usr/local/share/zsh/site-functions
%
%
% tldr -v
tldr v1.3.0 (v1.3.0)
Copyright (C) 2016 Arvid Gerstmann
Source available at https://github.com/tldr-pages/tldr-c-client
marchersimon commented 2 years ago

Just found the issue. The version number is hardcoded and hasn't been updated since 1.3.0.

Although I am not sure why the version number is displayed twice, to be honest.

The first one is the version defined in the code, the second one is the one brew uses. But I would have to take a look at the brew build file (if something like this exists) to make sure.

glawrence commented 2 years ago

You can see the URL in the brew info from @machale above, but see https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/tldr.rb I think this is just downloading a .tar.gz file....

marchersimon commented 2 years ago

Thanks for the link. Obviously, brew sees tldr as being at version v1.4.1, so that's not the problem. The actual problem is the Makefile, where the version is defined too. (Not the best idea to hardcode the version in two separate files imo, but at least now we know.)

@CleanMachine1 @navarroaxel now where we know how to update the version number is there a way to do that without creating a new release? I doubt it because brew already created the binaries for version v1.4.1. Should I do a PR to update to version v1.4.2 and create a new release?

navarroaxel commented 2 years ago

Yep v1.4.2 it's the best.