From cf10a7c7a7cff69f1585ae5979458f16d6415bad Mon Sep 17 00:00:00 2001 From: pat-s Date: Fri, 30 Aug 2024 09:48:46 +0200 Subject: [PATCH] typo --- .woodpecker/process_cran_updates.yaml | 2 +- R/process_cran_updates.R | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.woodpecker/process_cran_updates.yaml b/.woodpecker/process_cran_updates.yaml index bc5b847..836d9ed 100644 --- a/.woodpecker/process_cran_updates.yaml +++ b/.woodpecker/process_cran_updates.yaml @@ -41,7 +41,7 @@ steps: # more complicated system dependencies which pak cannot resolve - mkdir -p /mnt/cache/pkgcache /mnt/cache/R-pkgs /mnt/cache/ccache /mnt/cache/packages # set additional repos: important as otherwise some packages cannot be resolved (e.g. INLA). Also: setting our own binary repos so we can make use of them for dep installation at some point - - R -q -e 'options(crayon.enabled = TRUE, Ncpus = 4, future.globals.onReference = "error", repos = structure(c(getOption("repos"),INLA="https://inla.r-inla-download.org/R/stable"))); pkgs = tools::CRAN_package_db()[[1]][${BLOCK}]; pkgs = setdiff(pkgs, c("biplotbootGUI", "cncaGUI", "dynBiplotGUI", "ade4TkGUI", "BlockmodelingGUI", "cncaGUI", "EventDetectGUI", "irtGUI", "KappaGUI", "magickGUI", "miniGUI", "multibiplotGUI", "TextMiningGUI", "later", "RclusTool", "Rcmdr", "RcmdrMisc", "RcmdrPlugin.aRnova", "RcmdrPlugin.BiclustGUI", "RcmdrPlugin.BWS1", "RcmdrPlugin.BWS2", "RcmdrPlugin.BWS3", "RcmdrPlugin.cpd", "RcmdrPlugin.DCCV", "RcmdrPlugin.DCE", "RcmdrPlugin.depthTools", "RcmdrPlugin.DoE", "RcmdrPlugin.EACSPIR", "RcmdrPlugin.EBM", "RcmdrPlugin.EcoVirtual", "RcmdrPlugin.Export", "RcmdrPlugin.EZR", "RcmdrPlugin.FactoMineR", "RcmdrPlugin.GWRM", "RcmdrPlugin.HH", "RcmdrPlugin.KMggplot2", "RcmdrPlugin.MA", "RcmdrPlugin.MPAStats", "RcmdrPlugin.NMBU", "RcmdrPlugin.orloca", "RcmdrPlugin.PcaRobust", "RcmdrPlugin.RiskDemo", "RcmdrPlugin.RMTCJags", "RcmdrPlugin.ROC", "RcmdrPlugin.sos" , "RcmdrPlugin.survival", "RcmdrPlugin.TeachingDemos", "RcmdrPlugin.TeachStat", "RcmdrPlugin.temis", "RcmdrPlugin.UCA" , "RcmdrPlugin.WorldFlora", "sf", "StratigrapheR", "tcltk2", "TVMM", "uHMM")); library(rBinaries); future::plan("sequential"); process_cran_updates(interval = lubridate::interval(lubridate::today() - 28, lubridate::today() - 2), platform = "${PLATFORM}", process_updated = FALSE, process_new = FALSE)' + - R -q -e 'options(crayon.enabled = TRUE, Ncpus = 4, future.globals.onReference = "error", repos = structure(c(getOption("repos"),INLA="https://inla.r-inla-download.org/R/stable"))); pkgs = tools::CRAN_package_db()[[1]][${BLOCK}]; pkgs = setdiff(pkgs, c("biplotbootGUI", "cncaGUI", "dynBiplotGUI", "ade4TkGUI", "BlockmodelingGUI", "cncaGUI", "EventDetectGUI", "irtGUI", "KappaGUI", "magickGUI", "miniGUI", "multibiplotGUI", "TextMiningGUI", "later", "RclusTool", "Rcmdr", "RcmdrMisc", "RcmdrPlugin.aRnova", "RcmdrPlugin.BiclustGUI", "RcmdrPlugin.BWS1", "RcmdrPlugin.BWS2", "RcmdrPlugin.BWS3", "RcmdrPlugin.cpd", "RcmdrPlugin.DCCV", "RcmdrPlugin.DCE", "RcmdrPlugin.depthTools", "RcmdrPlugin.DoE", "RcmdrPlugin.EACSPIR", "RcmdrPlugin.EBM", "RcmdrPlugin.EcoVirtual", "RcmdrPlugin.Export", "RcmdrPlugin.EZR", "RcmdrPlugin.FactoMineR", "RcmdrPlugin.GWRM", "RcmdrPlugin.HH", "RcmdrPlugin.KMggplot2", "RcmdrPlugin.MA", "RcmdrPlugin.MPAStats", "RcmdrPlugin.NMBU", "RcmdrPlugin.orloca", "RcmdrPlugin.PcaRobust", "RcmdrPlugin.RiskDemo", "RcmdrPlugin.RMTCJags", "RcmdrPlugin.ROC", "RcmdrPlugin.sos" , "RcmdrPlugin.survival", "RcmdrPlugin.TeachingDemos", "RcmdrPlugin.TeachStat", "RcmdrPlugin.temis", "RcmdrPlugin.UCA" , "RcmdrPlugin.WorldFlora", "sf", "StratigrapheR", "tcltk2", "TVMM", "uHMM")); library(rBinaries); future::plan("sequential"); process_cran_updates(interval = lubridate::interval(lubridate::today() - 32, lubridate::today() - 2), platform = "${PLATFORM}", process_updated = FALSE, process_new = FALSE)' backend_options: kubernetes: ### PROD diff --git a/R/process_cran_updates.R b/R/process_cran_updates.R index 916ac38..dd7ac92 100644 --- a/R/process_cran_updates.R +++ b/R/process_cran_updates.R @@ -6,8 +6,10 @@ #' @importFrom dplyr bind_rows #' @importFrom purrr walk2 #' @examples -#' process_cran_updates(interval = lubridate::interval(lubridate::today() - 2, lubridate::today() - 20), -#' process_updated = FALSE, process_new = FALSE) +#' process_cran_updates( +#' interval = lubridate::interval(lubridate::today() - 2, lubridate::today() - 20), +#' process_updated = FALSE, process_new = FALSE +#' ) #' #' @export process_cran_updates <- function( @@ -30,14 +32,13 @@ process_cran_updates <- function( updated_pkgs <- get_updated_cran_packages(interval) new_pkgs <- get_new_cran_packages(interval) - cli::cli_alert_success("{.fun process_cran_updates}: Updated packages:") - print(updated_pkgs) - cli::cli_alert_success("{.fun process_cran_updates}: New packages:") - print(new_pkgs) - all_pkgs <- dplyr::bind_rows(updated_pkgs, new_pkgs) if (any(c(process_updated, process_new))) { + cli::cli_alert_success("{.fun process_cran_updates}: Updated packages:") + print(updated_pkgs) + cli::cli_alert_success("{.fun process_cran_updates}: New packages:") + print(new_pkgs) purrr::walk2(all_pkgs$name, all_pkgs$version, ~ { build_binary_package(.x, .y, platform = platform) archive_package(.x) @@ -56,6 +57,7 @@ process_cran_updates <- function( region_name = region, ) + codename = set_codename(codename) if (!build_for_minor) { local_bin_dir <- sprintf("%s/arm64/%s/latest/src/contrib", local_build_root, codename) remote_bin_dir <- sprintf("%s/arm64/%s/latest/src/contrib", bucket, codename) @@ -69,7 +71,7 @@ process_cran_updates <- function( purrr::walk(removed_pkgs$name, ~ { cli::cli_alert("{.fun process_cran_updates}: Removing package {.pkg {.x}} from S3.") files_filtered <- grep(sprintf("/%s_", .x), files, value = TRUE) - if (length(files_filtered > 0)) { + if (length(files_filtered) > 0) { s3fs::s3_file_delete(files_filtered) cli::cli_alert_success("{.fun process_cran_updates}: Successfully removed {.pkg {basename(files_filtered)}} from S3.") } else {