fix: print original instead of kebab cased names

This commit is contained in:
oSumAtrIX 2023-07-24 14:18:15 +02:00
parent fa85482c4a
commit 5eaad33dc1
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
1 changed files with 6 additions and 6 deletions

View File

@ -17,12 +17,11 @@ fun Patcher.addPatchesFiltered(allPatches: PatchList) {
val includedPatches = mutableListOf<Class<out Patch<Context>>>()
allPatches.forEach patchLoop@{ patch ->
val compatiblePackages = patch.compatiblePackages
val patchName = patch.patchName.lowercase().replace(" ", "-")
val args = args.patchArgs?.patchingArgs!!
val prefix = "Skipping $patchName"
val prefix = "Skipping ${patch.patchName}"
if (compatiblePackages == null) logger.trace("$patchName: No constraint on packages.")
if (compatiblePackages == null) logger.trace("${patch.patchName}: No package constraints.")
else {
if (!compatiblePackages.any { it.name == packageName }) {
logger.trace("$prefix: Incompatible with $packageName. This patch is only compatible with ${
@ -42,15 +41,16 @@ fun Patcher.addPatchesFiltered(allPatches: PatchList) {
}
}
if (args.excludedPatches.contains(patchName)) {
val kebabCasedPatchName = patch.patchName.lowercase().replace(" ", "-")
if (args.excludedPatches.contains(kebabCasedPatchName)) {
logger.info("$prefix: Manually excluded")
return@patchLoop
} else if ((!patch.include || args.exclusive) && !args.includedPatches.contains(patchName)) {
} else if ((!patch.include || args.exclusive) && !args.includedPatches.contains(kebabCasedPatchName)) {
logger.info("$prefix: Excluded by default")
return@patchLoop
}
logger.trace("Adding $patchName")
logger.trace("Adding ${patch.patchName}")
includedPatches.add(patch)
}