1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-13 03:03:15 +00:00

Fix make and gmake completion

Submitted by:	Daniel Shahaf (on zsh mailing list)
Reported by:	Guilherme Salazar (on zsh mailing list)
This commit is contained in:
Baptiste Daroussin 2016-10-16 18:46:14 +00:00
parent 6217deba5d
commit f121cb0019
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=424080
2 changed files with 32 additions and 1 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= zsh
DISTVERSION= 5.2
PORTREVISION= 3
PORTREVISION= 4
CATEGORIES= shells
MASTER_SITES= http://www.zsh.org/pub/ \
SF \

View File

@ -0,0 +1,31 @@
--- Completion/Unix/Command/_make.orig 2016-10-16 18:41:19 UTC
+++ Completion/Unix/Command/_make
@@ -262,17 +262,20 @@ _make() {
if [[ -n "$file" ]]
then
- if [[ $is_gnu == gnu ]] && zstyle -t ":completion:${curcontext}:targets" call-command
+ if [[ $is_gnu == gnu ]]
then
- _make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsp --no-print-directory -f "$file" .PHONY 2> /dev/null)
+ if zstyle -t ":completion:${curcontext}:targets" call-command; then
+ _make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsp --no-print-directory -f "$file" .PHONY 2> /dev/null)
+ else
+ _make-parseMakefile $PWD < $file
+ fi
else
- case "$OSTYPE" in
- freebsd*)
- _make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsp -f "$file" .PHONY 2> /dev/null)
- ;;
- *)
+ if [[ $OSTYPE == (freebsd|dragonfly|netbsd)* || /$words[1] == */bmake* ]]; then
+ TARGETS+=(${=${(f)"$(_call_program targets "$words[1]" -s -f "$file" -V.ALLTARGETS 2> /dev/null)"}})
+ _make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsdg1Fstdout -f "$file" .PHONY 2> /dev/null)
+ else
_make-parseMakefile $PWD < $file
- esac
+ fi
fi
fi