diff options
| author | Saul Wold <Saul.Wold@intel.com> | 2010-08-26 19:46:40 -0700 |
|---|---|---|
| committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-09-02 09:38:35 +0100 |
| commit | 68385456af93a6a80c558676fd176e3ec81c9183 (patch) | |
| tree | dca279051ea1de9bb274f7af03f8f112d9c1cf20 /meta/classes/utility-tasks.bbclass | |
| parent | 444e44806530e90300135cc66cf7d160beb1b4be (diff) | |
| download | poky-68385456af93a6a80c558676fd176e3ec81c9183.tar.gz | |
distro_check: fix for natives, cross, and initial recipe types
datetime checking is changed to be once per day
Signed-off-by: Saul Wold <Saul.Wold@intel.com>
distro_check: fix for natives, cross, and initial recipe types
Signed-off-by: Saul Wold <Saul.Wold@intel.com>
Diffstat (limited to 'meta/classes/utility-tasks.bbclass')
| -rw-r--r-- | meta/classes/utility-tasks.bbclass | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/meta/classes/utility-tasks.bbclass b/meta/classes/utility-tasks.bbclass index b3609965e7..8e905308be 100644 --- a/meta/classes/utility-tasks.bbclass +++ b/meta/classes/utility-tasks.bbclass | |||
| @@ -488,6 +488,31 @@ do_buildall() { | |||
| 488 | : | 488 | : |
| 489 | } | 489 | } |
| 490 | 490 | ||
| 491 | addhandler check_eventhandler | ||
| 492 | python check_eventhandler() { | ||
| 493 | from bb.event import Handled, NotHandled | ||
| 494 | # if bb.event.getName(e) == "TaskStarted": | ||
| 495 | |||
| 496 | if bb.event.getName(e) == "BuildStarted": | ||
| 497 | import oe.distro_check as dc | ||
| 498 | tmpdir = bb.data.getVar('TMPDIR', e.data, 1) | ||
| 499 | distro_check_dir = os.path.join(tmpdir, "distro_check") | ||
| 500 | datetime = bb.data.getVar('DATETIME', e.data, 1) | ||
| 501 | """initialize log files.""" | ||
| 502 | logpath = bb.data.getVar('LOG_DIR', e.data, 1) | ||
| 503 | bb.utils.mkdirhier(logpath) | ||
| 504 | logfile = os.path.join(logpath, "distrocheck.%s.csv" % bb.data.getVar('DATETIME', e.data, 1)) | ||
| 505 | if not os.path.exists(logfile): | ||
| 506 | slogfile = os.path.join(logpath, "distrocheck.csv") | ||
| 507 | if os.path.exists(slogfile): | ||
| 508 | os.remove(slogfile) | ||
| 509 | os.system("touch %s" % logfile) | ||
| 510 | os.symlink(logfile, slogfile) | ||
| 511 | bb.data.setVar('LOG_FILE', logfile, e.data) | ||
| 512 | |||
| 513 | return NotHandled | ||
| 514 | } | ||
| 515 | |||
| 491 | addtask distro_check | 516 | addtask distro_check |
| 492 | do_distro_check[nostamp] = "1" | 517 | do_distro_check[nostamp] = "1" |
| 493 | python do_distro_check() { | 518 | python do_distro_check() { |
| @@ -495,12 +520,9 @@ python do_distro_check() { | |||
| 495 | import oe.distro_check as dc | 520 | import oe.distro_check as dc |
| 496 | localdata = bb.data.createCopy(d) | 521 | localdata = bb.data.createCopy(d) |
| 497 | bb.data.update_data(localdata) | 522 | bb.data.update_data(localdata) |
| 498 | 523 | tmpdir = bb.data.getVar('TMPDIR', d, 1) | |
| 499 | tmpdir = bb.data.getVar('TMPDIR', localdata, 1) | ||
| 500 | distro_check_dir = os.path.join(tmpdir, "distro_check") | 524 | distro_check_dir = os.path.join(tmpdir, "distro_check") |
| 501 | datetime = bb.data.getVar('DATETIME', localdata, 1) | 525 | datetime = bb.data.getVar('DATETIME', localdata, 1) |
| 502 | |||
| 503 | # if distro packages list data is old then rebuild it | ||
| 504 | dc.update_distro_data(distro_check_dir, datetime) | 526 | dc.update_distro_data(distro_check_dir, datetime) |
| 505 | 527 | ||
| 506 | # do the comparison | 528 | # do the comparison |
| @@ -510,3 +532,10 @@ python do_distro_check() { | |||
| 510 | dc.save_distro_check_result(result, datetime, d) | 532 | dc.save_distro_check_result(result, datetime, d) |
| 511 | } | 533 | } |
| 512 | 534 | ||
| 535 | addtask distro_checkall after do_distro_check | ||
| 536 | do_distro_checkall[recrdeptask] = "do_distro_check" | ||
| 537 | do_distro_checkall[nostamp] = "1" | ||
| 538 | do_distro_checkall() { | ||
| 539 | : | ||
| 540 | } | ||
| 541 | |||
