}
# pull in all the R dependencies
- notice('dependencies:',paste(pkg$depends$r,collapse=', '))
+ notice('R dependencies:',paste(pkg$depends$r,collapse=', '))
for (dep in pkg$depends$r) {
if (pkgname_as_debian(dep) %in% debian_pkgs) {
notice('using Debian package of',dep)
forced <- forced_deps_as_debian(pkg$name)
if (length(forced)) {
+ notice('forced build dependencies:',paste(forced$build, collapse=', '))
+ notice('forced binary dependencies:',paste(forced$build, collapse=', '))
depends$bin = c(forced$bin,depends$bin)
depends$build = c(forced$build,depends$build)
}
-#!/usr/bin/env rc
+#!/bin/sh
## DOC: cran2deb build_ctv
## DOC: build all CRAN TaskViews. warning and error logs in ./ctv/
## DOC:
-for (ctv in `{cran2deb cran_pkgs query}) {
+for ctv in $(cran2deb cran_pkgs query); do
echo task view $ctv...
- if (![ -e ctv/$ctv ]) {
- cran2deb build_some $ctv
- mkdir -p ctv/$ctv
- mv warn fail ctv/$ctv
- }
-}
+ if [ ! -e "ctv/$ctv" ]; then
+ cran2deb build_some "$ctv"
+ mkdir -p "ctv/$ctv"
+ mv warn fail "ctv/$ctv"
+ fi
+done
mkdir -p warn fail
shift
-if ([ ! -e all_pkgs ]) {
+if [ ! -e all_pkgs ]; then
cran2deb cran_pkgs $* >all_pkgs
-}
-for (pkg in `{cat all_pkgs}) {
+fi
+
+for pkg in $(cat all_pkgs); do
if (~ $pkg *..* */*) {
echo bad name $pkg >>fail/ERROR
} else if ([ -e warn/$pkg ]) {
echo FAILED
}
}
-}
+done
-#!/usr/bin/rc
+#!/bin/sh
umask 002
-root=`{r -e 'suppressMessages(library(cran2deb));cat(system.file(package=''cran2deb''),file=stdout())'}
+root=$(r -e 'suppressMessages(library(cran2deb));cat(system.file(package="cran2deb"),file=stdout())')
cmd=$1
shift
-if ([ ! -x $root/exec/$cmd ]) {
+if [ ! -x "$root/exec/$cmd" ]; then
echo unknown command $cmd
exit 1
-}
-$root/exec/$cmd $root $*
+fi
+"$root/exec/$cmd" "$root" $*
-#!/usr/bin/env rc
-{for (x in ctv/*) {echo;echo;echo $x: ; cd $x && cran2deb diagnose && cd ../..}} >ctv.results
+#!/bin/sh
+(for x in ctv/*; do echo;echo;echo "$x: "; cd "$x" && cran2deb diagnose && cd ../..; done) >ctv.results
-#!/usr/bin/rc
+#!/bin/sh
echo usage: cran2deb '<cmd> [args ...]'
echo where '<cmd>' is one of
grep '## [D]OC:' $1/exec/* | sed -e 's/.*[D]OC://'
-#!/usr/bin/rc
+#!/bin/sh
echo $1
umask 022
root=$1
shift
-for (x in `{find /etc/cran2deb -type f -name '*.in'}) {
- y=`{echo $x | sed -e 's,.in$,,'}
- sed -e 's:@ROOT@:'^$root^':g' <$x >$y
-}
mkdir -p /var/cache/cran2deb/results || exit 1
mini-dinstall --batch -c /etc/cran2deb/mini-dinstall.conf || exit 1
update_period=10800
sudo pbuilder $mode --override-config --configfile /etc/cran2deb/pbuilderrc
$root/exec/update_cache $root
}
-if (![ -e /var/cache/cran2deb/cran2deb.db ] || [ $delta -gt $update_period ]) {
- cat $root/data/^(populate_licenses quit) | $root/exec/license $root
- cat $root/data/^(populate_depend_aliases populate_sysreq populate_forcedep quit) | $root/exec/depend $root
-}
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()
--- /dev/null
+A dependency alias (created in populated_depend_aliases) is some name (such as
+java) and some associated run and build time dependencies, specified like this:
+
+ alias_build java openjdk-6-jdk
+ alias_build java libgcj9-dev
+ alias_run java openjdk-6-jre
+
+So when cran2deb needs to use the 'java' build dependency, it will add
+"openjdk-6-jdk, libgcj9-dev" to the Build-Depends:. alias_run deals with
+Depends: only.
+Since in Debian you cannot Build-Depend: upon build-essential, there is a
+special 'ignore' dependency alias (this can be handy for dropping unnecessary
+system requirements)
+
+ alias_build ignore build-essential
+
+populate_forcedep contains like:
+
+ force java rJava
+
+which forces the R package rJava to use the dependency alias 'java'. This is
+for cases where there is no SystemRequirement.
+
+Finally, populate_sysreq has lines like:
+
+ sysreq quantlib quantlib%
+
+This says, whenever a part of a SystemRequirement matches the SQL LIKE pattern
+'quantlib%', use the dependency alias. SystemRequirements are converted to
+lower case and messed around with; details are in R/debcontrol.R in the
+sysreqs_as_debian function. R/debcontrol.R contains pretty much all of the code
+for dependencies (the database interface code is in R/db.R).
+
--- /dev/null
+One of the key data structures using by cran2deb is commonly called 'pkg'.
+It is constructed in R/getrpkg.R by prepare_pkg. prepare_pkg obtains
+an R package and converts the source package into something suitable for use
+with Debian.
+
+If a particular upstream version has already been used to create a Debian
+package, then the source tarball of that upstream version is expected to be
+available locally, and is used for building. In this case no conversion is
+performed, so the archive does not change. In future it may be desirable to
+obtain the source tarball from some central archive but this is not done at the
+moment.
+
+download_pkg in R/getrpkg.R obtains the tarball (archive) of the R package, either
+from the previous Debian build, or from the R archive. The field pkg$need_repack
+indicates if the obtained archive must be repacked into a form acceptable
+as a Debian source archive. This repacking, if necessary, is performed by
+repack_pkg in R/getrpkg.R
+
+
+Most of the creation of pkg is done by R/getrpkg.R. However some more build
+specific operations (such as determining the new build version pkg$debversion)
+are performed by R/debianpkg.R.
+