diff options
author | Ross Burton <ross.burton@intel.com> | 2019-05-08 11:40:24 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-05-09 16:31:56 +0100 |
commit | 92290d3b7010d1f6c1206c1974deadf2423cfe6f (patch) | |
tree | ed4b3498c19057e4aebbd2de62540bc90da7cd49 /meta/lib | |
parent | b5dd016f29303513f94655a7fd0bb10931913434 (diff) | |
download | poky-92290d3b7010d1f6c1206c1974deadf2423cfe6f.tar.gz |
patch: add minver and maxver parameters
Add minver/maxver parameters to limit patch application by comparing PV.
(From OE-Core rev: 3fac9f884ac6bcc0280e1bb5d0f0e397bb53678f)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oe/patch.py | 11 |
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): | |||
851 | 851 | ||
852 | 852 | ||
853 | def should_apply(parm, d): | 853 | def should_apply(parm, d): |
854 | import bb.utils | ||
854 | if "mindate" in parm or "maxdate" in parm: | 855 | if "mindate" in parm or "maxdate" in parm: |
855 | pn = d.getVar('PN') | 856 | pn = d.getVar('PN') |
856 | srcdate = d.getVar('SRCDATE_%s' % pn) | 857 | srcdate = d.getVar('SRCDATE_%s' % pn) |
@@ -887,5 +888,15 @@ def should_apply(parm, d): | |||
887 | if srcrev and parm["notrev"] in srcrev: | 888 | if srcrev and parm["notrev"] in srcrev: |
888 | return False, "doesn't apply to revision" | 889 | return False, "doesn't apply to revision" |
889 | 890 | ||
891 | if "maxver" in parm: | ||
892 | pv = d.getVar('PV') | ||
893 | if bb.utils.vercmp_string_op(pv, parm["maxver"], ">"): | ||
894 | return False, "applies to earlier version" | ||
895 | |||
896 | if "minver" in parm: | ||
897 | pv = d.getVar('PV') | ||
898 | if bb.utils.vercmp_string_op(pv, parm["minver"], "<"): | ||
899 | return False, "applies to later version" | ||
900 | |||
890 | return True, None | 901 | return True, None |
891 | 902 | ||