zsh-users
 help / color / mirror / code / Atom feed
* Does mandir get saved some place?
@ 2017-08-03 15:01 Jim
  2017-08-06  1:00 ` Nikolay Aleksandrovich Pavlov (ZyX)
  2017-08-06 11:02 ` Bart Schaefer
  0 siblings, 2 replies; 8+ messages in thread
From: Jim @ 2017-08-03 15:01 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 1466 bytes --]

Hi,

Sorry if I missed this in the documentation, but so far I have been unable
to find what I'm looking for.  Google doesn't always find things either.

First, thanks for the fact that zsh is very version conscious. This makes
it very easy to test a particular build of zsh. Not all distributions take
advantage of this, but that's something to take up with the distribution.
I just wish more applications would take this approach. I digress.

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.

Again, if I missed this in the documentation, sorry for the noise.

Sincerely,

Jim

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Does mandir get saved some place?
  2017-08-03 15:01 Does mandir get saved some place? Jim
@ 2017-08-06  1:00 ` Nikolay Aleksandrovich Pavlov (ZyX)
       [not found]   ` <CA+rB6GLYMUyzO=c5P=FLSyhS15JUQW8-naRWzfc73fovAJQ3hQ@mail.gmail.com>
  2017-08-06 11:02 ` Bart Schaefer
  1 sibling, 1 reply; 8+ messages in thread
From: Nikolay Aleksandrovich Pavlov (ZyX) @ 2017-08-06  1:00 UTC (permalink / raw)
  To: linuxtechguy, zsh-users

03.08.2017, 18:03, "Jim" <linux.tech.guy@gmail.com>:
> Hi,
>
> Sorry if I missed this in the documentation, but so far I have been unable
> to find what I'm looking for. Google doesn't always find things either.
>
> First, thanks for the fact that zsh is very version conscious. This makes
> it very easy to test a particular build of zsh. Not all distributions take
> advantage of this, but that's something to take up with the distribution.
> I just wish more applications would take this approach. I digress.
>
> 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.
>
> Again, if I missed this in the documentation, sorry for the noise.
>
> Sincerely,
>
> Jim

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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Fwd: Does mandir get saved some place?
       [not found]   ` <CA+rB6GLYMUyzO=c5P=FLSyhS15JUQW8-naRWzfc73fovAJQ3hQ@mail.gmail.com>
@ 2017-08-06  6:37     ` Jim
  2017-08-06  9:48       ` Nikolay Aleksandrovich Pavlov (ZyX)
  0 siblings, 1 reply; 8+ messages in thread
From: Jim @ 2017-08-06  6:37 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 3061 bytes --]

---------- Forwarded message ----------
From: Jim <linux.tech.guy@gmail.com>
Date: Sun, Aug 6, 2017 at 1:29 AM
Subject: Re: Does mandir get saved some place?
To: "Nikolay Aleksandrovich Pavlov (ZyX)" <kp-pav@yandex.ru>

Forgot to change address to go the list.


Nikolay,

On Sat, Aug 5, 2017 at 8:00 PM, Nikolay Aleksandrovich Pavlov (ZyX) <
kp-pav@yandex.ru> wrote:

> 03.08.2017, 18:03, "Jim" <linux.tech.guy@gmail.com>:
>
> > 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Does mandir get saved some place?
  2017-08-06  6:37     ` Fwd: " Jim
@ 2017-08-06  9:48       ` Nikolay Aleksandrovich Pavlov (ZyX)
  2017-08-06 17:55         ` Jim
  0 siblings, 1 reply; 8+ messages in thread
From: Nikolay Aleksandrovich Pavlov (ZyX) @ 2017-08-06  9:48 UTC (permalink / raw)
  To: linuxtechguy, zsh-users



06.08.2017, 09:40, "Jim" <linux.tech.guy@gmail.com>:
> ---------- Forwarded message ----------
> From: Jim <linux.tech.guy@gmail.com>
> Date: Sun, Aug 6, 2017 at 1:29 AM
> Subject: Re: Does mandir get saved some place?
> To: "Nikolay Aleksandrovich Pavlov (ZyX)" <kp-pav@yandex.ru>
>
> Forgot to change address to go the list.
>
> Nikolay,
>
> On Sat, Aug 5, 2017 at 8:00 PM, Nikolay Aleksandrovich Pavlov (ZyX) <
> kp-pav@yandex.ru> wrote:
>
>>  03.08.2017, 18:03, "Jim" <linux.tech.guy@gmail.com>:
>>
>>  > 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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Does mandir get saved some place?
  2017-08-03 15:01 Does mandir get saved some place? Jim
  2017-08-06  1:00 ` Nikolay Aleksandrovich Pavlov (ZyX)
