Subject: pkg/25559: pkgsrc/bootstrap/bmake handles .SHELL incorrectly
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <tnn@netilium.org>
List: pkgsrc-bugs
Date: 05/14/2004 00:48:19
>Number:         25559
>Category:       pkg
>Synopsis:       pkgsrc/bootstrap/bmake handles .SHELL incorrectly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 14 00:49:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Tobias Nygren
>Release:        2.0_BETA
>Organization:
>Environment:
NetBSD soyokaze 2.0_BETA NetBSD 2.0_BETA (SOYOKAZE) #0: Wed May 12 15:19:01 CEST 2004  tnn@hitomi:/gtmp/netbsd-2-0/src/obj-athlon/sys/arch/i386/compile/SOYOKAZE i386
>Description:
The Job_ParseShell() function ignores the last parameter given
on the .SHELL target. (see below).
Additionally the shell is only used if bmake is run with the -j flag.
Have not solved the latter problem yet.

>How-To-Repeat:
tnn@soyokaze:~/bmake_test$ cat > Makefile
.SHELL: name=csh
all:
        true
tnn@soyokaze:~/bmake_test$ bmake/bmake
bmake: "/u/tnn/bmake_test/Makefile" line 1: Neither path nor name specified
bmake: "/u/tnn/bmake_test/Makefile" line 1: improper shell specification
bmake: Fatal errors encountered -- cannot continue

bmake: stopped in /u/tnn/bmake_test
tnn@soyokaze:~/bmake_test$ (cd bmake ; patch < job.diff; make) > /dev/null 2>&1
tnn@soyokaze:~/bmake_test$ bmake/bmake 
true
tnn@soyokaze:~/bmake_test$ cat > Makefile
.SHELL: name=uptime path=/usr/bin/uptime

all:
        true
tnn@soyokaze:~/bmake_test$ bmake/bmake
true
tnn@soyokaze:~/bmake_test$ bmake/bmake -j 1
 2:45AM  up 1 day,  7:28, 16 users, load averages: 0.80, 0.73, 0.66

>Fix:
+++ job.c	2004-05-14 02:39:34.000000000 +0200
@@ -2779,7 +2779,7 @@
     /*
      * Parse the specification by keyword
      */
-    for (path = NULL, argc = wordCount - 1, argv = words;
+    for (path = NULL, argc = wordCount, argv = words;
 	argc != 0;
 	argc--, argv++) {
 	    if (strncmp(*argv, "path=", 5) == 0) {

>Release-Note:
>Audit-Trail:
>Unformatted: