Skip to content

Commit

Permalink
cyclic dependency check not relevant for test packages
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@84602 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
smeyer committed Jun 26, 2023
1 parent 84dee7d commit f29b9a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/library/tools/R/QC.R
Original file line number Diff line number Diff line change
Expand Up @@ -3115,10 +3115,9 @@ function(dir, force_suggests = TRUE, check_incoming = FALSE,
## and we cannot have cycles
## this check needs a package db from repository(s), so
repos <- getOption("repos")
if(any(grepl("@CRAN@", repos)))
if(any(repos == "@CRAN@"))
repos <- .get_standard_repository_URLs()
if(!any(grepl("@CRAN@", repos))) {
## Not getting here should no longer be possble ...
if(length(repos)) {
available <- utils::available.packages(repos = repos)
ad <- .check_dependency_cycles(db, available)
pkgname <- db[["Package"]]
Expand Down Expand Up @@ -8047,7 +8046,7 @@ function(dir, localOnly = FALSE, pkgSize = NA)

## If a package has a FOSS license, check whether any of its strong
## recursive dependencies restricts use.
if(!localOnly && foss) {
if(foss) {
available <-
utils::available.packages(utils::contrib.url(urls, "source"),
filters = c("R_version", "duplicates"))
Expand Down
5 changes: 4 additions & 1 deletion tests/reg-packages.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ showProc.time <- local({ ## function + 'pct' variable
final)
}
})
options(width=120)
options(
width = 120
, repos = character() # tests here should work without remote access
)

## PR 1271 detach("package:base") crashes R.
tools::assertError(detach("package:base"))
Expand Down

0 comments on commit f29b9a3

Please sign in to comment.