aboutsummaryrefslogtreecommitdiffstats
path: root/ports-mgmt
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2012-12-07 01:46:10 +0800
committerbdrewery <bdrewery@FreeBSD.org>2012-12-07 01:46:10 +0800
commit031b7fb7bd9da6ec4df7a7ba5d863170b4f1a374 (patch)
tree56455bef50f00716f92c4be4097669f98d6e1b28 /ports-mgmt
parent8249d2bccccfe38863bf4638df4aae7a369f2464 (diff)
downloadfreebsd-ports-gnome-031b7fb7bd9da6ec4df7a7ba5d863170b4f1a374.tar.gz
freebsd-ports-gnome-031b7fb7bd9da6ec4df7a7ba5d863170b4f1a374.tar.zst
freebsd-ports-gnome-031b7fb7bd9da6ec4df7a7ba5d863170b4f1a374.zip
- Add upstream patch for fixing bash completions with PKGNG
and to respect env PORTSDIR/PKG_DBDIR Feature safe: yes
Diffstat (limited to 'ports-mgmt')
-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