extract isBroken

This commit is contained in:
Ryan Mulligan 2018-05-06 16:43:24 -07:00
parent 9238c5c3f2
commit 9608392048
2 changed files with 13 additions and 6 deletions

View File

@ -13,6 +13,7 @@ module Nix
, getMaintainers
, getOldHash
, getSrcUrl
, getIsBroken
, Raw(..)
) where
@ -105,3 +106,11 @@ getMaintainers attrPath =
attrPath <>
".meta.maintainers or []))))") &
rewriteError ("Could not fetch maintainers for" <> attrPath)
getIsBroken :: Text -> Sh (Either Text Text)
getIsBroken attrPath =
nixEvalE
NoRaw
("(let pkgs = import ./. {}; in pkgs." <> attrPath <>
".meta.broken or false)") &
rewriteError ("Could not get meta.broken for attrpath " <> attrPath)

View File

@ -38,6 +38,7 @@ import Nix
( Raw(..)
, compareVersions
, getDerivationFile
, getIsBroken
, getMaintainers
, getOldHash
, getSrcUrl
@ -272,10 +273,7 @@ updatePackage log updateEnv = do
commit commitMessage
-- Try to push it three times
push updateEnv `orElse` push updateEnv `orElse` push updateEnv
isBroken <-
nixEval
("(let pkgs = import ./. {}; in pkgs." <> attrPath <>
".meta.broken or false)")
isBroken <- eitherToError errorExit (getIsBroken attrPath)
let brokenWarning =
if isBroken == "true"
then "- WARNING: Package has meta.broken=true; Please manually test this package update and remove the broken attribute."