This is an automated email from the ASF dual-hosted git repository.

assignuser pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 7346bdffbd GH-39041:[R] Improve `update-checksum.R` output (#39042)
7346bdffbd is described below

commit 7346bdffbdca36492089f6160534bfa2b81bad90
Author: Jacob Wujciak-Jens <[email protected]>
AuthorDate: Tue Dec 5 18:47:34 2023 +0100

    GH-39041:[R] Improve `update-checksum.R` output (#39042)
    
    
    ### Rationale for this change
    
    The script was to quiet.
    
    ### What changes are included in this PR?
    
    Fix regex and add some output:
    ```
    Rscript tools/update-checksums.R 14.0.0                                     
                                      1 ✘
    [1] "Extracting libarrow binary paths from tasks.yml"
    [1] "Downloading windows/arrow-14.0.0.zip.sha512"
    [1] "Converting windows/arrow-14.0.0.zip to windows style line endings"
    [1] "Downloading linux-openssl-1.0/arrow-14.0.0.zip.sha512"
    [1] "Downloading linux-openssl-1.1/arrow-14.0.0.zip.sha512"
    [1] "Downloading linux-openssl-3.0/arrow-14.0.0.zip.sha512"
    [1] "Downloading darwin-arm64-openssl-1.1/arrow-14.0.0.zip.sha512"
    [1] "Downloading darwin-arm64-openssl-3.0/arrow-14.0.0.zip.sha512"
    [1] "Downloading darwin-x86_64-openssl-1.1/arrow-14.0.0.zip.sha512"
    [1] "Downloading darwin-x86_64-openssl-3.0/arrow-14.0.0.zip.sha512"
    [1] "Checksums updated successfully!"
    ```
    
    ### Are these changes tested?
    locally
    
    ### Are there any user-facing changes?
    no
    * Closes: #39041
    
    Authored-by: Jacob Wujciak-Jens <[email protected]>
    Signed-off-by: Jacob Wujciak-Jens <[email protected]>
---
 r/tools/update-checksums.R | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/r/tools/update-checksums.R b/r/tools/update-checksums.R
index 2aa9df3171..8b9f1e6959 100644
--- a/r/tools/update-checksums.R
+++ b/r/tools/update-checksums.R
@@ -38,6 +38,7 @@ if (!file.exists(tasks_yml)) {
   stop("Run this script from the r/ directory of the arrow repo")
 }
 
+cat("Extracting libarrow binary paths from tasks.yml\n")
 # Get the libarrow binary paths from the tasks.yml file
 binary_paths <- readLines(tasks_yml) |>
   grep("r-lib__libarrow", x = _, value = TRUE) |>
@@ -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)
-
+  
+  cat(paste0("Downloading ", sha_path, "\n"))
   url <- sprintf(artifactory_root, VERSION, sha_path)
   download.file(url, file, quiet = TRUE, cacheOK = FALSE)
 
   if (grepl("windows", path)) {
+    cat(paste0("Converting ", path, " to windows style line endings\n"))
     # 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)
     }
   }
 }
+
+cat("Checksums updated successfully!\n")

Reply via email to