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

Tom Rini tom_rini at mentor.com
Mon Apr 25 18:31:11 UTC 2011


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 at mentor.com>
---
 classes/patch.bbclass |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

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):
-- 
1.7.0.4





More information about the Openembedded-devel mailing list