From 15149be9b95429f50a2753b70a39f9c33c0a3c1e Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Tue, 23 Jul 2024 07:53:22 -0500 Subject: [PATCH 1/3] List known platforms in `pkg_sysreqs()` documentation This is the second time I've had to figure this out in order to generate a working example on my laptop, so I figured I'd actually document it. I couldn't get the documentation to build correctly and I'm not sure what style you use for these documentation helper functions, so you'll need to do a little work to finish it off. --- R/sysreqs.R | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/R/sysreqs.R b/R/sysreqs.R index dcd56b5ee..b7f269b7d 100644 --- a/R/sysreqs.R +++ b/R/sysreqs.R @@ -68,10 +68,16 @@ sysreqs_fix_installed <- function(packages = NULL, #' Calculate system requirements of one of more packages #' #' @inheritParams pkg_install -#' @param sysreqs_platform System requirements platform. If `NULL`, then the -#' `sysreqs_platform` \eval{man_config_link("configuration option")} -#' is used, which defaults to the current platform. Set this option if -#' \eval{.packageName} does not detect your platform correctly. +#' @param sysreqs_platform System requirements platform. +#' +#' If `NULL`, then the `sysreqs_platform` +#' \eval{man_config_link("configuration option")} is used, which defaults to +#' the current platform. +#' +#' Set this option if to one of \eval{platforms()} if \eval{.packageName} +#' fails to correctly detect your platform or if you want to see the system +#' requirements for a different platform. +#' #' @return List with entries: #' * `os`: character string. Operating system. #' * `distribution`: character string. Linux distribution, `NA` if the @@ -197,3 +203,8 @@ print.pak_sysreqs <- function(x, ...) { class(x) <- setdiff(class(x), "pak_sysreqs") NextMethod("[") } + + +platforms <- function() { + paste0('\\code{"', sysreqs_platforms()$distribution, '"}', collapse = ", ") +} From f1c57efd2dfb7a264aac777e452ee6dd7c63aefe Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Tue, 23 Jul 2024 07:54:33 -0500 Subject: [PATCH 2/3] Sort platforms alphabetically --- R/sysreqs.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/sysreqs.R b/R/sysreqs.R index b7f269b7d..3a2ec304e 100644 --- a/R/sysreqs.R +++ b/R/sysreqs.R @@ -206,5 +206,5 @@ print.pak_sysreqs <- function(x, ...) { platforms <- function() { - paste0('\\code{"', sysreqs_platforms()$distribution, '"}', collapse = ", ") + paste0('\\code{"', sort(sysreqs_platforms()$distribution), '"}', collapse = ", ") } From 324941dc18fffd26310ac843353b0428657c657a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Thu, 8 Aug 2024 11:59:14 +0200 Subject: [PATCH 3/3] Update man. --- DESCRIPTION | 2 +- man/pkg_sysreqs.Rd | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6f7b49a0f..cabd4fca7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -87,5 +87,5 @@ Config/Needs/deploy: processx Config/testthat/edition: 3 Encoding: UTF-8 -RoxygenNote: 7.2.3.9000 +RoxygenNote: 7.3.2 Biarch: true diff --git a/man/pkg_sysreqs.Rd b/man/pkg_sysreqs.Rd index ac71e83f1..3dd40a52d 100644 --- a/man/pkg_sysreqs.Rd +++ b/man/pkg_sysreqs.Rd @@ -41,10 +41,15 @@ See \link{Package dependency types} for other possible values and more information about package dependencies. }} -\item{sysreqs_platform}{System requirements platform. If \code{NULL}, then the -\code{sysreqs_platform} \eval{man_config_link("configuration option")} -is used, which defaults to the current platform. Set this option if -\eval{.packageName} does not detect your platform correctly.} +\item{sysreqs_platform}{System requirements platform. + +If \code{NULL}, then the \code{sysreqs_platform} +\eval{man_config_link("configuration option")} is used, which defaults to +the current platform. + +Set this option if to one of \eval{platforms()} if \eval{.packageName} +fails to correctly detect your platform or if you want to see the system +requirements for a different platform.} } \value{ List with entries: @@ -82,8 +87,8 @@ Calculate system requirements of one of more packages Other package functions: \code{\link{lib_status}()}, \code{\link{pak}()}, -\code{\link{pkg_deps_tree}()}, \code{\link{pkg_deps}()}, +\code{\link{pkg_deps_tree}()}, \code{\link{pkg_download}()}, \code{\link{pkg_install}()}, \code{\link{pkg_remove}()},