summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2007-08-03 14:29:07 +0000
committerRichard Purdie <richard@openedhand.com>2007-08-03 14:29:07 +0000
commit4df629aa49a79ae77f4e5448547fc3390b2555ba (patch)
tree3da9b74b5f1061b4c924d22210fc1a538bc557bd
parent4c75040fc6079612f0eaad6c6c156857fcf7f100 (diff)
downloadpoky-4df629aa49a79ae77f4e5448547fc3390b2555ba.tar.gz
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
-rw-r--r--meta/classes/patch.bbclass44
1 files changed, 23 insertions, 21 deletions
diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass
index 68a71754c8..5263089916 100644
--- a/meta/classes/patch.bbclass
+++ b/meta/classes/patch.bbclass
@@ -458,33 +458,35 @@ python patch_do_patch() {
458 else: 458 else:
459 pname = os.path.basename(unpacked) 459 pname = os.path.basename(unpacked)
460 460
461 if "mindate" in parm: 461 if "mindate" in parm or "maxdate" in parm:
462 mindate = parm["mindate"] 462 pn = bb.data.getVar('PN', d, 1)
463 else: 463 srcdate = bb.data.getVar('SRCDATE_%s' % pn, d, 1)
464 mindate = 0 464 if not srcdate:
465 465 srcdate = bb.data.getVar('SRCDATE', d, 1)
466 if "maxdate" in parm:
467 maxdate = parm["maxdate"]
468 else:
469 maxdate = "20711226"
470
471 pn = bb.data.getVar('PN', d, 1)
472 srcdate = bb.data.getVar('SRCDATE_%s' % pn, d, 1)
473 466
474 if not srcdate: 467 if srcdate == "now":
475 srcdate = bb.data.getVar('SRCDATE', d, 1) 468 srcdate = bb.data.getVar('DATE', d, 1)
476 469
477 if srcdate == "now": 470 if "maxdate" in parm and parm["maxdate"] < srcdate:
478 srcdate = bb.data.getVar('DATE', d, 1)
479
480 if (maxdate < srcdate) or (mindate > srcdate):
481 if (maxdate < srcdate):
482 bb.note("Patch '%s' is outdated" % pname) 471 bb.note("Patch '%s' is outdated" % pname)
472 continue
483 473
484 if (mindate > srcdate): 474 if "mindate" in parm and parm["mindate"] > srcdate:
485 bb.note("Patch '%s' is predated" % pname) 475 bb.note("Patch '%s' is predated" % pname)
476 continue
486 477
487 continue 478
479 if "minrev" in parm:
480 srcrev = bb.data.getVar('SRCREV', d, 1)
481 if srcrev and srcrev < parm["minrev"]:
482 bb.note("Patch '%s' applies to later revisions" % pname)
483 continue
484
485 if "maxrev" in parm:
486 srcrev = bb.data.getVar('SRCREV', d, 1)
487 if srcrev and srcrev > parm["maxrev"]:
488 bb.note("Patch '%s' applies to earlier revisions" % pname)
489 continue
488 490
489 bb.note("Applying patch '%s'" % pname) 491 bb.note("Applying patch '%s'" % pname)
490 try: 492 try: