Skip to content

Commit

Permalink
One last time?
Browse files Browse the repository at this point in the history
  • Loading branch information
jonkeane committed Jan 15, 2024
1 parent e2e8658 commit 5d3508c
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions r/tools/nixlibs.R
Expand Up @@ -113,16 +113,22 @@ validate_checksum <- function(binary_url, libfile, hush = quietly) {
# Try `shasum`, and if that doesn't work, fall back to `sha512sum` if not found
# 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
# The warnings from system2 if it fails pop up later in the log and thus are
# more confusing than they are helpful (so we suppress them)
checksum_ok <- suppressWarnings(system2(
"shasum",
args = c("--status", "-a", "512", "-c", checksum_file),
stdout = ifelse(quietly, FALSE, ""),
stderr = ifelse(quietly, FALSE, "")
)) == 0

if (!checksum_ok) {
checksum_ok <- system2(
checksum_ok <- suppressWarnings(system2(
"sha512sum",
args = c("--status", "-c", checksum_file)
) == 0
args = c("--status", "-c", checksum_file),
stdout = ifelse(quietly, FALSE, ""),
stderr = ifelse(quietly, FALSE, "")
)) == 0
}

if (checksum_ok) {
Expand Down

0 comments on commit 5d3508c

Please sign in to comment.