Skip to content

Commit

Permalink
fix(package-managers): Do not set the package type to the manager name
Browse files Browse the repository at this point in the history
If a manager would get renamed, the package type should stay the same.

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Jan 17, 2025
1 parent a5659de commit d7f223f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion plugins/package-managers/bazel/src/main/kotlin/Bazel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ class Bazel(
private fun BazelModule.toPackageReference(archiveOverrides: Map<String, ArchiveOverride>): PackageReference =
PackageReference(
id = Identifier(
type = managerName,
type = "Bazel",
namespace = "",
name = key.substringBefore("@", ""),
version = key.substringAfter("@", "")
Expand Down
6 changes: 3 additions & 3 deletions plugins/package-managers/carthage/src/main/kotlin/Carthage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class Carthage(

return Package(
id = Identifier(
type = managerName,
type = "Carthage",
namespace = vcsHost?.getUserOrOrganization(projectUrl).orEmpty(),
name = vcsHost?.getProject(projectUrl).orEmpty(),
version = revision
Expand All @@ -207,7 +207,7 @@ class Carthage(

return Package(
id = Identifier(
type = managerName,
type = "Carthage",
namespace = "",
name = fileUrl.substringAfterLast("/"),
version = revision
Expand All @@ -225,7 +225,7 @@ class Carthage(
private fun createPackageFromBinarySpec(binarySpec: Map<String, String>, id: String, revision: String) =
Package(
id = Identifier(
type = managerName,
type = "Carthage",
namespace = "",
name = id.substringAfterLast("/").removeSuffix(".json"),
version = revision
Expand Down
4 changes: 2 additions & 2 deletions plugins/package-managers/pub/src/main/kotlin/Pub.kt
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ class Pub(
if (pkgInfoFromLockfile == null || pkgInfoFromLockfile.source == "sdk") return@forEach

val id = Identifier(
type = managerName,
type = "Pub",
namespace = "",
name = packageName,
version = pkgInfoFromLockfile.version.orEmpty()
Expand Down Expand Up @@ -629,7 +629,7 @@ class Pub(
}

val id = Identifier(
type = managerName,
type = "Pub",
namespace = "",
name = rawName,
version = version
Expand Down

0 comments on commit d7f223f

Please sign in to comment.