diff options
Diffstat (limited to 'meta/lib/oe/distro_check.py')
| -rw-r--r-- | meta/lib/oe/distro_check.py | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/meta/lib/oe/distro_check.py b/meta/lib/oe/distro_check.py index c85d4fb28b..55cdcad461 100644 --- a/meta/lib/oe/distro_check.py +++ b/meta/lib/oe/distro_check.py | |||
| @@ -73,7 +73,8 @@ def clean_package_list(package_list): | |||
| 73 | def get_latest_released_meego_source_package_list(): | 73 | def get_latest_released_meego_source_package_list(): |
| 74 | "Returns list of all the name os packages in the latest meego distro" | 74 | "Returns list of all the name os packages in the latest meego distro" |
| 75 | 75 | ||
| 76 | 76 | if not os.path.isfile("/tmp/Meego-1.0"): | |
| 77 | os.mknod("/tmp/Meego-1.0") | ||
| 77 | f = open("/tmp/Meego-1.0", "r") | 78 | f = open("/tmp/Meego-1.0", "r") |
| 78 | package_names = [] | 79 | package_names = [] |
| 79 | for line in f: | 80 | for line in f: |
| @@ -341,7 +342,22 @@ def compare_in_distro_packages_list(distro_check_dir, d): | |||
| 341 | bb.note("Matching: %s" % matching_distros) | 342 | bb.note("Matching: %s" % matching_distros) |
| 342 | return matching_distros | 343 | return matching_distros |
| 343 | 344 | ||
| 344 | def save_distro_check_result(result, datetime, d): | 345 | def create_log_file(d, logname): |
| 346 | logpath = bb.data.getVar('LOG_DIR', d, True) | ||
| 347 | bb.utils.mkdirhier(logpath) | ||
| 348 | logfn, logsuffix = os.path.splitext(logname) | ||
| 349 | logfile = os.path.join(logpath, "%s.%s%s" % (logfn, bb.data.getVar('DATETIME', d, True), logsuffix)) | ||
| 350 | if not os.path.exists(logfile): | ||
| 351 | slogfile = os.path.join(logpath, logname) | ||
| 352 | if os.path.exists(slogfile): | ||
| 353 | os.remove(slogfile) | ||
| 354 | os.system("touch %s" % logfile) | ||
| 355 | os.symlink(logfile, slogfile) | ||
| 356 | bb.data.setVar('LOG_FILE', logfile, d) | ||
| 357 | return logfile | ||
| 358 | |||
| 359 | |||
| 360 | def save_distro_check_result(result, datetime, result_file, d): | ||
| 345 | pn = bb.data.getVar('PN', d, True) | 361 | pn = bb.data.getVar('PN', d, True) |
| 346 | logdir = bb.data.getVar('LOG_DIR', d, True) | 362 | logdir = bb.data.getVar('LOG_DIR', d, True) |
| 347 | if not logdir: | 363 | if not logdir: |
| @@ -349,16 +365,9 @@ def save_distro_check_result(result, datetime, d): | |||
| 349 | return | 365 | return |
| 350 | if not os.path.isdir(logdir): | 366 | if not os.path.isdir(logdir): |
| 351 | os.makedirs(logdir) | 367 | os.makedirs(logdir) |
| 352 | result_file = os.path.join(logdir, "distrocheck.%s.csv" % datetime) | ||
| 353 | line = pn | 368 | line = pn |
| 354 | for i in result: | 369 | for i in result: |
| 355 | line = line + "," + i | 370 | line = line + "," + i |
| 356 | if not os.path.exists(result_file): | ||
| 357 | sresult_file = os.path.join(logdir, "distrocheck.csv") | ||
| 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") | 371 | f = open(result_file, "a") |
| 363 | import fcntl | 372 | import fcntl |
| 364 | fcntl.lockf(f, fcntl.LOCK_EX) | 373 | fcntl.lockf(f, fcntl.LOCK_EX) |
