From 1c89cb5b585d640bfe84d3d6b19028e6f5327f9d Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Wed, 30 Mar 2016 15:49:25 -0700 Subject: [PATCH] Clear index cache whenever index updated #1962 --- src/Stack/Fetch.hs | 1 - src/Stack/PackageIndex.hs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) 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