#14452: select.sh produce unneeded warnings when the only option is "-n" --------------------------------+------------------------------------------- Reporter: ebgssth@… | Owner: raimue@… Type: enhancement | Status: closed Priority: Normal | Milestone: Port Enhancements Component: ports | Version: 1.6.0 Resolution: fixed | Keywords: gcc_select python_select select.sh Port: | --------------------------------+------------------------------------------- Changes (by raimue@…): * status: new => closed * resolution: => fixed Old description:
{{{ $ python_select -n /opt/local/bin/python_select: line 83: [: ==: unary operator expected /opt/local/bin/python_select: line 83: [: ==: unary operator expected /opt/local/bin/python_select: line 83: [: ==: unary operator expected /opt/local/bin/python_select: line 83: [: ==: unary operator expected version "" is invalid! }}}
easy fix would be {{{ - if [ ${1} == ${version} ]; then + if [ x${1} == x${version} ]; then }}}
might be better to stop script when python_select called with -n only
New description: {{{ $ python_select -n /opt/local/bin/python_select: line 83: [: ==: unary operator expected /opt/local/bin/python_select: line 83: [: ==: unary operator expected /opt/local/bin/python_select: line 83: [: ==: unary operator expected /opt/local/bin/python_select: line 83: [: ==: unary operator expected version "" is invalid! }}} easy fix would be {{{ - if [ ${1} == ${version} ]; then + if [ x${1} == x${version} ]; then }}} might be better to stop script when python_select called with -n only -- Comment: Fixed with python_select 0.2 in r44662. -- Ticket URL: <http://trac.macports.org/ticket/14452#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS