Lines 346-358
def _prepare_workdir(mysettings):
Link Here
|
346 |
writemsg(_unicode_decode("!!! %s: %s\n") % |
346 |
writemsg(_unicode_decode("!!! %s: %s\n") % |
347 |
(_("Permission Denied"), log_subdir), noiselevel=-1) |
347 |
(_("Permission Denied"), log_subdir), noiselevel=-1) |
348 |
|
348 |
|
|
|
349 |
tmpdir_log_path = os.path.join( |
350 |
mysettings["T"], "build.log%s" % compress_log_ext) |
349 |
if not logdir_subdir_ok: |
351 |
if not logdir_subdir_ok: |
350 |
# NOTE: When sesandbox is enabled, the local SELinux security policies |
352 |
# NOTE: When sesandbox is enabled, the local SELinux security policies |
351 |
# may not allow output to be piped out of the sesandbox domain. The |
353 |
# may not allow output to be piped out of the sesandbox domain. The |
352 |
# current policy will allow it to work when a pty is available, but |
354 |
# current policy will allow it to work when a pty is available, but |
353 |
# not through a normal pipe. See bug #162404. |
355 |
# not through a normal pipe. See bug #162404. |
354 |
mysettings["PORTAGE_LOG_FILE"] = os.path.join( |
356 |
mysettings["PORTAGE_LOG_FILE"] = tmpdir_log_path |
355 |
mysettings["T"], "build.log%s" % compress_log_ext) |
357 |
else: |
|
|
358 |
# Create a symlink from tmpdir_log_path to PORTAGE_LOG_FILE, as |
359 |
# requested in bug #412865. |
360 |
make_new_symlink = False |
361 |
try: |
362 |
target = os.readlink(tmpdir_log_path) |
363 |
except OSError: |
364 |
make_new_symlink = True |
365 |
else: |
366 |
if target != mysettings["PORTAGE_LOG_FILE"]: |
367 |
make_new_symlink = True |
368 |
if make_new_symlink: |
369 |
try: |
370 |
os.unlink(tmpdir_log_path) |
371 |
except OSError: |
372 |
pass |
373 |
os.symlink(mysettings["PORTAGE_LOG_FILE"], tmpdir_log_path) |
356 |
|
374 |
|
357 |
def _ensure_log_subdirs(logdir, subdir): |
375 |
def _ensure_log_subdirs(logdir, subdir): |
358 |
""" |
376 |
""" |