Skip to content

Commit

Permalink
another way
Browse files Browse the repository at this point in the history
  • Loading branch information
jonkeane committed Jan 15, 2024
1 parent bdf08ec commit e2e8658
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions r/tools/nixlibs.R
Expand Up @@ -111,19 +111,19 @@ validate_checksum <- function(binary_url, libfile, hush = quietly) {
checksum_file <- file.path(checksum_path, checksum_file)

# Try `shasum`, and if that doesn't work, fall back to `sha512sum` if not found
checksum_ok <- tryCatch({
system2(
"shasum",
args = c("--status", "-a", "512", "-c", checksum_file)
) == 0
},
error = function(e) {
system2(
# system2 doesn't generate an R error, so we can't use a tryCatch to
# move from shasum to sha512sum.
checksum_ok <- system2(
"shasum",
args = c("--status", "-a", "512", "-c", checksum_file),
) == 0

if (!checksum_ok) {
checksum_ok <- system2(
"sha512sum",
args = c("--status", "-c", checksum_file)
) == 0
}
)

if (checksum_ok) {
lg("Checksum validated successfully for libarrow")
Expand Down

0 comments on commit e2e8658

Please sign in to comment.