Skip to content
Prev Previous commit
Next Next commit
include messaging in the main pkg_sysreqs function. Unsure if this …
…is really needed...
  • Loading branch information
matteodelucchi committed Aug 14, 2025
commit 6aba81951ae86a23ed4b75fa78fa28ef34cba5ad
30 changes: 29 additions & 1 deletion R/sysreqs.R
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,15 @@ pkg_sysreqs <- function(
sysreqs_platform = NULL
) {
load_extra("pillar")
remote(
# Check if sysreqs support is enabled
sysreqs_enabled <- remote(
function() {
config <- pkgdepends::current_config()
config$get("sysreqs")
}
)

result <- remote(
function(...) {
get("pkg_sysreqs_internal", asNamespace("pak"))(...)
},
Expand All @@ -163,6 +171,26 @@ pkg_sysreqs <- function(
sysreqs_platform = sysreqs_platform
)
)

# Add informational message if results are shown
if (sysreqs_enabled && length(result$install_scripts) > 0) {
cli::cli_alert_info(
"System packages detected via system package manager only."
)
cli::cli_alert_info(
"Software in non-standard locations may require manual verification."
)
} else if (!sysreqs_enabled) {
cli::cli_alert_info(
"System requirements lookup is disabled."
)
cli::cli_alert_info(
"Enable with {.code Sys.setenv('PKG_SYSREQS' = 'TRUE')}
or {.code options(pkg.sysreqs = TRUE)}."
)
}

result
}

pkg_sysreqs_internal <- function(
Expand Down