-
-
Notifications
You must be signed in to change notification settings - Fork 109
check $XDG_DATA_DIRS for a cache when user cache misses #329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Gotta write documentation before merging this |
acuteenvy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who is this for if we aren't going to include /usr/share/tldr in the client spec? I think a configuration option to change the cache location would be much more useful. /usr/share/tldr won't exist 99% of the time, because the user has to create that directory and extract the pages archive there. If someone is willing to do that, setting a config option shouldn't be a problem at all.
|
In my opinion just having the files exist would be less friction for the user or the deployer. Both cases would require |
I'm not sure I understand what you're saying. How are these files going to exist? Do you want Linux distributions to package |
|
A distribution can, but I'm not insisting on it. Personally it'll help me make easily copyable containers with a cache pre-downloaded. Also as @SpikeTheDragon40k said here, it'll be great for airgapped systems. tldr-pages/tldr#19775 (comment) |
I doubt anyone will if we keep this as a client-specific feature. And if it isn't standardized, why force users to use I don't want to block this though, maybe it's just me. But if it's going to be client-specific, I'd personally rather have an environment variable to configure the location. |
|
Could we use opt/tldr? |
|
Possibly. Can you run me through the conceptual differences between using these directories? I always forget them. |
I was thinking something similar, but @niklasmohrin convinced me otherwise that it would be too big of a shift in the goals of the spec. tldr-pages/tldr#19775 (comment) We'll just have to rely on organic co-ordination instead of top-down dictating. |
Used Ai just to help me put the thought in words: /usr/share is the standard spot for read-only, architecture-independent system data like docs and pages managed by your distro's package manager, think tldr pages installed via apt that auto-update and serve all users. /opt is for optional, third-party or manually installed software packages kept in self-contained subdirs (like /opt/tldr) to avoid messing with the core system files. The big diff: /usr/share stays pristine under OS control; /opt gives you isolation for custom stuff without conflicts. |
|
Oh wait, wouldn't |
|
Man the code is so goddamn inefficient. There's so many repeated operations. Complete rewrite would be great. |
Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
As was requested in tldr-pages/tldr#19775
The method I implemented this with feels stupid but I guess it works.