Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Does mandir get saved some place?
- X-seq: zsh-users 22792
- From: "Nikolay Aleksandrovich Pavlov (ZyX)" <kp-pav@xxxxxxxxx>
- To: "linuxtechguy@xxxxxxxxx" <linuxtechguy@xxxxxxxxx>, "zsh-users@xxxxxxx" <zsh-users@xxxxxxx>
- Subject: Re: Does mandir get saved some place?
- Date: Sun, 06 Aug 2017 12:48:28 +0300
- Authentication-results: mxback2o.mail.yandex.net; dkim=pass header.i=@yandex.ru
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1502012909; bh=T5yPDp++b8Y975nm7QxaZzo2rzp5/Cbrkxi8LLIiJMQ=; h=From:To:In-Reply-To:References:Subject:Message-Id:Date; b=Ru3lQf1xIp5jtUjEzRk/4BjKpMJ7gqgso0cXQQJcQWaObvpXYXG/c7y+4DnJ+Jl5J mlROqn5Inxd5j+DXBqJoWy4pjHUiPoXrN+JT30LU2H1QNNwPFFhblZ2ffXPqgZ7TgD P4bte6Tb+VMA3z30ZAXl66bZgl7rBqp8pwNiZNxI=
- In-reply-to: <CA+rB6GLgganw1BwuHJDN10ASnOWrX4T++cm2traw2WvAaLZOug@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CA+rB6G+XTk5JvKQQ=8RTic4j+92UgvBpn6p6Q=P0hJBmz1uoaA@mail.gmail.com> <76131501981203@web60g.yandex.ru> <CA+rB6GLYMUyzO=c5P=FLSyhS15JUQW8-naRWzfc73fovAJQ3hQ@mail.gmail.com> <CA+rB6GLgganw1BwuHJDN10ASnOWrX4T++cm2traw2WvAaLZOug@mail.gmail.com>
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