freebsd-ports/ports-mgmt/portmaster/files/extra-patch-files::zsh-completions
Bryan Drewery 138760a2b8 - Update ZSH completions with pkgng support [1]
- Enable the PKGNG patch by default if WITH_PKGNG
  is defined.

Submitted by:	ume [1]
Feature safe:	yes
2012-10-16 03:00:00 +00:00

30 lines
949 B
Text

Index: files/zsh-completions
diff -u files/zsh-completions.orig files/zsh-completions
--- files/zsh-completions.orig 2012-10-10 21:46:28.000000000 +0900
+++ files/zsh-completions 2012-10-16 01:37:31.000000000 +0900
@@ -61,7 +61,11 @@
case "$state" in
pkgs)
- array=("${PKG_DBDIR:-/var/db/pkg}"/*(/:t))
+ if [ -n "$(make -V WITH_PKGNG)" ]; then
+ array=($(pkg info -aq))
+ else
+ array=("${PKG_DBDIR:-/var/db/pkg}"/*(/:t))
+ fi
_describe -t packages "installed ports" array
;;
ports)
@@ -71,7 +75,11 @@
_tags packages ports
while _tags; do
if _requested packages; then
- array=("${PKG_DBDIR:-/var/db/pkg}"/*(/:t))
+ if [ -n "$(make -V WITH_PKGNG)" ]; then
+ array=($(pkg info -aq))
+ else
+ array=("${PKG_DBDIR:-/var/db/pkg}"/*(/:t))
+ fi
_describe -t packages "installed ports" array && ret=0
fi
if _requested ports; then