Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-39041:[R] Improve update-checksum.R output #39042

Merged
merged 3 commits into from
Dec 5, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions r/tools/update-checksums.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ if (!file.exists(tasks_yml)) {
stop("Run this script from the r/ directory of the arrow repo")
}

print("Extracting libarrow binary paths from tasks.yml")
assignUser marked this conversation as resolved.
Show resolved Hide resolved
# Get the libarrow binary paths from the tasks.yml file
binary_paths <- readLines(tasks_yml) |>
grep("r-lib__libarrow", x = _, value = TRUE) |>
Expand All @@ -53,15 +54,19 @@ for (path in binary_paths) {
sha_path <- paste0(path, ".sha512")
file <- file.path("tools/checksums", sha_path)
dirname(file) |> dir.create(path = _, recursive = TRUE, showWarnings = FALSE)


print(paste0("Downloading ", sha_path))
url <- sprintf(artifactory_root, VERSION, sha_path)
download.file(url, file, quiet = TRUE, cacheOK = FALSE)

if (grepl("windows", path)) {
print(paste0("Converting ", path, " to windows style line endings"))
# UNIX style line endings cause errors with mysys2 sha512sum
sed_status <- system2("sed", args = c("-i", "s/\\r//", file))
sed_status <- system2("sed", args = c("-i", "s/\\\\r//", file))
if (sed_status != 0) {
stop("Failed to remove \\r from windows checksum file. Exit code: ", sed_status)
}
}
}

print("Checksums updated successfully!")