]> git.donarmstrong.com Git - cran2deb.git/blob - branch/double_build/R/patch.R
initial commit of build all-at-once code.
[cran2deb.git] / branch / double_build / R / patch.R
1 apply_patches <- function(pkg) {
2     patch_path = file.path(patch_dir, pkg$name)
3     if (!file.exists(patch_path)) {
4         notice('no patches in',patch_path)
5         return()
6     }
7
8     # make debian/patches for simple-patchsys
9     deb_patch = pkg$debfile('patches')
10     if (!dir.create(deb_patch)) {
11         fail('could not create patches directory', deb_patch)
12     }
13
14     # now just copy the contents of patch_path into debian/patches
15     for (patch in list.files(patch_path)) {
16         notice('including patch', patch)
17         file.copy(file.path(patch_path, patch), deb_patch)
18     }
19 }
20