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

avoid ./ in symlink paths, use readlink instead of ls to resolve link #5

Merged
merged 1 commit into from
Feb 18, 2019

Conversation

jprjr
Copy link
Contributor

@jprjr jprjr commented Feb 18, 2019

Just some minor tweaks - I noticed the symlinks were being generated with "./" in them, which isn't necessary.

I also switch install.sh to use readlink to resolve symlinks, instead of parsing the output of ls. Both methods are support by POSIX, I just think readlink makes it more apparent what's going on.

@codecov
Copy link

codecov bot commented Feb 18, 2019

Codecov Report

Merging #5 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

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

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dbbe325...18e3639. Read the comment docs.

@@ -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"
Copy link
Owner

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
Copy link
Owner

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.

@gavinhoward gavinhoward merged commit aee557e into gavinhoward:master Feb 18, 2019
@gavinhoward
Copy link
Owner

Merged. Will make a few changes, but thank you for your contribution!

Also, I am investigating the readlink item more. I may keep that change too; I just have to see what is truly portable across POSIX.

gavinhoward pushed a commit that referenced this pull request Aug 21, 2020
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.

2 participants