diff options
author | Mei Lei <lei.mei@intel.com> | 2011-04-28 22:14:17 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-05-04 00:54:36 +0100 |
commit | 0e2eb05f46192e179912160cc557f274148dcf15 (patch) | |
tree | ea4cadf1e2916aa94a24e751156f73904f30383b /meta/lib/oe/distro_check.py | |
parent | 8e551931feb7ca1baf0f376a956ec6157e5f2890 (diff) | |
download | poky-0e2eb05f46192e179912160cc557f274148dcf15.tar.gz |
distro_check.py: Fix some bugs in distro_check.py
The recipe meta-ide-support's alias is Poky, but not defined in distro_exceptions, this will lead an error.
The compare_in_distro_packages_list function omit a split process, this will lead to a form issue.
Change the log file generate way, use symbolic links link to the latest log file, instead of appending every log file in old log.
(From OE-Core rev: 123a7f49753aef4d5ccb5f5a5590c3c88775c6d0)
Signed-off-by: Mei Lei <lei.mei@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/distro_check.py')
-rw-r--r-- | meta/lib/oe/distro_check.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/meta/lib/oe/distro_check.py b/meta/lib/oe/distro_check.py index d6abd9bfaa..c85d4fb28b 100644 --- a/meta/lib/oe/distro_check.py +++ b/meta/lib/oe/distro_check.py | |||
@@ -302,7 +302,7 @@ def compare_in_distro_packages_list(distro_check_dir, d): | |||
302 | bb.note("Recipe: %s" % recipe_name) | 302 | bb.note("Recipe: %s" % recipe_name) |
303 | tmp = bb.data.getVar('DISTRO_PN_ALIAS', localdata, True) | 303 | tmp = bb.data.getVar('DISTRO_PN_ALIAS', localdata, True) |
304 | 304 | ||
305 | distro_exceptions = dict({"OE-Core":'OE-Core', "OpenedHand":'OpenedHand', "Intel":'Intel', "Upstream":'Upstream', "WindRiver":'Windriver', "OSPDT":'OSPDT Approved'}) | 305 | distro_exceptions = dict({"OE-Core":'OE-Core', "OpenedHand":'OpenedHand', "Intel":'Intel', "Upstream":'Upstream', "WindRiver":'Windriver', "OSPDT":'OSPDT Approved', "Poky":'poky'}) |
306 | 306 | ||
307 | if tmp: | 307 | if tmp: |
308 | list = tmp.split(' ') | 308 | list = tmp.split(' ') |
@@ -335,8 +335,9 @@ def compare_in_distro_packages_list(distro_check_dir, d): | |||
335 | 335 | ||
336 | 336 | ||
337 | if tmp != None: | 337 | if tmp != None: |
338 | matching_distros.append(tmp) | 338 | list = tmp.split(' ') |
339 | 339 | for item in list: | |
340 | matching_distros.append(item) | ||
340 | bb.note("Matching: %s" % matching_distros) | 341 | bb.note("Matching: %s" % matching_distros) |
341 | return matching_distros | 342 | return matching_distros |
342 | 343 | ||
@@ -348,13 +349,17 @@ def save_distro_check_result(result, datetime, d): | |||
348 | return | 349 | return |
349 | if not os.path.isdir(logdir): | 350 | if not os.path.isdir(logdir): |
350 | os.makedirs(logdir) | 351 | os.makedirs(logdir) |
351 | result_file = os.path.join(logdir, "distrocheck.csv") | 352 | result_file = os.path.join(logdir, "distrocheck.%s.csv" % datetime) |
352 | line = pn | 353 | line = pn |
353 | for i in result: | 354 | for i in result: |
354 | line = line + "," + i | 355 | line = line + "," + i |
355 | if not os.path.exists(result_file): | 356 | if not os.path.exists(result_file): |
356 | open(result_file, 'w+b').close() # touch the file so that the next open won't fail | 357 | sresult_file = os.path.join(logdir, "distrocheck.csv") |
357 | f = open(result_file, "a+b") | 358 | if os.path.exists(sresult_file): |
359 | os.remove(sresult_file) | ||
360 | os.system("touch %s" % result_file) | ||
361 | os.symlink(result_file, sresult_file) | ||
362 | f = open(result_file, "a") | ||
358 | import fcntl | 363 | import fcntl |
359 | fcntl.lockf(f, fcntl.LOCK_EX) | 364 | fcntl.lockf(f, fcntl.LOCK_EX) |
360 | f.seek(0, os.SEEK_END) # seek to the end of file | 365 | f.seek(0, os.SEEK_END) # seek to the end of file |