[95144] trunk/dports/sysutils

raimue at macports.org raimue at macports.org
Thu Jul 5 15:14:48 PDT 2012


Revision: 95144
          https://trac.macports.org/changeset/95144
Author:   raimue at macports.org
Date:     2012-07-05 15:14:48 -0700 (Thu, 05 Jul 2012)
Log Message:
-----------
bash-completion, bash-completion-devel:
Handle the special case when port is actually an alias or a function in the
current shell environment, closes #27504

Modified Paths:
--------------
    trunk/dports/sysutils/bash-completion/Portfile
    trunk/dports/sysutils/bash-completion/files/port
    trunk/dports/sysutils/bash-completion-devel/Portfile
    trunk/dports/sysutils/bash-completion-devel/files/port

Modified: trunk/dports/sysutils/bash-completion/Portfile
===================================================================
--- trunk/dports/sysutils/bash-completion/Portfile	2012-07-05 22:08:09 UTC (rev 95143)
+++ trunk/dports/sysutils/bash-completion/Portfile	2012-07-05 22:14:48 UTC (rev 95144)
@@ -6,6 +6,7 @@
 conflicts       bash-completion-devel
 epoch           1
 version         2.0
+revision        1
 categories      sysutils
 platforms       darwin
 supported_archs noarch

Modified: trunk/dports/sysutils/bash-completion/files/port
===================================================================
--- trunk/dports/sysutils/bash-completion/files/port	2012-07-05 22:08:09 UTC (rev 95143)
+++ trunk/dports/sysutils/bash-completion/files/port	2012-07-05 22:14:48 UTC (rev 95144)
@@ -45,12 +45,12 @@
                 if [[ $i != -* ]]; then
                     case $mode in
                         contents|uninstall|upgrade)
-                            if port -q installed -- "$i" | awk '{print $1}' | grep -qi '^'$i'$'; then
+                            if command port -q installed -- "$i" | awk '{print $1}' | grep -qi '^'$i'$'; then
                                 port=$i
                             fi
                             ;;
                         *)
-                            if port -q search --name --exact -- "$i" | grep -qi '^'$i'$'; then
+                            if command port -q search --name --exact -- "$i" | grep -qi '^'$i'$'; then
                                 port=$i
                             fi
                             ;;
@@ -65,28 +65,28 @@
             case $mode in
                 contents|uninstall)
                     # installed variants
-                    COMPREPLY=( $( port -q installed -- "$port" \
+                    COMPREPLY=( $( command port -q installed -- "$port" \
                         | awk '{print $2}' | tr '\n' ' ' 2>/dev/null ) )
                     COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- $cur ) )
                     return 0
                     ;;
                 activate)
                     # inactive variants
-                    COMPREPLY=( $( port -q installed -- "$port" | grep -v '(active)' \
+                    COMPREPLY=( $( command port -q installed -- "$port" | grep -v '(active)' \
                         | awk '{print $2}' | tr '\n' ' ' 2>/dev/null ) )
                     COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- $cur ) )
                     return 0
                     ;;
                 deactivate)
                     # active variants
-                    COMPREPLY=( $( port -q installed -- "$port" | grep '(active)' \
+                    COMPREPLY=( $( command port -q installed -- "$port" | grep '(active)' \
                         | awk '{print $2}' | tr '\n' ' ' 2>/dev/null ) )
                     COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- $cur ) )
                     return 0
                     ;;
                 *)
                     # all variants
-                    COMPREPLY=( $( port -q info --line --variants -- "$port" | tr '\n,' '  ' ) )
+                    COMPREPLY=( $( command port -q info --line --variants -- "$port" | tr '\n,' '  ' ) )
                     COMPREPLY=( $( compgen -P'+' -W '${COMPREPLY[@]}' -- ${cur/+/} ) )
                     return 0
                     ;;
@@ -97,7 +97,7 @@
         if [ -n "$mode" ]; then
             if [[ $cur == -* ]]; then
                 # complete options
-                COMPREPLY=( $( port -q usage -- "$mode" 2>&1 | sed 's/Usage: $mode //' ) )
+                COMPREPLY=( $( command port -q usage -- "$mode" 2>&1 | sed 's/Usage: $mode //' ) )
                 COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- $cur ) )
                 return 0
             else
@@ -105,7 +105,7 @@
                 case $mode in
                     contents|installed|outdated|uninstall|upgrade)
                         # installed ports
