Skip to content

Commit

Permalink
Update embedded pkgcache
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborcsardi committed Nov 7, 2024
1 parent c552ee1 commit 981d13c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/library/pkgcache/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: pkgcache
Title: Cache 'CRAN'-Like Metadata and R Packages
Version: 2.2.2.9000
Version: 2.2.3.9000
Authors@R: c(
person("Gábor", "Csárdi", , "[email protected]", role = c("aut", "cre")),
person("Posit Software, PBC", role = c("cph", "fnd"))
Expand All @@ -25,7 +25,7 @@ Language: en-US
Roxygen: list(markdown = TRUE, r6 = FALSE)
RoxygenNote: 7.3.2
NeedsCompilation: yes
Packaged: 2024-08-08 09:38:56 UTC; gaborcsardi
Packaged: 2024-11-07 10:28:04 UTC; gaborcsardi
Author: Gábor Csárdi [aut, cre],
Posit Software, PBC [cph, fnd]
Maintainer: Gábor Csárdi <[email protected]>
1 change: 1 addition & 0 deletions src/library/pkgcache/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ if (getRversion() >= "4.0.0") importFrom(tools, R_user_dir)
importFrom(R6,R6Class)
importFrom(tools,file_ext)
importFrom(utils,URLencode)
importFrom(utils,download.file)
importFrom(utils,getSrcDirectory)
importFrom(utils,getSrcFilename)
importFrom(utils,getSrcLocation)
Expand Down
2 changes: 2 additions & 0 deletions src/library/pkgcache/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# pkgcache (development version)

# pkgcache 2.2.3

* The metadata cache now does not use source URLs for packages in `Archive`
on Posit Package Manager repositories. This URLs may serve a different
package, even a source package when the main URL for the same package
Expand Down
4 changes: 3 additions & 1 deletion src/library/pkgcache/R/bioc.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
#' @noRd
NULL

#' @importFrom utils download.file

bioconductor <- local({

Expand Down Expand Up @@ -113,7 +114,8 @@ bioconductor <- local({
"4.0" = package_version("3.12"),
"4.1" = package_version("3.14"),
"4.2" = package_version("3.16"),
"4.3" = package_version("3.18")
"4.3" = package_version("3.18"),
"4.4" = package_version("3.20")
# Do not include R 4.4 <-> Bioc 3.19, because R 4.4 will use
# Bioc 3.20 eventually.
)
Expand Down
24 changes: 24 additions & 0 deletions src/library/pkgcache/R/packages-gz.R
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,30 @@ read_packages_file <- function(path, mirror, repodir, platform,
pkgs$needscompilation[hasbin] <- NA
}

# Assume that R-universe Linux binaries are for the current platform.
# They seem to have a Built field, so use that for the R version.
if (grepl("r-universe.dev/bin/linux", mirror, fixed = TRUE)) {
built <- strsplit(pkgs$built, ";")
# add $rversion from Built, if not there already
miss_r <- pkgs$rversion == "*"
built_r <- substr(trimws(vcapply(built[miss_r], "[[", 1)), 3, 1000)
pkgs$rversion[miss_r] <- sub(
"^([0-9]+[.][0-9]+)[.][0-9]+$",
"\\1",
built_r,
perl = TRUE
)

# add $platform from build, assume current platform if missing
miss_plat <- pkgs$platform == "source"
built_plat <- trimws(vcapply(built[miss_plat], "[[", 2))
current_plat <- current_r_platform()
built_plat[built_plat == ""] <- current_plat
pkgs$platform[miss_plat][
built_plat == current_plat | startsWith(current_plat, built_plat)
] <- current_plat
}

# If we only want one Windows platform, then filter here
if (platform %in% c("i386-w64-mingw32", "x86_64-w64-mingw32")) {
drop <- pkgs$platform != platform &
Expand Down

0 comments on commit 981d13c

Please sign in to comment.