summaryrefslogtreecommitdiff
path: root/classes/base.bbclass
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <hrw@openembedded.org>2006-05-20 12:05:46 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2006-05-20 12:05:46 +0000
commit3360528ed1615dff05dddca99d26fc67fa54e77b (patch)
tree4b7663fc6e3bca97c24e76c41812a4d5aa7df1cb /classes/base.bbclass
parentbb903928954e6ac7f65405d7b4a68debc446a467 (diff)
base.bbclass: add support for 'min/max' date for patches
- SRC_URI = "file//something.patch;patch=1;mindate=20050312;maxdate=20060302 means that patch should be applied if SRCDATE > 20050312 and SRCDATE < 20060302
Diffstat (limited to 'classes/base.bbclass')
-rw-r--r--classes/base.bbclass28
1 files changed, 28 insertions, 0 deletions
diff --git a/classes/base.bbclass b/classes/base.bbclass
index 5f0e0d2fce..683b9e0d2a 100644
--- a/classes/base.bbclass
+++ b/classes/base.bbclass
@@ -475,6 +475,34 @@ python base_do_patch() {
else:
pname = os.path.basename(unpacked)
+ if "mindate" in parm:
+ mindate = parm["mindate"]
+ else:
+ mindate = 0
+
+ if "maxdate" in parm:
+ maxdate = parm["maxdate"]
+ else:
+ maxdate = bb.data.getVar('DATE', d, 1)
+
+ pn = bb.data.getVar('PN', d, 1)
+ srcdate = bb.data.getVar('SRCDATE_%s' % pn, d, 1)
+
+ if not srcdate:
+ srcdate = bb.data.getVar('SRCDATE', d, 1)
+
+ if srcdate == "now":
+ srcdate = bb.data.getVar('DATE', d, 1)
+
+ if (maxdate < srcdate) or (mindate > srcdate):
+ if (maxdate < srcdate):
+ bb.note("Patch '%s' is outdated" % pname)
+
+ if (mindate > srcdate):
+ bb.note("Patch '%s' is predated" % pname)
+
+ continue
+
bb.note("Applying patch '%s'" % pname)
bb.data.setVar("do_patchcmd", bb.data.getVar("PATCHCMD", d, 1) % (pnum, pname, unpacked), d)
bb.data.setVarFlag("do_patchcmd", "func", 1, d)