diff options
Diffstat (limited to 'bitbake/lib/bb/build.py')
| -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 1d0ae463c1..0e2b8bf2f5 100644 --- a/bitbake/lib/bb/build.py +++ b/bitbake/lib/bb/build.py | |||
| @@ -122,9 +122,22 @@ def exec_func(func, d, dirs = None): | |||
| 122 | if not t: | 122 | if not t: |
| 123 | raise SystemExit("T variable not set, unable to build") | 123 | raise SystemExit("T variable not set, unable to build") |
| 124 | bb.utils.mkdirhier(t) | 124 | bb.utils.mkdirhier(t) |
| 125 | loglink = "%s/log.%s" % (t, func) | ||
| 125 | logfile = "%s/log.%s.%s" % (t, func, str(os.getpid())) | 126 | logfile = "%s/log.%s.%s" % (t, func, str(os.getpid())) |
| 126 | runfile = "%s/run.%s.%s" % (t, func, str(os.getpid())) | 127 | runfile = "%s/run.%s.%s" % (t, func, str(os.getpid())) |
| 127 | 128 | ||
| 129 | # Even though the log file has not yet been opened, lets create the link | ||
| 130 | if loglink: | ||
| 131 | try: | ||
| 132 | os.remove(loglink) | ||
| 133 | except OSError as e: | ||
| 134 | pass | ||
| 135 | |||
| 136 | try: | ||
| 137 | os.symlink(logfile, loglink) | ||
| 138 | except OSError as e: | ||
| 139 | pass | ||
| 140 | |||
| 128 | # Change to correct directory (if specified) | 141 | # Change to correct directory (if specified) |
| 129 | if adir and os.access(adir, os.F_OK): | 142 | if adir and os.access(adir, os.F_OK): |
| 130 | os.chdir(adir) | 143 | os.chdir(adir) |
| @@ -200,6 +213,10 @@ def exec_func(func, d, dirs = None): | |||
| 200 | if os.path.exists(logfile) and os.path.getsize(logfile) == 0: | 213 | if os.path.exists(logfile) and os.path.getsize(logfile) == 0: |
| 201 | bb.msg.debug(2, bb.msg.domain.Build, "Zero size logfile %s, removing" % logfile) | 214 | bb.msg.debug(2, bb.msg.domain.Build, "Zero size logfile %s, removing" % logfile) |
| 202 | os.remove(logfile) | 215 | os.remove(logfile) |
| 216 | try: | ||
| 217 | os.remove(loglink) | ||
| 218 | except OSError as e: | ||
| 219 | pass | ||
| 203 | 220 | ||
| 204 | # Close the backup fds | 221 | # Close the backup fds |
| 205 | os.close(osi[0]) | 222 | os.close(osi[0]) |
