[Portland-bugs] [Bug 64634] New: Non-portable "readlink" usage

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed May 15 06:22:23 PDT 2013


https://bugs.freedesktop.org/show_bug.cgi?id=64634

          Priority: medium
            Bug ID: 64634
          Assignee: portland-bugs at lists.freedesktop.org
           Summary: Non-portable "readlink" usage
          Severity: normal
    Classification: Unclassified
                OS: Mac OS X (All)
          Reporter: dmacks at netspace.org
          Hardware: All
            Status: NEW
           Version: 1.1.0 rc1
         Component: xdg-utils
           Product: Portland

Many of the xdg-utils scripts use shell commands like `readlink -f $path`.
However, this -f flag is only available in some flavors of the readlink command
and has different meanings in some as well. For example, the (I assume)
intended meaning is as in GNU readlink manpage:

      -f, --canonicalize
              canonicalize  by  following  every symlink in every component of
              the given name recursively; all  but  the  last  component  must
              exist

OS X is BSDish not GNUish. Even up through 10.7, their readlink command does
not support the -f flag, and googling around doesn't find that it was added in
10.8 (or if so, that it would have the same meaning).

The immediate effect is that self-tests fail with messages such as:

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

And obviously whatever the scripts are hoping to do with the canonical version
of $path won't be getting the expected string.

I can install the GNU coreutils suite (via fink, etc or manually) and get the
readline that xdg-utils wants, but that's a pretty heavy dependency for such a
simple set of sscripts. Here's one discussion of possible solutions:

http://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/portland-bugs/attachments/20130515/a5e6ae0d/attachment.html>


More information about the Portland-bugs mailing list