implements isolated install sanity-checking for Cabal installs

This commit is contained in:
Arjun Kathuria 2021-08-10 20:14:46 +05:30
parent bb430fa0b7
commit 300cfd3ba6
3 changed files with 6 additions and 1 deletions

View File

@ -442,6 +442,7 @@ install' _ (_, ListResult {..}) = do
, DownloadFailed , DownloadFailed
, NoUpdate , NoUpdate
, TarDirDoesNotExist , TarDirDoesNotExist
, IsolatedDirNotEmpty
] ]
run (do run (do

View File

@ -1478,6 +1478,7 @@ Report bugs at <https://gitlab.haskell.org/haskell/ghcup-hs/issues>|]
, TarDirDoesNotExist , TarDirDoesNotExist
, NextVerNotFound , NextVerNotFound
, NoToolVersionSet , NoToolVersionSet
, IsolatedDirNotEmpty
] ]
let runInstTool mInstPlatform action' = do let runInstTool mInstPlatform action' = do

View File

@ -405,6 +405,7 @@ installCabalBindist :: ( MonadMask m
#if !defined(TAR) #if !defined(TAR)
, ArchiveResult , ArchiveResult
#endif #endif
, IsolatedDirNotEmpty
] ]
m m
() ()
@ -425,7 +426,8 @@ installCabalBindist dlinfo ver isoFilepath = do
) )
(throwE $ AlreadyInstalled Cabal ver) (throwE $ AlreadyInstalled Cabal ver)
_ -> pure () -- check isn't required in isolated installs Just isoDir ->
liftE $ isolatedInstallSanityCheck isoDir
-- download (or use cached version) -- download (or use cached version)
dl <- liftE $ downloadCached dlinfo Nothing dl <- liftE $ downloadCached dlinfo Nothing
@ -498,6 +500,7 @@ installCabalBin :: ( MonadMask m
#if !defined(TAR) #if !defined(TAR)
, ArchiveResult , ArchiveResult
#endif #endif
, IsolatedDirNotEmpty
] ]
m m
() ()