fix matching of packages for which the latest verison is not available
This commit is contained in:
parent
25f29f56ee
commit
8ae2c12262
3 changed files with 4 additions and 1 deletions
|
|
@ -17,6 +17,7 @@ Imports:
|
|||
magrittr,
|
||||
pkgbuild,
|
||||
progressr,
|
||||
stringr,
|
||||
purrr,
|
||||
RPostgres,
|
||||
s3fs (>= 0.1.7),
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ importFrom(s3fs,s3_dir_ls)
|
|||
importFrom(s3fs,s3_file_exists)
|
||||
importFrom(s3fs,s3_file_system)
|
||||
importFrom(s3fs,s3_file_upload)
|
||||
importFrom(stringr,str_split)
|
||||
importFrom(xml2,read_xml)
|
||||
importFrom(xml2,xml_find_all)
|
||||
importFrom(xml2,xml_find_first)
|
||||
|
|
|
|||
|
|
@ -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