diff options
author | Richard Purdie <rpurdie@rpsys.net> | 2007-08-03 00:18:28 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@rpsys.net> | 2007-08-03 00:18:28 +0000 |
commit | f8b12ef5be647d1bd011d2415c458b937ab61c96 (patch) | |
tree | 9f19fbff23e675975bccf3b99bb59f5b03c63aa7 | |
parent | 3ba795388884e38e9212b75b6441895c5949e469 (diff) |
patch.bbclass: Add minrev and maxrev support for patches, cleanup maxdate and mindate support
-rw-r--r-- | classes/patch.bbclass | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/classes/patch.bbclass b/classes/patch.bbclass index 12657fa0f6..2ba6729af8 100644 --- a/classes/patch.bbclass +++ b/classes/patch.bbclass @@ -492,33 +492,35 @@ python patch_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 = "20711226" - - pn = bb.data.getVar('PN', d, 1) - srcdate = bb.data.getVar('SRCDATE_%s' % pn, d, 1) + if "mindate" in parm or "maxdate" in parm: + 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 not srcdate: - srcdate = bb.data.getVar('SRCDATE', d, 1) + if srcdate == "now": + srcdate = bb.data.getVar('DATE', d, 1) - if srcdate == "now": - srcdate = bb.data.getVar('DATE', d, 1) - - if (maxdate < srcdate) or (mindate > srcdate): - if (maxdate < srcdate): + if "maxdate" in parm and parm["maxdate"] < srcdate: bb.note("Patch '%s' is outdated" % pname) + continue - if (mindate > srcdate): + if "mindate" in parm and parm["mindate"] > srcdate: bb.note("Patch '%s' is predated" % pname) + continue - continue + + if "minrev" in parm: + srcrev = bb.data.getVar('SRCREV', d, 1) + if srcrev and srcrev < parm["minrev"]: + bb.note("Patch '%s' applies to later revisions" % pname) + continue + + if "maxrev" in parm: + srcrev = bb.data.getVar('SRCREV', d, 1) + if srcrev and srcrev > parm["maxrev"]: + bb.note("Patch '%s' applies to earlier revisions" % pname) + continue bb.note("Applying patch '%s'" % pname) try: |