Skip Menu |

This queue is for tickets about the App-perlbrew CPAN distribution.

Report information
The Basics
Id: 66518
Status: resolved
Priority: 0/
Queue: App-perlbrew

People
Owner: Nobody in particular
Requestors: chad.a.davis [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.17
Fixed in: (no value)



Subject: noclobber shell option prevents switch
The bash shell option 'noclobber' (which prevents accidental overwriting of existing files when using shell redirection) prevents Perlbrew from being able to switch perls. This seems to be due to __perlbrew_reinit() which creates $HOME/.perlbrew/init anew using shell redirection. This can be fixed by writing the redirection as (patch attached): echo '# DO NOT EDIT THIS FILE' >| $HOME/.perlbrew/init When the noclobber shell option is not set, the semantics will be the same.
Subject: noclobber.patch
--- perl5/perlbrew/etc/bashrc.bak 2011-03-10 11:47:26.627288000 +0100 +++ perl5/perlbrew/etc/bashrc 2011-03-10 11:47:42.155910000 +0100 @@ -9,7 +9,7 @@ mkdir -p $HOME/.perlbrew fi - echo '# DO NOT EDIT THIS FILE' > $HOME/.perlbrew/init + echo '# DO NOT EDIT THIS FILE' >| $HOME/.perlbrew/init command perlbrew $short_option env $1 >> $HOME/.perlbrew/init source $HOME/.perlbrew/init __perlbrew_set_path
On Thu Mar 10 06:09:01 2011, chad.a.davis@gmail.com wrote: Show quoted text
> The bash shell option 'noclobber' (which prevents accidental overwriting > of existing files when using shell redirection) prevents Perlbrew from > being able to switch perls. > > This seems to be due to __perlbrew_reinit() which creates > $HOME/.perlbrew/init anew using shell redirection. > > This can be fixed by writing the redirection as (patch attached): > > echo '# DO NOT EDIT THIS FILE' >| $HOME/.perlbrew/init > > When the noclobber shell option is not set, the semantics will be the > same. >
Awesome catch! This might be the cause of some many "perlbrew switch is not working" I've seen from time to time. Thanks a lot!
The patch is in the develop branch now, at https://github.com/gugod/App- perlbrew/tree/develop. It will be released in 0.18. Thanks again!