summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaul Wold <Saul.Wold@intel.com>2010-08-26 19:46:40 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2010-09-02 09:38:35 +0100
commit68385456af93a6a80c558676fd176e3ec81c9183 (patch)
treedca279051ea1de9bb274f7af03f8f112d9c1cf20
parent444e44806530e90300135cc66cf7d160beb1b4be (diff)
downloadopenembedded-core-68385456af93a6a80c558676fd176e3ec81c9183.tar.gz
openembedded-core-68385456af93a6a80c558676fd176e3ec81c9183.tar.bz2
openembedded-core-68385456af93a6a80c558676fd176e3ec81c9183.zip
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>
-rw-r--r--meta/classes/utility-tasks.bbclass37
-rw-r--r--meta/lib/oe/distro_check.py33
2 files changed, 62 insertions, 8 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() {
:
}
+addhandler check_eventhandler
+python check_eventhandler() {
+ from bb.event import Handled, NotHandled
+ # if bb.event.getName(e) == "TaskStarted":
+
+ if bb.event.getName(e) == "BuildStarted":
+ import oe.distro_check as dc
+ tmpdir = bb.data.getVar('TMPDIR', e.data, 1)
+ distro_check_dir = os.path.join(tmpdir, "distro_check")
+ datetime = bb.data.getVar('DATETIME', e.data, 1)
+ """initialize log files."""
+ logpath = bb.data.getVar('LOG_DIR', e.data, 1)
+ bb.utils.mkdirhier(logpath)
+ logfile = os.path.join(logpath, "distrocheck.%s.csv" % bb.data.getVar('DATETIME', e.data, 1))
+ if not os.path.exists(logfile):
+ slogfile = os.path.join(logpath, "distrocheck.csv")
+ if os.path.exists(slogfile):
+ os.remove(slogfile)
+ os.system("touch %s" % logfile)
+ os.symlink(logfile, slogfile)
+ bb.data.setVar('LOG_FILE', logfile, e.data)
+
+ return NotHandled
+}
+
addtask distro_check
do_distro_check[nostamp] = "1"
python do_distro_check() {
@@ -495,12 +520,9 @@ python do_distro_check() {
import oe.distro_check as dc
localdata = bb.data.createCopy(d)
bb.data.update_data(localdata)
-
- tmpdir = bb.data.getVar('TMPDIR', localdata, 1)
+ tmpdir = bb.data.getVar('TMPDIR', d, 1)
distro_check_dir = os.path.join(tmpdir, "distro_check")
datetime = bb.data.getVar('DATETIME', localdata, 1)
-
- # if distro packages list data is old then rebuild it
dc.update_distro_data(distro_check_dir, datetime)
# do the comparison
@@ -510,3 +532,10 @@ python do_distro_check() {
dc.save_distro_check_result(result, datetime, d)
}
+addtask distro_checkall after do_distro_check
+do_distro_checkall[recrdeptask] = "do_distro_check"
+do_distro_checkall[nostamp] = "1"
+do_distro_checkall() {
+ :
+}
+
diff --git a/meta/lib/oe/distro_check.py b/meta/lib/oe/distro_check.py
index 58972585a6..3f61630d1a 100644
--- a/meta/lib/oe/distro_check.py
+++ b/meta/lib/oe/distro_check.py
@@ -230,7 +230,7 @@ def update_distro_data(distro_check_dir, datetime):
f = open(datetime_file, "r+b")
fcntl.lockf(f, fcntl.LOCK_EX)
saved_datetime = f.read()
- if saved_datetime != datetime:
+ if saved_datetime[0:8] != datetime[0:8]:
bb.note("The build datetime did not match: saved:%s current:%s" % (saved_datetime, datetime))
bb.note("Regenerating distro package lists")
create_distro_packages_list(distro_check_dir)
@@ -247,10 +247,33 @@ def compare_in_distro_packages_list(distro_check_dir, d):
if not os.path.isdir(distro_check_dir):
raise Exception("compare_in_distro_packages_list: invalid distro_check_dir passed")
+ localdata = bb.data.createCopy(d)
pkglst_dir = os.path.join(distro_check_dir, "package_lists")
matching_distros = []
+ pn = bb.data.getVar('PN', d, True)
recipe_name = bb.data.getVar('PN', d, True)
- tmp = bb.data.getVar('DISTRO_PN_ALIAS', d, True)
+ bb.note("Checking: %s" % pn)
+
+ if pn.find("-native") != -1:
+ pnstripped = pn.split("-native")
+ bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + bb.data.getVar('OVERRIDES', d, True), localdata)
+ bb.data.update_data(localdata)
+ recipe_name = pnstripped[0]
+
+ if pn.find("-cross") != -1:
+ pnstripped = pn.split("-cross")
+ bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + bb.data.getVar('OVERRIDES', d, True), localdata)
+ bb.data.update_data(localdata)
+ recipe_name = pnstripped[0]
+
+ if pn.find("-initial") != -1:
+ pnstripped = pn.split("-initial")
+ bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + bb.data.getVar('OVERRIDES', d, True), localdata)
+ bb.data.update_data(localdata)
+ recipe_name = pnstripped[0]
+
+ bb.note("Recipe: %s" % recipe_name)
+ tmp = bb.data.getVar('DISTRO_PN_ALIAS', localdata, True)
distro_pn_aliases = {}
if tmp:
list = tmp.split(' ')
@@ -271,6 +294,8 @@ def compare_in_distro_packages_list(distro_check_dir, d):
f.close()
break
f.close()
+
+ bb.note("Matching: %s" % matching_distros)
return matching_distros
def save_distro_check_result(result, datetime, d):
@@ -281,8 +306,8 @@ def save_distro_check_result(result, datetime, d):
return
if not os.path.isdir(logdir):
os.makedirs(logdir)
- result_file = os.path.join(logdir, "distro_check-" + datetime + ".results")
- line = pn + " : "
+ result_file = os.path.join(logdir, "distrocheck.csv")
+ line = pn + ", "
for i in result:
line = line + i + ", "
if result: