Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 398339 - sys-apps/coreutils-8.15: realpath --relative-to behaves strangely for "/" path
Summary: sys-apps/coreutils-8.15: realpath --relative-to behaves strangely for "/" path
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL: http://lists.gnu.org/archive/html/bug...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-10 09:01 UTC by Ulrich Müller
Modified: 2012-01-10 21:53 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Müller gentoo-dev 2012-01-10 09:01:48 UTC
realpath with option --relative-to behaves strangely if one of the paths is "/".

$ realpath --relative-to=/ /usr
../usr

Expected Results:
It should return just "usr". Especially, ../usr will fail if it is subsequently  used with some nontrivial ${ROOT}.

$ realpath --relative-to=/usr /
../
$ realpath --relative-to=/usr/bin /usr
..

Expected Results:
It should behave consistently, i.e. always return ".." without the trailing slash.

$ realpath --version
realpath (GNU coreutils) 8.15
Packaged by Gentoo (8.15 (p1))
Comment 1 SpanKY gentoo-dev 2012-01-10 20:38:06 UTC
since this is new functionality, and i'd be hard pressed to say a bug that actually breaks anything, i'm inclined to mark UPSTREAM and let things progress naturally that way

you ok with that ?
Comment 2 Ulrich Müller gentoo-dev 2012-01-10 21:40:10 UTC
(In reply to comment #1)
> you ok with that ?

Yes.

One thing that I've noticed in your report upstream:

> as does these:
>         realpath --relative-to=/ /usr
>         realpath --relative-to=/ /usr/
> which is to say, they show:
>         ..

Both of these output "../usr" for me. (But ".." is wrong too, correct would be "usr".)
Comment 3 SpanKY gentoo-dev 2012-01-10 21:53:52 UTC
thanks ... i've followed up in my report with that info