[95135] trunk/dports/sysutils
raimue at macports.org
raimue at macports.org
Thu Jul 5 14:53:02 PDT 2012
Revision: 95135
https://trac.macports.org/changeset/95135
Author: raimue at macports.org
Date: 2012-07-05 14:53:02 -0700 (Thu, 05 Jul 2012)
Log Message:
-----------
bash-completion, bash-completion-devel:
Update both to version 2.0
Modified Paths:
--------------
trunk/dports/sysutils/bash-completion/Portfile
trunk/dports/sysutils/bash-completion/files/patch-vpnc.diff
trunk/dports/sysutils/bash-completion-devel/Portfile
Added Paths:
-----------
trunk/dports/sysutils/bash-completion/files/launchctl
trunk/dports/sysutils/bash-completion/files/port
Removed Paths:
-------------
trunk/dports/sysutils/bash-completion/files/launchctl
trunk/dports/sysutils/bash-completion/files/patch-man.diff
trunk/dports/sysutils/bash-completion/files/port
trunk/dports/sysutils/bash-completion-devel/files/patch-man.diff
Modified: trunk/dports/sysutils/bash-completion/Portfile
===================================================================
--- trunk/dports/sysutils/bash-completion/Portfile 2012-07-05 21:51:40 UTC (rev 95134)
+++ trunk/dports/sysutils/bash-completion/Portfile 2012-07-05 21:53:02 UTC (rev 95135)
@@ -5,8 +5,7 @@
name bash-completion
conflicts bash-completion-devel
epoch 1
-version 1.3
-revision 6
+version 2.0
categories sysutils
platforms darwin
supported_archs noarch
@@ -14,18 +13,20 @@
maintainers raimue
description Programmable bash completions
long_description \
- Programmable completion library for bash.
+ Programmable completion library for bash. This port requires bash >=4.1 and \
+ is meant to be used together with the bash port.
homepage http://bash-completion.alioth.debian.org/
master_sites http://bash-completion.alioth.debian.org/files/
-checksums md5 a1262659b4bbf44dc9e59d034de505ec \
- sha1 6a46b93f44c56cc336632ab28d90c0595fbcc98f \
- rmd160 222be4aee5a9542e5b27133d8bfd697c2c95262d
+checksums md5 0d903f398be8c8f24bc5ffa6f86127f8 \
+ rmd160 5f6f9aacd7692e7aa49d82c74eaaeed5a6bc25b3 \
+ sha256 e5a490a4301dfb228361bdca2ffca597958e47dd6056005ef9393a5852af5804
use_bzip2 yes
-patchfiles patch-man.diff \
- patch-vpnc.diff
+depends_run port:bash
+patchfiles patch-vpnc.diff
+
post-patch {
reinplace "s:/etc/bash_completion:${prefix}/etc/bash_completion:g" \
${worksrcpath}/bash_completion
@@ -38,16 +39,32 @@
}
post-destroot {
- xinstall -m 644 -W ${filespath} port launchctl ${destroot}${prefix}/etc/bash_completion.d/
+ xinstall -m 644 -W ${filespath} port launchctl \
+ ${destroot}${prefix}/share/bash-completion/completions/
+
+ # Add a link for compatibility with versions <2.0 of this port
+ ln -s ${prefix}/etc/profile.d/bash_completion.sh ${destroot}${prefix}/etc/bash_completion
}
notes "
To use bash_completion, add the following lines at the end of your .bash_profile:
- if \[ -f ${prefix}/etc/bash_completion ]; then
- . ${prefix}/etc/bash_completion
+ if \[ -f ${prefix}/etc/profile.d/bash_completion.sh ]; then
+ . ${prefix}/etc/profile.d/bash_completion.sh
fi
"
+if {${os.platform} == "darwin" && ${os.subplatform} == "macosx"} {
+ # Insert an empty line into the notes
+ notes-append ""
+ notes-append "
+ The port bash-completion >=2.0 requires bash >=4.1; please make sure
+ you are using ${prefix}/bin/bash by changing the preferences of your
+ terminal accordingly. If your version of bash is too old, the script
+ above will not modify your shell environment and no extended completion
+ will be available.
+ "
+}
+
livecheck.type regex
livecheck.url ${homepage}
livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
Deleted: trunk/dports/sysutils/bash-completion/files/launchctl
===================================================================
--- trunk/dports/sysutils/bash-completion/files/launchctl 2012-07-05 21:51:40 UTC (rev 95134)
+++ trunk/dports/sysutils/bash-completion/files/launchctl 2012-07-05 21:53:02 UTC (rev 95135)
@@ -1,171 +0,0 @@
-# ex: filetype=sh et sw=4
-#
-# launchctl(1) completion
-#
-have launchctl &&
-{
-_launchctl()
-{
- local cur oslevel
-
- oslevel=${OSTYPE//darwin/}
- oslevel=${oslevel%%.*}
-
- COMPREPLY=()
- cur=`_get_cword`
-
- if [[ $COMP_CWORD -eq 1 ]]; then
- local commands
-
- commands="load unload start stop list setenv unsetenv \
- getenv export limit shutdown getrusage log umask help"
-
- if [[ $oslevel -le 8 ]]; then
- commands+=" reloadttys stdout stderr"
- fi
-
- if [[ $oslevel -ge 9 ]]; then
- commands+=" submit remove bootstrap singleuser bsexec bslist"
- if [[ $oslevel -ge 10 ]]; then
- commands+=" bstree managerpid manageruid managername"
- fi
- fi
- COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
- else
- local command
- command=${COMP_WORDS[1]}
- prev=${COMP_WORDS[COMP_CWORD-1]}
-
- case "$command" in
- load|unload)
- case $prev in
- -S)
- COMPREPLY=( $( compgen -W "Aqua LoginWindow Background StandardIO System" -- $cur ) )
- ;;
- -D)
- COMPREPLY=( $( compgen -W "system local network all user" -- $cur ) )
- ;;
- *)
- opts="-w"
- if [[ $oslevel -ge 0 ]]; then
- opts+=" -S -D"
- if [[ $command = load ]]; then
- opts+=" -F"
- fi
- fi
- COMPREPLY=( $( compgen -f -W "$opts" -- $cur ) )
- ;;
- esac
- ;;
- start|stop|remove|list)
- local jobs opts
-
- if [[ $command != list || $oslevel -ge 9 ]]; then
- if [[ $oslevel -le 8 ]]; then
- jobs="$( launchctl list )"
- else
- jobs="$( launchctl list | awk 'NR>1 { print $3 }')"
- if [[ $oslevel -ge 10 && $command = list ]]; then
- opts="-x"
- fi
- fi
- fi
- COMPREPLY=( $( compgen -W "$jobs $opts" -- $cur ) )
- ;;
- getenv|setenv|unsetenv)
- if [[ $COMP_CWORD -eq 2 ]]; then
- envvars="$( launchctl export | cut -f1 -d= )"
- COMPREPLY=( $( compgen -W "$envvars" -- $cur ) )
- fi
- ;;
- getrusage)
- if [[ $COMP_CWORD -eq 2 ]]; then
- COMPREPLY=( $( compgen -W "self children" -- $cur ) )
- fi
- ;;
- limit)
- if [[ $COMP_CWORD -eq 2 ]]; then
- local limits
- limits="$( launchctl limit | awk '{print $1}' )"
- COMPREPLY=( $( compgen -W "$limits" -- $cur ) )
- fi
- ;;
- log)
- if [[ $COMP_CWORD -eq 2 ]]; then
- COMPREPLY=( $( compgen -W "level only mask" -- $cur ) )
- else
- local level
- levels="debug info notice warning error critical alert emergency"
- case ${COMP_WORDS[2]} in
- level)
- if [[ $COMP_CWORD -eq 3 ]]; then
- COMPREPLY=( $( compgen -W "$levels" -- $cur ) )
- fi
- ;;
- mask|only)
- COMPREPLY=( $( compgen -W "$levels" -- $cur ) )
- ;;
- esac
- fi
- ;;
- stdout|stderr)
- # Darwin 8 only
- if [[ $oslevel -le 8 ]]; then
- _filedir
- fi
- ;;
- submit)
- local i
- i=1
- while [[ $i -lt ${#COMP_WORDS[@]} ]]; do
- if [[ "${COMP_WORDS[i-1]}" = "--" ]]; then
- _command_offset $i
- return 0
- fi
- i=$((i+1))
- done
-
- local submit_opts
- submit_opts="-l -p -o -e --"
- case $prev in
- -l)
- ;;
- -p)
- _command_offset $COMP_CWORD
- ;;
- -o|-e)
- _filedir
- ;;
- *)
- COMPREPLY=( $( compgen -W "$submit_opts" -- $cur ) )
- ;;
- esac
-
- ;;
- bslist)
- local pids opts
- pids=$( ps axo pid= )
- [[ $oslevel -ge 10 ]] && opts="-j"
- COMPREPLY=( $( compgen -W "$pids $opts" -- $cur ) )
- ;;
- bsexec)
- if [[ $COMP_CWORD -eq 2 ]]; then
- local pids
- pids=$( ps axo pid= )
- COMPREPLY=( $( compgen -W "$pids" -- $cur ) )
- else
- _command_offset 3
- fi
- ;;
- bstree)
- if [[ $oslevel -ge 10 ]]; then
- COMPREPLY=( $( compgen -W "-j" -- $cur ) )
- fi
- ;;
- esac
- fi
-
- return 0
-}
-complete -F _launchctl $filenames launchctl
-}
Copied: trunk/dports/sysutils/bash-completion/files/launchctl (from rev 95101, trunk/dports/sysutils/bash-completion-devel/files/launchctl)
===================================================================
--- trunk/dports/sysutils/bash-completion/files/launchctl (rev 0)
+++ trunk/dports/sysutils/bash-completion/files/launchctl 2012-07-05 21:53:02 UTC (rev 95135)
@@ -0,0 +1,169 @@
+# launchctl(1) completion -*- shell-script -*-
+
+_launchctl()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ local oslevel
+
+ oslevel=${OSTYPE//darwin/}
+ oslevel=${oslevel%%.*}
+
+ COMPREPLY=()
+
+ if [[ $cword -eq 1 ]]; then
+ local commands
+
+ commands="load unload start stop list setenv unsetenv \
+ getenv export limit shutdown getrusage log umask help"
+
+ if [[ $oslevel -le 8 ]]; then
+ commands+=" reloadttys stdout stderr"
+ fi
+
+ if [[ $oslevel -ge 9 ]]; then
+ commands+=" submit remove bootstrap singleuser bsexec bslist"
+ if [[ $oslevel -ge 10 ]]; then
+ commands+=" bstree managerpid manageruid managername"
+ fi
+ fi
+ COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
+ else
+ local command
+ command=${words[1]}
+
+ case "$command" in
+ load|unload)
+ case $prev in
+ -S)
+ COMPREPLY=( $( compgen -W "Aqua LoginWindow Background StandardIO System" -- $cur ) )
+ ;;
+ -D)
+ COMPREPLY=( $( compgen -W "system local network all user" -- $cur ) )
+ ;;
+ *)
+ opts="-w"
+ if [[ $oslevel -ge 0 ]]; then
+ opts+=" -S -D"
+ if [[ $command = load ]]; then
+ opts+=" -F"
+ fi
+ fi
+ COMPREPLY=( $( compgen -f -W "$opts" -- $cur ) )
+ ;;
+ esac
+ ;;
+ start|stop|remove|list)
+ local jobs opts
+
+ if [[ $command != list || $oslevel -ge 9 ]]; then
+ if [[ $oslevel -le 8 ]]; then
+ jobs="$( launchctl list )"
+ else
+ jobs="$( launchctl list | awk 'NR>1 { print $3 }')"
+ if [[ $oslevel -ge 10 && $command = list ]]; then
+ opts="-x"
+ fi
+ fi
+ fi
+ COMPREPLY=( $( compgen -W "$jobs $opts" -- $cur ) )
+ ;;
+ getenv|setenv|unsetenv)
+ if [[ $cword -eq 2 ]]; then
+ envvars="$( launchctl export | cut -f1 -d= )"
+ COMPREPLY=( $( compgen -W "$envvars" -- $cur ) )
+ fi
+ ;;
+ getrusage)
+ if [[ $cword -eq 2 ]]; then
+ COMPREPLY=( $( compgen -W "self children" -- $cur ) )
+ fi
+ ;;
+ limit)
+ if [[ $cword -eq 2 ]]; then
+ local limits
+ limits="$( launchctl limit | awk '{print $1}' )"
+ COMPREPLY=( $( compgen -W "$limits" -- $cur ) )
+ fi
+ ;;
+ log)
+ if [[ $cword -eq 2 ]]; then
+ COMPREPLY=( $( compgen -W "level only mask" -- $cur ) )
+ else
+ local level
+ levels="debug info notice warning error critical alert emergency"
+ case ${words[2]} in
+ level)
+ if [[ $cword -eq 3 ]]; then
+ COMPREPLY=( $( compgen -W "$levels" -- $cur ) )
+ fi
+ ;;
+ mask|only)
+ COMPREPLY=( $( compgen -W "$levels" -- $cur ) )
+ ;;
+ esac
+ fi
+ ;;
+ stdout|stderr)
+ # Darwin 8 only
+ if [[ $oslevel -le 8 ]]; then
+ _filedir
+ fi
+ ;;
+ submit)
+ local i
+ i=1
+ while [[ $i -lt ${#words[@]} ]]; do
+ if [[ "${words[i-1]}" = "--" ]]; then
+ _command_offset $i
+ return 0
+ fi
+ i=$((i+1))
+ done
+
+ local submit_opts
+ submit_opts="-l -p -o -e --"
+ case $prev in
+ -l)
+ ;;
+ -p)
+ _command_offset $cword
+ ;;
+ -o|-e)
+ _filedir
+ ;;
+ *)
+ COMPREPLY=( $( compgen -W "$submit_opts" -- $cur ) )
+ ;;
+ esac
+
+ ;;
+ bslist)
+ local pids opts
+ pids=$( ps axo pid= )
+ [[ $oslevel -ge 10 ]] && opts="-j"
+ COMPREPLY=( $( compgen -W "$pids $opts" -- $cur ) )
+ ;;
+ bsexec)
+ if [[ $cword -eq 2 ]]; then
+ local pids
+ pids=$( ps axo pid= )
+ COMPREPLY=( $( compgen -W "$pids" -- $cur ) )
+ else
+ _command_offset 3
+ fi
+ ;;
+ bstree)
+ if [[ $oslevel -ge 10 ]]; then
+ COMPREPLY=( $( compgen -W "-j" -- $cur ) )
+ fi
+ ;;
+ esac
+ fi
+
+ return 0
+} &&
+complete -F _launchctl launchctl
+
+# ex: ts=4 sw=4 et filetype=sh
Deleted: trunk/dports/sysutils/bash-completion/files/patch-man.diff
===================================================================
--- trunk/dports/sysutils/bash-completion/files/patch-man.diff 2012-07-05 21:51:40 UTC (rev 95134)
+++ trunk/dports/sysutils/bash-completion/files/patch-man.diff 2012-07-05 21:53:02 UTC (rev 95135)
@@ -1,11 +0,0 @@
---- completions/man.orig 2011-02-10 20:00:21.000000000 +0100
-+++ completions/man 2011-02-10 20:00:58.000000000 +0100
-@@ -27,7 +27,7 @@
- fi
-
- uname=$( uname -s )
-- if [[ $uname == @(Linux|GNU|GNU/*|FreeBSD|Cygwin|CYGWIN_*) ]]; then
-+ if [[ $uname == @(Linux|GNU|GNU/*|FreeBSD|Darwin|Cygwin|CYGWIN_*) ]]; then
- manpath=$( manpath 2>/dev/null || command man --path )
- else
- manpath=$MANPATH
Modified: trunk/dports/sysutils/bash-completion/files/patch-vpnc.diff
===================================================================
--- trunk/dports/sysutils/bash-completion/files/patch-vpnc.diff 2012-07-05 21:51:40 UTC (rev 95134)
+++ trunk/dports/sysutils/bash-completion/files/patch-vpnc.diff 2012-07-05 21:53:02 UTC (rev 95135)
@@ -1,6 +1,6 @@
--- completions/vpnc.orig 2012-04-14 12:02:34.000000000 +0200
+++ completions/vpnc 2012-04-14 12:09:45.000000000 +0200
-@@ -35,7 +35,7 @@
+@@ -32,7 +32,7 @@
--pid-file --local-port --udp-port --disable-natt \
--non-inter' -- "$cur" ) )
else
Deleted: trunk/dports/sysutils/bash-completion/files/port
===================================================================
--- trunk/dports/sysutils/bash-completion/files/port 2012-07-05 21:51:40 UTC (rev 95134)
+++ trunk/dports/sysutils/bash-completion/files/port 2012-07-05 21:53:02 UTC (rev 95135)
@@ -1,170 +0,0 @@
-# bash
-
-have port && {
-# helper functions for port completion
-#
-
-# port(1) completion
-#
-_port()
-{
- local cur prev mode count portdir cmdfile i port PSEUDOPORTS
-
- PSEUDOPORTS=( all current active inactive installed uninstalled
- outdated obsolete requested unrequested leaves )
-
- COMPREPLY=()
- cur=${COMP_WORDS[COMP_CWORD]}
- prev=${COMP_WORDS[COMP_CWORD-1]}
-
- count=0
- for i in ${COMP_WORDS[@]}; do
- [ $count -eq $COMP_CWORD ] && break
- # Last parameter was a required parameter, now go back to mode selection
- if [ "${COMP_WORDS[((count))]}" == "$portdir" -a "$mode" == "portdir" ] \
- || [ "${COMP_WORDS[((count))]}" == "$cmdfile" -a "$mode" == "cmdfile" ]; then
- mode=""
- fi
- if [ -z "$mode" ]; then
- case $i in
- -D)
- mode=portdir
- portdir=${COMP_WORDS[((count+1))]}
- ;;
- -F)
- mode=cmdfile
- cmdfile=${COMP_WORDS[((count+1))]}
- ;;
- activate|archive|archivefetch|build|cat|cd|checksum|clean|configure|\
- contents|deactivate|dependents|deps|destroot|dir|distcheck|distfiles|\
- dmg|dpkg|echo|ed|edit|extract|fetch|file|gohome|help|\
- info|install|installed|lint|list|livecheck|load|location|log|\
- logfile|mdmg|mirror|mpkg|notes|outdated|patch|pkg|platform|\
- portpkg|provides|quit|rdependents|rdeps|rev-upgrade|rpm|search|select|selfupdate|\
- setrequested|space|srpm|submit|sync|test|unarchive|uninstall|\
- unload|unsetrequested|upgrade|url|usage|variants|version|work)
- mode=$i
- ;;
- esac
- elif [ -z "$port" ]; then
- if [[ $i != -* ]]; then
- case $mode in
- contents|uninstall|upgrade)
- if 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
- port=$i
- fi
- ;;
- esac
- fi
- fi
- count=$((++count))
- done
-
- if [ -n "$port" ]; then
- # complete variants
- case $mode in
- contents|uninstall)
- # installed variants
- COMPREPLY=( $( 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)' \
- | 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)' \
- | 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=( $( compgen -P'+' -W '${COMPREPLY[@]}' -- ${cur/+/} ) )
- return 0
- ;;
- esac
-
- fi
-
- if [ -n "$mode" ]; then
- if [[ $cur == -* ]]; then
- # complete options
- COMPREPLY=( $( port -q usage -- "$mode" 2>&1 | sed 's/Usage: $mode //' ) )
- COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- $cur ) )
- return 0
- else
- # complete port names
- case $mode in
- contents|installed|outdated|uninstall|upgrade)
- # installed ports
- COMPREPLY=( $( port -q installed -- "$cur*" \
- | awk '{print $1}' | uniq ) \
- $( compgen -W '${PSEUDOPORTS[@]}' -- $cur ) \
- )
- return 0
- ;;
- activate)
- # inactive ports
- COMPREPLY=( $( port -q installed -- "$cur*" | grep -v '(active)' \
- | awk '{print $1}' | uniq ) \
- $( compgen -W '${PSEUDOPORTS[@]}' -- $cur ) \
- )
- return 0
- ;;
- deactivate)
- # active ports
- COMPREPLY=( $( port -q installed -- "$cur*" | grep '(active)' \
- | awk '{print $1}' | uniq ) \
- $( compgen -W '${PSEUDOPORTS[@]}' -- $cur ) \
- )
- return 0
- ;;
- provides|cmdfile)
- _filedir
- return 0
- ;;
- portdir)
- _filedir -d
- return 0
- ;;
- selfupdate|search|sync|platform)
- # no port
- return 0
- ;;
- *)
- # all ports
- COMPREPLY=( $( port -q search --name --glob -- "$cur*" 2>/dev/null | uniq ) \
- $( compgen -W '${PSEUDOPORTS[@]}' -- $cur ) \
- )
- return 0
- ;;
- esac
- fi
- fi
-
- COMPREPLY=( $( compgen -W '-b -c -d -f -k -n -o -p -q -R -s -t -u -v -y \
- activate archive archivefetch build cat cd checksum clean configure \
- contents deactivate dependents deps destroot dir distcheck distfiles \
- dmg dpkg echo ed edit exit extract fetch file gohome help \
- info install installed lint list livecheck load location log \
- logfile mdmg mirror mpkg notes outdated patch pkg platform \
- portpkg provides quit rdependents rdeps rev-upgrade rpm search select selfupdate \
- setrequested space srpm submit sync test unarchive uninstall \
- unload unsetrequested upgrade url usage variants version work' -- $cur ) )
- return 0
-}
-complete -F _port $filenames port
-}
Copied: trunk/dports/sysutils/bash-completion/files/port (from rev 95101, trunk/dports/sysutils/bash-completion-devel/files/port)
===================================================================
--- trunk/dports/sysutils/bash-completion/files/port (rev 0)
+++ trunk/dports/sysutils/bash-completion/files/port 2012-07-05 21:53:02 UTC (rev 95135)
@@ -0,0 +1,166 @@
+# port(1) completion -*- shell-script -*-
+
+_port()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ local mode count portdir cmdfile i port PSEUDOPORTS
+
+ PSEUDOPORTS=( all current active inactive installed uninstalled
+ outdated obsolete requested unrequested leaves )
+
+ COMPREPLY=()
+
+ count=0
+ for i in ${words[@]}; do
+ [ $count -eq $cword ] && break
+ # Last parameter was a required parameter, now go back to mode selection
+ if [ "${words[((count))]}" == "$portdir" -a "$mode" == "portdir" ] \
+ || [ "${words[((count))]}" == "$cmdfile" -a "$mode" == "cmdfile" ]; then
+ mode=""
+ fi
+ if [ -z "$mode" ]; then
+ case $i in
+ -D)
+ mode=portdir
+ portdir=${words[((count+1))]}
+ ;;
+ -F)
+ mode=cmdfile
+ cmdfile=${words[((count+1))]}
+ ;;
+ activate|archive|archivefetch|build|cat|cd|checksum|clean|configure|\
+ contents|deactivate|dependents|deps|destroot|dir|distcheck|distfiles|\
+ dmg|dpkg|echo|ed|edit|extract|fetch|file|gohome|help|\
+ info|install|installed|lint|list|livecheck|load|location|log|\
+ logfile|mdmg|mirror|mpkg|notes|outdated|patch|pkg|platform|\
+ portpkg|provides|quit|rdependents|rdeps|rev-upgrade|rpm|search|select|selfupdate|\
+ setrequested|space|srpm|submit|sync|test|unarchive|uninstall|\
+ unload|unsetrequested|upgrade|url|usage|variants|version|work)
+ mode=$i
+ ;;
+ esac
+ elif [ -z "$port" ]; then
+ if [[ $i != -* ]]; then
+ case $mode in
+ contents|uninstall|upgrade)
+ if 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
+ port=$i
+ fi
+ ;;
+ esac
+ fi
+ fi
+ count=$((++count))
+ done
+
+ if [ -n "$port" ]; then
+ # complete variants
+ case $mode in
+ contents|uninstall)
+ # installed variants
+ COMPREPLY=( $( 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)' \
+ | 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)' \
+ | 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=( $( compgen -P'+' -W '${COMPREPLY[@]}' -- ${cur/+/} ) )
+ return 0
+ ;;
+ esac
+
+ fi
+
+ if [ -n "$mode" ]; then
+ if [[ $cur == -* ]]; then
+ # complete options
+ COMPREPLY=( $( port -q usage -- "$mode" 2>&1 | sed 's/Usage: $mode //' ) )
+ COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- $cur ) )
+ return 0
+ else
+ # complete port names
+ case $mode in
+ contents|installed|outdated|uninstall|upgrade)
+ # installed ports
+ COMPREPLY=( $( port -q installed -- "$cur*" \
+ | awk '{print $1}' | uniq ) \
+ $( compgen -W '${PSEUDOPORTS[@]}' -- $cur ) \
+ )
+ return 0
+ ;;
+ activate)
+ # inactive ports
+ COMPREPLY=( $( port -q installed -- "$cur*" | grep -v '(active)' \
+ | awk '{print $1}' | uniq ) \
+ $( compgen -W '${PSEUDOPORTS[@]}' -- $cur ) \
+ )
+ return 0
+ ;;
+ deactivate)
+ # active ports
+ COMPREPLY=( $( port -q installed -- "$cur*" | grep '(active)' \
+ | awk '{print $1}' | uniq ) \
+ $( compgen -W '${PSEUDOPORTS[@]}' -- $cur ) \
+ )
+ return 0
+ ;;
+ provides|cmdfile)
+ _filedir
+ return 0
+ ;;
+ portdir)
+ _filedir -d
+ return 0
+ ;;
+ selfupdate|search|sync|platform)
+ # no port
+ return 0
+ ;;
+ *)
+ # all ports
+ COMPREPLY=( $( port -q search --name --glob -- "$cur*" 2>/dev/null | uniq ) \
+ $( compgen -W '${PSEUDOPORTS[@]}' -- $cur ) \
+ )
+ return 0
+ ;;
+ esac
+ fi
+ fi
+
+ COMPREPLY=( $( compgen -W '-b -c -d -f -k -n -o -p -q -R -s -t -u -v -y \
+ activate archive archivefetch build cat cd checksum clean configure \
+ contents deactivate dependents deps destroot dir distcheck distfiles \
+ dmg dpkg echo ed edit extract fetch file gohome help \
+ info install installed lint list livecheck load location log \
+ logfile mdmg mirror mpkg notes outdated patch pkg platform \
+ portpkg provides quit rdependents rdeps rev-upgrade rpm search select selfupdate \
+ setrequested space srpm submit sync test unarchive uninstall \
+ unload unsetrequested upgrade url usage variants version work' -- $cur ) )
+ return 0
+} &&
+complete -F _port port
+
+# ex: ts=4 sw=4 et filetype=sh
Modified: trunk/dports/sysutils/bash-completion-devel/Portfile
===================================================================
--- trunk/dports/sysutils/bash-completion-devel/Portfile 2012-07-05 21:51:40 UTC (rev 95134)
+++ trunk/dports/sysutils/bash-completion-devel/Portfile 2012-07-05 21:53:02 UTC (rev 95135)
@@ -4,8 +4,7 @@
name bash-completion-devel
conflicts bash-completion
-version 1.99
-revision 2
+version 2.0
categories sysutils
platforms darwin
supported_archs noarch
@@ -13,20 +12,21 @@
maintainers raimue
description Programmable bash completions
long_description \
- Programmable completion library for bash. Note that this port is meant to \
- be used with bash >=4.1 as provided by the bash port.
+ Programmable completion library for bash. This port requires bash >=4.1 and \
+ is meant to be used together with the bash port.
homepage http://bash-completion.alioth.debian.org/
master_sites http://bash-completion.alioth.debian.org/files/
distname bash-completion-${version}
-checksums md5 3cf478b7f1065f424d3d6ec35f80e4f2 \
- rmd160 c5b4a926d8a7c1843c6bc85a6ba22b371baaf20e \
- sha256 a2baf5130fa015527f435e145949029c653f0106c89ccfd20ad8987f292ed314
+checksums md5 0d903f398be8c8f24bc5ffa6f86127f8 \
+ rmd160 5f6f9aacd7692e7aa49d82c74eaaeed5a6bc25b3 \
+ sha256 e5a490a4301dfb228361bdca2ffca597958e47dd6056005ef9393a5852af5804
use_bzip2 yes
-patchfiles patch-man.diff \
- patch-vpnc.diff
+depends_run port:bash
+patchfiles patch-vpnc.diff
+
post-patch {
reinplace "s:/etc/bash_completion:${prefix}/etc/bash_completion:g" \
${worksrcpath}/bash_completion
@@ -42,7 +42,7 @@
xinstall -m 644 -W ${filespath} port launchctl \
${destroot}${prefix}/share/bash-completion/completions/
- # Add a link for compatibility with older versions
+ # Add a link for compatibility with versions <2.0 of this port
ln -s ${prefix}/etc/profile.d/bash_completion.sh ${destroot}${prefix}/etc/bash_completion
}
@@ -53,6 +53,18 @@
fi
"
+if {${os.platform} == "darwin" && ${os.subplatform} == "macosx"} {
+ # Insert an empty line into the notes
+ notes-append ""
+ notes-append "
+ The port bash-completion >=2.0 requires bash >=4.1; please make sure
+ you are using ${prefix}/bin/bash by changing the preferences of your
+ terminal accordingly. If your version of bash is too old, the script
+ above will not modify your shell environment and no extended completion
+ will be available.
+ "
+}
+
livecheck.type regex
livecheck.url ${homepage}
livecheck.regex "bash-completion-(\\d+(?:\\.\\d+)*)${extract.suffix}"
Deleted: trunk/dports/sysutils/bash-completion-devel/files/patch-man.diff
===================================================================
--- trunk/dports/sysutils/bash-completion-devel/files/patch-man.diff 2012-07-05 21:51:40 UTC (rev 95134)
+++ trunk/dports/sysutils/bash-completion-devel/files/patch-man.diff 2012-07-05 21:53:02 UTC (rev 95135)
@@ -1,11 +0,0 @@
---- completions/man.orig 2011-02-10 20:00:21.000000000 +0100
-+++ completions/man 2011-02-10 20:00:58.000000000 +0100
-@@ -27,7 +27,7 @@
- fi
-
- uname=$( uname -s )
-- if [[ $uname == @(Linux|GNU|GNU/*|FreeBSD|Cygwin|CYGWIN_*) ]]; then
-+ if [[ $uname == @(Linux|GNU|GNU/*|FreeBSD|Darwin|Cygwin|CYGWIN_*) ]]; then
- manpath=$( manpath 2>/dev/null || command man --path )
- else
- manpath=$MANPATH
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120705/060b61f1/attachment-0001.html>
More information about the macports-changes
mailing list