packages feed

stackage-curator 0.7.1 → 0.7.1.1

raw patch · 3 files changed

+28/−2 lines, 3 files

Files

ChangeLog.md view
@@ -1,3 +1,7 @@+## 0.7.1.1++* Fix bug with existing .haddock file collection+ ## 0.7.1  * Add the `stats` command
Stackage/PerformBuild.hs view
@@ -195,7 +195,6 @@     warningsVar <- newTVarIO id     mutex <- newMVar ()     env <- getEnvironment-    haddockFiles <- newTVarIO mempty      registeredPackages <- setupPackageDatabase         (pbDatabase pb)@@ -204,6 +203,9 @@         (ppVersion <$> bpPackages pbPlan)         (deletePreviousResults pb) +    pbLog "Collecting existing .haddock files\n"+    haddockFiles <- getHaddockFiles pb >>= newTVarIO+     forM_ packageMap $ \pi -> void $ async $ singleBuild pb registeredPackages       SingleBuild         { sbSem = sem@@ -570,3 +572,23 @@     forM_ [minBound..maxBound] $ \rt ->     withPRPath pb rt name $ \fp ->     void $ tryIO $ removeFile fp++-- | Discover existing .haddock files in the docs directory+getHaddockFiles :: PerformBuild -> IO (Map Text FilePath)+getHaddockFiles pb =+      runResourceT+    $ sourceDirectory (pbDocDir pb)+   $$ foldMapMC (liftIO . go)+  where+    go :: FilePath -> IO (Map Text FilePath)+    go dir =+        case simpleParse nameVerText of+            Nothing -> return mempty+            Just pi@(PackageIdentifier (PackageName name) _) -> do+                let fp = dir </> fpFromString name <.> "haddock"+                exists <- isFile fp+                return $ if exists+                    then singletonMap nameVerText fp+                    else mempty+      where+        nameVerText = fpToText $ filename dir
stackage-curator.cabal view
@@ -1,5 +1,5 @@ name:                stackage-curator-version:             0.7.1+version:             0.7.1.1 synopsis:            Tools for curating Stackage bundles description:         Please see <http://www.stackage.org/package/stackage-curator> for a description and documentation. homepage:            https://github.com/fpco/stackage