Skip to content

Commit

Permalink
Externals/Gradle: Fix a typo, "downloadble"
Browse files Browse the repository at this point in the history
This is a trivial fix to correct a typo, "downloadble".

Signed-off-by: Wook Song <wook16.song@samsung.com>
  • Loading branch information
wooksong authored and myungjoo committed Jun 10, 2024
1 parent f25866d commit 9e97dea
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions externals/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ tasks {
downloadablePath.createDirectories()
}

for (downloadble in downloadables) {
val (tarFileName, targetDir, url, isEnabled, downloadableFormat, digestFileName) = downloadble
for (downloadable in downloadables) {
val (tarFileName, targetDir, url, isEnabled, downloadableFormat, digestFileName) = downloadable
val targetPath = projectDir.toPath().resolve(targetDir)

if (!isEnabled || targetPath.isDirectory()) {
Expand All @@ -103,8 +103,8 @@ tasks {
println("...downloading from $url")
println("This step may take some time to complete...")

val downloadbleName = "$tarFileName$downloadableFormat"
downloadFile(URL("$url/$downloadbleName"), downloadablePath.resolve(downloadbleName).toString())
val downloadableName = "$tarFileName$downloadableFormat"
downloadFile(URL("$url/$downloadableName"), downloadablePath.resolve(downloadableName).toString())

val verified = if (digestFileName.isEmpty().or(digestFileName.isBlank())) {
true
Expand All @@ -120,22 +120,22 @@ tasks {
fileNameToHashMap[filename] = hash
}
//FIXME Support other algorithms such as MD5, sha512
fileNameToHashMap[downloadbleName] == File("$downloadablePath/$downloadbleName").sha256sum()
fileNameToHashMap[downloadableName] == File("$downloadablePath/$downloadableName").sha256sum()
}

if (!verified) {
throw IOException("Failed to verify the integrity of the downloaded file: $downloadbleName")
throw IOException("Failed to verify the integrity of the downloaded file: $downloadableName")
}

when {
downloadbleName.endsWith(".xz") -> {
downloadableName.endsWith(".xz") -> {
try {
File("$downloadablePath/$downloadbleName").inputStream().buffered().use { bufferedIn ->
File("$downloadablePath/$downloadableName").inputStream().buffered().use { bufferedIn ->
XZCompressorInputStream(bufferedIn).toFile("$downloadablePath/$tarFileName")
}
downloadablePath.resolve(downloadbleName).deleteIfExists()
downloadablePath.resolve(downloadableName).deleteIfExists()
} catch (e: IOException) {
println("Failed to decompress $downloadablePath/$downloadbleName")
println("Failed to decompress $downloadablePath/$downloadableName")
}
}
}
Expand Down

0 comments on commit 9e97dea

Please sign in to comment.