@ 2017-08-06 11:02 ` Bart Schaefer
  2017-08-06 19:20   ` Jim
  1 sibling, 1 reply; 8+ messages in thread
From: Bart Schaefer @ 2017-08-06 11:02 UTC (permalink / raw)
  To: linuxtechguy; +Cc: Zsh Users

On Thu, Aug 3, 2017 at 8:01 AM, Jim <linux.tech.guy@gmail.com> wrote:
>
> 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.

Ah, well, the purpose of the configure option is so you can tell "make
install" to put the manual pages in a place that's already in your
$MANPATH.  It's not intended to change the shell to know about some
new location.

> would it be unreasonable to ask that a variable like "mandir" be set with
> the path to those man pages?

It wouldn't be unreasonable to ask, but I wouldn't promise an
affirmative response.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Does mandir get saved some place?
  2017-08-06  9:48       ` Nikolay Aleksandrovich Pavlov (ZyX)
@ 2017-08-06 17:55         ` Jim
  2017-08-06 20:13           ` Nikolay Aleksandrovich Pavlov (ZyX)
  0 siblings, 1 reply; 8+ messages in thread
From: Jim @ 2017-08-06 17:55 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 2675 bytes --]

Nikolay,

On Sun, Aug 6, 2017 at 4:48 AM, Nikolay Aleksandrovich Pavlov (ZyX) <
kp-pav@yandex.ru> wrote:

>
> Wondering why do you install different zsh versions with one prefix? This
> would need some hacks like moving mandir you mentioned.


Simple answer, by default this is what happens when you build zsh. Zsh
has this "self protection system" built into the the build and install, so
it
doesn't overwrite unless your building the "same version". So, for
someone new to the zsh build process, they can just checkout and build
another version and each version will work. All by default and all with the
/usr/local/ prefix. May not be the best way, and it is not the only way,
but it
appears to be the default way. You don't need man pages to "run" any
version of zsh. They are nice to have when needed.

After 30+ years of system administration(UNIX/Linux) on multi user
systems, I view things from the point of view of how this would best work
for all users on that system.  Old habits are sometimes hard to break.


> 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.
>

Like most things with UNIX/Linux there are any number of ways of doing this.
Some may be better or worst then others for one reason or another, but will
still work. Ask 12 people how they do it, and you are likely to get 12
answers
and or at least 12 variants of the same answer.


>
> 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.
>
>
Not sure I understand what you are saying here, or at least why you need
to remove the `zsh` executable. I have to assume you are not talking about
removing /bin/zsh. I guess I'm looking at it from a slightly different
point of
view. Having only one `zsh` is not a bad idea.


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

One of many reasons I love zsh.


>
> 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.
>

True. Sadly, but true.  But I think there is a different way to approach
this.
Just need to think about this for a while.

Useful discussion, thanks.

Jim

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Does mandir get saved some place?
  2017-08-06 11:02 ` Bart Schaefer
@ 2017-08-06 19:20   ` Jim
  0 siblings, 0 replies; 8+ messages in thread
From: Jim @ 2017-08-06 19:20 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 1926 bytes --]

Bart,

On Sun, Aug 6, 2017 at 6:02 AM, Bart Schaefer <schaefer@brasslantern.com>
wrote:

> On Thu, Aug 3, 2017 at 8:01 AM, Jim <linux.tech.guy@gmail.com> wrote:
> >
> > 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.
>
> Ah, well, the purpose of the configure option is so you can tell "make
> install" to put the manual pages in a place that's already in your
> $MANPATH.  It's not intended to change the shell to know about some
> new location.
>
> Understand.  Wasn't looking at it from that point of view.


> > would it be unreasonable to ask that a variable like "mandir" be set with
> > the path to those man pages?
>
> It wouldn't be unreasonable to ask, but I wouldn't promise an
> affirmative response.
>

In light of that, a rethink is in in order.  The one thing that still
bothers me
is that if you just use the defaults when building multiple versions the man
pages are overwritten. Without a rebuild there is currently no way, that I
can see, to get a specific version of the man pages back without a rebuild.
Reminds me of the saying, "If it hurts, don't do it".  But it does hurts
anyone
who is not aware of this. Not sure there is an easy answer.

Zsh is version "wise", so it doesn't seem unreasonable to have the man
pages do the same(like ${prefix}/share/zsh/{version}/man) It would take
the guesswork out of where the man pages are and make it easier to set
MANPATH when changing versions. This can be done with the --mandir
option and a few lines in .zshrc. The default man pages would be whatever
version of zsh your distribution has installed. But most distributions are
behind the current version, which started me down this rode in the first
place. :-(  As long as things are under my *own* control, this will work.

Thanks for responding and listening,

Jim

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Does mandir get saved some place?
  2017-08-06 17:55         ` Jim
@ 2017-08-06 20:13           ` Nikolay Aleksandrovich Pavlov (ZyX)
  0 siblings, 0 replies; 8+ messages in thread
From: Nikolay Aleksandrovich Pavlov (ZyX) @ 2017-08-06 20:13 UTC (permalink / raw)
  To: linuxtechguy, zsh-users



06.08.2017, 20:57, "Jim" <linux.tech.guy@gmail.com>:
> Nikolay,
>
> On Sun, Aug 6, 2017 at 4:48 AM, Nikolay Aleksandrovich Pavlov (ZyX) <
> kp-pav@yandex.ru> wrote:
>
>>  Wondering why do you install different zsh versions with one prefix? This
>>  would need some hacks like moving mandir you mentioned.
>
> Simple answer, by default this is what happens when you build zsh. Zsh
> has this "self protection system" built into the the build and install, so
> it
> doesn't overwrite unless your building the "same version". So, for
> someone new to the zsh build process, they can just checkout and build
> another version and each version will work. All by default and all with the
> /usr/local/ prefix. May not be the best way, and it is not the only way,
> but it
> appears to be the default way. You don't need man pages to "run" any
> version of zsh. They are nice to have when needed.
>
> After 30+ years of system administration(UNIX/Linux) on multi user
> systems, I view things from the point of view of how this would best work
> for all users on that system. Old habits are sometimes hard to break.
>
>>  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.
>
> Like most things with UNIX/Linux there are any number of ways of doing this.
> Some may be better or worst then others for one reason or another, but will
> still work. Ask 12 people how they do it, and you are likely to get 12
> answers
> and or at least 12 variants of the same answer.
>
>>  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.
>
> Not sure I understand what you are saying here, or at least why you need
> to remove the `zsh` executable. I have to assume you are not talking about
> removing /bin/zsh. I guess I'm looking at it from a slightly different
> point of
> view. Having only one `zsh` is not a bad idea.

When you build zsh you have two executables installed as a result: `zsh` and `zsh-${ZSH_VERSION}`. If you have more then one zsh version then when you run `zsh` obviously only one of `zsh`s wins. But if you have different zsh version installed with the same prefix then whatever is the last zsh version you installed will overwrite `zsh` executable and you will thus somehow need to counter that. With /bin/zsh and /usr prefix it is logical to just remove /usr/bin/zsh. With zsh-version-specific prefixes there are other options, I normally just use separate testing environments (i.e. test zsh will not appear in $PATH up until I want to do some testing).

I would not be surprised to know that there is some configure option after which executable is simply not installed though, I just never needed to find it.

>
>>  This variant is also more universal: not all software uses its version in
>>  its paths.
>
> One of many reasons I love zsh.
>
>>  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.
>
> True. Sadly, but true. But I think there is a different way to approach
> this.
> Just need to think about this for a while.
>
> Useful discussion, thanks.
>
> Jim


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-08-06 20:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-03 15:01 Does mandir get saved some place? Jim
2017-08-06  1:00 ` Nikolay Aleksandrovich Pavlov (ZyX)
     [not found]   ` <CA+rB6GLYMUyzO=c5P=FLSyhS15JUQW8-naRWzfc73fovAJQ3hQ@mail.gmail.com>
2017-08-06  6:37     ` Fwd: " Jim
2017-08-06  9:48       ` Nikolay Aleksandrovich Pavlov (ZyX)
2017-08-06 17:55         ` Jim
2017-08-06 20:13           ` Nikolay Aleksandrovich Pavlov (ZyX)
2017-08-06 11:02 ` Bart Schaefer
2017-08-06 19:20   ` Jim

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).