Patch for MonadLogger deletion since new rebase
This commit is contained in:
parent
f0fb019c70
commit
7a6a119829
11
lib/GHCup.hs
11
lib/GHCup.hs
@ -417,7 +417,7 @@ installCabalBindist :: ( MonadMask m
|
|||||||
m
|
m
|
||||||
()
|
()
|
||||||
installCabalBindist dlinfo ver isoFilepath forceInstall = do
|
installCabalBindist dlinfo ver isoFilepath forceInstall = do
|
||||||
lift $ $(logDebug) $ "Requested to install cabal version " <> prettyVer ver
|
lift $ logDebug $ "Requested to install cabal version " <> prettyVer ver
|
||||||
|
|
||||||
PlatformRequest {..} <- lift getPlatformReq
|
PlatformRequest {..} <- lift getPlatformReq
|
||||||
Dirs {..} <- lift getDirs
|
Dirs {..} <- lift getDirs
|
||||||
@ -429,7 +429,7 @@ installCabalBindist dlinfo ver isoFilepath forceInstall = do
|
|||||||
| forceInstall
|
| forceInstall
|
||||||
, regularCabalInstalled
|
, regularCabalInstalled
|
||||||
, Nothing <- isoFilepath -> do
|
, Nothing <- isoFilepath -> do
|
||||||
lift $ $(logInfo) $ "Removing the currently installed version first!"
|
lift $ logInfo $ "Removing the currently installed version first!"
|
||||||
liftE $ rmCabalVer ver
|
liftE $ rmCabalVer ver
|
||||||
|
|
||||||
| not forceInstall
|
| not forceInstall
|
||||||
@ -453,7 +453,7 @@ installCabalBindist dlinfo ver isoFilepath forceInstall = do
|
|||||||
|
|
||||||
case isoFilepath of
|
case isoFilepath of
|
||||||
Just isoDir -> do -- isolated install
|
Just isoDir -> do -- isolated install
|
||||||
lift $ $(logInfo) $ "isolated installing Cabal to " <> T.pack isoDir
|
lift $ logInfo $ "isolated installing Cabal to " <> T.pack isoDir
|
||||||
liftE $ installCabalUnpacked workdir isoDir Nothing forceInstall
|
liftE $ installCabalUnpacked workdir isoDir Nothing forceInstall
|
||||||
|
|
||||||
Nothing -> do -- regular install
|
Nothing -> do -- regular install
|
||||||
@ -465,7 +465,6 @@ installCabalBindist dlinfo ver isoFilepath forceInstall = do
|
|||||||
when (maybe True (ver >=) lInstCabal) $ liftE $ setCabal ver
|
when (maybe True (ver >=) lInstCabal) $ liftE $ setCabal ver
|
||||||
|
|
||||||
checkIfToolInstalled :: ( MonadIO m
|
checkIfToolInstalled :: ( MonadIO m
|
||||||
, MonadLogger m
|
|
||||||
, MonadReader env m
|
, MonadReader env m
|
||||||
, HasDirs env
|
, HasDirs env
|
||||||
, MonadCatch m) =>
|
, MonadCatch m) =>
|
||||||
@ -486,14 +485,14 @@ checkIfToolInstalled tool ver = do
|
|||||||
_ -> pure False
|
_ -> pure False
|
||||||
|
|
||||||
-- | Install an unpacked cabal distribution.Symbol
|
-- | Install an unpacked cabal distribution.Symbol
|
||||||
installCabalUnpacked :: (MonadLogger m, MonadCatch m, MonadIO m)
|
installCabalUnpacked :: (MonadCatch m, HasLog env, MonadIO m, MonadReader env m)
|
||||||
=> FilePath -- ^ Path to the unpacked cabal bindist (where the executable resides)
|
=> FilePath -- ^ Path to the unpacked cabal bindist (where the executable resides)
|
||||||
-> FilePath -- ^ Path to install to
|
-> FilePath -- ^ Path to install to
|
||||||
-> Maybe Version -- ^ Nothing for isolated install
|
-> Maybe Version -- ^ Nothing for isolated install
|
||||||
-> Bool -- ^ Force Install
|
-> Bool -- ^ Force Install
|
||||||
-> Excepts '[CopyError, FileAlreadyExistsError] m ()
|
-> Excepts '[CopyError, FileAlreadyExistsError] m ()
|
||||||
installCabalUnpacked path inst mver' forceInstall = do
|
installCabalUnpacked path inst mver' forceInstall = do
|
||||||
lift $ $(logInfo) "Installing cabal"
|
lift $ logInfo "Installing cabal"
|
||||||
let cabalFile = "cabal"
|
let cabalFile = "cabal"
|
||||||
liftIO $ createDirRecursive' inst
|
liftIO $ createDirRecursive' inst
|
||||||
let destFileName = cabalFile
|
let destFileName = cabalFile
|
||||||
|
@ -250,7 +250,6 @@ getInstalledGHCs = do
|
|||||||
-- | Get all installed cabals, by matching on @~\/.ghcup\/bin/cabal-*@.
|
-- | Get all installed cabals, by matching on @~\/.ghcup\/bin/cabal-*@.
|
||||||
getInstalledCabals :: ( MonadReader env m
|
getInstalledCabals :: ( MonadReader env m
|
||||||
, HasDirs env
|
, HasDirs env
|
||||||
, HasLog env
|
|
||||||
, MonadIO m
|
, MonadIO m
|
||||||
, MonadCatch m
|
, MonadCatch m
|
||||||
)
|
)
|
||||||
@ -268,7 +267,7 @@ getInstalledCabals = do
|
|||||||
|
|
||||||
|
|
||||||
-- | Whether the given cabal version is installed.
|
-- | Whether the given cabal version is installed.
|
||||||
cabalInstalled :: (HasLog env, MonadIO m, MonadReader env m, HasDirs env, MonadCatch m) => Version -> m Bool
|
cabalInstalled :: (MonadIO m, MonadReader env m, HasDirs env, MonadCatch m) => Version -> m Bool
|
||||||
cabalInstalled ver = do
|
cabalInstalled ver = do
|
||||||
vers <- fmap rights getInstalledCabals
|
vers <- fmap rights getInstalledCabals
|
||||||
pure $ elem ver vers
|
pure $ elem ver vers
|
||||||
|
Loading…
Reference in New Issue
Block a user