| Line 1... |
Line 1... |
| 1 |
### This needs a local CRAN mirror or Internet access
|
1 |
### This needs a local (partial) CRAN mirror or Internet access
|
| - |
|
2 |
## Specifically, needs web/packages/packages.rds and web/checks/*.rds
|
| 2 |
|
3 |
|
| 3 |
## This may need to download, so increase the timeout.
|
4 |
## This may need to download, so increase the timeout.
|
| 4 |
options(warn = 1L, timeout = max(600, getOption('timeout')))
|
5 |
options(warn = 1L, timeout = max(600, getOption('timeout')))
|
| 5 |
|
6 |
|
| 6 |
.ptime <- proc.time()
|
7 |
.ptime <- proc.time()
|
| Line 13... |
Line 14... |
| 13 |
message("Using CRAN mirror ", sQuote(mirror))
|
14 |
message("Using CRAN mirror ", sQuote(mirror))
|
| 14 |
|
15 |
|
| 15 |
## Sanity check: the examples use /web/packages/packages.rds and
|
16 |
## Sanity check: the examples use /web/packages/packages.rds and
|
| 16 |
## web/checks/check_*.rds,
|
17 |
## web/checks/check_*.rds,
|
| 17 |
## but partial mirrors for package installation only need src/contrib.
|
18 |
## but partial mirrors for package installation only need src/contrib.
|
| 18 |
## This would fail with a file:// mirror but provide a cheap check
|
19 |
## This would fail with a file:// mirror but provides a cheap check
|
| 19 |
## of the availability of a https:// one.
|
20 |
## of the availability of a https:// one.
|
| 20 |
if(!startsWith(mirror, "file://")) {
|
21 |
if(!startsWith(mirror, "file://")) {
|
| 21 |
foo <- tryCatch(readLines(paste0(mirror, "/web/packages")),
|
22 |
foo <- tryCatch(readLines(paste0(mirror, "/web/packages")),
|
| 22 |
error = function(e) {
|
23 |
error = function(e) {
|
| 23 |
message(conditionMessage(e))
|
24 |
message(conditionMessage(e))
|