Many packages out there don't respect $ROOT properly. This results in screwed up "true root" filesystems when you're trying to install something into $ROOT. Portage should prevent this from happening by sandboxing everything outside of $ROOT so you just get a build failure instead of randomly screwed-with files.
hmm, good idea ... i always wondered if we could catch these misbehaving packages
SO, any reason this hasn't been done yet?
nope ... as noted in Bug 152474, we could just:
and add sandbox deny to that
So why don't you do it then? ;)
Created attachment 193215 [details, diff]
Messy sandbox implementation
Untested. Messy. First portage patch ever. Can it get any worse? ;)
This bug is pretty stale, and it looks like no one really cares anymore. I had some time to poke around, so I did the best I could with the (perceived lack of) documentation on portage.
I don't expect you to seriously apply this. What I want to know is if I'm headed in the right direction. If someone could provide more detailed information on what exactly should be done, it might make patching portage a bit easier.