Ryan Schmidt wrote:
> Looking at the port select code, it just tries to create each symlink in 
> turn. There isn't any special error handling code to deal with the case that 
> a symlink can't be created; if that happens, an error will occur and MacPorts 
> will exit. Any symlinks that were already successfully created will remain on 
> disk. This would leave you with an incomplete or possibly even inconsistent 
> set of symlinks. 
> 
> Somebody should fix the bug in the mysql57 port. If you'd like to do so, you 
> can submit a pull request in macports-ports. 

Until it's fixed, this bash script ought to fix this issue :

#!<prefix>/bin/bash

# this goes through alle the installed mysql versions
# and removes all links
while read -u 9 portName isActive
do
    while read -u 8 fileName
    do
        link=$( echo "${fileName}" \
              | sed -E -e 's/lib\///' -e "s/${portName}\///" )
        [[ -L "${link}" ]] && rm "${link}"
    done 8< <( port contents ${portName} )
done 9< \
    <(    port -q select --list mysql \
        | grep -v -F 'none' )

# this creates the links for a mysql version given in ${1}
while read -u 8 fileName
do
    link=$( echo "${fileName}" \
          | sed -E -e 's/lib\///' -e "s/${portName}\///" )
    ln -s "${fileName}" "${link}"
done 8< <( port contents ${1} )


-- 
Bjarne D Mathiesen
Korsør ; Danmark ; Europa
----------------------------------------------------------------------
denne besked er skrevet i et (næsten) M$-frit miljø
MacOS X 10.13.6 High Sierra ; 2.8GHz Intel Core i7 ; 16GB 1067MHz DDR3

Reply via email to