+
+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')
invisible()
}
-download_pkg <- function(dir, pkgname) {
+download_pkg <- function(dir, pkgname, repacking=0) {
# download pkgname into dir, and construct some metadata
# record some basic information
# 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)
}
,archive))
pkg$archive = archive
# this is not a Debian conformant archive
- pkg$need_repack = TRUE
+ ## we basically should never repack
+ ## pkg$need_repack = TRUE
}
return(pkg)
}
# if necessary, repack the archive into Debian-conformant format
if (pkg$need_repack) {
pkg <- repack_pkg(pkg)
+ } else {
+ log_system('ln','-sf',shQuote(pkg$archive),
+ shQuote(file.path(dirname(pkg$archive)
+ ,paste(pkg$srcname,'_'
+ ,pkg$version,'.orig.tar.gz'
+ ,sep=''))))
}
if (!file.info(pkg$path)[,'isdir']) {
fail(pkg$path,'is not a directory and should be.')