mirror of
https://github.com/ryantm/nixpkgs-update.git
synced 2024-11-10 13:24:58 +03:00
extract isBrokeMsg
This commit is contained in:
parent
753edcf99f
commit
957c563180
15
src/Nix.hs
15
src/Nix.hs
@ -110,12 +110,19 @@ getMaintainers attrPath =
|
||||
".meta.maintainers or []))))") &
|
||||
rewriteError ("Could not fetch maintainers for" <> attrPath)
|
||||
|
||||
getIsBroken :: Text -> Sh (Either Text Text)
|
||||
readNixBool :: Either Text Text -> Either Text Bool
|
||||
readNixBool (Right "true") = Right True
|
||||
readNixBool (Right "false") = Right False
|
||||
readNixBool (Right a) = Left ("Failed to convert expected nix boolean " <> a)
|
||||
readNixBool (Left e) = Left e
|
||||
|
||||
getIsBroken :: Text -> Sh (Either Text Bool)
|
||||
getIsBroken attrPath =
|
||||
nixEvalE
|
||||
NoRaw
|
||||
("(let pkgs = import ./. {}; in pkgs." <> attrPath <>
|
||||
".meta.broken or false)") &
|
||||
NoRaw
|
||||
("(let pkgs = import ./. {}; in pkgs." <> attrPath <>
|
||||
".meta.broken or false)") &
|
||||
fmap readNixBool &
|
||||
rewriteError ("Could not get meta.broken for attrpath " <> attrPath)
|
||||
|
||||
getDescription :: Text -> Sh (Either Text Text)
|
||||
|
@ -228,12 +228,8 @@ publishPackage log updateEnv newSrcUrl attrPath result = do
|
||||
-- Try to push it three times
|
||||
push updateEnv `orElse` push updateEnv `orElse` push updateEnv
|
||||
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."
|
||||
else ""
|
||||
untilOfBorgFree
|
||||
pr (prMessage commitMsg brokenWarning metaDescription releaseUrlMessage resultCheckReport commitHash attrPath maintainersCc)
|
||||
pr (prMessage commitMsg isBroken metaDescription releaseUrlMessage resultCheckReport commitHash attrPath maintainersCc)
|
||||
cleanAndResetToMaster
|
||||
return True
|
||||
|
||||
@ -249,11 +245,18 @@ commitMessage updateEnv attrPath =
|
||||
Semi-automatic update generated by https://github.com/ryantm/nixpkgs-update tools. This update was made based on information from https://repology.org/metapackage/$pN/versions.
|
||||
|]
|
||||
|
||||
prMessage :: Text -> Text -> Text -> Text -> Text -> Text -> Text -> Text -> Text
|
||||
prMessage commitMsg brokenWarning metaDescription releaseUrlMessage resultCheckReport commitHash attrPath maintainersCc =
|
||||
brokenWarning :: Bool -> Text
|
||||
brokenWarning False = ""
|
||||
brokenWarning True = "- WARNING: Package has meta.broken=true; Please manually test this package update and remove the broken attribute."
|
||||
|
||||
prMessage :: Text -> Bool -> Text -> Text -> Text -> Text -> Text -> Text -> Text
|
||||
prMessage commitMsg isBroken metaDescription releaseUrlMessage resultCheckReport commitHash attrPath maintainersCc =
|
||||
let
|
||||
brokenMsg = brokenWarning isBroken
|
||||
in
|
||||
[text|
|
||||
$commitMsg
|
||||
$brokenWarning
|
||||
$brokenMsg
|
||||
$metaDescription
|
||||
$releaseUrlMessage
|
||||
<details>
|
||||
|
Loading…
Reference in New Issue
Block a user