From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21766 invoked by alias); 24 Mar 2018 13:59:20 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42521 Received: (qmail 27954 invoked by uid 1010); 24 Mar 2018 13:59:20 -0000 X-Qmail-Scanner-Diagnostics: from park01.gkg.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(205.235.26.22):SA:0(-1.4/5.0):. Processed in 10.05076 secs); 24 Mar 2018 13:59:20 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS,T_DKIM_INVALID,T_RP_MATCHES_RCVD autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: SRS0=kkOk=GO=yahoo.co.uk=okiddle@bounces.park01.gkg.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Virus-Scanned: by amavisd-new at gkg.net Authentication-Results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.co.uk X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1521899930; bh=1ItfjPwDTcdKnjyua6QK3x0mqyL/fC88r6WTM2DOJtA=; h=From:References:To:Subject:Date:From:Subject; b=H+rhZ3Wc65ExGaCFmr94SMdag3dwOAxB8zHkAoOypTlz6oZNmx1TD8LhoJwfxoOs+2hy6HKZtcA2QixysrZkHjdBTnYjTNrtXX+0qnkYmWCx9PpsdPHKoHetEAmgTlw3jjdBbgunYbylILwY1OsYWuqg+bXLU6FEOcqpLxE8WPE76BtbiGK9xeWRs5+uCoJ69LeaAFl1lF9XG6VqyO8eWwhkBPUlaIKJ+uNOBPdcyuJzUt//usCUuSL0Dc7GBUz2W08JG4bsUdOqUDsA2DneB1MzMpEdqDbLZTd7mrnmEKW5mgnvqslP3Yff/EhdnMwcITLAb3TQvoVNya5tCqtg7g== X-YMail-OSG: uUP0DWYVM1lZs1CSfwQU6WQdhRo6SCKhwozJIbcxQ7VDesqOmVvLBMlDVkPDpzt FLpXAAi8mzjb5nvemgjOqOqghscOUjXkbBKVyfbzgBpfhaapDPVTb62jMlcne7pau2E5_kikYsBd U9_cab1K6ImAAlsmNcJ04Ep30GSvtYPF3u4SXsMM_KjgYDXmzq4pPkf0FUIltkkO3MaVUBcQjaYT _Or0fQ.PF.lkeo4TaDlFgkfu5P7Ep68xb7oOTUTp5oDC4llHxt_HVQi1mCHmnVP7bLC_4bzjGnGx jS_ZOLHl67z6lXLOezRlxI4OP9ILYgk5aH2ZumYy0wSfBsQVMoTi_gXy0t3W5X0tfRj5qa4K047h xSkniNNj7kU_0rhek0hHXZXv3olrjTiyB5ri6y6TbngjSpGagAc3H7ZTraNm0CJmcQ0u3ZikiHs0 616QFciP.6jGT2ZGg7GlyV8a0gYPFYX3Bwr87nXAZFBDKGgFRMWpbPiFfAJUPREsss8wolshbFW9 NYa3_gKCKaw-- cc: zsh-workers@zsh.org In-reply-to: <87wp2eobmf.wl-fumiyas@osstech.co.jp> From: Oliver Kiddle References: <87wp2eobmf.wl-fumiyas@osstech.co.jp> To: SATOH Fumiyasu Subject: Re: [PATCH] include Makefile relative from the current working directory MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7677.1521898276.1@thecus> Date: Sat, 24 Mar 2018 14:31:16 +0100 Message-ID: <7678.1521898276@thecus> On 25 Nov, SATOH Fumiyasu wrote: > I've confirmed that GNU make, BSD make, Solaris 10 make and > AIX 7.2 make include Makefile relative from the current > working directory. Sorry for taking so long to review this and reply. I can confirm the make behaviour and the patch looks good. There's also further superfluous code in _make, there to keep track of the location of the current Makefile location. This can also be removed so I'll apply the following expanded patch. Oliver diff --git a/Completion/Unix/Command/_make b/Completion/Unix/Command/_make index 890ad1c83..c4548f9a5 100644 --- a/Completion/Unix/Command/_make +++ b/Completion/Unix/Command/_make @@ -69,7 +69,7 @@ _make-expandVars() { } _make-parseMakefile () { - local input var val target dep TAB=$'\t' dir=$1 tmp IFS= + local input var val target dep TAB=$'\t' tmp IFS= while read input do @@ -108,14 +108,10 @@ _make-parseMakefile () { f=${f%[\">]} fi f=$(_make-expandVars $f) - case $f in - (/*) ;; - (*) f=$dir/$f ;; - esac if [[ -r $f ]] then - _make-parseMakefile ${f%%/[^/]##} < $f + _make-parseMakefile < $f fi ;; esac @@ -150,7 +146,7 @@ _make-findBasedir () { _make() { - local prev="$words[CURRENT-1]" file expl tmp is_gnu dir incl match + local prev="$words[CURRENT-1]" file expl tmp is_gnu incl match local context state state_descr line local -a option_specs local -A VARIABLES VAR_ARGS opt_args @@ -266,16 +262,16 @@ _make() { if [[ $is_gnu == gnu ]] then 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) + _make-parseMakefile < <(_call_program targets "$words[1]" -nsp --no-print-directory -f "$file" .PHONY 2> /dev/null) else - _make-parseMakefile $PWD < $file + _make-parseMakefile < $file fi else 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) + _make-parseMakefile < <(_call_program targets "$words[1]" -nsdg1Fstdout -f "$file" .PHONY 2> /dev/null) else - _make-parseMakefile $PWD < $file + _make-parseMakefile < $file fi fi fi