fix grepl pattern in update packages

This commit is contained in:
Patrick Schratz 2024-10-07 08:14:48 +02:00
commit c23011b811
Signed by: pat-s
GPG key ID: 3C6318841EF78925

View file

@ -65,7 +65,7 @@ archive_package <- function(
# get most recent version from CRAN
last_version <- available.packages("https://cloud.r-project.org/src/contrib")[.x, "Version"]
# check if last version is available in repo
if (any(grepl(last_version, all_versions))) {
if (any(grepl(sprintf("^%s_%s.tar.gz", package_name, last_version), all_versions))) {
index <- which(grepl(sprintf("_%s.tar.gz", last_version), all_versions, fixed = TRUE))
old_versions <- all_versions[-index]
} else {