]> git.donarmstrong.com Git - cran2deb.git/commitdiff
more verbose dependency messages. rewrite some scripts to use sh not rc (a few compl...
authorblundellc <blundellc@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Sat, 13 Sep 2008 13:27:30 +0000 (13:27 +0000)
committerblundellc <blundellc@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Sat, 13 Sep 2008 13:27:30 +0000 (13:27 +0000)
cran2deb repopulate will bump the DB version, cran2deb update will not.

git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@131 edb9625f-4e0d-4859-8d74-9fd3b1da38cb

12 files changed:
pkg/trunk/R/build.R
pkg/trunk/R/debcontrol.R
pkg/trunk/exec/build_ctv
pkg/trunk/exec/build_some
pkg/trunk/exec/cran2deb
pkg/trunk/exec/diagnose_ctv
pkg/trunk/exec/help
pkg/trunk/exec/root
pkg/trunk/exec/update
pkg/trunk/exec/update_cache
pkg/trunk/inst/doc/DEPENDS [new file with mode: 0644]
pkg/trunk/inst/doc/PKG [new file with mode: 0644]

index e6eeccd6cbb5469d1edceabaa3db7a0915effee6..9fcc8d74cd058ccd8e64ff3ab410f5b3e3499a1e 100644 (file)
@@ -42,7 +42,7 @@ build <- function(name,extra_deps,force=F) {
         }
 
         # pull in all the R dependencies
-        notice('dependencies:',paste(pkg$depends$r,collapse=', '))
+        notice('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)
index c610ce245810ea4abaaa4d25a02e7558a58fde0e..be7eb864b56bb00569d88aa2d24af16252dc02b1 100644 (file)
@@ -23,6 +23,8 @@ get_dependencies <- function(pkg,extra_deps) {
 
     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)
     }
index 35d9a424be2fcbdfc2b4c24b055b41698adbdbf2..1e39e04269272862bff59d7ffe96a62051e961c2 100755 (executable)
@@ -1,14 +1,14 @@
-#!/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
 
index 679eed2e153e4e974b5c107d0e4187b79f481eb6..f02af9d98db2d28e1ce06e12c7de8d38c7f7b0f8 100755 (executable)
@@ -8,10 +8,11 @@
 
 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 ]) {
@@ -33,4 +34,4 @@ for (pkg in `{cat all_pkgs}) {
             echo FAILED
         }
     }
-}
+done
index 7130044d4c9be92463bbf15979d2df7f4868dc23..7efedc751a484296ff30eb77cc3ed568cebc6635 100755 (executable)
@@ -1,10 +1,10 @@
-#!/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" $*
index b1f995d6fc3c1327050b47745ff283260c93efd4..5e7ef0340653f530aa623f53680273a0bc0cec65 100755 (executable)
@@ -1,2 +1,2 @@
-#!/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
index e7397f8b12344ee86be56e00991a2ef274a5f1e3..3eeabab484b6ea040c2935f5b985a2039885e35c 100755 (executable)
@@ -1,4 +1,4 @@
-#!/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://'
index 729458863fbef697acbb38da9f7a81ee741d3d12..31337785f38910081779f84032feca335c10d91a 100755 (executable)
@@ -1,2 +1,2 @@
-#!/usr/bin/rc
+#!/bin/sh
 echo $1
index 020872318e15f8bf824894202d36f7ff70a19bc7..bcd74a7401178199a46d9ca515154591287da357 100755 (executable)
@@ -8,10 +8,6 @@
 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
@@ -30,8 +26,4 @@ if (![ -e /var/cache/cran2deb/cache.rda ] || [ $delta -gt $update_period ]) {
     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
-}
 
index 5370210c02c1bab56e218554f5eb650618a3b6c8..689384670f01d01b9ce20ae4e1909bc1ca0194c2 100755 (executable)
@@ -28,3 +28,6 @@ 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()
diff --git a/pkg/trunk/inst/doc/DEPENDS b/pkg/trunk/inst/doc/DEPENDS
new file mode 100644 (file)
index 0000000..471f240
--- /dev/null
@@ -0,0 +1,33 @@
+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).
+
diff --git a/pkg/trunk/inst/doc/PKG b/pkg/trunk/inst/doc/PKG
new file mode 100644 (file)
index 0000000..de0a4b2
--- /dev/null
@@ -0,0 +1,23 @@
+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.
+