The following code fragment in ebuild.sh (dyn_preinst function is incorrect) # remove share dir if unnessesary if hasq nodoc $FEATURES -o hasq noman $FEATURES -o hasq noinfo $FEATURES; then rmdir "${IMAGE}/usr/share" &> /dev/null fi 1. Unless I'm wrong -o is an "or" when "and" seems more logical 2. /usr/share can contain files that are not related to doc, man or info. There are generally shared configation files of a particular package. Logic shoud be (imho) if /usr/share is empty remove it. rmdir --ignore-fail-on-non-empty "${IMAGE}/usr/share" maybe?
If the directory is empty, it is removed... The or'ing simply prevents it from attempting to remove it without a reason. Above that code there are conditions to remove the subcomponents. It's not a forced unlink.