updates usages of new installGHCBindist and related installGHCBin

This commit is contained in:
Arjun Kathuria 2021-07-25 13:38:32 +05:30
parent 338f5f309d
commit 5efe2e5f7a
3 changed files with 20 additions and 25 deletions

View File

@ -448,7 +448,7 @@ install' _ (_, ListResult {..}) = do
case lTool of case lTool of
GHC -> do GHC -> do
let vi = getVersionInfo lVer GHC dls let vi = getVersionInfo lVer GHC dls
liftE $ installGHCBin lVer $> vi liftE $ installGHCBin lVer Nothing $> vi
Cabal -> do Cabal -> do
let vi = getVersionInfo lVer Cabal dls let vi = getVersionInfo lVer Cabal dls
liftE $ installCabalBin lVer $> vi liftE $ installCabalBin lVer $> vi

View File

@ -1601,28 +1601,22 @@ Report bugs at <https://gitlab.haskell.org/haskell/ghcup-hs/issues>|]
----------------------- -----------------------
let installGHC InstallOptions{..} = let installGHC InstallOptions{..} =
(case isolateDir of (case instBindist of
Just isoDir -> runInstTool instPlatform $ do Nothing -> runInstTool instPlatform $ do
(v, vi) <- liftE $ fromVersion instVer GHC (v, vi) <- liftE $ fromVersion instVer GHC
let ghcVersion = _tvVersion v liftE $ installGHCBin (_tvVersion v) isolateDir
liftE $ installGHCBinIsolated isoDir ghcVersion when instSet $ void $ liftE $ setGHC v SetGHCOnly
pure vi pure vi
Nothing -> Just uri -> do
case instBindist of s' <- liftIO appState
Nothing -> runInstTool instPlatform $ do runInstTool' s'{ settings = settings {noVerify = True}} instPlatform $ do
(v, vi) <- liftE $ fromVersion instVer GHC (v, vi) <- liftE $ fromVersion instVer GHC
liftE $ installGHCBin (_tvVersion v) liftE $ installGHCBindist
when instSet $ void $ liftE $ setGHC v SetGHCOnly (DownloadInfo uri (Just $ RegexDir "ghc-.*") "")
pure vi (_tvVersion v)
Just uri -> do isolateDir
s' <- liftIO appState when instSet $ void $ liftE $ setGHC v SetGHCOnly
runInstTool' s'{ settings = settings {noVerify = True}} instPlatform $ do pure vi
(v, vi) <- liftE $ fromVersion instVer GHC
liftE $ installGHCBindist
(DownloadInfo uri (Just $ RegexDir "ghc-.*") "")
(_tvVersion v)
when instSet $ void $ liftE $ setGHC v SetGHCOnly
pure vi
) )
>>= \case >>= \case
VRight vi -> do VRight vi -> do

View File

@ -405,6 +405,7 @@ installGHCBin :: ( MonadFail m
, MonadUnliftIO m , MonadUnliftIO m
) )
=> Version -- ^ the version to install => Version -- ^ the version to install
-> Maybe FilePath -- ^ isolated install filepath, if user passed any
-> Excepts -> Excepts
'[ AlreadyInstalled '[ AlreadyInstalled
, BuildFailed , BuildFailed
@ -420,9 +421,9 @@ installGHCBin :: ( MonadFail m
] ]
m m
() ()
installGHCBin ver = do installGHCBin ver isoFilepath = do
dlinfo <- liftE $ getDownloadInfo GHC ver dlinfo <- liftE $ getDownloadInfo GHC ver
installGHCBindist dlinfo ver installGHCBindist dlinfo ver isoFilepath
-- | Like 'installCabalBin', except takes the 'DownloadInfo' as -- | Like 'installCabalBin', except takes the 'DownloadInfo' as