If I have in pkg_pretend free space check it fails because old failed build is still located in the /var/tmp/portage/. I think portage should wipe out folders for all to-be-emerged packages prior running the pretend checks.
You're only talking about the temp directory that belongs to the current package, right? It wouldn't necessarily be safe to clean up any other ones, since the user might be using them to diagnose other build failures.
This is fixed in git: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=001970d23ff76b451a60ecdc9075344ee8e3c7d5
This is fixed in 2.1.10.35 and 2.2.0_alpha75.
(In reply to comment #3) > This is fixed in 2.1.10.35 and 2.2.0_alpha75. There was a bug that prevented the code from working correctly: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7a0a0a1dc02487b08f47fef129a29e18f7c226a0 It's fixed in 2.1.10.42 and 2.2.0_alpha82.