smarter update processing
This commit is contained in:
parent
d10483d4e2
commit
4ec483a1f2
1 changed files with 14 additions and 7 deletions
|
|
@ -5,6 +5,10 @@
|
||||||
#'
|
#'
|
||||||
#' @importFrom dplyr bind_rows
|
#' @importFrom dplyr bind_rows
|
||||||
#' @importFrom purrr walk2
|
#' @importFrom purrr walk2
|
||||||
|
#' @examples
|
||||||
|
#' process_cran_updates(interval = lubridate::interval(lubridate::today() - 2, lubridate::today() - 20),
|
||||||
|
#' process_updated = FALSE, process_new = FALSE)
|
||||||
|
#'
|
||||||
#' @export
|
#' @export
|
||||||
process_cran_updates <- function(
|
process_cran_updates <- function(
|
||||||
package_name,
|
package_name,
|
||||||
|
|
@ -12,14 +16,16 @@ process_cran_updates <- function(
|
||||||
platform,
|
platform,
|
||||||
local_clone_dir,
|
local_clone_dir,
|
||||||
interval = lubridate::today(),
|
interval = lubridate::today(),
|
||||||
prune = TRUE,
|
|
||||||
build_for_minor = FALSE,
|
build_for_minor = FALSE,
|
||||||
codename = NULL,
|
codename = NULL,
|
||||||
r_minor_version = NULL,
|
r_minor_version = NULL,
|
||||||
local_build_root = ".",
|
local_build_root = ".",
|
||||||
endpoint = "https://s3.eu-central-003.backblazeb2.com",
|
endpoint = "https://s3.eu-central-003.backblazeb2.com",
|
||||||
region = "eu-central-003",
|
region = "eu-central-003",
|
||||||
bucket = "devxy-arm64-r-binaries") {
|
bucket = "devxy-arm64-r-binaries",
|
||||||
|
process_updated = TRUE,
|
||||||
|
process_new = TRUE,
|
||||||
|
process_removed = TRUE) {
|
||||||
# Get list of updated and new packages for a specific day
|
# Get list of updated and new packages for a specific day
|
||||||
updated_pkgs <- get_updated_cran_packages(interval)
|
updated_pkgs <- get_updated_cran_packages(interval)
|
||||||
new_pkgs <- get_new_cran_packages(interval)
|
new_pkgs <- get_new_cran_packages(interval)
|
||||||
|
|
@ -31,13 +37,14 @@ process_cran_updates <- function(
|
||||||
|
|
||||||
all_pkgs <- dplyr::bind_rows(updated_pkgs, new_pkgs)
|
all_pkgs <- dplyr::bind_rows(updated_pkgs, new_pkgs)
|
||||||
|
|
||||||
purrr::walk2(all_pkgs$name, all_pkgs$version, ~ {
|
if (any(c(process_updated, process_new))) {
|
||||||
build_binary_package(.x, .y, platform = platform)
|
purrr::walk2(all_pkgs$name, all_pkgs$version, ~ {
|
||||||
archive_package(.x)
|
build_binary_package(.x, .y, platform = platform)
|
||||||
|
archive_package(.x)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
)
|
|
||||||
|
|
||||||
if (prune) {
|
if (process_removed) {
|
||||||
removed_pkgs <- get_removed_cran_packages(interval)
|
removed_pkgs <- get_removed_cran_packages(interval)
|
||||||
cli::cli_alert_success("{.fun process_cran_updates}: Removed packages:")
|
cli::cli_alert_success("{.fun process_cran_updates}: Removed packages:")
|
||||||
print(removed_pkgs)
|
print(removed_pkgs)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue