=sys-apps/portage-2.2_rc33 in ebuild.sh defines PATH likes this: PATH=$PORTAGE_BIN_PATH/ebuild-helpers:$PREROOTPATH${PREROOTPATH:+:}/usr/local/sbin:/sbin:/usr/sbin:/usr/local/bin:/bin:/usr/bin${ROOTPATH:+:}$ROOTPATH Is there any real reason to keep /bin and /sbin before /usr ones? In my opinion, /usr/*bin should be placed before /*bin in $PATH. Firstly, /*bin can contain some kind of stripped down versions of utilities which doesn't require /usr to be mounted. And then /usr/*bin would contain full-featured versions which should be used instead if /usr is available. Secondly, this $PATH already contains /usr/local/*bin before /*bin and thus allows user to override root binaries with /usr/local ones. To keep the hierarchy clean we should allow /usr ones to override them too. Moreover, this is the way /etc/profile by default (=baselayout-2.0.1) defines PATH. Thus, if there's no real reason to keep /*bin before /usr/*bin in portage-defined PATH, I think the PATH definition should be modified to: PATH=$PORTAGE_BIN_PATH/ebuild-helpers:$PREROOTPATH${PREROOTPATH:+:}/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin${ROOTPATH:+:}$ROOTPATH
Created attachment 197675 [details, diff] Patch to change $PATH set by ebuild.sh
Thanks, this is in svn r13935. I copied the order from /etc/profile: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
This is fixed in 2.2_rc37.
Not released in 2.1.*.
This is fixed in 2.1.7.