If I'm upgrading a package which uses pkg_pretend(), I get three logfiles: x11-drivers:xf86-input-synaptics-1.6.2:20120727-071032.log x11-drivers:xf86-input-synaptics-1.6.2:20120727-071040.log x11-drivers:xf86-input-synaptics-1.6.2:20120727-071120.log The first one contains just the pkg_pretend() output. The second one contains the complete merge output (including unmerge of the older version), and the third one contains only the unmerge output. I believe there's no good reason to keep those logs separate, and it will be beneficial to keep them as one. Especially that introducing multiple logfiles per build make it really painful to find the 'previous' or 'three builds earlier' log.
The current behavior is implemented by linking the timestamp of $PORTAGE_BUILDDIR/.logid to log file that's named with the same timestamp. Since pkg_pretend and packages being unmerged each have a separate $PORTAGE_BUILDDIR, they get different logs. In order to share a single log, then we'll have to replace $PORTAGE_BUILDDIR/.logid with some other approach. The nice thing about $PORTAGE_BUILDDIR/.logid is that it works across multiple invocations of ebuild(1) with the same build dir, and also works with emerge when FEATURES=keepwork is enabled.
(In reply to comment #1) > The current behavior is implemented by linking the timestamp of > $PORTAGE_BUILDDIR/.logid to log file that's named with the same timestamp. > Since pkg_pretend and packages being unmerged each have a separate > $PORTAGE_BUILDDIR, they get different logs. Hmm, but then why the unmerge output is in the 'middle' log as well?
Unmerge has an entirely separate $PORTAGE_BUILDDIR, since it's a separate package instance with its own saved environment. It's located inside the $PORTAGE_TMPDIR/.unmerge directory.