fix matching of packages for which the latest verison is not available
This commit is contained in:
parent
25f29f56ee
commit
8ae2c12262
1 changed files with 4 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
#' Archive packages in CRAN-like repositories
|
||||
#' @importFrom stringr str_split
|
||||
#' @export
|
||||
#' @examples
|
||||
#' archive_package("AATtools", codename = "rhel9")
|
||||
|
|
@ -48,7 +49,7 @@ archive_package <- function(
|
|||
} else {
|
||||
versions <- rev(pak::pkg_history(.x)$Version)
|
||||
for (i in versions) {
|
||||
if (any(grepl(i, all_versions, fixed = TRUE))) {
|
||||
if (any(grepl(paste0("^", i, "$"), stringr::str_split(stringr::str_split(all_versions, "_", simplify = T)[, 2], ".tar.gz", simplify = TRUE)[, 1]))) {
|
||||
index <- which(grepl(sprintf("_%s.tar.gz", i), all_versions))
|
||||
old_versions <- all_versions[-index]
|
||||
break
|
||||
|
|
|
|||
Loading…
Reference in a new issue