On Thu, Dec 01, 2011 at 12:21:03PM +0000, PƔdraig Brady wrote:
> On 12/01/2011 12:10 PM, Dmitry V. Levin wrote:
> > On Thu, Dec 01, 2011 at 12:07:00PM +0100, Jim Meyering wrote:
[...]
> >> PƔdraig Brady and I talked about this today, and he suggested to call this
> >> new program realpath, and with usage like this:
> >>
> >> realpath --relative-start=DIR FILE ...
> >
> > In that case, please make its interface compatible with Debian's realpath:
> > http://packages.debian.org/search?keywords=realpath
> > http://anonscm.debian.org/gitweb/?p=users/robert/realpath.git
>
> Which is:
>
> realpath [-s|--strip] [-z|--zero] filename ...
>
> I.E. the same except that debian's also has a --strip option to:
> "Only strip . and .., components, but do not resolve symlinks".
>
> If we implement --strip, then it means Debian could prefer the
> coreutils version, which is a superset.
This would probably mean implementing a CAN_STRIP mode for
canonicalize_filename_mode().
As a side effect, readlink(1) could be taught to use it with a new
option, e.g. --canonicalize-strip.
> Using realpath, means we get more related functionality
> into a single tool, and also we overlap with FreeBSDs util
> of the same name. No options proposed so far conflict with
> existing implementations.
The only drawback with this realpath interface is that by allowing to
process several file names at once it makes error handling in scripts harder.
--
ldv