bash-4.3 interprets the line MY_P="${P/_/~}" as "replace the underscore with full homepath" so the result leads to "grub-2.02/var/tmp/portage/sys-boot/grub-2.02_beta2/homedirbeta2" instead of "grub-2.02~beta2" I have no idea how to fix this easily as bash-4.2 has a bug which prevents simple escaping of the tilde character from working correctly (see URL). Examples: replace_with_tilde() { P="2.02_beta2" ; echo "${P/_/~}" ; echo "${P/_/\~}" ; } bash-4.2.45: ~% replace_with_tilde 2.02~beta2 2.02\~beta2 bash-4.3.0: ~% replace_with_tilde 2.02/home/polynomial-cbeta2 2.02~beta2
should be all set now in the tree; thanks for the report! Commit message: Use single quotes around ~ to get consistent behavior in <=bash-4.2 and >=bash-4.3 versions http://sources.gentoo.org/sys-boot/grub/grub-2.00_p5107-r2.ebuild?r1=1.6&r2=1.7 http://sources.gentoo.org/sys-boot/grub/grub-2.02_beta2.ebuild?r1=1.3&r2=1.4 http://sources.gentoo.org/sys-boot/grub/grub-9999-r1.ebuild?r1=1.12&r2=1.13