Skip to content
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

keep the locks on the same drive #5

Closed
wants to merge 1 commit into from
Closed

Conversation

bricewge
Copy link
Contributor

This fix the issue discussed here.
Following is an example of the bug:

$ brew install gpg
Error: You must `brew link pkg-config` before gnupg2 can be installed
$ brew link pkg-config
Linking /Users/ypringau/.brew/Cellar/pkg-config/0.29.1_2... 2 symlinks created
$ brew install gpg
Error: You must `brew link pkg-config` before gnupg2 can be installed

It seems it came from the fact that symlinking between drives (here /Users/$USER and /) doesn't work. I don't know what was the reason behind doing this, but removing this part of the script solve the issue.

@kube
Copy link
Owner

kube commented Dec 18, 2016

I made an answer on the 42 forum post, about why these symlinks are here.

They were added to let Homebrew use flock() on the old NFS sessions, and these sessions are still in use in some 42 partner schools. (e.g. WeThinkCode in South Africa)

I would prefer to add a guard, in case this script is used on a NFS session:

if [ is_nfs_session() ]
then
  # Create symlinks for Locks folder
fi

This means we would need to find a way to detect an NFS session.

Creating a random file at ~/ and trying to flock() it would be a solution:

If it fails we can assume we're on an NFS session.

@bricewge
Copy link
Contributor Author

This would be definitely cleaner that what this pull request offers.
A simple way to test if the user partition is of NFS type would be to do a grep on mount or showmount. I'll try to make a new pull request in the coming days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants