jonkeane commented on code in PR #38534:
URL: https://github.com/apache/arrow/pull/38534#discussion_r1388225995


##########
r/tools/nixlibs.R:
##########
@@ -44,17 +46,32 @@ find_latest_nightly <- function(description_version) {
   res <- try(
     {
       # Binaries are only uploaded if all jobs pass so can just look at the 
source versions.
-      urls <- readLines("https://nightlies.apache.org/arrow/r/src/contrib";)
-      versions <- grep("arrow_.*\\.tar\\.gz", urls, value = TRUE)
-      versions <- sub(".*arrow_(.*)\\.tar\\.gz.*", "\\1", x = versions)
-      versions <- sapply(versions, package_version)
-      versions <- data.frame(do.call(rbind, versions))
-      matching_major <- versions[versions$X1 == description_version[1, 1], ]
-      latest <- matching_major[which.max(matching_major$X4), ]
-      package_version(paste0(latest, collapse = "."))
+      urls <- readLines(list_uri)
+      versions <- grep("Version:\\s*.*?", urls, value = TRUE)
+      versions <- sort(package_version(sub("Version:\\s*", "\\1", versions)))
+      major_versions <- vapply(
+        versions,
+        function(x) as.integer(x[[c(1, 1)]]),
+        integer(1)
+      )

Review Comment:
   Any reason not to do: 
   
   ```suggestion
         major_versions <- versions$major
   ```



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