]> git.donarmstrong.com Git - cran2deb.git/commitdiff
For the largish BioConductor files one has
authormoeller <moeller@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Sat, 12 Feb 2011 19:42:29 +0000 (19:42 +0000)
committermoeller <moeller@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Sat, 12 Feb 2011 19:42:29 +0000 (19:42 +0000)
(even with good connects) download times of
45 minutes, easily. Retries are found not
to be necessary, limit set to 60.

One does not not want to
try again in an unsupervised manner after
dropping 500MBs of download because of a
time limit, retries hence set to 0.

git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@357 edb9625f-4e0d-4859-8d74-9fd3b1da38cb

trunk/R/getrpkg.R

index 9c87c379460d28ecbc990241cb3fd287cadbd9e9..02266c4e9634d372d546ef3d55718b18a8f15d26 100644 (file)
@@ -1,3 +1,7 @@
+
+curl.maxtime<-60*60  # 60 minutes max download time (some bioconductor packages are truly big and take time)
+curl.retries<-0             # No retries (connections are commonly good enough)
+
 setup <- function() {
     # set up the working directory
     tmp <- tempfile('cran2deb')
@@ -61,7 +65,9 @@ download_pkg <- function(dir, pkgname) {
             # dodgy network connections (hello BT 'OpenWorld', bad ISP)
             url <- paste(available[pkgname,'Repository'], fn, sep='/')
             # don't log the output -- we don't care!
-            ret <- system(paste('curl','-o',shQuote(archive),'-m 720 --retry 5',shQuote(url)))
+            ret <- system(paste('curl','-o',shQuote(archive),
+                          paste('-m',curl.maxtime,'--retry',curl.retries,sep=' '),
+                          shQuote(url)))
             if (ret != 0) {
                 fail('failed to download',url)
             }