Bug 1369

Summary: coreutils\' ln: fails with --target-dir
Product: Sisyphus Reporter: imz <vanyaz>
Component: fileutilsAssignee: Dmitry V. Levin <ldv>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: unstable   
Hardware: all   
OS: Linux   
Attachments:
Description Flags
0001369-coreutils-4.5.2-alt-ln-target_directory.patch none

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 -&gt; ../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