diff options
author | Harald Hoyer <harald@redhat.com> | 2012-03-22 20:51:20 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2012-03-22 20:51:20 +0000 |
commit | 15b8318e93a947d1422e9a927f699eda1085cf0d (patch) | |
tree | d992d1a8f2dbc137446b6691c9144543c3e79cf6 /src/Makefile.am | |
parent | b1428e3152afa3139a2968dd530e507ddd312051 (diff) | |
download | coreutils-15b8318e93a947d1422e9a927f699eda1085cf0d.tar.xz |
ln: add the --relative option
With the "--relative --symbolic" options, ln computes the relative
symbolic link for the user.
So, ln works just as cp, but creates relative symbolic links instead
of copying the file.
I miss this feature since the beginning of using ln.
$ tree ./
/
`-- usr
|-- bin
`-- lib
`-- foo
`-- foo
4 directories, 1 file
$ ln -s -v --relative usr/lib/foo/foo usr/bin/foo
‘usr/bin/foo’ -> ‘../lib/foo/foo’
$ tree ./
/
`-- usr
|-- bin
| `-- foo -> ../lib/foo/foo
`-- lib
`-- foo
`-- foo
4 directories, 2 files
$ ln -s -v --relative usr/bin/foo usr/lib/foo/link-to-foo
‘usr/lib/foo/link-to-foo’ -> ‘foo’
$ tree ./
/
`-- usr
|-- bin
| `-- foo -> ../lib/foo/foo
`-- lib
`-- foo
|-- link-to-foo -> foo
`-- foo
4 directories, 3 files
* src/Makefile.am: Reference the relpath module.
* src/ln.c (usage): Mention the new option.
(do_link): Call the relative conversion if specified.
(convert_abs_rel): Perform the relative conversion
using the relpath module.
* tests/ln/relative: Add a new test.
* tests/Makefile.am: Reference the new test.
* doc/coreutils.texi: Document the new feature.
* NEWS: Mention the new feature.
Diffstat (limited to 'src/Makefile.am')
-rw-r--r-- | src/Makefile.am | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 85f12d65a..06ab61527 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -474,6 +474,7 @@ vdir_SOURCES = ls.c ls-vdir.c id_SOURCES = id.c group-list.c groups_SOURCES = groups.c group-list.c ls_SOURCES = ls.c ls-ls.c +ln_SOURCES = ln.c relpath.c relpath.h chown_SOURCES = chown.c chown-core.c chgrp_SOURCES = chgrp.c chown-core.c kill_SOURCES = kill.c operand2sig.c |