aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMykyta Holubakha <hilobakho@gmail.com>2017-07-06 04:47:17 +0300
committerMykyta Holubakha <hilobakho@gmail.com>2017-07-06 04:47:17 +0300
commit6cf478d92f538e8f3d1704dbc5a0ce5677f93ee3 (patch)
treec32c013b741528e0d3dfdad762e0e10e18d110c1 /pomu/package.py
parentSome fixes (diff)
downloadpomu-6cf478d92f538e8f3d1704dbc5a0ce5677f93ee3.tar.gz
pomu-6cf478d92f538e8f3d1704dbc5a0ce5677f93ee3.tar.bz2
pomu-6cf478d92f538e8f3d1704dbc5a0ce5677f93ee3.zip
patch package source module
patch application in packages new dependency: patch
Diffstat (limited to 'pomu/package.py')
-rw-r--r--pomu/package.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/pomu/package.py b/pomu/package.py
index 7c9321e..5027569 100644
--- a/pomu/package.py
+++ b/pomu/package.py
@@ -10,6 +10,8 @@ from shutil import copy2
import subprocess
+from patch import PatchSet
+
from pomu.util.fs import strip_prefix
from pomu.util.result import Result
@@ -82,6 +84,13 @@ class Package():
return Result.Err('You do not have enough permissions')
return Result.Ok()
+ def apply_patches(self, location, patches):
+ """Applies a sequence of patches at the location"""
+ ps = PatchSet()
+ for p in patches:
+ ps.parse(open(p, 'r'))
+ ps.apply(root=location)
+
def gen_manifests(self, dst):
"""
Generate manifests for the installed package (in the dst directory).