Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkgAvail should handle multiple package types #89

Open
achubaty opened this issue Jun 19, 2017 · 1 comment
Open

pkgAvail should handle multiple package types #89

achubaty opened this issue Jun 19, 2017 · 1 comment
Assignees
Milestone

Comments

@achubaty
Copy link
Collaborator

achubaty commented Jun 19, 2017

Managing a miniCRAN repo with multiple package types, I get the following warnings:

> updatePackages(..., type = c("mac.binary.el-capitan", "win.binary", "source"), ...)

Warning messages:
1: In if (type == "both") type <- "source" :
  the condition has length > 1 and only the first element will be used
2: In if (type == "binary") type <- .Platform$pkgType :
  the condition has length > 1 and only the first element will be used
3: In if (substr(type, 1L, 11L) == "mac.binary.") { :
  the condition has length > 1 and only the first element will be used

I think this is an issue with the use of pkgAvail -- it can only handle a single type, or both, and I can't think of an easy way to incorporate an lapply or similar into that function to deal with multiple types.

@andrie andrie self-assigned this Jun 20, 2017
@andrie andrie added this to the v0.2.9 milestone Jun 20, 2017
@andrie
Copy link
Owner

andrie commented Jun 20, 2017

One possibility is that pkgAvail() returns a list of matrices if length(type) . 1.

Then it becomes the responsibility of the downstream code to know how to deal with a single matrix (if type is singular) or a list (if type is plural).

You will then have to modify the lapply() loop in updatePackages() to be more like a traditional for loop:

lapply(seq_along(type), function(i){...}

Inside the ... you have to subset into type[i] and availPkgs[[i]].

@andrie andrie modified the milestones: v next, v0.2.9 Jul 20, 2017
@andrie andrie modified the milestones: v next, v0.2.12 Jun 22, 2018
@andrie andrie modified the milestones: v0.2.12, v next Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants