readlink -f not supported on OS X/BSD

Bug #740370 reported by Matthew Boehlig on 2011-03-22
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
byobu
Low
Unassigned

Bug Description

Version: byobu v3.29
Platform: Mac OS X 10.6.6; byobu installed using homebrew
Behavour: When starting byobu this message flashes in the terminal before the screen is cleared:

  readlink: illegal option -- f
  usage: readlink [-n] [file ...]

In v3.29 byobu-janitor was changed to use readlink -f. OS X has BSD readlink where the option -f is not supported.

Coreutils provides a GNU compatible flavour with greadlink, but would add additional dependencies.

Here's some discussion:
http://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac
https://trac.macports.org/ticket/21877 - decided to not use greadlink and work around the -f option

Related branches

Changed in byobu:
importance: Undecided → Medium
Dustin Kirkland  (kirkland) wrote :

Thanks for the report, and the pointers. I'll just committed a fix ;-)

Changed in byobu:
importance: Medium → Low
status: New → Fix Committed
Changed in byobu:
status: Fix Committed → Fix Released

I just got this error message today on OSX with byobu 5.21. I have greadlink as well as readlink.

ProductName: Mac OS X
ProductVersion: 10.6.8
BuildVersion: 10K549

I installed via,
./configure
sudo make install

byobu returns,
samson:~ nlucaroni$ byobu
readlink: illegal option -- f
usage: readlink [-n] [file ...]
usage: dirname path
usage: dirname path

The result from greadlink is,
samson:bin nlucaroni$ greadlink
greadlink: missing operand
Try `greadlink --help' for more information.

The line that determines if we should use greadlink doesn't work correctly,
samson:bin nlucaroni$ greadlink >/dev/null 2>&1 && export BYOBU_READLINK="greadlink" || export BYOBU_READLINK="readlink"
samson:bin nlucaroni$ echo $BYOBU_READLINK
readlink

the above will work if the --help option is added to the greadlink line, when I changed to that, it works fine.

Maryan (morel-maryan) wrote :

Hi,

I've installed the last version of byobu using Homebrew, and got the same bug. Tmux and coreutils are installed and up to date.

Platform: Mac OS X 10.7.5

Error:

bash-4.2$ byobu
readlink: illegal option -- f
usage: readlink [-n] [file ...]
usage: dirname path
usage: dirname path

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers