[prev in list] [next in list] [prev in thread] [next in thread] 

List:       macports-users
Subject:    Re: Problems With Mysql57
From:       Bjarne D Mathiesen <macintosh () mathiesen ! info>
Date:       2019-08-16 22:43:37
Message-ID: 66c0592f-c084-b2a6-d85f-0338556dc6c1 () mathiesen ! info
[Download RAW message or body]



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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic