File tree 1 file changed +9
-2
lines changed
cabal-install/Distribution/Client 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,8 @@ import Distribution.Utils.Generic
107
107
( writeFileAtomic )
108
108
import Distribution.Text
109
109
( simpleParse )
110
+ import Distribution.Pretty
111
+ ( prettyShow )
110
112
111
113
import Control.Exception
112
114
( catch )
@@ -586,16 +588,21 @@ symlinkBuiltPackage :: Verbosity
586
588
, [(ComponentTarget , [TargetSelector ])] )
587
589
-> IO ()
588
590
symlinkBuiltPackage verbosity mkSourceBinDir destDir (pkg, components) =
589
- traverse_ (symlinkBuiltExe verbosity (mkSourceBinDir pkg) destDir) exes
591
+ traverse_ symlinkAndWarn exes
590
592
where
591
593
exes = catMaybes $ (exeMaybe . fst ) <$> components
592
594
exeMaybe (ComponentTarget (CExeName exe) _) = Just exe
593
595
exeMaybe _ = Nothing
596
+ symlinkAndWarn exe = do
597
+ success <- symlinkBuiltExe verbosity (mkSourceBinDir pkg) destDir exe
598
+ unless success $ warn verbosity $ " Symlink for "
599
+ <> prettyShow exe
600
+ <> " already exists. Not overwriting."
594
601
595
602
-- | Symlink a specific exe.
596
603
symlinkBuiltExe :: Verbosity -> FilePath -> FilePath -> UnqualComponentName -> IO Bool
597
604
symlinkBuiltExe verbosity sourceDir destDir exe = do
598
- notice verbosity $ " Symlinking " ++ unUnqualComponentName exe
605
+ notice verbosity $ " Symlinking " ++ prettyShow exe
599
606
symlinkBinary
600
607
destDir
601
608
sourceDir
You can’t perform that action at this time.
0 commit comments