Skip to content

Commit 981d13c

Browse files
committed
Update embedded pkgcache
1 parent c552ee1 commit 981d13c

File tree

5 files changed

+32
-3
lines changed

5 files changed

+32
-3
lines changed

src/library/pkgcache/DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: pkgcache
22
Title: Cache 'CRAN'-Like Metadata and R Packages
3-
Version: 2.2.2.9000
3+
Version: 2.2.3.9000
44
Authors@R: c(
55
person("Gábor", "Csárdi", , "[email protected]", role = c("aut", "cre")),
66
person("Posit Software, PBC", role = c("cph", "fnd"))
@@ -25,7 +25,7 @@ Language: en-US
2525
Roxygen: list(markdown = TRUE, r6 = FALSE)
2626
RoxygenNote: 7.3.2
2727
NeedsCompilation: yes
28-
Packaged: 2024-08-08 09:38:56 UTC; gaborcsardi
28+
Packaged: 2024-11-07 10:28:04 UTC; gaborcsardi
2929
Author: Gábor Csárdi [aut, cre],
3030
Posit Software, PBC [cph, fnd]
3131
Maintainer: Gábor Csárdi <[email protected]>

src/library/pkgcache/NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ if (getRversion() >= "4.0.0") importFrom(tools, R_user_dir)
5050
importFrom(R6,R6Class)
5151
importFrom(tools,file_ext)
5252
importFrom(utils,URLencode)
53+
importFrom(utils,download.file)
5354
importFrom(utils,getSrcDirectory)
5455
importFrom(utils,getSrcFilename)
5556
importFrom(utils,getSrcLocation)

src/library/pkgcache/NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# pkgcache (development version)
22

3+
# pkgcache 2.2.3
4+
35
* The metadata cache now does not use source URLs for packages in `Archive`
46
on Posit Package Manager repositories. This URLs may serve a different
57
package, even a source package when the main URL for the same package

src/library/pkgcache/R/bioc.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
#' @noRd
7575
NULL
7676

77+
#' @importFrom utils download.file
7778

7879
bioconductor <- local({
7980

@@ -113,7 +114,8 @@ bioconductor <- local({
113114
"4.0" = package_version("3.12"),
114115
"4.1" = package_version("3.14"),
115116
"4.2" = package_version("3.16"),
116-
"4.3" = package_version("3.18")
117+
"4.3" = package_version("3.18"),
118+
"4.4" = package_version("3.20")
117119
# Do not include R 4.4 <-> Bioc 3.19, because R 4.4 will use
118120
# Bioc 3.20 eventually.
119121
)

src/library/pkgcache/R/packages-gz.R

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,30 @@ read_packages_file <- function(path, mirror, repodir, platform,
157157
pkgs$needscompilation[hasbin] <- NA
158158
}
159159

160+
# Assume that R-universe Linux binaries are for the current platform.
161+
# They seem to have a Built field, so use that for the R version.
162+
if (grepl("r-universe.dev/bin/linux", mirror, fixed = TRUE)) {
163+
built <- strsplit(pkgs$built, ";")
164+
# add $rversion from Built, if not there already
165+
miss_r <- pkgs$rversion == "*"
166+
built_r <- substr(trimws(vcapply(built[miss_r], "[[", 1)), 3, 1000)
167+
pkgs$rversion[miss_r] <- sub(
168+
"^([0-9]+[.][0-9]+)[.][0-9]+$",
169+
"\\1",
170+
built_r,
171+
perl = TRUE
172+
)
173+
174+
# add $platform from build, assume current platform if missing
175+
miss_plat <- pkgs$platform == "source"
176+
built_plat <- trimws(vcapply(built[miss_plat], "[[", 2))
177+
current_plat <- current_r_platform()
178+
built_plat[built_plat == ""] <- current_plat
179+
pkgs$platform[miss_plat][
180+
built_plat == current_plat | startsWith(current_plat, built_plat)
181+
] <- current_plat
182+
}
183+
160184
# If we only want one Windows platform, then filter here
161185
if (platform %in% c("i386-w64-mingw32", "x86_64-w64-mingw32")) {
162186
drop <- pkgs$platform != platform &

0 commit comments

Comments
 (0)