Patchwork [1/3] patch.bbclass: Add minver/maxver params

login
register
mail settings
Submitter Tom Rini
Date April 25, 2011, 6:31 p.m.
Message ID <1303756273-22385-2-git-send-email-tom_rini@mentor.com>
Download mbox | patch
Permalink /patch/2825/
State New, archived
Headers show

Comments

Tom Rini - April 25, 2011, 6:31 p.m.
Similar to minrev/maxrev and mindate/maxdate allow us to list patches
in an inc file and only apply them in certain versions.

Signed-off-by: Tom Rini <tom_rini@mentor.com>
---
 classes/patch.bbclass |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

Patch

diff --git a/classes/patch.bbclass b/classes/patch.bbclass
index edfb5e9..3045719 100644
--- a/classes/patch.bbclass
+++ b/classes/patch.bbclass
@@ -102,6 +102,18 @@  python patch_do_patch() {
 				bb.note("Patch '%s' applies to earlier revisions" % pname)
 				continue
 
+		if "minver" in parm:
+			srcver = bb.data.getVar('PV', d, 1)
+			if srcver and srcver < parm["minver"]:
+				bb.note("Patch '%s' applies to later versions" % pname)
+				continue
+
+		if "maxver" in parm:
+			srcver = bb.data.getVar('PV', d, 1)
+			if srcver and srcver > parm["maxver"]:
+				bb.note("Patch '%s' applies to earlier versions" % pname)
+				continue
+
 		if "patchdir" in parm:
 			patchdir = parm["patchdir"]
 			if not os.path.isabs(patchdir):