readlink -f

Warren Block wblock at wonkity.com
Tue Jul 12 15:27:12 UTC 2011


At the end of 2010, the -f option was added to the native 
readlink/stat(1) for CURRENT[1].  It was MFCed to RELENG-7 and -8 two 
weeks later[2].

"readlink -f" works in CURRENT, 7-STABLE, or 8-STABLE since then.

Porters running these newer versions may find "readlink -f" slipping 
through in their ports.  But it fails on 7.4-RELEASE and 8.2-RELEASE.[3]

One way to fix the problem is to replace 'readlink -f' with 'realpath', 
as done in the graphics/darktable port[4] and shamelessly copied by me 
for the Arduino port[5].

More elegant would be to check OSVERSION and only patch if necessary. 
These are untested:
RELENG-7: >=704100
RELENG-8: >=802501
CURRENT:  >=900027

1.  http://svnweb.freebsd.org/base?view=revision&revision=216203
2.  http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.bin/stat/stat.c
3.  http://forums.freebsd.org/showthread.php?t=24839
4.  http://www.freebsd.org/cgi/cvsweb.cgi/ports/graphics/darktable/Makefile?rev=1.13;content-type=text%2Fplain
5.  http://www.freebsd.org/cgi/query-pr.cgi?pr=158832


More information about the freebsd-ports mailing list