Skip to content

Commit

Permalink
Fix Rtools detection from the registry
Browse files Browse the repository at this point in the history
Rtools version numbers have now three parts
in the registry, we need to drop the last part when
matching compatible versions.
  • Loading branch information
gaborcsardi committed Oct 28, 2024
1 parent 79356bd commit eac4e28
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
* pkgbuild now does a better job at finding Rtools 4.3 and 4.4 if they
were not installed from an installer.

* pkgbuild now detects Rtools correctly from the Windows registry
again for Rtools 4.3 and 4.4

# pkgbuild 1.4.4

* pkgbuild now supports R 4.4.x and Rtools44 (#183).
Expand Down
10 changes: 9 additions & 1 deletion R/rtools.R
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,12 @@ has_rtools <- function(debug = FALSE) {
}

# Otherwise it must be ok :)

# Recently Rtools is versioned properly
from_registry$version <- sub(
"^([0-9]+[.][0-9]+)[.].*$", "\\1",
from_registry$version
)
rtools_path_set(from_registry)
TRUE
}
Expand Down Expand Up @@ -282,7 +288,9 @@ is_compatible <- function(rtools) {
}

stopifnot(is.rtools(rtools))
info <- version_info[[rtools$version]]
version <- rtools$version
version <- sub("^([0-9]+[.][0-9]+)[.].*$", "\\1", version)
info <- version_info[[version]]
if (is.null(info)) {
return(FALSE)
}
Expand Down

0 comments on commit eac4e28

Please sign in to comment.