From 3913e9fb75b76220c8b46a3cf8cd4ef4be1d6ad8 Mon Sep 17 00:00:00 2001 From: blundellc Date: Mon, 15 Sep 2008 12:27:36 +0000 Subject: [PATCH] Rebase to trunk. Pull in patching fun. git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@164 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- branch/multisys/R/debcontrol.R | 2 +- branch/multisys/R/debianpkg.R | 1 + branch/multisys/R/patch.R | 20 ++++++++++++++++++++ branch/multisys/R/zzz.R | 1 + 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 branch/multisys/R/patch.R diff --git a/branch/multisys/R/debcontrol.R b/branch/multisys/R/debcontrol.R index 84d9933..aa8ba8a 100644 --- a/branch/multisys/R/debcontrol.R +++ b/branch/multisys/R/debcontrol.R @@ -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}') } diff --git a/branch/multisys/R/debianpkg.R b/branch/multisys/R/debianpkg.R index f1b427e..7384089 100644 --- a/branch/multisys/R/debianpkg.R +++ b/branch/multisys/R/debianpkg.R @@ -128,6 +128,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/branch/multisys/R/patch.R b/branch/multisys/R/patch.R new file mode 100644 index 0000000..b9dc8ce --- /dev/null +++ b/branch/multisys/R/patch.R @@ -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) + } +} + diff --git a/branch/multisys/R/zzz.R b/branch/multisys/R/zzz.R index 9bf3047..d184393 100644 --- a/branch/multisys/R/zzz.R +++ b/branch/multisys/R/zzz.R @@ -15,6 +15,7 @@ global("dinstall_archive", file.path('/etc/cran2deb/archive',which_system)) 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,'_' -- 2.39.5