assignUser commented on code in PR #38236:
URL: https://github.com/apache/arrow/pull/38236#discussion_r1363095893


##########
r/tools/nixlibs.R:
##########
@@ -15,35 +15,55 @@
 # specific language governing permissions and limitations
 # under the License.
 
-args <- commandArgs(TRUE)
-VERSION <- args[1]
-dst_dir <- paste0("libarrow/arrow-", VERSION)
+#### Fuctions #### check end of file for main logic
+env_is <- function(var, value) identical(tolower(Sys.getenv(var)), value)
 
-# TESTING is set in test-nixlibs.R; it won't be set when called from configure
-test_mode <- exists("TESTING")
+# Log messages in the style of the configure script
+lg <- function(..., .indent = "***") {
+  cat(.indent, " ", sprintf(...), "\n", sep = "")
+}
 
-# Prevent error with binary selection during testing.
-if (test_mode && is.na(VERSION)) {
-  VERSION <- "8.0.0.9000"
+# Exit the script after logging with .status=1 instead of throwing an error
+exit <- function(..., .status = 1) {
+  lg(...)
+  q(save = "no", status = .status)
 }
 
-dev_version <- package_version(VERSION)[1, 4]
-on_macos <- tolower(Sys.info()[["sysname"]]) == "darwin"
 
+# checks the nightly repo for the latest nightly version X.Y.Z.100<dev>
+find_latest_nightly <- function(description_version) {
+  if (!startsWith(arrow_repo, "https://nightlies.apache.org/arrow/r";)) {
+    lg("Detected non standard dev repo: %s, not checking latest nightly 
version.", arrow_repo)
+    return(description_version)
+  }
 
-# Small dev versions are added for R-only changes during CRAN submission.
-if (is.na(dev_version) || dev_version < "100") {
-  VERSION <- package_version(VERSION)[1, 1:3]
-  arrow_repo <- paste0(getOption("arrow.repo", 
sprintf("https://apache.jfrog.io/artifactory/arrow/r/%s";, VERSION)), 
"/libarrow/")
-} else {
-  arrow_repo <- paste0(getOption("arrow.dev_repo", 
"https://nightlies.apache.org/arrow/r";), "/libarrow/")
+  res <- try(
+    {
+      url_file <- tempfile()
+      on.exit(unlink(url_file))

Review Comment:
   :exploding_head: 



-- 
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