Skip to content

Conversation

@dgilman
Copy link
Contributor

@dgilman dgilman commented Dec 7, 2025

Description

The tldr-pages port is introduced here just to provide data for the build process but could be consumed by the tlrc port in MacPorts. Currently, the tldr clients don't support reading from a system directory (like manpages) and require the user to fetch a new tldr.zip but I think this is simply an oversight on their design. I've opened a PR with upstream to ask about changing the behavior of the clients.

Unfortuntunately, the GitHub project for the tldr.zip does releases by stealth updating the tldr.zip file on a single release possibly multiple times a day. If this is too much churn for MacPorts the feature could be backed out.

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS 15.4 24E248 x86_64
Xcode 16.3 16E140

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • referenced existing tickets on Trac with full URL in commit message?
  • checked your Portfile with port lint?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?
  • checked that the Portfile's most important variants haven't been broken?

@reneeotten
Copy link
Contributor

wrong checksum... already an example of an upstream stealth update? That's really bog ideal for MacPorts or any other downstream packager... Can you ask upstream to do proper releases?

Copy link
Contributor

@reneeotten reneeotten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments, but if the statement in the PR description

Unfortuntunately, the GitHub project for the tldr.zip does releases by stealth updating the tldr.zip file on a single release possibly multiple times a day. If this is too much churn for MacPorts the feature could be backed out.

is indeed true then this shouldn't be added to MacPorts as such a "stealth update" method will break the package every time....

long_description {*}${description}. This package installs an archive \
of the latest help pages to your system.

depends_build-append port:npm11
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't aligned correctly with four spaces

build {
system -W ${worksrcpath} "npm ci"
system -W ${worksrcpath} "npm run build-index"
system -W ${worksrcpath} "zip -q -r tldr.zip pages* LICENSE.md index.json"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why would we be generating/installing a .zip file?

Comment on lines +27 to +31
build {
system -W ${worksrcpath} "npm ci"
system -W ${worksrcpath} "npm run build-index"
system -W ${worksrcpath} "zip -q -r tldr.zip pages* LICENSE.md index.json"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can/should this be using the npm PortGroup instead (disclaimer: I have no experience with npm build/packages/PortGroup)?

PortSystem 1.0
PortGroup github 1.0

github.setup tldr-pages tldr 5a38d5f9f7dff0111fa756fdbbfc1546aa6905c7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you will need to add a version field that sets a reasonable value, we do not want/can use a git hash for that as it doesn't necessarily "increase" as a usual version number. Other ports use, for example, the data of the commit as the version (of course in the form YYYYMMDD)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants