-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix #1118: follow only dir-symlinks #1120
Fix #1118: follow only dir-symlinks #1120
Conversation
This corrects the deffect where pyenv tries to determine an absolute path of the directory containing a file and follows symlinks manually. Because of missing check it behaved correctly, but a misleading error message was shown in the terminal output. Thanks to @HQJaTu for the patch
@joshfriend @yyuu @timsavage what is the policy for bugfix releases? can we have this out asap plz? |
Ping @joshfriend @yyuu @timsavage |
Please stop referencing me, I'm not part of the pyenv team. |
Oops, sorry. I just saw your commits in master and missed they they're coming from PR :) |
@@ -40,7 +40,7 @@ else | |||
|
|||
# Use a subshell to avoid changing the current path | |||
( | |||
while [ -n "$path" ]; do | |||
while [[ -n "$path" && $(echo "$path" | grep /) ]]; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will return "pwd" if "$path" is /. At least it must not be the correct return value of the function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some fix like following will work sufficiently. Please consider adding tests for it.
while [[ "$path" == *"/"* ]]; do
cd "${path%/*}"
local name="${path##*/}"
[ -n "$name" ] || break
path="$(resolve_link "$name" || true)"
done
pwd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'll check this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checked it: it doesn't work your way at all. Will need to investigate some better way.
I've started a while back to fix this in rbenv (upstream), but it needs updating: rbenv/rbenv#868. |
btw: |
Wow, why? /me needs to get back to fixing this |
Closing in favor of #1216. |
This corrects the deffect where pyenv tries to determine an absolute
path of the directory containing a file and follows symlinks
manually. Because of missing check it behaved correctly, but a
misleading error message was shown in the terminal output.
Resolves #1118.
Thanks to @HQJaTu for the initial patch.