on master help sign in
Fix skipping certain compilers error
commitb867e6f2042b64ba6ca2a3471bb12923f7d37456 authorJasper Van der Jeugt <jaspervdj@gmail.com> dateMon 17 Jan 2011, 10:02 (16 years ago) parent6e7dc0e
2 files changed+11−5
src/Hakyll/Core/DirectedGraph.hs+9 src/Hakyll/Core/Run.hs+2−5
src/Hakyll/Core/DirectedGraph.hs+9
@@ -4,6 +4,7 @@
44module Hakyll.Core.DirectedGraph
55 ( DirectedGraph
66 , fromList
7+ , member
78 , nodes
89 , neighbours
910 , reverse
@@ -27,6 +28,14 @@ fromList :: Ord a
2728 -> DirectedGraph a -- ^ Resulting directed graph
2829fromList = DirectedGraph . M.fromList . map (\(t, d) -> (t, Node t d))
2930
31+-- | Check if a node lies in the given graph
32+--
33+member :: Ord a
34+ => a -- ^ Node to check for
35+ -> DirectedGraph a -- ^ Directed graph to check in
36+ -> Bool -- ^ If the node lies in the graph
37+member n = M.member n . unDirectedGraph
38+
3039-- | Get all nodes in the graph
3140--
3241nodes :: Ord a
src/Hakyll/Core/Run.hs+2−5
@@ -95,10 +95,7 @@ addNewCompilers oldCompilers newCompilers = Hakyll $ do
9595 provider <- hakyllResourceProvider <$> ask
9696 store <- hakyllStore <$> ask
9797
98− let -- Create a set of new compilers
99− newCompilerIdentifiers = S.fromList $ map fst newCompilers
100−
101− -- All compilers
98+ let -- All compilers
10299 compilers = oldCompilers ++ newCompilers
103100
104101 -- Get all dependencies for the compilers
@@ -128,7 +125,7 @@ addNewCompilers oldCompilers newCompilers = Hakyll $ do
128125 -- Find obsolete items. Every item that is reachable from a modified
129126 -- item is considered obsolete. From these obsolete items, we are only
130127 -- interested in ones that are in the current subgraph.
131− obsolete = S.filter (`S.member` newCompilerIdentifiers)
128+ obsolete = S.filter (`member` currentGraph)
132129 $ reachableNodes modified' $ reverse completeGraph
133130
134131 -- Solve the graph and retain only the obsolete items