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

Bug #1026595 reported by Daniel Hahler
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
byobu
Fix Released
Medium
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)
description: updated
description: updated
Revision history for this message
leopay (leopay) wrote :

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

export BYOBU_TEST=which

Revision history for this message
Daniel Hahler (blueyed) wrote :

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

Changed in byobu:
status: New → Confirmed
Revision history for this message
Tristan Grégoire (yy-tris6tn-gz) wrote :

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

by:
"$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.

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.