Skip to content

Commit

Permalink
bioconductor: modern bioc DESCRIPTION files have Repository (#729)
Browse files Browse the repository at this point in the history
Look at biocViews before Repository when deciding if a package is from Bioconductor.

See rstudio/rsconnect#1134
  • Loading branch information
aronatkins authored Jan 31, 2025
1 parent af3bed4 commit d88dfa3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
- Improve package installation in a multi-process environment. Do less work
when a target package is in the cache and write package `DESCRIPTION`
updates to temporary files before persisting. (#720)
- When determining the package source, consider `biocViews` before
`Repository`. Recent Bioconductor package `DESCRIPTION` files include the
`Repository` field, which caused Packrat to believe that those packages
originated from a CRAN-like repository, not Bioconductor. (#729)

# Packrat 0.9.2

Expand Down
14 changes: 7 additions & 7 deletions R/pkg.R
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,13 @@ inferPackageRecord <- function(df, available = availablePackages()) {
} else if (identical(as.character(df$Priority), 'base')) {
# It's a base package!
return(NULL)
} else if (length(df$biocViews)) {
# It's Bioconductor!
return(structure(list(
name = name,
source = 'Bioconductor',
version = ver
), class = c('packageRecord', 'Bioconductor')))
} else if (length(df$Repository) && identical(as.character(df$Repository), 'CRAN')) {
# It's CRAN!
return(structure(list(
Expand All @@ -390,13 +397,6 @@ inferPackageRecord <- function(df, available = availablePackages()) {
source = as.character(df$Repository),
version = ver
), class = c('packageRecord', 'CustomCRANLikeRepository')))
} else if (length(df$biocViews)) {
# It's Bioconductor!
return(structure(list(
name = name,
source = 'Bioconductor',
version = ver
), class = c('packageRecord', 'Bioconductor')))
} else if (name %in% available[, "Package"]) {
# It's available on CRAN, so get it from CRAN!
return(structure(list(
Expand Down
1 change: 1 addition & 0 deletions packrat.Rproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version: 1.0
ProjectId: 88c01d36-523a-49d0-b291-43c5007d3bf2

RestoreWorkspace: No
SaveWorkspace: No
Expand Down

0 comments on commit d88dfa3

Please sign in to comment.