X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=tags%2Fgsoc_final%2Fexec%2Fupdate_cache;fp=tags%2Fgsoc_final%2Fexec%2Fupdate_cache;h=5370210c02c1bab56e218554f5eb650618a3b6c8;hb=5101cce1568b46d042316f32c8216e956f76ff65;hp=0000000000000000000000000000000000000000;hpb=1d3c6e2092b87a8e640704ce3ceec4e8ece3859e;p=cran2deb.git diff --git a/tags/gsoc_final/exec/update_cache b/tags/gsoc_final/exec/update_cache new file mode 100755 index 0000000..5370210 --- /dev/null +++ b/tags/gsoc_final/exec/update_cache @@ -0,0 +1,30 @@ +#!/usr/bin/env Rscript +library(cran2deb) +library(ctv) + +argv <- commandArgs() +argv <- argv[-(1:match("--args", argv))] + +#mirror <- 'http://cran.uk.r-project.org/' +mirror <- 'http://cran.r-project.org/' + +message('updating list of available R packages...') +available <- available.packages(contrib.url(mirror)) + +#available <- rbind(available,available.packages(contrib.url('http://www.bioconductor.org/'))) +#dupes <- duplicated(rownames(available), fromLast=T) +#available <- available[!dupes,] + +message('updating list of available R task views...') +ctv.available <- available.views(repo=mirror) + +message('updating list of base R packages...') +base_pkgs <- readLines(pipe(paste('sudo pbuilder --execute --override-config --configfile' + ,shQuote(pbuilder_config),'-- /usr/bin/R --vanilla 2>&1 >/dev/null <' + ,shQuote(file.path(root,'exec/get_base_pkgs')) + ,'| grep -v ^W:'))) + +message('updating list of existing Debian packages...') +debian_pkgs <- readLines(pipe('apt-cache rdepends r-base-core | sed -e "/^ r-cran/{s/^[[:space:]]*r/r/;p}" -e d | sort -u')) + +save(debian_pkgs, base_pkgs, available, ctv.available, file=file.path(cache_root,'cache.rda'),eval.promises=T)