Skip to content

Commit

Permalink
Change default of available.packages to filters=NULL #153
Browse files Browse the repository at this point in the history
  • Loading branch information
andrie committed Mar 24, 2024
1 parent b647e86 commit 1ca50df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
11 changes: 7 additions & 4 deletions R/pkgDep.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ pkgDep <- function(pkg, availPkgs, repos = getOption("repos"), type = "source",

pkgInAvail <- pkg %in% availPkgs[, "Package"]
pkgInAvail <- pkg %in% availPkgNames(availPkgs)
# browser()
if (sum(pkgInAvail) == 0 ) stop("No valid packages in pkg")
if (sum(pkgInAvail) < length(pkg)) {
warning("Package not recognized: ", paste(pkg[!pkgInAvail], collapse = ", "))
Expand Down Expand Up @@ -153,12 +152,16 @@ print.pkgDep <- function(x, ...) {
#' repository, otherwise attempts to read from a CRAN mirror at the `repos` url.
#'
#' @inheritParams pkgDep
#'
#' @param filters passed to [utils::available.packages]
#'
#' @export
#' @family create repo functions
#' @seealso [pkgDep()]
pkgAvail <- function(repos = getOption("repos"),
type = "source",
Rversion = R.version, quiet = FALSE) {
Rversion = R.version, quiet = FALSE,
filters = NULL) {
assert_that(is_repos(repos))
if (!grepl("^https*://|file:///", repos[1]) && file.exists(repos[1])) {
repos <- paste0("file:///", normalizePath(repos[1],
Expand All @@ -176,7 +179,7 @@ pkgAvail <- function(repos = getOption("repos"),
type = type,
Rversion = Rversion),
type = type,
filters = list(),
filters = filters,
repos = repos
)
} else {
Expand All @@ -185,7 +188,7 @@ pkgAvail <- function(repos = getOption("repos"),
type = type,
Rversion = Rversion),
type = type,
filters = list()
filters = filters
)
}
}
Expand Down
5 changes: 4 additions & 1 deletion man/pkgAvail.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1ca50df

Please sign in to comment.