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

Export version_info or rtools_needed #97

Closed
burgerga opened this issue Jun 11, 2020 · 1 comment
Closed

Export version_info or rtools_needed #97

burgerga opened this issue Jun 11, 2020 · 1 comment

Comments

@burgerga
Copy link
Contributor

burgerga commented Jun 11, 2020

The latest R/Rtools release broke the installr::install.Rtools functionality (talgalili/installr#148).
I am working on a fix, but for this fix it would be very convenient if either version_info or rtools_needed would be exported. (Of course, it would be even more convenient if pkgbuild would have a function to install a compatible Rtools 😁)

What I was trying to do:

rtools_needed <- function(r_version = getRversion())
  tryCatch({
    version_info <- pkgbuild:::version_info
    version_info$custom <- NULL
    
    for (i in rev(seq_along(version_info))) {
      version <- names(version_info)[i]
      info <- version_info[[i]]
      ok <- r_version >= info$version_min && r_version <= info$version_max
      if (ok) return(version)
    }
  }, error = function(e) { })
  stop("Can't determine compatible Rtools version")
}

but because the ::: I don't think this is going to pass CRAN checks 😅
Happy to discuss options/opinions!

@burgerga
Copy link
Contributor Author

Thanks! Still one issue, it always returns "Rtools custom", that is because it always checks it first and it's always ok, that's why I removed custom in my code above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant