Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#30584 closed enhancement (fixed)

setupenv.bash misses to declare some variables as local, cluttering shell env

Reported by: mp@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 2.1.0
Component: base Version: 2.0.1
Keywords: Cc:

Description (last modified by jmroot (Joshua Root))

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
@@ -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
-    local IFS=":"
     for p in $MANPATH; do
         if [ "$p" == "$mpath" ]; then

Change History (4)

comment:1 Changed 9 years ago by jmroot (Joshua Root)

Description: modified (diff)

Please remember to use WikiFormatting, or better, just add patches as attachments.

comment:2 Changed 9 years ago by mp@…

Cc: mp@… added

Cc Me!

comment:3 Changed 9 years ago by neverpanic (Clemens Lang)

Cc: mp@… removed
Resolution: fixed
Status: newclosed

You don't need to cc yourself.

Fixed in r90601. I didn't use the patch, because setupenv.bash is created by autoconf from and the patch didn't apply against

comment:4 Changed 9 years ago by jmroot (Joshua Root)

Milestone: MacPorts 2.1.0
Note: See TracTickets for help on using tickets.