HPath.IO.Errors: fix throwDestinationInSource
'canonicalizePath' was missing, making this function far less reliable. In order for this to work we have to work around circular imports with a IO.hs-boot file.
This commit is contained in:
parent
78a3baeb25
commit
8a28a5dd0f
7
src/HPath/IO.hs-boot
Normal file
7
src/HPath/IO.hs-boot
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
module HPath.IO where
|
||||||
|
|
||||||
|
|
||||||
|
import HPath
|
||||||
|
|
||||||
|
canonicalizePath :: Path Abs -> IO (Path Abs)
|
||||||
|
|
@ -44,6 +44,10 @@ import GHC.IO.Exception
|
|||||||
IOErrorType
|
IOErrorType
|
||||||
)
|
)
|
||||||
import HPath
|
import HPath
|
||||||
|
import {-# SOURCE #-} HPath.IO
|
||||||
|
(
|
||||||
|
canonicalizePath
|
||||||
|
)
|
||||||
import HPath.IO.Utils
|
import HPath.IO.Utils
|
||||||
import System.IO.Error
|
import System.IO.Error
|
||||||
(
|
(
|
||||||
@ -194,8 +198,7 @@ throwDestinationInSource :: Path Abs -- ^ source dir
|
|||||||
-> IO ()
|
-> IO ()
|
||||||
throwDestinationInSource source dest = do
|
throwDestinationInSource source dest = do
|
||||||
dest' <- (\x -> maybe x (\y -> x </> y) $ basename dest)
|
dest' <- (\x -> maybe x (\y -> x </> y) $ basename dest)
|
||||||
{- <$> (canonicalizePath $ P.dirname dest) -}
|
<$> (canonicalizePath $ dirname dest)
|
||||||
<$> (return $ dirname dest)
|
|
||||||
dids <- forM (getAllParents dest') $ \p -> do
|
dids <- forM (getAllParents dest') $ \p -> do
|
||||||
fs <- PF.getSymbolicLinkStatus (fromAbs p)
|
fs <- PF.getSymbolicLinkStatus (fromAbs p)
|
||||||
return (PF.deviceID fs, PF.fileID fs)
|
return (PF.deviceID fs, PF.fileID fs)
|
||||||
|
Loading…
Reference in New Issue
Block a user