From 80234ce7fbcbd08998a642567f3514db84537a6d Mon Sep 17 00:00:00 2001 From: pat-s Date: Sat, 27 Jul 2024 23:50:53 +0200 Subject: [PATCH] also report unique package count --- R/packages_index.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/packages_index.R b/R/packages_index.R index 10cf318..9d3b464 100644 --- a/R/packages_index.R +++ b/R/packages_index.R @@ -80,11 +80,13 @@ upload_package_index <- function( region_name = region, ) - pkg_count = length(s3fs::s3_dir_ls(remote_bin_dir)) - 4 + pkgs = s3fs::s3_dir_ls(remote_bin_dir) + pkg_count = length(pkgs) - 4 + unique_pkgs = length(unique(sapply(strsplit(basename(pkgs), "_"), function(x) x[1]))) t1 <- Sys.time() cranlike::update_PACKAGES(sprintf("s3://%s", remote_bin_dir)) total_build_time <- round(Sys.time() - t1, 2) - cli::cli_alert("Time updating PACKAGES index for {.field {pkg_count}} packages: {.strong {total_build_time} {units(difftime(Sys.time(), t1))}}.") + cli::cli_alert("Time updating PACKAGES index for {.field {pkg_count}} ({.field {unique_pkgs}} unique) packages: {.strong {total_build_time} {units(difftime(Sys.time(), t1))}}.") purrr::walk2( c("PACKAGES", "PACKAGES.db", "PACKAGES.rds", "PACKAGES.gz"),