All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1]distro_check: Fix a bug when creating log file
@ 2011-05-14  5:55 Mei Lei
  2011-05-14  5:55 ` [PATCH 1/1] distro_check: Fix a bug in distro_check.py Mei Lei
  0 siblings, 1 reply; 2+ messages in thread
From: Mei Lei @ 2011-05-14  5:55 UTC (permalink / raw)
  To: poky

From: Mei Lei <lei.mei@intel.com>

Hi Saul,
	This patch fix a bug when creating log file, because we have created the log file in check_eventhandler, we need to remove the create log process in save_distro_check_result.

Thanks
Lei 

Pull URL: git://git.pokylinux.org/poky-contrib.git
  Branch: lmei3/licensecheck
  Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=lmei3/licensecheck

Thanks,
    Mei Lei <lei.mei@intel.com>
---


Mei Lei (1):
  distro_check: Fix a bug in distro_check.py

 meta/classes/distrodata.bbclass |    9 +++++++--
 meta/lib/oe/distro_check.py     |    9 +--------
 2 files changed, 8 insertions(+), 10 deletions(-)



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] distro_check: Fix a bug in distro_check.py
  2011-05-14  5:55 [PATCH 0/1]distro_check: Fix a bug when creating log file Mei Lei
@ 2011-05-14  5:55 ` Mei Lei
  0 siblings, 0 replies; 2+ messages in thread
From: Mei Lei @ 2011-05-14  5:55 UTC (permalink / raw)
  To: poky

From: Mei Lei <lei.mei@intel.com>

distro_check.py: Fix a bug when creating log file, due to we have created the log file in check_eventhandler, we need to remove the log generate process in save_distro_check_result.
distrodata.bbclass: Sync with distro_check.py change.

Signed-off-by: Mei Lei <lei.mei@intel.com>
---
 meta/classes/distrodata.bbclass |    9 +++++++--
 meta/lib/oe/distro_check.py     |    9 +--------
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/meta/classes/distrodata.bbclass b/meta/classes/distrodata.bbclass
index 58a2cf7..b6c2c72 100644
--- a/meta/classes/distrodata.bbclass
+++ b/meta/classes/distrodata.bbclass
@@ -644,7 +644,7 @@ python check_eventhandler() {
         datetime = bb.data.getVar('DATETIME', e.data, 1)
         """initialize log files."""
         import oe.distro_check as dc
-        logfile = dc.create_log_file(e.data,"distrocheck.csv")
+        result_file = dc.create_log_file(e.data,"distrocheck.csv")
     return
 }
 
@@ -653,10 +653,15 @@ do_distro_check[nostamp] = "1"
 python do_distro_check() {
     """checks if the package is present in other public Linux distros"""
     import oe.distro_check as dc
+    import bb
+    import shutil
     localdata = bb.data.createCopy(d)
     bb.data.update_data(localdata)
     tmpdir = bb.data.getVar('TMPDIR', d, 1)
     distro_check_dir = os.path.join(tmpdir, "distro_check")
+    logpath = bb.data.getVar('LOG_DIR', d, 1)
+    bb.utils.mkdirhier(logpath)
+    result_file = os.path.join(logpath, "distrocheck.csv")
     datetime = bb.data.getVar('DATETIME', localdata, 1)
     dc.update_distro_data(distro_check_dir, datetime)
 
@@ -664,7 +669,7 @@ python do_distro_check() {
     result = dc.compare_in_distro_packages_list(distro_check_dir, d)
 
     # save the results
-    dc.save_distro_check_result(result, datetime, d)
+    dc.save_distro_check_result(result, datetime, result_file, d)
 }
 
 addtask distro_checkall after do_distro_check
diff --git a/meta/lib/oe/distro_check.py b/meta/lib/oe/distro_check.py
index 134e92a..e00215a 100644
--- a/meta/lib/oe/distro_check.py
+++ b/meta/lib/oe/distro_check.py
@@ -356,7 +356,7 @@ def create_log_file(d, logname):
     return logfile
 
 
-def save_distro_check_result(result, datetime, d):
+def save_distro_check_result(result, datetime, result_file, d):
     pn = bb.data.getVar('PN', d, True)
     logdir = bb.data.getVar('LOG_DIR', d, True)
     if not logdir:
@@ -364,16 +364,9 @@ def save_distro_check_result(result, datetime, d):
         return
     if not os.path.isdir(logdir):
         os.makedirs(logdir)
-    result_file = os.path.join(logdir, "distrocheck.%s.csv" % datetime)
     line = pn
     for i in result:
         line = line + "," + i
-    if not os.path.exists(result_file):
-        sresult_file = os.path.join(logdir, "distrocheck.csv")
-	if os.path.exists(sresult_file):
-	    os.remove(sresult_file)
-	os.system("touch %s" % result_file)
-	os.symlink(result_file, sresult_file)
     f = open(result_file, "a")
     import fcntl
     fcntl.lockf(f, fcntl.LOCK_EX)
-- 
1.6.3.3



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-14  5:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-14  5:55 [PATCH 0/1]distro_check: Fix a bug when creating log file Mei Lei
2011-05-14  5:55 ` [PATCH 1/1] distro_check: Fix a bug in distro_check.py Mei Lei

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.