Skip to content
Snippets Groups Projects
Commit 6882787d authored by Lautaro Martin Emanuel's avatar Lautaro Martin Emanuel Committed by Oleg Grenrus
Browse files

Installing (copy or symlink) executable message prints destination.

parent 3d93cdd7
No related branches found
No related tags found
No related merge requests found
...@@ -835,24 +835,26 @@ installBuiltExe ...@@ -835,24 +835,26 @@ installBuiltExe
installBuiltExe verbosity overwritePolicy installBuiltExe verbosity overwritePolicy
sourceDir exeName finalExeName sourceDir exeName finalExeName
installdir InstallMethodSymlink = do installdir InstallMethodSymlink = do
notice verbosity $ "Symlinking '" <> exeName <> "'" notice verbosity $ "Symlinking '" <> exeName <> "' to '" <> destination <> "'"
symlinkBinary symlinkBinary
overwritePolicy overwritePolicy
installdir installdir
sourceDir sourceDir
finalExeName finalExeName
exeName exeName
where
destination = installdir </> finalExeName
installBuiltExe verbosity overwritePolicy installBuiltExe verbosity overwritePolicy
sourceDir exeName finalExeName sourceDir exeName finalExeName
installdir InstallMethodCopy = do installdir InstallMethodCopy = do
notice verbosity $ "Copying '" <> exeName <> "'" notice verbosity $ "Copying '" <> exeName <> "' to '" <> destination <> "'"
exists <- doesPathExist destination exists <- doesPathExist destination
case (exists, overwritePolicy) of case (exists, overwritePolicy) of
(True , NeverOverwrite ) -> pure False (True , NeverOverwrite ) -> pure False
(True , AlwaysOverwrite) -> remove >> copy (True , AlwaysOverwrite) -> remove >> copy
(False, _ ) -> copy (False, _ ) -> copy
where where
source = sourceDir </> exeName source = sourceDir </> exeName
destination = installdir </> finalExeName destination = installdir </> finalExeName
remove = do remove = do
isDir <- doesDirectoryExist destination isDir <- doesDirectoryExist destination
......
...@@ -186,6 +186,10 @@ symlinkBinaries platform comp overwritePolicy ...@@ -186,6 +186,10 @@ symlinkBinaries platform comp overwritePolicy
cinfo = compilerInfo comp cinfo = compilerInfo comp
(CompilerId compilerFlavor _) = compilerInfoId cinfo (CompilerId compilerFlavor _) = compilerInfoId cinfo
-- | Symlink binary.
--
-- The paths are take in pieces, so we can make relative link when possible.
--
symlinkBinary :: symlinkBinary ::
OverwritePolicy -- ^ Whether to force overwrite an existing file OverwritePolicy -- ^ Whether to force overwrite an existing file
-> FilePath -- ^ The canonical path of the public bin dir eg -> FilePath -- ^ The canonical path of the public bin dir eg
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment