Skip to content

Commit d8e2cde

Browse files
bs-ondemsschuberth
authored andcommitted
fix(cocoapods): Store patched podspec in original podspec directory
Writing the patched podspec file in a temp directory broke relative paths used in some podspecs (e.g. to `package.json`). Storing it alongside the original podspec file ensures the CocoaPods command `pod ipc spec` evaluates it with proper path resolution. Signed-off-by: Onur Demirci <[email protected]>
1 parent 0df84a1 commit d8e2cde

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

plugins/package-managers/cocoapods/src/main/kotlin/PodDependencyHandler.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ package org.ossreviewtoolkit.plugins.packagemanagers.cocoapods
2222
import java.io.File
2323
import java.io.IOException
2424

25-
import kotlin.io.path.createTempFile
26-
import kotlin.io.path.pathString
27-
import kotlin.io.path.writeText
28-
2925
import org.apache.logging.log4j.kotlin.logger
3026

3127
import org.ossreviewtoolkit.analyzer.PackageManager.Companion.processPackageVcs
@@ -139,11 +135,11 @@ internal class PodDependencyHandler : DependencyHandler<Lockfile.Pod> {
139135
}
140136
} ?: content
141137

142-
val patchedPodspecFile = createTempFile("ruby_podspec", ".podspec").apply { writeText(rubyContent) }
138+
val patchedPodspecFile = resolveSibling("ort_$name").apply { writeText(rubyContent) }
143139

144140
return runCatching {
145141
// Convert the Ruby podspec file to JSON.
146-
CocoaPodsCommand.run(parentFile, "ipc", "spec", patchedPodspecFile.pathString)
142+
CocoaPodsCommand.run(parentFile, "ipc", "spec", patchedPodspecFile.absolutePath)
147143
.requireSuccess()
148144
.stdout
149145
}.onFailure { e ->

0 commit comments

Comments
 (0)