Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Does mandir get saved some place?




06.08.2017, 09:40, "Jim" <linux.tech.guy@xxxxxxxxx>:
> ---------- Forwarded message ----------
> From: Jim <linux.tech.guy@xxxxxxxxx>
> Date: Sun, Aug 6, 2017 at 1:29 AM
> Subject: Re: Does mandir get saved some place?
> To: "Nikolay Aleksandrovich Pavlov (ZyX)" <kp-pav@xxxxxxxxx>
>
> Forgot to change address to go the list.
>
> Nikolay,
>
> On Sat, Aug 5, 2017 at 8:00 PM, Nikolay Aleksandrovich Pavlov (ZyX) <
> kp-pav@xxxxxxxxx> wrote:
>
>>  03.08.2017, 18:03, "Jim" <linux.tech.guy@xxxxxxxxx>:
>>
>>  > With the fact that the configure script has the option "mandir=<some
>>  dir>"
>>  > I assumed(bad thing to do) that there would be an easy way to discover
>>  > where the man pages were saved. If there is, so far I haven't found it.
>>  My
>>  > reasoning for this is, if I'm testing a particular build, I would like to
>>  > have
>>  > available the pages for that build if they exist. I assumed(I know)
>>  > that is why "mandir" is there, to make this possible.
>>  >
>>  > Is there a variable of something else that can be accessed to tell
>>  > someone where a particular zsh build saved the man pages? If not,
>>  > would it be unreasonable to ask that a variable like "mandir" be set with
>>  > the path to those man pages? This would make it so much easier to
>>  > set MANPATH. For me it would even be better if zsh automatically
>>  > added a path to them before the normal locations. I'm sure others
>>  > would disagree. An option allowing such behaviour would allow a user
>>  > to set this to meet there own needs.
>>
>>  You can probably use `zsh -fc 'printf "%s" $module_path[1]:h:h:h/share/man'`.
>>  Should work fine as long as you are only setting single installation prefix
>>  based on which other locations are computed and not other installation
>>  locations explicitly. All versions I ever needed have `$module_path[1]` set
>>  to something like `{prefix}/lib(64)?/zsh/$ZSH_VERSION`, so three `:h` are
>>  there to get rid of `lib*`, `zsh` and `$ZSH_VERSION` components.
>
> I had been playing around with something like that. It assumes that the man
> pages go into the traditional locations of either /usr/share/man or
> /usr/local/share/man depending on the prefix. The issue with this, from
> what
> I've seen, is if two versions are installed with the same prefix, the last
> version
> installed will overwrite the previous version's man pages. Each version can
> be given its on directory to store the man pages, by adding the option
> --mandir=<a unique path for each version> when executing ./configure during
> the build. This means they will be in a non-standard location and the
> location
> would have to be added to MANPATH. The result of using --mandir in this
> way is the method used above will not give you the results you need to set
> MANPATH.
>
> It would appear that unlike modules, which has the "module_path" variable,
> there is no equivalent variable for mandir. If there is I haven't found it.
> It
> can be argued that zsh doesn't need to know where the man pages are
> located. But the command "man" does, which means that zsh has to set
> MANPATH correctly. It would simplify things if zsh could somehow return
> this information.
>
> Thanks for responding,
>
> Jim

Wondering why do you install different zsh versions with one prefix? This would need some hacks like moving mandir you mentioned. For testing purposes I usually just compile with prefix `~/.local-${app}[-${app_version}]`, this way each application is installed into its own directory and additionally does not need superuser rights for installation or creating a package. For system-wide installations there is /opt which may be used for this purpose.

Of course, if you need all zsh’s available at once you will need to remove `zsh` executable, keeping only `zsh-{version}` and modify $PATH, either in .zshrc or in some place like /etc/env.d.

This variant is also more universal: not all software uses its version in its paths.

Alternative is making “a unique path for each version” be computable based on `$ZSH_VERSION`, in any case even if new variable is created it will be only available in new zsh versions.



Messages sorted by: Reverse Date, Date, Thread, Author