diff --git a/src/Stack/Fetch.hs b/src/Stack/Fetch.hs index 7fb3b5e461..02129517fc 100644 --- a/src/Stack/Fetch.hs +++ b/src/Stack/Fetch.hs @@ -307,7 +307,6 @@ withCabalLoader menv inner = do , "Updating and trying again." ] updateAllIndices menv - clearPackageCaches caches <- getPackageCaches liftIO $ writeIORef icaches caches return (False, doLookup ident) diff --git a/src/Stack/PackageIndex.hs b/src/Stack/PackageIndex.hs index b65412dbe8..d05554454a 100644 --- a/src/Stack/PackageIndex.hs +++ b/src/Stack/PackageIndex.hs @@ -20,7 +20,6 @@ module Stack.PackageIndex ( updateAllIndices , getPackageCaches , getPackageVersions - , clearPackageCaches ) where import qualified Codec.Archive.Tar as Tar @@ -200,7 +199,8 @@ updateAllIndices ,HasConfig env,MonadBaseControl IO m, MonadCatch m) => EnvOverride -> m () -updateAllIndices menv = +updateAllIndices menv = do + clearPackageCaches asks (configPackageIndices . getConfig) >>= mapM_ (updateIndex menv) -- | Update the index tarball