diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2010-09-30 15:04:18 -0500 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-10-01 18:45:32 +0100 |
commit | 8e429accb89e098b5bdf4f090ff851a1d2dafbf7 (patch) | |
tree | f71c679e1dff2f48b1efe66f18fa3142f60959cf | |
parent | df07008f56676b2fe4dd64e565303d21a6770ed6 (diff) | |
download | openembedded-core-8e429accb89e098b5bdf4f090ff851a1d2dafbf7.tar.gz openembedded-core-8e429accb89e098b5bdf4f090ff851a1d2dafbf7.tar.bz2 openembedded-core-8e429accb89e098b5bdf4f090ff851a1d2dafbf7.tar.xz openembedded-core-8e429accb89e098b5bdf4f090ff851a1d2dafbf7.zip |
build.py: Add a symlink for the logging
[BUGID #375]
When configuring for the log file output, we generate a symlink to the
target filename. This link uses the same file naming, but without the
active pid, making it easier to see which log file is the last one
generated.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
-rw-r--r-- | bitbake/lib/bb/build.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py index 1d0ae463c..0e2b8bf2f 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py @@ -122,9 +122,22 @@ def exec_func(func, d, dirs = None): if not t: raise SystemExit("T variable not set, unable to build") bb.utils.mkdirhier(t) + loglink = "%s/log.%s" % (t, func) logfile = "%s/log.%s.%s" % (t, func, str(os.getpid())) runfile = "%s/run.%s.%s" % (t, func, str(os.getpid())) + # Even though the log file has not yet been opened, lets create the link + if loglink: + try: + os.remove(loglink) + except OSError as e: + pass + + try: + os.symlink(logfile, loglink) + except OSError as e: + pass + # Change to correct directory (if specified) if adir and os.access(adir, os.F_OK): os.chdir(adir) @@ -200,6 +213,10 @@ def exec_func(func, d, dirs = None): if os.path.exists(logfile) and os.path.getsize(logfile) == 0: bb.msg.debug(2, bb.msg.domain.Build, "Zero size logfile %s, removing" % logfile) os.remove(logfile) + try: + os.remove(loglink) + except OSError as e: + pass # Close the backup fds os.close(osi[0]) |