$BYOBU_TEST is used before it gets defined (fails to detect greadlink)

Bug #1026595 reported by Daniel Hahler on 2012-07-19
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Dustin Kirkland 

Bug Description

BYOBU_TEST gets used to test for greadlink here:

    $BYOBU_TEST greadlink >/dev/null 2>&1 && export BYOBU_READLINK="greadlink" || export BYOBU_READLINK="readlink"

But gets defined only later when "${BYOBU_PREFIX}/lib/${PKG}/include/common" is sourced.

Calling "greadlink" without arguments (like it happens in this case) results in an error and therefore "readlink" is used always.

Daniel Hahler (blueyed) on 2012-07-19
description: updated
description: updated
leopay (leopay) wrote :

maybe you could add below in to $HOME/.byoburc to fix this

export BYOBU_TEST=which

Daniel Hahler (blueyed) wrote :

Yes, that would work as a workaround, but should get fixed anyway, of course.

Changed in byobu:
status: New → Confirmed

On Mac OS X I simply replace:
"$BYOBU_TEST greadlink >/dev/null 2>&1 && export BYOBU_READLINK="greadlink" || export BYOBU_READLINK="readlink""

"$BYOBU_TEST greadlink -f . >/dev/null 2>&1 && export BYOBU_READLINK="greadlink" || export BYOBU_READLINK="readlink""

If you type greadlink in a terminal the command exit status is 1 even if greadlink exist and works.
A better test is to test the dot file "." with "greadline -f ." which exist in all folder and will not case error exit if greadlink exist.
The exist status will be 0 if greadlink exist and 1 otherwise and BYOBU_READLINK will be set to greadlink if exist.

That's work perfectly for me on Mac OS X 10.7.5 with a bash SHELL.

Dustin Kirkland  (kirkland) wrote :

Committed revision 2018.

Changed in byobu:
importance: Undecided → Medium
assignee: nobody → Dustin Kirkland (kirkland)
status: Confirmed → Fix Committed
Changed in byobu:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers