Make windows mergeFileTree more robust
This commit is contained in:
parent
68c81577a4
commit
c56b9ec3ce
@ -328,10 +328,11 @@ installUnpackedGHC path inst ver forceInstall
|
|||||||
-- Windows bindists are relocatable and don't need
|
-- Windows bindists are relocatable and don't need
|
||||||
-- to run configure.
|
-- to run configure.
|
||||||
-- We also must make sure to preserve mtime to not confuse ghc-pkg.
|
-- We also must make sure to preserve mtime to not confuse ghc-pkg.
|
||||||
liftE $ mergeFileTree path inst GHC (mkTVer ver) $ \source dest -> liftIO $ do
|
liftE $ mergeFileTree path inst GHC (mkTVer ver) $ \source dest -> do
|
||||||
mtime <- ifM (pathIsSymbolicLink source) (pure Nothing) (Just <$> getModificationTime source)
|
mtime <- liftIO $ ifM (pathIsSymbolicLink source) (pure Nothing) (Just <$> getModificationTime source)
|
||||||
moveFilePortable source dest
|
when forceInstall $ hideError doesNotExistErrorType $ hideError InappropriateType $ recycleFile dest
|
||||||
forM_ mtime $ setModificationTime dest
|
liftIO $ moveFilePortable source dest
|
||||||
|
forM_ mtime $ liftIO . setModificationTime dest
|
||||||
| otherwise = do
|
| otherwise = do
|
||||||
PlatformRequest {..} <- lift getPlatformReq
|
PlatformRequest {..} <- lift getPlatformReq
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user