]> git.donarmstrong.com Git - cran2deb.git/commitdiff
Merge branch/patch into trunk
authorblundellc <blundellc@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Mon, 15 Sep 2008 11:31:44 +0000 (11:31 +0000)
committerblundellc <blundellc@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Mon, 15 Sep 2008 11:31:44 +0000 (11:31 +0000)
git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@162 edb9625f-4e0d-4859-8d74-9fd3b1da38cb

trunk/R/debcontrol.R
trunk/R/debianpkg.R
trunk/R/patch.R [new file with mode: 0644]
trunk/R/zzz.R

index 84d9933780a35d64795aa15649a9766b82bcea03..aa8ba8abd00800286f8021d337a57d8d750894c5 100644 (file)
@@ -44,7 +44,7 @@ get_dependencies <- function(pkg,extra_deps) {
     depends <- lapply(depends,unique)
 
     # append the Debian dependencies
-    depends$build=c(depends$build,'debhelper (>> 4.1.0)','cdbs')
+    depends$build=c(depends$build,'debhelper (>> 4.1.0)','cdbs','dpatch')
     if (pkg$archdep) {
         depends$bin=c(depends$bin,'${shlibs:Depends}')
     }
index 8d9bb65e32ff0f8013bdb6559bda60c5a89c7068..31bdb9609a900f16283bdac5d499ef99e482d364 100644 (file)
@@ -127,6 +127,7 @@ prepare_new_debian <- function(pkg,extra_deps) {
 
     pkg$license <- accept_license(pkg)
     pkg$depends <- get_dependencies(pkg,extra_deps)
+    apply_patches(pkg)
     generate_changelog(pkg)
     generate_rules(pkg)
     generate_copyright(pkg)
diff --git a/trunk/R/patch.R b/trunk/R/patch.R
new file mode 100644 (file)
index 0000000..b9dc8ce
--- /dev/null
@@ -0,0 +1,20 @@
+apply_patches <- function(pkg) {
+    patch_path = file.path(patch_dir, pkg$name)
+    if (!file.exists(patch_path)) {
+        notice('no patches in',patch_path)
+        return()
+    }
+
+    # make debian/patches for simple-patchsys
+    deb_patch = pkg$debfile('patches')
+    if (!dir.create(deb_patch)) {
+        fail('could not create patches directory', deb_patch)
+    }
+
+    # now just copy the contents of patch_path into debian/patches
+    for (patch in list.files(patch_path)) {
+        notice('including patch', patch)
+        file.copy(file.path(patch_path, patch), deb_patch)
+    }
+}
+
index a576837ffc8741622070654f2c4dd504edeef313..3255fe703267cb369d55474e13a3d969bcb876d7 100644 (file)
@@ -10,6 +10,7 @@
     global("dinstall_archive", '/etc/cran2deb/archive')
     global("r_depend_fields", c('Depends','Imports')) # Suggests, Enhances
     global("scm_revision", 'svn:$Id$')
+    global("patch_dir", '/etc/cran2deb/patches')
     global("changesfile", function(srcname,version='*') {
         return(file.path(pbuilder_results
                         ,paste(srcname,'_',version,'_'