Bug 1369 - coreutils\' ln: fails with --target-dir
Summary: coreutils\' ln: fails with --target-dir
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: fileutils (show other bugs)
Version: unstable
Hardware: all Linux
: P3 major
Assignee: Dmitry V. Levin
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-08 00:48 MSD by imz
Modified: 2003-08-25 15:18 MSD (History)
0 users

See Also:


Attachments
0001369-coreutils-4.5.2-alt-ln-target_directory.patch (586 bytes, application/octet-stream)
2002-10-08 17:26 MSD, imz
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description imz 2002-10-08 00:48:42 MSD
Does its job, but complains about an error and exits with an error code.

---
$ mkdir dir; touch src; ln -s --target-dir=dir ../src; echo $?; ls -l src dir
ln: `dir/.\': cannot overwrite directory
1
-rw-r--r--    1 imz      imz             0 Окт  8 00:36 src

dir:
итого 0
lrwxrwxrwx    1 imz      imz             6 Окт  8 00:36 src -> ../src
[<a href="mailto:imz@basalt" target="_new">imz@basalt</a> tmp]$ rpm -qf /bin/ln
coreutils-4.5.1-alt2
[<a href="mailto:imz@basalt" target="_new">imz@basalt</a> tmp]$

---
Putting \&quot;dir\&quot; as the last argument makes it work.

Similar 

cp --target-dir=dir src

works fine.

This:

cp --symbolic-link --target-dir=dir \&quot;$(pwd)\&quot;/src

also works; can be regarded as a workaround.

Comment 1 Dmitry V. Levin 2002-10-08 17:28:14 MSD
Fixed in coreutils-4.5.2-alt1
(patch for coreutils-4.5.2 attached).
Comment 2 Dmitry V. Levin 2002-10-08 17:28:14 MSD
Fixed in coreutils-4.5.2-alt1
(patch for coreutils-4.5.2 attached).
Comment 3 Dmitry V. Levin 2002-10-08 18:48:14 MSD
Merged into coreutils-4.5.3
Comment 4 Dmitry V. Levin 2002-10-08 18:48:14 MSD
Merged into coreutils-4.5.3