ble.sh icon indicating copy to clipboard operation
ble.sh copied to clipboard

Why is readlink prefixed with PATH?

Open kiasoc5 opened this issue 3 years ago • 1 comments

I've packaged blesh for Guix. We patch binary paths to work with the non-FHS system like NixOS. One patch we do is to replace the following in ble.pp:

PATH=/bin:/usr/bin readlink -> PATH=/bin:/usr/bin (path to readlink on Guix)

Why is readlink prefixed with PATH? We don't have /bin or /usr/bin so it would be easier for us to remove the PATH prefix entirely.

Thanks! Further discussion here if interested.

kiasoc5 avatar Sep 19 '22 01:09 kiasoc5

Thank you for trying to package ble.sh!

Disclaimer: The corresponding code doesn't exist anymore in the master, so the following answer is for the old version of ble.sh.

Why is readlink prefixed with PATH?

Since readlink is not standardized by POSIX and its feature set varies among the implementations of readlink, we cannot rely on a random readlink picked up from an arbitrary position of the filesystem. Here, the assumption was that /bin/readlink and /usr/bin/readlink in GNU/Linux would be always readlink from GNU coreutils and thus that they have the necessary feature for ble.sh. As far as we can assume (path to readlink on Guix) is always readlink from GNU coreutils, you can safely replace it.

akinomyoga avatar Sep 19 '22 02:09 akinomyoga

ping @kiasoc5. Do you still have the problem? Are there any further questions? Can I close the issue?

akinomyoga avatar Oct 01 '22 01:10 akinomyoga

Thanks, I submitted a patch for Guix which you can track here. This issue can be closed.

kiasoc5 avatar Oct 01 '22 21:10 kiasoc5

Thanks!

akinomyoga avatar Oct 01 '22 22:10 akinomyoga