Skip to content

Commit

Permalink
Fix call to available.packages (#52)
Browse files Browse the repository at this point in the history
* mimic install.packages' calls

* bump version, update NEWS
  • Loading branch information
Enchufa2 authored Jan 9, 2023
1 parent 5d9f5f1 commit 27e4803
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: bspm
Type: Package
Title: Bridge to System Package Manager
Version: 0.4.0.1
Version: 0.4.1
Authors@R: c(
person("Iñaki", "Ucar", email="[email protected]",
role=c("aut", "cph", "cre"), comment=c(ORCID="0000-0001-6403-5550")))
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# bspm 0.4.0.1
# bspm 0.4.1

- New `type="binary-source"` option (or _fast mode_) tries to install as many
binaries as possible (requested packages and dependencies), and then falls
back to source installation (per @eddelbuettel's wish).
- Fix the call to `available.packages()` when the `repos` argument is specified
(#52 addressing #51).

# bspm 0.4.0

Expand Down
7 changes: 4 additions & 3 deletions R/integration.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ enable <- function() {
type <- "source"
} else if (type == "both") {
# get pkgs with non-installed dependencies
dbs <- available.packages(type="source")
inst <- row.names(installed.packages(.Library.site))
dbs <- available.packages(contriburl=contriburl, method=method,
type="source", ...)
inst <- row.names(installed.packages(.Library.site, ...))
pkgs <- tools::package_dependencies(pkgs, dbs, recursive=TRUE)
pkgs <- lapply(pkgs, function(x) setdiff(x, inst))
pkgs <- unique(c(names(pkgs), unlist(pkgs, use.names=FALSE)))
Expand Down Expand Up @@ -98,7 +99,7 @@ enable <- function() {
} else if (type == "binary-source") {
# install as many binaries as possible and fallback to source
if (length(pkgs <- bspm::install_sys(pkgs))) {
inst <- row.names(installed.packages(.Library.site))
inst <- row.names(installed.packages(.Library.site, ...))
deps <- tools::package_dependencies(pkgs, recursive=TRUE)
deps <- lapply(deps, function(x) setdiff(x, inst))
deps <- unique(unlist(deps, use.names=FALSE))
Expand Down
5 changes: 2 additions & 3 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
## Minor release
Enhance integration to imitate the mixed installation mechanism available
on Windows and macOS.
## Patch release
Fixes a bug report.

## Test environments
- local R installation, R 4.2.2
Expand Down

0 comments on commit 27e4803

Please sign in to comment.