LIB: make recreateSymlink more robust

This commit is contained in:
Julian Ospald 2015-12-21 18:36:45 +01:00
parent 433cb164a6
commit 773cb100b4
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020

View File

@ -192,14 +192,15 @@ copyDir cm from' to' = do
-- |Recreate a symlink. Don't call `canonicalizePath` on the symlink
-- destination since that will mess with the symlink.
-- |Recreate a symlink.
recreateSymlink :: FilePath -- ^ the old symlink file
-> FilePath -- ^ destination of the new symlink file
-> IO ()
recreateSymlink symf' symdest = do
recreateSymlink symf' symdest' = do
symf <- canonicalizePath' symf'
symname <- readSymbolicLink symf
symdestd <- canonicalizePath' (baseDir symdest')
let symdest = symdestd </> takeFileName symdest'
createSymbolicLink symname symdest