Fix prefetch for cross bindists

This commit is contained in:
Julian Ospald 2023-11-12 18:21:49 +08:00
parent 6047614a16
commit e5a7a2da70
No known key found for this signature in database
GPG Key ID: 4275CDA6A29BED43
2 changed files with 6 additions and 6 deletions

View File

@ -199,19 +199,19 @@ prefetch prefetchCommand runAppState runLogger =
(v, _) <- liftE $ fromVersion mt GHC
if pfGHCSrc
then liftE $ fetchGHCSrc v pfCacheDir
else liftE $ fetchToolBindist (_tvVersion v) GHC pfCacheDir
else liftE $ fetchToolBindist v GHC pfCacheDir
PrefetchCabal PrefetchOptions {pfCacheDir} mt -> do
forM_ pfCacheDir (liftIO . createDirRecursive')
(v, _) <- liftE $ fromVersion mt Cabal
liftE $ fetchToolBindist (_tvVersion v) Cabal pfCacheDir
liftE $ fetchToolBindist v Cabal pfCacheDir
PrefetchHLS PrefetchOptions {pfCacheDir} mt -> do
forM_ pfCacheDir (liftIO . createDirRecursive')
(v, _) <- liftE $ fromVersion mt HLS
liftE $ fetchToolBindist (_tvVersion v) HLS pfCacheDir
liftE $ fetchToolBindist v HLS pfCacheDir
PrefetchStack PrefetchOptions {pfCacheDir} mt -> do
forM_ pfCacheDir (liftIO . createDirRecursive')
(v, _) <- liftE $ fromVersion mt Stack
liftE $ fetchToolBindist (_tvVersion v) Stack pfCacheDir
liftE $ fetchToolBindist v Stack pfCacheDir
PrefetchMetadata -> do
pfreq <- lift getPlatformReq
_ <- liftE $ getDownloadsF pfreq

View File

@ -100,7 +100,7 @@ fetchToolBindist :: ( MonadFail m
, MonadIO m
, MonadUnliftIO m
)
=> Version
=> GHCTargetVersion
-> Tool
-> Maybe FilePath
-> Excepts
@ -113,7 +113,7 @@ fetchToolBindist :: ( MonadFail m
m
FilePath
fetchToolBindist v t mfp = do
dlinfo <- liftE $ getDownloadInfo t v
dlinfo <- liftE $ getDownloadInfo' t v
liftE $ downloadCached' dlinfo Nothing mfp