[MacPorts] #30584: setupenv.bash misses to declare some variables as local, cluttering shell env
#30584: setupenv.bash misses to declare some variables as local, cluttering shell env ------------------------------+--------------------------------------------- Reporter: mp@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: base | Version: 2.0.1 Keywords: | Port: ------------------------------+--------------------------------------------- Simple fix: --- setupenv.bash.orig 2011-08-03 23:14:52.000000000 +0200 +++ setupenv.bash 2011-08-03 23:13:11.000000000 +0200 @@ -32,8 +32,9 @@ function export_path() { local binpath="/opt/local/bin" local sbinpath="/opt/local/sbin" - local IFS=":" + local p + for p in $PATH; do if [ "$p" == "$binpath" ]; then binpath="" @@ -54,13 +55,14 @@ } function export_manpath() { - mpath="/opt/local/share/man" + local mpath="/opt/local/share/man" + local IFS=":" + local p if [ -z "$MANPATH" ]; then return fi - local IFS=":" for p in $MANPATH; do if [ "$p" == "$mpath" ]; then mpath="" -- Ticket URL: <https://trac.macports.org/ticket/30584> MacPorts <http://www.macports.org/> Ports system for Mac OS
#30584: setupenv.bash misses to declare some variables as local, cluttering shell env ------------------------------+--------------------------------------------- Reporter: mp@… | Owner: macports-tickets@… Type: enhancement | Status: new Priority: Normal | Milestone: Component: base | Version: 2.0.1 Keywords: | Port: ------------------------------+--------------------------------------------- Old description:
Simple fix:
--- setupenv.bash.orig 2011-08-03 23:14:52.000000000 +0200 +++ setupenv.bash 2011-08-03 23:13:11.000000000 +0200 @@ -32,8 +32,9 @@ function export_path() { local binpath="/opt/local/bin" local sbinpath="/opt/local/sbin" - local IFS=":" + local p + for p in $PATH; do if [ "$p" == "$binpath" ]; then binpath="" @@ -54,13 +55,14 @@ }
function export_manpath() { - mpath="/opt/local/share/man" + local mpath="/opt/local/share/man" + local IFS=":" + local p
if [ -z "$MANPATH" ]; then return fi
- local IFS=":" for p in $MANPATH; do if [ "$p" == "$mpath" ]; then mpath=""
New description: Simple fix: {{{ --- setupenv.bash.orig 2011-08-03 23:14:52.000000000 +0200 +++ setupenv.bash 2011-08-03 23:13:11.000000000 +0200 @@ -32,8 +32,9 @@ function export_path() { local binpath="/opt/local/bin" local sbinpath="/opt/local/sbin" - local IFS=":" + local p + for p in $PATH; do if [ "$p" == "$binpath" ]; then binpath="" @@ -54,13 +55,14 @@ } function export_manpath() { - mpath="/opt/local/share/man" + local mpath="/opt/local/share/man" + local IFS=":" + local p if [ -z "$MANPATH" ]; then return fi - local IFS=":" for p in $MANPATH; do if [ "$p" == "$mpath" ]; then mpath="" }}} -- Comment(by jmr@…): Please remember to use WikiFormatting, or better, just add patches as attachments. -- Ticket URL: <https://trac.macports.org/ticket/30584#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#30584: setupenv.bash misses to declare some variables as local, cluttering shell env -------------------------------+-------------------------------------------- Reporter: mp@… | Owner: macports-tickets@… Type: enhancement | Status: closed Priority: Normal | Milestone: Component: base | Version: 2.0.1 Resolution: fixed | Keywords: Port: | -------------------------------+-------------------------------------------- Changes (by cal@…): * status: new => closed * cc: mp@… (removed) * resolution: => fixed Comment: You don't need to cc yourself. Fixed in r90601. I didn't use the patch, because setupenv.bash is created by autoconf from setupenv.bash.in and the patch didn't apply against setupenv.bash.in. -- Ticket URL: <https://trac.macports.org/ticket/30584#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#30584: setupenv.bash misses to declare some variables as local, cluttering shell env -------------------------------+-------------------------------------------- Reporter: mp@… | Owner: macports-tickets@… Type: enhancement | Status: closed Priority: Normal | Milestone: MacPorts 2.1.0 Component: base | Version: 2.0.1 Resolution: fixed | Keywords: Port: | -------------------------------+-------------------------------------------- Changes (by jmr@…): * milestone: => MacPorts 2.1.0 -- Ticket URL: <https://trac.macports.org/ticket/30584#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts