-
Notifications
You must be signed in to change notification settings - Fork 34
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
avoid ./ in symlink paths, use readlink instead of ls to resolve link #5
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5 +/- ##
=======================================
Coverage 97.94% 97.94%
=======================================
Files 16 16
Lines 2876 2876
=======================================
Hits 2817 2817
Misses 59 59 Continue to review full report at Codecov.
|
@@ -39,8 +39,7 @@ for exe in $bindir/*; do | |||
base=$(basename "$exe") | |||
|
|||
if [ -L "$exe" ]; then | |||
L=$(ls -dl "$exe") | |||
link=$(printf ${L#*-> }) | |||
link=$(readlink "$exe") | |||
"$INSTALL" -Dlm 755 "$link$exec_suffix" "$installdir/$base$exec_suffix" |
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.
Hmm...I originally had readlink
in this spot in this script, but someone (I can't remember who) made me aware that it is not a part of POSIX, which is why there is this weird combination of ls
and printf
, which is portable across POSIX.
@@ -42,7 +41,7 @@ for exe in ./*; do | |||
name="$link" | |||
fi | |||
|
|||
ln -fs "$exe" "./$name" | |||
ln -fs "$base" "$bindir/$name" | |||
fi |
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.
All of thise changes look good. I will merge them and test them in my local copy and be sure they work on my machine.
Merged. Will make a few changes, but thank you for your contribution! Also, I am investigating the |
…from xry111/bc:xry111-patch-1 into master
Just some minor tweaks - I noticed the symlinks were being generated with "./" in them, which isn't necessary.
I also switch
install.sh
to usereadlink
to resolve symlinks, instead of parsing the output of ls. Both methods are support by POSIX, I just thinkreadlink
makes it more apparent what's going on.