[oe-commits] [openembedded-core] 18/23: patch: add minver and maxver parameters

git at git.openembedded.org git at git.openembedded.org
Wed May 8 22:37:16 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit e3be67558389844094bcfe8d82c5a291be0c2e54
Author: Ross Burton <ross.burton at intel.com>
AuthorDate: Wed May 8 11:40:24 2019 +0100

    patch: add minver and maxver parameters
    
    Add minver/maxver parameters to limit patch application by comparing PV.
    
    Signed-off-by: Ross Burton <ross.burton at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oe/patch.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index d8e4ef5..2b1eee1 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
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list