Closed konsolebox closed 6 months ago
Everything after #
gets stripped from package_url a few lines above the line you've linked: https://github.com/rbenv/ruby-build/blob/0aefaa4e30428a895d74f603e04f7731fa7e026f/bin/ruby-build#L468-L470
Seems like this no longer works in Bash 5.3: ${package_url/\#}
I sent a bug report to bug-bash but maybe these issues can be avoided by using [[ $str != pattern ]]
. There's no reason to make it POSIX compatible.
Bash devel branch has fixed the issue and I just tested ruby-build works again so I'm closing this now, thanks.
Thanks for reporting! I'm all for accepting a PR switching to [[ str != pattern ]]
if bash 5.3 is already widely distributed and if it will take a while for the patch to roll out to package managers. But it's good to know this has been fixed.
Semi-related: something that I found out (in a different repo) the hard way is that newer versions of bash expand the ~
as a pathname in the expression ${str/pattern/~}
, while bash 3.2 interprets it as a literal. For newer versions of bash, the solution is to backslash-escape the ~
sign, but in bash 3.2 the replacement would result in a literal \~
. I couldn't find a way to make it work across bash versions, so I just rewrote the expression using different string replacement methods.
Thanks for reporting! I'm all for accepting a PR switching to
[[ str != pattern ]]
if bash 5.3 is already widely distributed and if it will take a while for the patch to roll out to package managers. But it's good to know this has been fixed.
Well Bash 5.3 is still in alpha stage so you don't have to worry. It's basically a use at your own risk version. In Gentoo for example, it doesn't even have a keyword. I OTOH prefer to install it (and sometimes the devel branch version) so I can find issues like this.
https://github.com/rbenv/ruby-build/blob/0aefaa4e30428a895d74f603e04f7731fa7e026f/bin/ruby-build#L484
If
package_url
is likehttps://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0.tar.bz2#7aa247a19622a803bdd29fdb28108de9798abe841254fe8ea82c31d125c6ab26
, that condition fails.Perhaps change it to: