Skip to content

Commit d88dfa3

Browse files
authored
bioconductor: modern bioc DESCRIPTION files have Repository (#729)
Look at biocViews before Repository when deciding if a package is from Bioconductor. See rstudio/rsconnect#1134
1 parent af3bed4 commit d88dfa3

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
- Improve package installation in a multi-process environment. Do less work
66
when a target package is in the cache and write package `DESCRIPTION`
77
updates to temporary files before persisting. (#720)
8+
- When determining the package source, consider `biocViews` before
9+
`Repository`. Recent Bioconductor package `DESCRIPTION` files include the
10+
`Repository` field, which caused Packrat to believe that those packages
11+
originated from a CRAN-like repository, not Bioconductor. (#729)
812

913
# Packrat 0.9.2
1014

R/pkg.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,13 @@ inferPackageRecord <- function(df, available = availablePackages()) {
376376
} else if (identical(as.character(df$Priority), 'base')) {
377377
# It's a base package!
378378
return(NULL)
379+
} else if (length(df$biocViews)) {
380+
# It's Bioconductor!
381+
return(structure(list(
382+
name = name,
383+
source = 'Bioconductor',
384+
version = ver
385+
), class = c('packageRecord', 'Bioconductor')))
379386
} else if (length(df$Repository) && identical(as.character(df$Repository), 'CRAN')) {
380387
# It's CRAN!
381388
return(structure(list(
@@ -390,13 +397,6 @@ inferPackageRecord <- function(df, available = availablePackages()) {
390397
source = as.character(df$Repository),
391398
version = ver
392399
), class = c('packageRecord', 'CustomCRANLikeRepository')))
393-
} else if (length(df$biocViews)) {
394-
# It's Bioconductor!
395-
return(structure(list(
396-
name = name,
397-
source = 'Bioconductor',
398-
version = ver
399-
), class = c('packageRecord', 'Bioconductor')))
400400
} else if (name %in% available[, "Package"]) {
401401
# It's available on CRAN, so get it from CRAN!
402402
return(structure(list(

packrat.Rproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Version: 1.0
2+
ProjectId: 88c01d36-523a-49d0-b291-43c5007d3bf2
23

34
RestoreWorkspace: No
45
SaveWorkspace: No

0 commit comments

Comments
 (0)