Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 503860

Summary: sys-boot/grub-2.02_beta2 ebuild fails with >=app-shells/bash-4.3
Product: Gentoo Linux Reporter: Lars Wendler (Polynomial-C) (RETIRED) <polynomial-c>
Component: [OLD] Core systemAssignee: Mike Gilbert <floppym>
Status: RESOLVED FIXED    
Severity: normal CC: base-system
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00038.html
Whiteboard:
Package list:
Runtime testing required: ---

Description Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2014-03-08 12:51:43 UTC
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
Comment 1 SpanKY gentoo-dev 2014-03-09 07:12:52 UTC
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