diff --git a/DESCRIPTION b/DESCRIPTION index 952e243..fbf7a47 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -23,4 +23,5 @@ SystemRequirements: git, svn License: Artistic-2.0 URL: https://github.com/gmbecker/switchr BugReports: https://github.com/gmbecker/switchr/issues +Encoding: UTF-8 RoxygenNote: 7.2.3 diff --git a/R/Utilities.R b/R/Utilities.R index 23b0aeb..600fd07 100644 --- a/R/Utilities.R +++ b/R/Utilities.R @@ -1,4 +1,8 @@ +.cran_path <- function() { + getOption("switchr_cran_mirror", "http://cran.r-project.org") +} + ## defaults to src .getExt = function(repourl = "./src/contrib", regex = FALSE) { diff --git a/R/accessors.R b/R/accessors.R index 3522c66..b3d241e 100644 --- a/R/accessors.R +++ b/R/accessors.R @@ -185,7 +185,6 @@ setMethod("dep_repos<-", "SessionManifest", function(x, value) { ##' @title Get or set the manifest associated with an object -##' ##' ##' @description Get or set manifest associated with an object ##' diff --git a/R/crandbtmp.R b/R/crandbtmp.R index a12dd1c..2f5f801 100644 --- a/R/crandbtmp.R +++ b/R/crandbtmp.R @@ -183,7 +183,7 @@ buildTarURLs = function(pkgvers, avail) { iscurrent[stillthere[currentpkgs]] = TRUE baseurl = ifelse(iscurrent, "http://cran.rstudio.com/src/contrib", - paste("http://cran.r-project.org/src/contrib/Archive", names(pkgvers), sep="/") + paste(.cran_path(), "src/contrib/Archive", names(pkgvers), sep="/") ) tarnames = paste0(names(pkgvers), "_", pkgvers, ".tar.gz") cranurls = paste(baseurl, tarnames, sep = "/") diff --git a/R/manifestFromLib.R b/R/manifestFromLib.R index d26d2d3..eac2040 100644 --- a/R/manifestFromLib.R +++ b/R/manifestFromLib.R @@ -216,7 +216,7 @@ setMethod("libManifest", "SwitchrCtx", ##' known_manifest and official repositories. ##' @param ... Currently unused. ##' @examples -##' man = makeSeedMan() +##' \dontrun{man = makeSeedMan()} ##' @export ##' @docType methods ##' @rdname makeSeedMan diff --git a/R/retrievePkgVersion.R b/R/retrievePkgVersion.R index 5b100d6..36c3c90 100644 --- a/R/retrievePkgVersion.R +++ b/R/retrievePkgVersion.R @@ -86,7 +86,7 @@ findPkgVersionInCRAN = function(name, version, param = SwitchrParam(), dir) tarname = paste0(name, "_", version, ".tar.gz") - cranurl = paste("http://cran.r-project.org/src/contrib/Archive", name, tarname, sep = "/") + cranurl = paste(.cran_path(), "src/contrib/Archive", name, tarname, sep = "/") if(!file.exists(destpath)) diff --git a/inst/examples/crandb.R b/inst/examples/crandb.R index 3065240..4e7325e 100644 --- a/inst/examples/crandb.R +++ b/inst/examples/crandb.R @@ -34,7 +34,7 @@ iscurrent = rep(FALSE, times=length(vers)) iscurrent[stillthere[currentpkgs]] = TRUE baseurl = ifelse(iscurrent, "http://cran.rstudio.com/src/contrib", - paste("http://cran.r-project.org/src/contrib/Archive", names(vers), sep="/") + paste(.cran_path(), "src/contrib/Archive", names(vers), sep="/") ) cranurls = paste(baseurl, tarnames, sep = "/") diff --git a/man/makeSeedMan.Rd b/man/makeSeedMan.Rd index 0237aca..27af538 100644 --- a/man/makeSeedMan.Rd +++ b/man/makeSeedMan.Rd @@ -37,5 +37,5 @@ known_manifest and official repositories.} makeSeedMan } \examples{ -man = makeSeedMan() +\dontrun{man = makeSeedMan()} }