The following patch allow to define a "MERGE_EXCLUDE" path list in make.conf to prevent portage from installing files at given locations. Entries of the path can be both directories or files paths. Possible uses of this feature are (at least, here is why some people talked about it this last few days on gentoo-dev): - do not install /usr/share/{doc,man} on small size targets - do not install an "updated" /etc/fstab - do not install a few non vanilla files that some people don't like (/etc/cron.daily/updatedb for instance) Limitations: - In a first version of the patch I was also allowing a "MERGE_EXCLUDE_MASK" (same semantics that CONFIG_PROTECT_MASK regarding CONFIG_PROTECT), but in fact it was to slow this way. I think this implementation without mask is far more efficient. - I don't know what would be the right way to deal with symlinks (I mean, for instance, when a target excluded path is in fact a symlink to a non-excluded real directory for instance, should I merge the files?), so I've chosen what was the simpliest (see comments in the patch). But if you think of a better behavior, tell me. Reproducible: Always Steps to Reproduce:
Created attachment 20285 [details, diff] merge-exclude.patch patch is against portage.py from 2.0.49-r{15,16}
Created attachment 20289 [details, diff] merge-exclude.patch ooops... this one sounds better.
lambda is on my bad list, btw. I prefer things written out as functions. Deeply nested anything isn't a good practice. I'm not very inclined to add this feature as it doesn't sound like it would contribute in a positive way to much. fstab doesn't change that often.
The main target was /usr/share/{doc,man,info}, and there is now an adhoc solution for this ones, so I agree this patch is not really needed anymore. I absolutly disagree on lambdas tho... I don't like to define globally (at least class-wise) functions that I use only once in a very specific context and has no meaning anywhere else, as I don't like to do it for variables. But I think it's a matter of culture, and a debate on this would be endless, pointless, useless. Next time I touch portage code, I will try to temporary forget that lambda exists...
This functionality has been implemented in various forms so far... either custom INSTALL_MASK + bashrc trickery, or noman feature (fex).