Skip to content

Commit

Permalink
PIP: Fixup the names of two function parameters
Browse files Browse the repository at this point in the history
This parameter actually is the node for a single release. This is a
fixup for be256d9.

Signed-off-by: Sebastian Schuberth <sebastian.schuberth@here.com>
  • Loading branch information
sschuberth committed Mar 26, 2019
1 parent d6c2b5d commit 277297a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions analyzer/src/main/kotlin/managers/PIP.kt
Original file line number Diff line number Diff line change
Expand Up @@ -421,20 +421,20 @@ class PIP(name: String, analyzerConfig: AnalyzerConfiguration, repoConfig: Repos
return ProjectAnalyzerResult(project, packages.map { it.toCuratedPackage() }.toSortedSet())
}

private fun getBinaryArtifact(pkg: Package, releasesNode: ArrayNode): RemoteArtifact {
private fun getBinaryArtifact(pkg: Package, releaseNode: ArrayNode): RemoteArtifact {
// Prefer python wheels and fall back to the first entry (probably a sdist).
val binaryArtifact = releasesNode.asSequence().find {
val binaryArtifact = releaseNode.asSequence().find {
it["packagetype"].textValue() == "bdist_wheel"
} ?: releasesNode[0]
} ?: releaseNode[0]

val url = binaryArtifact["url"]?.textValue() ?: pkg.binaryArtifact.url
val hash = binaryArtifact["md5_digest"]?.textValue() ?: pkg.binaryArtifact.hash

return RemoteArtifact(url, hash, HashAlgorithm.fromHash(hash))
}

private fun getSourceArtifact(releasesNode: ArrayNode): RemoteArtifact {
val sourceArtifacts = releasesNode.asSequence().filter {
private fun getSourceArtifact(releaseNode: ArrayNode): RemoteArtifact {
val sourceArtifacts = releaseNode.asSequence().filter {
it["packagetype"].textValue() == "sdist"
}

Expand Down

0 comments on commit 277297a

Please sign in to comment.