X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=branch%2Fmultisys%2Fexec%2Fupdate_cache;fp=branch%2Fmultisys%2Fexec%2Fupdate_cache;h=689384670f01d01b9ce20ae4e1909bc1ca0194c2;hb=413d9e15b7bd5f8f36685c2cccbb9bbed3a3a0b9;hp=0000000000000000000000000000000000000000;hpb=65fce8cd87d7d6f0209611ff7a264819e42a6c9e;p=cran2deb.git diff --git a/branch/multisys/exec/update_cache b/branch/multisys/exec/update_cache new file mode 100755 index 0000000..6893846 --- /dev/null +++ b/branch/multisys/exec/update_cache @@ -0,0 +1,33 @@ +#!/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) + +message('synchronising database...') +db_update_package_versions()