[MacPorts] #30584: setupenv.bash misses to declare some variables as local, cluttering shell env

MacPorts noreply at macports.org
Wed Aug 3 23:54:46 PDT 2011


#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


More information about the macports-tickets mailing list