MantisBT - CMake
View Issue Details
0004418CMakeCMakepublic2007-02-06 16:342014-01-20 11:17
Alex Neundorf 
System Admin 
lowminoralways
closedfixed 
 
 
0004418: cmake -create-symlink doesn't overwrite existing symlinks
Hi,

cmake -E create_symlink old new

doesn't change/create "new" if it already exists. So if "new" already exists and it points to "/usr/foo", but I want it to point to "/usr/bar", create_symlink doesn't do this, the symlink is unchanged.

This seems to be the case both on Linux and OSX. It can be worked around be removing the symlink first.

Alex
No tags attached.
related to 0014713closed Brad King cmake -create-symlink doesn't overwrite existing dangling(!) symlinks 
Issue History
2014-01-20 11:17Brad KingRelationship addedrelated to 0014713

Notes
(0006371)
Bill Hoffman   
2007-02-07 11:37   
Well ln -s does the same thing, right?
(0006437)
Alex Neundorf   
2007-02-15 14:40   
Not exactly. Just "ln -s" fails with an error message in this case. "ln -f -s" creates the new symlink. Both is better than silently failing.


$ ln -s old new
$ ln -s oldx new
ln: `new': File exists
$ ln -f -s oldx new
$ ls -al
lrwxrwxrwx 1 alex users 4 Feb 15 20:38 new -> oldx
(0006441)
System Admin   
2007-02-15 15:07   
Checking for path: /cvsroot/CMake/CMake/Source
Unrestricted user: andy
/cvsroot/CMake/CMake/Source/cmake.cxx,v <-- cmake.cxx
new revision: 1.279; previous revision: 1.278