cleanup and reorg

This commit is contained in:
Patrick Schratz 2024-07-27 13:33:50 +02:00
commit 2e5939ace8
Signed by: pat-s
GPG key ID: 3C6318841EF78925

View file

@ -80,7 +80,13 @@ upload_package_index <- function(
region_name = region,
)
dummy <- purrr::walk2(
pkg_count = length(s3fs::s3_dir_ls(remote_bin_dir)) - 4
t1 <- Sys.time()
cranlike::update_PACKAGES(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))}}.")
purrr::walk2(
sprintf("%s/%s", local_bin_dir, c("PACKAGES", "PACKAGES.db", "PACKAGES.rds", "PACKAGES.gz")),
sprintf("%s/%s", remote_bin_dir, c("PACKAGES", "PACKAGES.db", "PACKAGES.rds", "PACKAGES.gz")),
\(x, y) s3fs::s3_file_upload(x, y, overwrite = TRUE)
@ -89,10 +95,10 @@ upload_package_index <- function(
pkgs_upload_local <- sprintf("%sPACKAGES", local_bin_dir)
pkgs_upload_remote <- sprintf("%sPACKAGES", remote_bin_dir)
if (debug) {
cli::cli_alert_warning("DEBUG: PACKAGES UPLOAD local dir: {pkgs_upload_local}")
cli::cli_alert_warning("DEBUG: PACKAGES UPLOAD remote dir: {pkgs_upload_remote}")
}
# if (debug) {
# cli::cli_alert_warning("DEBUG: PACKAGES UPLOAD local dir: {pkgs_upload_local}")
# cli::cli_alert_warning("DEBUG: PACKAGES UPLOAD remote dir: {pkgs_upload_remote}")
# }
# s3 <- paws.storage::s3(endpoint = endpoint, region = region)
# s3$put_object(Body = pkgs_upload_local, Bucket = bucket, Key = "__linux__/rhel9/latest/src/contrib/PACKAGES")