-                        COMPREPLY=( $( port -q installed -- "$cur*" \
+                        COMPREPLY=( $( command port -q installed -- "$cur*" \
                             | awk '{print $1}' | uniq ) \
                             $( compgen -W '${PSEUDOPORTS[@]}' -- $cur ) \
                         )
@@ -113,7 +113,7 @@
                         ;;
                     activate)
                         # inactive ports
-                        COMPREPLY=( $( port -q installed -- "$cur*" | grep -v '(active)' \
+                        COMPREPLY=( $( command port -q installed -- "$cur*" | grep -v '(active)' \
                             | awk '{print $1}' | uniq ) \
                             $( compgen -W '${PSEUDOPORTS[@]}' -- $cur ) \
                         )
@@ -121,7 +121,7 @@
                         ;;
                     deactivate)
                         # active ports
-                        COMPREPLY=( $( port -q installed -- "$cur*" | grep '(active)' \
+                        COMPREPLY=( $( command port -q installed -- "$cur*" | grep '(active)' \
                             | awk '{print $1}' | uniq ) \
                             $( compgen -W '${PSEUDOPORTS[@]}' -- $cur ) \
                         )
@@ -141,7 +141,7 @@
                         ;;
                     *)
                         # all ports
-                        COMPREPLY=( $( port -q search --name --glob -- "$cur*" 2>/dev/null | uniq ) \
+                        COMPREPLY=( $( command port -q search --name --glob -- "$cur*" 2>/dev/null | uniq ) \
                             $( compgen -W '${PSEUDOPORTS[@]}' -- $cur ) \
                         )
                         return 0

Modified: trunk/dports/sysutils/bash-completion-devel/Portfile
===================================================================
--- trunk/dports/sysutils/bash-completion-devel/Portfile	2012-07-05 22:08:09 UTC (rev 95143)
+++ trunk/dports/sysutils/bash-completion-devel/Portfile	2012-07-05 22:14:48 UTC (rev 95144)
@@ -5,6 +5,7 @@
 name            bash-completion-devel
 conflicts       bash-completion
 version         2.0
+revision        1
 categories      sysutils
 platforms       darwin
 supported_archs noarch

Modified: trunk/dports/sysutils/bash-completion-devel/files/port
===================================================================
--- trunk/dports/sysutils/bash-completion-devel/files/port	2012-07-05 22:08:09 UTC (rev 95143)
+++ trunk/dports/sysutils/bash-completion-devel/files/port	2012-07-05 22:14:48 UTC (rev 95144)
@@ -45,12 +45,12 @@
                 if [[ $i != -* ]]; then
                     case $mode in
                         contents|uninstall|upgrade)
-                            if port -q installed -- "$i" | awk '{print $1}' | grep -qi '^'$i'$'; then
+                            if command port -q installed -- "$i" | awk '{print $1}' | grep -qi '^'$i'$'; then
                                 port=$i
                             fi
                             ;;
                         *)
-                            if port -q search --name --exact -- "$i" | grep -qi '^'$i'$'; then
+                            if command port -q search --name --exact -- "$i" | grep -qi '^'$i'$'; then
                                 port=$i
                             fi
                             ;;
@@ -65,28 +65,28 @@
             case $mode in
                 contents|uninstall)
                     # installed variants
-                    COMPREPLY=( $( port -q installed -- "$port" \
+                    COMPREPLY=( $( command port -q installed -- "$port" \
                         | awk '{print $2}' | tr '\n' ' ' 2>/dev/null ) )
                     COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- $cur ) )
                     return 0
                     ;;
                 activate)
                     # inactive variants
-                    COMPREPLY=( $( port -q installed -- "$port" | grep -v '(active)' \
+                    COMPREPLY=( $( command port -q installed -- "$port" | grep -v '(active)' \
                         | awk '{print $2}' | tr '\n' ' ' 2>/dev/null ) )
                     COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- $cur ) )
                     return 0
                     ;;
                 deactivate)
                     # active variants
-                    COMPREPLY=( $( port -q installed -- "$port" | grep '(active)' \
+                    COMPREPLY=( $( command port -q installed -- "$port" | grep '(active)' \
                         | awk '{print $2}' | tr '\n' ' ' 2>/dev/null ) )
                     COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- $cur ) )
                     return 0
                     ;;
                 *)
                     # all variants
-                    COMPREPLY=( $( port -q info --line --variants -- "$port" | tr '\n,' '  ' ) )
+                    COMPREPLY=( $( command port -q info --line --variants -- "$port" | tr '\n,' '  ' ) )
                     COMPREPLY=( $( compgen -P'+' -W '${COMPREPLY[@]}' -- ${cur/+/} ) )
                     return 0
                     ;;
@@ -97,7 +97,7 @@
         if [ -n "$mode" ]; then
             if [[ $cur == -* ]]; then
                 # complete options
-                COMPREPLY=( $( port -q usage -- "$mode" 2>&1 | sed 's/Usage: $mode //' ) )
+                COMPREPLY=( $( command port -q usage -- "$mode" 2>&1 | sed 's/Usage: $mode //' ) )
                 COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- $cur ) )
                 return 0
             else
@@ -105,7 +105,7 @@
                 case $mode in
                     contents|installed|outdated|uninstall|upgrade)
                         # installed ports
-                        COMPREPLY=( $( port -q installed -- "$cur*" \
+                        COMPREPLY=( $( command port -q installed -- "$cur*" \
                             | awk '{print $1}' | uniq ) \
                             $( compgen -W '${PSEUDOPORTS[@]}' -- $cur ) \
                         )
@@ -113,7 +113,7 @@
                         ;;
                     activate)
                         # inactive ports
-                        COMPREPLY=( $( port -q installed -- "$cur*" | grep -v '(active)' \
+                        COMPREPLY=( $( command port -q installed -- "$cur*" | grep -v '(active)' \
                             | awk '{print $1}' | uniq ) \
                             $( compgen -W '${PSEUDOPORTS[@]}' -- $cur ) \
                         )
@@ -121,7 +121,7 @@
                         ;;
                     deactivate)
                         # active ports
-                        COMPREPLY=( $( port -q installed -- "$cur*" | grep '(active)' \
+                        COMPREPLY=( $( command port -q installed -- "$cur*" | grep '(active)' \
                             | awk '{print $1}' | uniq ) \
                             $( compgen -W '${PSEUDOPORTS[@]}' -- $cur ) \
                         )
@@ -141,7 +141,7 @@
                         ;;
                     *)
                         # all ports
-                        COMPREPLY=( $( port -q search --name --glob -- "$cur*" 2>/dev/null | uniq ) \
+                        COMPREPLY=( $( command port -q search --name --glob -- "$cur*" 2>/dev/null | uniq ) \
                             $( compgen -W '${PSEUDOPORTS[@]}' -- $cur ) \
                         )
                         return 0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120705/5f0ba1de/attachment.html>


More information about the macports-changes mailing list