Browse Source

Remove the use of readlink in install.sh

After investigating this, I found that readlink is not specified by
POSIX. However, that does not mean that it was the better solution, as
the use of `ls -dl` and `printf ${L#*-> }` might not have been portable.
The possible issue was the use of `-> ` to get at the link target.

That said, after reading the POSIX standard for `ls`, I found out that
the `-> ` syntax is required by the standard if `ls` is called with the
option `-l` and without the option `-L`. That means that my original
formulation is most portable.
signals
Gavin Howard 3 years ago
parent
commit
6649657ced
Signed by untrusted user who does not match committer: gavin
GPG Key ID: C08038BDF280D33E
  1. 3
      install.sh

3
install.sh

@ -39,7 +39,8 @@ for exe in $bindir/*; do
base=$(basename "$exe")
if [ -L "$exe" ]; then
link=$(readlink "$exe")
L=$(ls -dl "$exe")
link=$(printf ${L#*-> })
"$INSTALL" -Dlm 755 "$link$exec_suffix" "$installdir/$base$exec_suffix"
else
"$INSTALL" -Dm 755 "$exe" "$installdir/$base$exec_suffix"

Loading…
Cancel
Save