diff options
author | Richard Purdie <richard@openedhand.com> | 2007-08-03 14:29:07 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2007-08-03 14:29:07 +0000 |
commit | 4df629aa49a79ae77f4e5448547fc3390b2555ba (patch) | |
tree | 3da9b74b5f1061b4c924d22210fc1a538bc557bd /meta/classes/patch.bbclass | |
parent | 4c75040fc6079612f0eaad6c6c156857fcf7f100 (diff) | |
download | openembedded-core-4df629aa49a79ae77f4e5448547fc3390b2555ba.tar.gz openembedded-core-4df629aa49a79ae77f4e5448547fc3390b2555ba.tar.bz2 openembedded-core-4df629aa49a79ae77f4e5448547fc3390b2555ba.tar.xz openembedded-core-4df629aa49a79ae77f4e5448547fc3390b2555ba.zip |
patch.bbclass: Add support for maxrev and minrev
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2350 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes/patch.bbclass')
-rw-r--r-- | meta/classes/patch.bbclass | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass index 68a71754c..526308991 100644 --- a/meta/classes/patch.bbclass +++ b/meta/classes/patch.bbclass @@ -458,33 +458,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: |