Closed jeroen closed 3 years ago
cran2git <- read.csv('https://r-universe-org.github.io/cran-to-git/crantogit.csv') txt <- readLines('https://www.r-project.org/nosvn/winutf8/ucrt3/patches/CRAN/') pt <- '.*href="(.*).diff".*' txt <- txt[grepl(pt, txt)] pkgs <- sub(pt, '\\1', txt) test_for_rwinlib <- function(pkg){ has_rwinlib <- url_exists(sprintf('https://raw.githubusercontent.com/cran/%s/master/tools/winlibs.R', pkg)) has_ucrt <- url_exists(sprintf('https://raw.githubusercontent.com/cran/%s/master/src/Makevars.ucrt', pkg)) if(!has_ucrt){ giturl <- cran2git$url[cran2git$package == pkg] if(length(giturl)){ base <- sub("https://github.com/", "", giturl) has_ucrt <- url_exists(sprintf('https://raw.githubusercontent.com/%s/master/src/Makevars.ucrt', base)) } } return(has_rwinlib && !has_ucrt) } url_exists <- function(url){ req <- curl::curl_fetch_memory(url) return(req$status == 200) } todo <- Filter(test_for_rwinlib, pkgs)