From ec256c8b89cacb01b1153a0716afe7616cb539a9 Mon Sep 17 00:00:00 2001 From: Stuart Lynn Date: Wed, 25 Oct 2023 12:56:42 +0100 Subject: [PATCH] testing `use-public-rspm` flag --- R/install_deps.R | 57 ++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/R/install_deps.R b/R/install_deps.R index 0bfb6f6ed..8024ac650 100644 --- a/R/install_deps.R +++ b/R/install_deps.R @@ -1,33 +1,34 @@ -repos = c( - "https://cran.ma.imperial.ac.uk" = "https://cran.ma.imperial.ac.uk" - ,"https://www.stats.bris.ac.uk/R" = "https://www.stats.bris.ac.uk/R" - ,"https://cran.rstudio.com/" = "https://cran.rstudio.com/" -) +# repos = c( +# "https://cran.ma.imperial.ac.uk" = "https://cran.ma.imperial.ac.uk" +# ,"https://www.stats.bris.ac.uk/R" = "https://www.stats.bris.ac.uk/R" +# ,"https://cran.rstudio.com/" = "https://cran.rstudio.com/" +# ) +options(repos = c(CRAN = "https://packagemanager.posit.co/cran/__linux__/focal/latest")) # CRAN = "https://packagemanager.posit.co/cran/__linux__/focal/latest" +# +# options(HTTPUserAgent = sprintf("R/%s R (%s)", getRversion(), paste(getRversion(), R.version["platform"], R.version["arch"], R.version["os"]))) +# options(download.file.extra = sprintf("--header \"User-Agent: R (%s)\"", paste(getRversion(), R.version["platform"], R.version["arch"], R.version["os"]))) +# +# print(sprintf("R/%s R (%s)", getRversion(), paste(getRversion(), R.version["platform"], R.version["arch"], R.version["os"]))) -options(HTTPUserAgent = sprintf("R/%s R (%s)", getRversion(), paste(getRversion(), R.version["platform"], R.version["arch"], R.version["os"]))) -options(download.file.extra = sprintf("--header \"User-Agent: R (%s)\"", paste(getRversion(), R.version["platform"], R.version["arch"], R.version["os"]))) - -print(sprintf("R/%s R (%s)", getRversion(), paste(getRversion(), R.version["platform"], R.version["arch"], R.version["os"]))) - -mirror_is_up <- function(x){ - out <- tryCatch({ - available.packages(contrib.url(x)) - } - ,error = function(cond){return(0)} - ,warning = function(cond){return(0)} - ,finally = function(cond){} - ) - return(length(out)) -} - -mirror_status = lapply(repos, mirror_is_up) -for(repo in names(mirror_status)){ - if (mirror_status[[repo]] > 1){ - repo <<- repo - break - } -} +# mirror_is_up <- function(x){ +# out <- tryCatch({ +# available.packages(contrib.url(x)) +# } +# ,error = function(cond){return(0)} +# ,warning = function(cond){return(0)} +# ,finally = function(cond){} +# ) +# return(length(out)) +# } +# +# mirror_status = lapply(repos, mirror_is_up) +# for(repo in names(mirror_status)){ +# if (mirror_status[[repo]] > 1){ +# repo <<- repo +# break +# } +# } .libPaths(c("/usr/lib/R/site-library", .libPaths()))