Comments (14)
Thanks for the tip! I'll move the colon to the end. I think that has a similar effect but will give priority to Linuxbrew man pages.
from brew.
Fixed. Thanks for the bug report!
from brew.
I've filed a PR (shown right above this comment) to also fix this in the installation script.
from brew.
Thanks for the tip! I'll move the colon to the end. I think that has a similar effect but will give priority to Linuxbrew man pages.
This seems to do exactly as you wish.
Thx for fixing!
from brew.
I'm not sure I understand the problem. Let's have a look at what the default export statement (export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
) does in the two possible situations.
(1) MANPATH is empty.
Then MANPATH="$HOME/.linuxbrew/share/man:
— that is with the desired colon at the end.
(2) MANPATH is not empty.
Then MANPATH="$HOME/.linuxbrew/share/man:$MANPATH
, that is linuxbrew's path is prepended to whatever MANPATH has been previously set.
So, I'm not sure that this change is necessary.
from brew.
@azrdev Please report…
echo x"$MANPATH"x
echo x"$HOME/.linuxbrew/share/man:$MANPATH"x
from brew.
You're right, I didn't consider the case when MANPATH is empty before. However, a MANPATH starting or ending with ::
seems to yield the same result as (the standard) single :
.
(2) MANPATH is not empty.
ThenMANPATH="$HOME/.linuxbrew/share/man:$MANPATH
, that is linuxbrew's path is prepended to whatever MANPATH has been previously set.
We need the colon at one end, for system manpages to be considered (see http://askubuntu.com/a/693612). You're assuming here whoever might have set MANPATH before should have appended the colon at the end, so brew shouldn't care about doing it?
from brew.
Users can set MANPATH so we have no right to assume that what they did with it was wrong or unintentional. Previous behavior was correct because it was only adding Linuxbrew's manpath, it was not overriding it.
from brew.
@azrdev Do you have an example where the previous code did not have the expected or desired behaviour?
from brew.
@sjackman quoting from my first comment here:
The README says you should add to your profile export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
This makes all the previous manual pages inaccessible
Actually, this is correct for both cases: (1) previously empty -> colon at the end. (2) previously set correctly (with colon at the end) -> still colon at the end.
The case it breaks is if it previously had a colon (only) at the beginning, or none at all. This might be intended by the user, but I assume most users expect less complexity. I was confused when setting MANPATH did hide the system files, even though the default value was empty. So at least a warning & explanation would be helpful at this point.
from brew.
When colon is at the beginning of MANPATH, the end result of the previous change would be:
MANPATH=$HOME/.linuxbrew/share/man::OTHER:PATHS
. Note the two colons there. Because environment variables are split based on colons, this MANPATH means that the following directories are included:
- $HOME/.linuxbrew/share/man
<empty>
- OTHER
- PATHS
The second (<empty>
) directory makes sure that default man pages are searched.
from brew.
Hi, @azrdev. I'm not able to duplicate the failure that you describe with a colon only at the beginning. Can you please give an exact example? The following works for me.
$ export MANPATH=:$HOME/man
$ echo $MANPATH
:/home/sjackman/man
$ man -w ab # some man page provided by host but not by Linuxbrew
/usr/share/man/man1/ab.1.gz
$ MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
$ echo $MANPATH
/home/sjackman/.linuxbrew/share/man::/home/sjackman/man
$ man -w ab
/usr/share/man/man1/ab.1.gz
So as Maxim points out, you can have a colon at the beginning or at the end, or a double colon in the middle, and it will still search the system MANPATH
.
from brew.
So as Maxim points out, you can have a colon at the beginning or at the end, or a double colon in the middle, and it will still search the system MANPATH.
Confirmed by looking at man 1 manpath
, so I was wrong again. I didn't know, just relied on said askubuntu link. :)
As it stands there was never a bug, only a pitfall we could (imho should) warn the user of.
from brew.
No worries. Glad we sorted it out. I've reverted both commits (brew
and install
).
from brew.
Related Issues (20)
- brew install mongodb gives SyntaxError HOT 4
- Repeated `xorgproto`-related warnings output from several core commands (e.g. `doctor`, `leaves`) HOT 30
- brew audit/style error when your Ruby2.6RubyGems3.0.2 HOT 3
- Brew upgrade don't delete old version's Cellar directory for packages installed from sources HOT 1
- brew won't use correct git version HOT 1
- Failure while executing git config, exit code 129 HOT 27
- Unable to install linuxbrew to vps server over ssh. " Cannot write: No space left on device HOT 2
- "Cannot write: No space left on device" when trying to install linuxbrew to VPS server HOT 29
- brew bundle dump fails HOT 2
- Redirect http://linuxbrew.sh to https://linuxbrew.sh HOT 1
- `brew install yarn` does not support `--without-node` HOT 1
- Vendored Ruby install fails with unhelpful message on i686 HOT 6
- Cannot execute one-line installation as root HOT 1
- Error: cannot load such file -- irb HOT 1
- Brewed curl cannot find the CA certificates and all bottle downloads fail HOT 14
- Stuck in rebase HOT 2
- Unable to resolve dependency: user requested 'did_you_mean' HOT 8
- cannot load such file -- os/linux/glibc HOT 5
- pipenv does not install HOT 9
- Applying patch breaks brew HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brew.