don't index package_name as list

This commit is contained in:
Patrick Schratz 2024-09-23 15:10:13 +02:00
commit c0b8fd67f9
Signed by: pat-s
GPG key ID: 3C6318841EF78925

View file

@ -3,7 +3,7 @@
#' @export
#' @examples
#' archive_package("AATtools", codename = "rhel9")
#' archive_package("asbio", codename = "rhel9", arch = "amd64")
#' archive_package("adw", codename = "rhel8", arch = "amd64")
#'
archive_package <- function(
package_name,
@ -57,6 +57,7 @@ archive_package <- function(
all_versions <- grep(sprintf("/%s_", .x), files, value = TRUE)
# only archive if more than one package exists in the root
if (length(all_versions) > 1) {
# 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