|
|
@ -58,8 +58,66 @@ exim_version_history <- function(refresh = FALSE) { |
|
|
|
dplyr::arrange(rls_date, major, minor, patch) %>% |
|
|
|
dplyr::mutate(vers = factor(vers, levels = vers)) -> out |
|
|
|
|
|
|
|
page <- gh::gh("/repos/Exim/exim/tags") |
|
|
|
|
|
|
|
purrr::map_df( |
|
|
|
page, ~{ |
|
|
|
list( |
|
|
|
vers = .x$name, |
|
|
|
rls_date = gh::gh(.x$commit$url)$commit$author$date # kinda dangerous |
|
|
|
) |
|
|
|
}) -> xdf |
|
|
|
|
|
|
|
sgh_next <- purrr::safely(gh::gh_next) # to stop on gh_next() error |
|
|
|
|
|
|
|
while(TRUE) { |
|
|
|
page <- sgh_next(page) |
|
|
|
if (is.null(page$result)) break; |
|
|
|
page <- page$result |
|
|
|
dplyr::bind_rows( |
|
|
|
xdf, |
|
|
|
purrr::map_df( |
|
|
|
page, ~{ |
|
|
|
list( |
|
|
|
vers = .x$name, |
|
|
|
rls_date = gh::gh(.x$commit$url)$commit$author$date # kinda dangerous |
|
|
|
) |
|
|
|
}) |
|
|
|
) -> xdf |
|
|
|
} |
|
|
|
|
|
|
|
dplyr::filter(xdf, stri_detect_regex(vers, "^exim-")) %>% |
|
|
|
dplyr::mutate(vers = stri_replace_first_regex(vers, "^exim-", "")) %>% |
|
|
|
dplyr::filter(!stri_detect_regex(vers, "[[:alpha:]]")) %>% |
|
|
|
dplyr::mutate(vers = stri_replace_all_regex(vers, "([[:digit:]]+)_", "$1.")) %>% |
|
|
|
dplyr::filter(stri_count_fixed(vers, ".") < 3) %>% |
|
|
|
dplyr::mutate(rls_date = as.Date(stri_sub(rls_date, 1, 10))) %>% |
|
|
|
dplyr::mutate(rls_year = lubridate::year(rls_date)) %>% |
|
|
|
tidyr::separate(vers, c("major", "minor", "patch", "build"), remove=FALSE, fill = "right") %>% |
|
|
|
dplyr::mutate(prerelease = ifelse( |
|
|
|
stri_detect_regex(build, "[[:alpha:]]"), |
|
|
|
stri_extract_first_regex(build, "[[:alpha:]][[:alnum:]]+"), |
|
|
|
"" |
|
|
|
)) %>% |
|
|
|
dplyr::mutate(build = stri_replace_first_regex(build, "[[:alpha:]][[:alnum:]]+", "")) %>% |
|
|
|
dplyr::mutate_at(.vars=c("major", "minor", "patch", "build"), .funs=c(as.integer)) %>% |
|
|
|
dplyr::mutate_at(vars(major, minor, patch), ~ifelse(is.na(.), 0, .)) %>% |
|
|
|
dplyr::arrange(major, minor, patch) %>% |
|
|
|
dplyr::mutate(vers = sprintf("%s.%s.%s", major, minor, patch)) %>% |
|
|
|
dplyr::select(vers, rls_date, rls_year, major, minor, patch, prerelease, build) -> from_gh |
|
|
|
|
|
|
|
dplyr::bind_rows( |
|
|
|
mutate(out, vers = as.character(vers)), |
|
|
|
filter(from_gh, !(vers %in% out$vers)) |
|
|
|
) %>% |
|
|
|
dplyr::arrange(rls_date, major, minor, patch) %>% |
|
|
|
dplyr::mutate(vers = factor(vers, levels = vers)) -> out |
|
|
|
|
|
|
|
if (use_cache() && (refresh || (!is_cached(tech)))) write_to_cache(out, tech) |
|
|
|
|
|
|
|
out |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|