Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Remaining rwinlib ucrt updates #219

Closed
25 of 28 tasks
jeroen opened this issue Jul 24, 2021 · 0 comments
Closed
25 of 28 tasks

Remaining rwinlib ucrt updates #219

jeroen opened this issue Jul 24, 2021 · 0 comments

Comments

@jeroen
Copy link
Member

jeroen commented Jul 24, 2021

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)
@jeroen jeroen closed this as completed Sep 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant