Skip to content

Commit

Permalink
[feat] include meate.homepage for the purl (#4075)
Browse files Browse the repository at this point in the history
  • Loading branch information
MangoIV authored Jun 3, 2024
1 parent d66df38 commit 5c59628
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions hack/bin/Sbom.hs
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,9 @@ mkPurl meta =
maybe "" ("@" <>) meta.version
]
where
checks = meta.homepage : meta.urls
repo
| any (maybe False (T.isInfixOf "hackage.haskell.org")) meta.urls = "hackage"
| any (maybe False (T.isInfixOf "hackage.haskell.org")) checks = "hackage"
| otherwise = "nixpkgs"

-- | serializes an SBom to JSON format
Expand All @@ -209,11 +210,7 @@ serializeSBom settings bom = do
-- FUTUREWORK(mangoiv): "tools" (the tools used in the creation of the bom)
let mkDependencies :: SBomMeta Identity -> Array
mkDependencies meta =
[ object
[ "ref" .= meta.outPath,
"dependsOn" .= runIdentity meta.directDeps
]
]
[object ["ref" .= meta.outPath, "dependsOn" .= runIdentity meta.directDeps]]

serializeLicense :: Maybe License -> Maybe Value
serializeLicense ml = do
Expand Down

0 comments on commit 5c59628

Please sign in to comment.