kou commented on code in PR #13622:
URL: https://github.com/apache/arrow/pull/13622#discussion_r922518037


##########
r/tools/nixlibs.R:
##########
@@ -22,7 +22,14 @@ dst_dir <- paste0("libarrow/arrow-", VERSION)
 # TESTING is set in test-nixlibs.R; it won't be set when called from configure
 test_mode <- exists("TESTING")
 
-arrow_repo <- paste0(getOption("arrow.dev_repo", 
"https://nightlies.apache.org/arrow/r";), "/libarrow/")
+# Check if version string has 4th component
+is_dev_version <- grepl("(\\d+\\.){3}\\d+", VERSION)
+
+if(is_dev_version){

Review Comment:
   ```suggestion
   if (is_dev_version) {
   ```



##########
dev/release/05-binary-upload.sh:
##########
@@ -104,6 +105,28 @@ fi
 if [ ${UPLOAD_PYTHON} -gt 0 ]; then
   rake_tasks+=(python:rc)
 fi
+if [ ${UPLOAD_R} -gt 0 ]; then
+  rake_tasks+=(r:rc)
+  # The R libarrow binaries have to be converted to the correct dir structure
+  pushd $artifact_dir/r-binary-packages
+  # R package binaries are distributed via CRAN
+  rm  r-pkg*
+  r_src_files=$(ls r-lib*)
+  # Decode relative path from file name.
+  # r-lib__libarrow__bin__centos-7__arrow-8.0.0.zip 
+  # --> libarrow/bin/centos-7/arrow-8.0.0.zip
+  r_dest_files=($(echo $r_src_files | sed 's/r-lib__//g; s/__/\//g'))
+  r_src_files=($r_src_files)
+
+  mkdir -p $(dirname ${r_dest_files[@]})
+  r_length=${#r_dest_files[@]}
+
+  for (( i=0; i<${r_length}; i++ ));
+  do
+    mv ${r_src_files[$i]} ${r_dest_files[$i]}
+  done
+  popd

Review Comment:
   I want to move this logic to `binary-task.rb`. If we do this at here, we 
can't run this script multiple times.
   
   I'll provide a diff for it later.



##########
r/tools/winlibs.R:
##########
@@ -37,11 +37,20 @@ if 
(!file.exists(sprintf("windows/arrow-%s/include/arrow/api.h", VERSION))) {
         silent = quietly
       )
     }
+
+    # Check if version string has 4th component
+    is_dev_version <- grepl("(\\d+\\.){3}\\d+", VERSION)
     # URL templates
-    nightly <- paste0(
-      getOption("arrow.dev_repo", "https://nightlies.apache.org/arrow/r";),
-      "/libarrow/bin/windows/arrow-%s.zip"
-    )
+    if (is_dev_version) {
+      nightly <- paste0(
+        getOption("arrow.dev_repo", "https://nightlies.apache.org/arrow/r";),
+        "/libarrow/bin/windows/arrow-%s.zip"
+      )
+    } else {
+      # %1$s uses the first variable for both substitutions
+      nightly <- 
"https://apache.jfrog.io/artifactory/arrow/r/%1$s/libarrow/bin/windows/arrow-%1$s.zip";

Review Comment:
   I think that this is not a nightly. Can we use more suitable variable name?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to