mirror of
https://github.com/commercialhaskell/stackage.git
synced 2026-02-22 11:07:53 +01:00
stackage check
This commit is contained in:
parent
203ba99ed9
commit
4396bed20c
@ -1,3 +1,7 @@
|
|||||||
|
## 0.3.1
|
||||||
|
|
||||||
|
* Added `justCheck` and `stackage check` command line.
|
||||||
|
|
||||||
## 0.3.0.1
|
## 0.3.0.1
|
||||||
|
|
||||||
Pre-fetch all packages from Hackage to catch Hackage downtime early.
|
Pre-fetch all packages from Hackage to catch Hackage downtime early.
|
||||||
|
|||||||
@ -5,6 +5,7 @@ module Stackage.CompleteBuild
|
|||||||
( BuildType (..)
|
( BuildType (..)
|
||||||
, BumpType (..)
|
, BumpType (..)
|
||||||
, completeBuild
|
, completeBuild
|
||||||
|
, justCheck
|
||||||
) where
|
) where
|
||||||
import Data.Default.Class (def)
|
import Data.Default.Class (def)
|
||||||
import Data.Semigroup (Max (..), Option (..))
|
import Data.Semigroup (Max (..), Option (..))
|
||||||
@ -129,6 +130,25 @@ renderLTSVer lts = fpFromText $ concat
|
|||||||
, ".yaml"
|
, ".yaml"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
-- | Generate and check a new build plan, but do not execute it.
|
||||||
|
--
|
||||||
|
-- Since 0.3.1
|
||||||
|
justCheck :: IO ()
|
||||||
|
justCheck = withManager tlsManagerSettings $ \man -> do
|
||||||
|
putStrLn "Loading build constraints"
|
||||||
|
bc <- defaultBuildConstraints man
|
||||||
|
|
||||||
|
putStrLn "Creating build plan"
|
||||||
|
plan <- newBuildPlan bc
|
||||||
|
|
||||||
|
putStrLn $ "Writing build plan to check-plan.yaml"
|
||||||
|
encodeFile "check-plan.yaml" plan
|
||||||
|
|
||||||
|
putStrLn "Checking plan"
|
||||||
|
checkBuildPlan plan
|
||||||
|
|
||||||
|
putStrLn "Plan seems valid!"
|
||||||
|
|
||||||
completeBuild :: BuildType -> IO ()
|
completeBuild :: BuildType -> IO ()
|
||||||
completeBuild buildType = withManager tlsManagerSettings $ \man -> do
|
completeBuild buildType = withManager tlsManagerSettings $ \man -> do
|
||||||
hSetBuffering stdout LineBuffering
|
hSetBuffering stdout LineBuffering
|
||||||
|
|||||||
@ -5,11 +5,12 @@ main :: IO ()
|
|||||||
main = do
|
main = do
|
||||||
args <- getArgs
|
args <- getArgs
|
||||||
case args of
|
case args of
|
||||||
[x] | Just y <- lookup x m -> completeBuild y
|
[x] | Just y <- lookup x m -> y
|
||||||
_ -> error $ "Expected one argument, one of: " ++ unwords (map fst m)
|
_ -> error $ "Expected one argument, one of: " ++ unwords (map fst m)
|
||||||
where
|
where
|
||||||
m =
|
m =
|
||||||
[ ("nightly", Nightly)
|
[ ("nightly", completeBuild Nightly)
|
||||||
, ("lts-major", LTS Major)
|
, ("lts-major", completeBuild $ LTS Major)
|
||||||
, ("lts-minor", LTS Minor)
|
, ("lts-minor", completeBuild $ LTS Minor)
|
||||||
|
, ("check", justCheck)
|
||||||
]
|
]
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: stackage
|
name: stackage
|
||||||
version: 0.3.0.1
|
version: 0.3.1
|
||||||
synopsis: "Stable Hackage," tools for creating a vetted set of packages from Hackage.
|
synopsis: "Stable Hackage," tools for creating a vetted set of packages from Hackage.
|
||||||
description: Please see <http://www.stackage.org/package/stackage> for a description and documentation.
|
description: Please see <http://www.stackage.org/package/stackage> for a description and documentation.
|
||||||
homepage: https://github.com/fpco/stackage
|
homepage: https://github.com/fpco/stackage
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user