Merge remote-tracking branch 'tomberek/master'

This commit is contained in:
Ryan Mulligan 2019-05-05 13:48:30 -07:00
commit 5eb0cbed2d
2 changed files with 15 additions and 1 deletions

View File

@ -17,6 +17,7 @@ module Nix
, parseStringList
, build
, getDescription
, getHomepage
, cachix
, assertOneOrFewerFetcher
, getHashFromBuild
@ -156,6 +157,14 @@ getDescription attrPath =
".meta.description or \"\")") &
overwriteErrorT ("Could not get meta.description for attrpath " <> attrPath)
getHomepage :: MonadIO m => Text -> ExceptT Text m Text
getHomepage attrPath =
nixEvalET
NoRaw
("(let pkgs = import ./. {}; in pkgs." <> attrPath <>
".meta.homepage or \"\")") &
overwriteErrorT ("Could not get meta.homepage for attrpath " <> attrPath)
getSrcUrl :: MonadIO m => Text -> ExceptT Text m Text
getSrcUrl =
srcOrMain

View File

@ -178,8 +178,11 @@ publishPackage log updateEnv oldSrcUrl newSrcUrl attrPath result opDiff = do
Right () -> lift $ Check.result updateEnv result
Left msg -> pure msg
d <- Nix.getDescription attrPath
u <- Nix.getHomepage attrPath
let metaDescription =
"\n\nmeta.description for " <> attrPath <> " is: '" <> d <> "'."
let metaHomepage =
"\n\nmeta.homepage for " <> attrPath <> " is: '" <> u
releaseUrlMessage <-
(do msg <- GH.releaseUrl newSrcUrl
return ("\n[Release on GitHub](" <> msg <> ")\n\n")) <|>
@ -211,6 +214,7 @@ publishPackage log updateEnv oldSrcUrl newSrcUrl attrPath result opDiff = do
updateEnv
isBroken
metaDescription
metaHomepage
releaseUrlMessage
compareUrlMessage
resultCheckReport
@ -258,7 +262,8 @@ prMessage ::
-> Text
-> Text
-> Text
prMessage updateEnv isBroken metaDescription releaseUrlMessage compareUrlMessage resultCheckReport commitHash attrPath maintainersCc resultPath opReport =
-> Text
prMessage updateEnv isBroken metaDescription metaHomepage releaseUrlMessage compareUrlMessage resultCheckReport commitHash attrPath maintainersCc resultPath opReport =
let brokenMsg = brokenWarning isBroken
title = prTitle updateEnv attrPath
repologyLink = repologyUrl updateEnv