Skip to content

Commit f702c33

Browse files
committed
pak should never call sudo during R CMD check
We can test and document devtools's use of pak without doing any sysreq stuff, which is what the `sudo` probe relates to.
1 parent 7bc873d commit f702c33

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

R/zzz.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,12 @@ devtools_default_options <- list(
1414
options(devtools_default_options[toset])
1515
}
1616

17+
# Prevent pak from trying to install system requirements during R CMD check.
18+
# On certain linux systems, it might call `sudo`, as a probe for capabilities.
19+
# That is flagged by CRAN as problematic.
20+
if (Sys.getenv("_R_CHECK_PACKAGE_NAME_", "") != "") {
21+
options(pkg.sysreqs = FALSE)
22+
}
23+
1724
invisible()
1825
}

0 commit comments

Comments
 (0)