]> git.donarmstrong.com Git - cran2deb.git/commitdiff
cran2deb: tame dput+mini-dinstall+pbuilder.
authorblundellc <blundellc@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Sat, 13 Sep 2008 13:14:00 +0000 (13:14 +0000)
committerblundellc <blundellc@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Sat, 13 Sep 2008 13:14:00 +0000 (13:14 +0000)
Constructs an archive that pbuilder can apt-get dependencies from when
necessary. This requires an http server to serve var/archive (can be a
symlink).

Let pbuilder/dput run lintian.

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

pkg/trunk/cran2deb
pkg/trunk/cranpkgs
pkg/trunk/etc/dput.cf.in
pkg/trunk/etc/mini-dinstall.conf.in
pkg/trunk/etc/pbuilderrc.in
pkg/trunk/setup

index 2e3db5599d423ecc9f27d281a6c1f0ef9c8749f7..2e380fe84583dc32e37f282b1d6ba01251cf7907 100755 (executable)
@@ -1,7 +1,8 @@
 #!/usr/bin/env r
 
-pbuilder_results <- '/var/cache/pbuilder/result'
-pbuilder_config <- '/home/cb/work/gsoc/cran2deb/pbuilderrc'
+pbuilder_results <- '/home/cb/work/gsoc/cran2deb/var/results'
+pbuilder_config <- '/home/cb/work/gsoc/cran2deb/etc/pbuilderrc'
+dput_config <- '/home/cb/work/gsoc/cran2deb/etc/dput.cf'
 
 version.new <- function(rver,debian_revision=1, debian_epoch=0) {
     # generate a string representation of the Debian version of an
@@ -332,26 +333,28 @@ prepare.new.debian <- function(pkg) {
     # determine dependencies
     bin.depends = list()
     src.depends = list()
-    for (dep in strsplit(chomp(pkg$description[1,'Depends'])
-                              ,'[[:space:]]*,[[:space:]]*')[[1]]) {
-        # remove other comments
-        dep = gsub('(\\(\\)|\\([[:space:]]*[^<=>!].*\\))','',dep)
-        # squish spaces
-        dep = chomp(gsub('[[:space:]]+',' ',dep))
-        # parse version
-        pat = '^([^ ()]+) ?(\\( ?([<=>!]+ ?[0-9.]+) ?\\))?$'
-        if (!length(grep(pat,dep))) {
-            stop(paste('R dependency',dep,'does not appear to be well-formed'))
+    if ('Depends' %in% names(pkg$description[1,])) {
+        for (dep in strsplit(chomp(pkg$description[1,'Depends'])
+                                  ,'[[:space:]]*,[[:space:]]*')[[1]]) {
+            # remove other comments
+            dep = gsub('(\\(\\)|\\([[:space:]]*[^<=>!].*\\))','',dep)
+            # squish spaces
+            dep = chomp(gsub('[[:space:]]+',' ',dep))
+            # parse version
+            pat = '^([^ ()]+) ?(\\( ?([<=>!]+ ?[0-9.]+) ?\\))?$'
+            if (!length(grep(pat,dep))) {
+                stop(paste('R dependency',dep,'does not appear to be well-formed'))
+            }
+            version = sub(pat,'\\3',dep)
+            dep = sub(pat,'\\1',dep)
+            src.deb = pkgname.as.debian(dep,pkg$repo,version=version,binary=F)
+            bin.deb = pkgname.as.debian(dep,pkg$repo,version=version,binary=T)
+            bin.depends = c(bin.depends,bin.deb)
+            src.depends = c(src.depends,src.deb)
         }
-        version = sub(pat,'\\3',dep)
-        dep = sub(pat,'\\1',dep)
-        src.deb = pkgname.as.debian(dep,pkg$repo,version=version,binary=F)
-        bin.deb = pkgname.as.debian(dep,pkg$repo,version=version,binary=T)
-        bin.depends = c(bin.depends,bin.deb)
-        src.depends = c(src.depends,src.deb)
+        src.depends=unique(src.depends)
+        bin.depends=unique(bin.depends)
     }
-    src.depends=unique(src.depends)
-    bin.depends=unique(bin.depends)
     if (!length(grep('^r-base',src.depends))) {
         src.depends = c(src.depends,pkgname.as.debian('R',version='>= 2.7.0',binary=F))
         bin.depends = c(bin.depends,pkgname.as.debian('R',version='>= 2.7.0',binary=T))
@@ -423,22 +426,15 @@ go <- function(name) {
     pkg <- try((function() {
         pkg <- prepare.new.debian(prepare.pkg(dir,name))
         build.debian(pkg)
-        message('N: running lintian')
-        upfiles=c(
-                paste(pkg$srcname,'_',pkg$debversion,'.dsc',sep='')
-               ,paste(pkg$srcname,'_',pkg$debversion,'_',host.arch(),'.changes',sep='')
-               ,paste(pkg$debname,'_',pkg$debversion,'_',pkg$arch,'.deb',sep=''))
-        rp = pbuilder_results
-        for (file in upfiles) {
-            ret = system(paste('lintian -v ',rp,'/',file,sep=''))
-            if (ret != 0) {
-                break
-            }
-        }
-        message('N: lintian done')
+        ret = system(paste('umask 022;dput','-c',shQuote(dput_config),'local'
+                    ,paste('/', pbuilder_results, '/'
+                          ,paste(pkg$srcname,'_',pkg$debversion,'_'
+                                ,host.arch(),'.changes',sep=''), sep='')))
         if (ret != 0) {
-            stop('lintian failed!')
+            stop('upload failed!')
         }
+# paste(pkg$srcname,'_',pkg$debversion,'.dsc',sep='')
+# paste(pkg$debname,'_',pkg$debversion,'_',pkg$arch,'.deb',sep='')
         return(pkg)
     })())
     cleanup(dir)
index 05e5f5feda29c5c02e03553b42542e40e850baab..ee2462f59130a23869f1a08a40da77d5850a8bd5 100755 (executable)
@@ -1,2 +1,3 @@
 #!/usr/bin/env r
-writeLines(sample(dimnames(available.packages(contriburl=contrib.url('http://cran.uk.r-project.org/')))[[1]],300))
+#writeLines(sample(dimnames(available.packages(contriburl=contrib.url('http://cran.uk.r-project.org/')))[[1]],300))
+writeLines(dimnames(available.packages(contriburl=contrib.url('http://cran.uk.r-project.org/')))[[1]])
index 9779aaf455364df77fdd2f98ec9efbf58dadc1fe..7d6b8d29283c6e079ea2a8b451dd2ebc5313d751 100644 (file)
@@ -1,7 +1,8 @@
-[local]                                                                                                                                          
-method = local                                                                                                                                   
-incoming = @ROOT@/var/incoming
-allow_non-us_software = 1                                                                                                                        
-run_dinstall = 0                                                                                                                                 
+[local]
+method = local
+incoming = @ROOT@/var/archive/mini-dinstall/incoming
+allow_non-us_software = 1
+run_dinstall = 0
+run_lintian = 1
 post_upload_command = /usr/bin/mini-dinstall --batch -c @ROOT@/etc/mini-dinstall.conf
 allow_unsigned_uploads = 1
index 72b7448f46822af09c84ab1c84e3c71854099379..b75f1d7c5e1e5e79a9e93c0d39d4a82dc9123d5d 100644 (file)
@@ -1,3 +1,12 @@
-archive_dir = @ROOT@/var/archive
+[DEFAULT]
+architectures = all, i386
+use_dnotify = 0
+verify_sigs = 0
+mail_on_success = 0
+archive_style = simple-subdir
+mail_log_level = NONE
+archivedir = @ROOT@/var/archive
 logfile = @ROOT@/var/mini-dinstall.log
 
+[unstable]
+
index f0424d8313c770e770fd69256a2a092043dd67d9..5d785b4cef8b8289ea468ba817ab17ca24621cf4 100644 (file)
@@ -1,4 +1,7 @@
 HOOKDIR=@ROOT@/etc/hook
-BUILDRESULT=@ROOT@/var/incoming
+BUILDRESULT=@ROOT@/var/results
 EXTRAPACKAGES='debhelper r-base-dev cdbs r-base-core lintian'
 DISTRIBUTION=lenny
+OTHERMIRROR='deb http://localhost/users/cb/cran2deb/ unstable/$(ARCH)/'
+MIRRORSITE='http://ftp.debian.org/debian/'
+APTCACHE=''
index 0bc447f3f159c6f751107c96f55e44de25a0e05f..e8537f23c0c483b7b1d7c7ba31f5c6002ae7a0f6 100755 (executable)
@@ -1,11 +1,18 @@
 #!/usr/bin/rc
+umask 022
+root=`pwd
 for (x in `{find etc -type f -name '*.in'}) {
     y=`{echo $x | sed -e 's,.in$,,'}
-    sed -e 's:@ROOT@:'^`pwd^':g' <$x >$y
+    sed -e 's:@ROOT@:'^$root^':g' <$x >$y
 }
-mkdir -p var/incoming var/archive
+mkdir -p var/results
+if ([ ! -e var/archive ]) {
+    # I symbolically link this into /var/www/
+    mkdir var/archive
+}
+mini-dinstall --batch -c $root/etc/mini-dinstall.conf || exit 1
 mode=create
 if ([ -e /var/cache/pbuilder/base.tgz ]) {
     mode=update
 }
-sudo pbuilder $mode --configfile `pwd^/etc/pbuilderrc
+sudo pbuilder $mode --override-config --configfile $root/etc/pbuilderrc