aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ports-mgmt/portmaster/Makefile2
-rw-r--r--ports-mgmt/portmaster/files/patch-files-bash-completions46
2 files changed, 47 insertions, 1 deletions
diff --git a/ports-mgmt/portmaster/Makefile b/ports-mgmt/portmaster/Makefile
index f834ef1f5ab3..65ed353f20bb 100644
--- a/ports-mgmt/portmaster/Makefile
+++ b/ports-mgmt/portmaster/Makefile
@@ -2,7 +2,7 @@
PORTNAME= portmaster
PORTVERSION= 3.14
-PORTREVISION= 7
+PORTREVISION= 8
CATEGORIES= ports-mgmt
MASTER_SITES= GH \
http://mirror.shatow.net/freebsd/portmaster/
diff --git a/ports-mgmt/portmaster/files/patch-files-bash-completions b/ports-mgmt/portmaster/files/patch-files-bash-completions
new file mode 100644
index 000000000000..f78b59cd6732
--- /dev/null
+++ b/ports-mgmt/portmaster/files/patch-files-bash-completions
@@ -0,0 +1,46 @@
+diff --git files/bash-completions files/bash-completions
+index 2293183..d5bf298 100644
+--- files/bash-completions
++++ files/bash-completions
+@@ -1,13 +1,25 @@
+ # $FreeBSD$
+ #
++_pkgs_list() {
++ local dbdir="$1"
++ shift 1 # the rest will be passed diretly to compgen
++ if [ -n "$(make -f /usr/share/mk/bsd.port.mk -V WITH_PKGNG)" ]; then
++ compgen -W "$(pkg info -aq)" $*
++ else
++ cd ${dbdir} && compgen -d $*
++ fi
++}
++
+ _portmaster () {
+- local cur
++ local cur dbdir portsdir
+ cur=${COMP_WORDS[COMP_CWORD]}
++ dbdir=${PKG_DBDIR:-/var/db/pkg}
++ portsdir=${PORTSDIR:-/usr/ports}
+
+ case "$cur" in
+- /usr/ports/*)
++ ${portsdir}/*)
+ COMPREPLY=( $( compgen -d $cur ) ) ;;
+- */*) COMPREPLY=( $( compgen -d /usr/ports/$cur ) ) ;;
++ */*) COMPREPLY=( $( compgen -d ${portsdir}/$cur ) ) ;;
+ --*) COMPREPLY=( $( compgen -W '--force-config --show-work \
+ --packages --packages-only \
+ --packages-build --packages-if-newer --delete-build-only \
+@@ -20,9 +32,9 @@ _portmaster () {
+ --check-depends --check-port-dbdir --list-origins \
+ --help --version' -- $cur ) )
+ ;;
+- *) COMPREPLY=( $( compgen -d /var/db/pkg/$cur ) )
+- COMPREPLY=( ${COMPREPLY[@]#/var/db/pkg/} )
+- COMPREPLY=( ${COMPREPLY[@]} $( compgen -d /usr/ports/$cur ) )
++ *) COMPREPLY=( $(_pkgs_list ${dbdir} "${cur}" ) )
++ COMPREPLY=( ${COMPREPLY[@]#${dbdir}/} )
++ COMPREPLY=( ${COMPREPLY[@]} $( compgen -d ${portsdir}/$cur ) )
+ COMPREPLY=( ${COMPREPLY[@]#/ports/} )
+ ;;
+ esac \ No newline at end of file