summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2019-05-08 11:40:24 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-05-09 16:31:06 +0100
commit3fac9f884ac6bcc0280e1bb5d0f0e397bb53678f (patch)
tree259f4fea13ce8ea403dc7fb59118d8c70d60b57a /meta
parentf178990495c773b4b36b1be6aafc2da158b76894 (diff)
downloadopenembedded-core-contrib-3fac9f884ac6bcc0280e1bb5d0f0e397bb53678f.tar.gz
openembedded-core-contrib-3fac9f884ac6bcc0280e1bb5d0f0e397bb53678f.tar.bz2
openembedded-core-contrib-3fac9f884ac6bcc0280e1bb5d0f0e397bb53678f.zip
patch: add minver and maxver parameters
Add minver/maxver parameters to limit patch application by comparing PV. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oe/patch.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index d8e4ef5398..2b1eee1003 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -851,6 +851,7 @@ def src_patches(d, all=False, expand=True):
def should_apply(parm, d):
+ import bb.utils
if "mindate" in parm or "maxdate" in parm:
pn = d.getVar('PN')
srcdate = d.getVar('SRCDATE_%s' % pn)
@@ -887,5 +888,15 @@ def should_apply(parm, d):
if srcrev and parm["notrev"] in srcrev:
return False, "doesn't apply to revision"
+ if "maxver" in parm:
+ pv = d.getVar('PV')
+ if bb.utils.vercmp_string_op(pv, parm["maxver"], ">"):
+ return False, "applies to earlier version"
+
+ if "minver" in parm:
+ pv = d.getVar('PV')
+ if bb.utils.vercmp_string_op(pv, parm["minver"], "<"):
+ return False, "applies to later version"
+
return True, None