]> git.donarmstrong.com Git - cran2deb.git/blobdiff - pkg/trunk/exec/update_cache
update_cache: use Rscript instead of littler.
[cran2deb.git] / pkg / trunk / exec / update_cache
index 627e570202d0e5e1898b7adaf1da1283b9fce4db..ec20ccb6688660a655a6d89d39ca3cb8e8d6c788 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env r
+#!/usr/bin/env Rscript
 library(cran2deb)
 library(ctv)
 #mirror <- 'http://cran.uk.r-project.org/'
@@ -10,11 +10,14 @@ available <- rbind(available,available.packages(contrib.url('http://www.biocondu
 
 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(base_pkgs, available, ctv.available, file=file.path(argv[1],'data/cache.rda'),eval.promises=T)
+save(debian_pkgs, base_pkgs, available, ctv.available, file=file.path(argv[1],'data/cache.rda'),eval.promises=T)