Skip to content
This repository has been archived by the owner on Feb 3, 2020. It is now read-only.

Commit

Permalink
Newest versions of dependencies (fixes #6)
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Aug 25, 2015
1 parent 3c82661 commit 8839682
Show file tree
Hide file tree
Showing 18 changed files with 197 additions and 344 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.11.0

* Use newest version of libraries [#6](https://github.com/fpco/stackage-curator/issues/6)

## 0.10.0

* Added `pcSkipBuild`
Expand Down
13 changes: 6 additions & 7 deletions Stackage/BuildConstraints.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ import Data.Aeson
import qualified Data.Map as Map
import Data.Yaml (decodeEither', decodeFileEither)
import Distribution.Package (Dependency (..))
import Distribution.System (Arch, OS)
import qualified Distribution.System
import Distribution.Version (anyVersion)
import Filesystem (isFile)
import Network.HTTP.Client (Manager, httpLbs, responseBody, Request)
import Stackage.CorePackages
import Stackage.Prelude
import System.Directory (doesFileExist)

data BuildConstraints = BuildConstraints
{ bcPackages :: Set PackageName
Expand Down Expand Up @@ -75,7 +74,7 @@ loadBuildConstraints :: BuildConstraintsSource -> Manager -> IO BuildConstraints
loadBuildConstraints bcs man = do
case bcs of
BCSDefault -> do
e <- isFile fp0
e <- doesFileExist fp0
if e
then loadFile fp0
else loadReq req0
Expand All @@ -85,7 +84,7 @@ loadBuildConstraints bcs man = do
fp0 = "build-constraints.yaml"
req0 = "https://raw.githubusercontent.com/fpco/stackage/master/build-constraints.yaml"

loadFile fp = decodeFileEither (fpToString fp) >>= either throwIO toBC
loadFile fp = decodeFileEither fp >>= either throwIO toBC
loadReq req = httpLbs req man >>=
either throwIO toBC . decodeEither' . toStrict . responseBody

Expand Down Expand Up @@ -143,9 +142,9 @@ instance FromJSON ConstraintFile where
_ -> fail $ "Invalid GHC major version: " ++ unpack t

data MismatchedGhcVersion = MismatchedGhcVersion
{ mgvGhcOnPath :: !Version
, mgvExpectedMajor :: !Int
, mgcExpectedMinor :: !Int
{ _mgvGhcOnPath :: !Version
, _mgvExpectedMajor :: !Int
, _mgcExpectedMinor :: !Int
}
deriving (Show, Typeable)
instance Exception MismatchedGhcVersion
Expand Down
2 changes: 0 additions & 2 deletions Stackage/BuildPlan.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ module Stackage.BuildPlan
) where

import Control.Monad.State.Strict (execState, get, put)
import Data.Aeson
import qualified Data.Map as Map
import qualified Data.Set as Set
import qualified Distribution.Compiler
import Distribution.PackageDescription
import Stackage.BuildConstraints
Expand Down
Loading

0 comments on commit 8839682

Please sign in to comment.