Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] more _make fixes



I'm working on _make a little more, and I noticed that it outputs extra
targets for "VAR := VALUE" lines.  My fix is to add "([^=]|$)" after the
":" in each regex (the "|$" part is just paranoia in case someone put a
useless target without rules or dependencies right at the end of the
file).

Attached is my patch.

..wayne..
--- _make	18 Aug 2004 17:10:27 -0000	1.5
+++ _make	18 Aug 2004 17:49:10 -0000
@@ -27,14 +27,14 @@ else
     if [[ $is_gnu = gnu ]] &&
        zstyle -t ":completion:${curcontext}:targets" call-command; then
        if [[ -n $useperl ]]; then
-        cmdargs=(perl -F: -ane '/^[a-zA-Z0-9][^\/\t=]+:/ && print "$F[0]\n"')
+        cmdargs=(perl -F: -ane '/^[a-zA-Z0-9][^\/\t=]+:([^=]|$)/ && print "$F[0]\n"')
        else
-        cmdargs=(awk '/^[a-zA-Z0-9][^\/\t=]+:/ {print $1}' FS=:)
+        cmdargs=(awk '/^[a-zA-Z0-9][^\/\t=]+:([^=]|$)/ {print $1}' FS=:)
        fi
        tmp=( $(_call_program targets "$words[1]" -nsp --no-print-directory -f "$file" .PHONY 2> /dev/null | $cmdargs) )
     elif [[ -n $useperl ]]; then
       tmp=(
-      $(perl -ne '@matches = /^(?:([a-zA-Z0-9]+[^\/\t=\s]+)\s*)+:/  and
+      $(perl -ne '@matches = /^(?:([a-zA-Z0-9]+[^\/\t=\s]+)\s*)+:([^=]|$)/  and
 	print join(" ", @matches), "\n";
 if (/^\.include\s+\<bsd\.port\.(subdir\.|pre\.)?mk>/ ||
     /^\.include\s+\".*mk\/bsd\.pkg\.(subdir\.)?mk\"/) {
@@ -44,7 +44,7 @@ if (/^\.include\s+\<bsd\.port\.(subdir\.
 	)
     else
       tmp=(
-            $(awk '/^[a-zA-Z0-9][^\/\t=]+:/ {print $1}
+            $(awk '/^[a-zA-Z0-9][^\/\t=]+:([^=]|$)/ {print $1}
  	      /^\.include  *<bsd\.port\.(subdir\.|pre\.)?mk>/ || /^\.include  *".*mk\/bsd\.pkg\.(subdir\.)?mk"/ {
  	        print "fetch fetch-list extract patch configure build install reinstall deinstall package describe checkpatch checksum makesum" }' \
  	     FS=: $file)


Messages sorted by: Reverse Date, Date, Thread, Author