Skip Menu |
 

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

Report information
The Basics
Id: 107817
Status: new
Priority: 0/
Queue: App-perlbrew

People
Owner: Nobody in particular
Requestors: jeff [...] bingham.co
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.73
Fixed in: (no value)



Subject: bashrc __perlbrew_purify function fails on OS X and strips too many PATHs
Download (untitled) / with headers
text/plain 1.3k
Issue 1: On OS X, the read command (in /usr/bin/read) is a generic shell wrapper to convert the command from upper to lowercase then pass it to the shell builtin. However, the wrapper breaks the array assignment of read. For the __perlbrew_purify function under bash, it doesn't assign the array properly. Under zsh the -A argument is passed by the wrapper to the /bin/sh builtin of read which doesn't have an -A argument. Fix for 1: simply call the read command as 'builtin read', like so. $ diff bashrc bashrc-fixed 18c18 < IFS=: read -r${BASH_VERSION+a}${ZSH_VERSION+A} patharray <<< "$1" --- Show quoted text
> IFS=: builtin read -r${BASH_VERSION+a}${ZSH_VERSION+A} patharray <<< "$1"
Issue 2: If your PATH contains multiple directories that contain PERLBREW_ROOT, the __perlbrew_purify function removes them all. For example, before perlbrew, my PATH was set to PATH=${HOME}/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/libexec:/usr/libexec and when I installed perlbrew with PERLBREW_ROOT as /usr/local, it converted my PATH to PATH=/usr/local/bin:${HOME}/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/libexec As you can see, it removed all PATH segments containing /usr/local Fix for #2: Remove the * wildcards around PERLBREW_ROOT when building the new PATH $ diff bashrc bashrc-fixed 22c22 < (*"$PERLBREW_ROOT"*) ;; --- Show quoted text
> ("${PERLBREW_ROOT}") ;;


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.