The new env eselect module make use of readlink -f but that option is not present in non-GNU readlinks. The same thing can be achieved by a simple recursive function: canonicalize() { link=$(readlink "$1") if [[ -n ${link} ]]; then canonicalize "$1" else echo "$1" fi } [although it needs a control to avoid infinite recursion if there's a circular linking] An alternative can be the non-recursive function (seem less performant): canonicalize() { currlink=$1 currfile=$(readlink "$1") while [[ -n ${currfile} ]]; do currlink=${currfile} currfile=$(readlink "${currlink}") done echo ${currlink} } [also this requires a infinite break] Without this, eselect 1.0.1 is not going to work on FreeBSD.
Does app-admin/realpath work on fbsd?
As a charm.
Ok, how about we make this a configure thing, where we check for readlink -f then realpath then explode, then call the detected program via canonicalise (like we do for sed/gsed)? We could add a userland? dep on realpath...
If you can do the check at runtime, which checks also for grealpath, I would suggest a || ( app-admin/realpath sys-apps/coreutils ) dependency...
I reaallllllllly don't want to do the check at runtime. Same with sed. Checking for greadlink at configure time is fine though.
Okay, then let it fail gracefully if someone for instance builds with coreutils (so with greadlink) and then changes with realpath, it's not unlikely that things with || () deps require a rebuild when passing from one to the other...
Proposed fix is in SVN now.
Fixed as of eselect-1.0.2