| Summary: | bug in make(1) | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Archie Cobbs <archie> | ||||
| Component: | bin | Assignee: | Martin Cracauer <cracauer> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 3.1-STABLE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
|
Description
Archie Cobbs
1999-10-25 04:50:01 UTC
On Sun, Oct 24, 1999 at 08:44:41PM -0700, Archie Cobbs wrote: > > >How-To-Repeat: > > $ cat makefile > foo1: > var1=yes; test "$$var1" = "no" && var2=". $$var2"; echo OK > foo2: > test "$$var1" = "no" && var2=". $$var2"; echo OK > $ make foo1 > var1=yes; test "$var1" = "no" && var2=". $var2"; echo OK > *** Error code 1 > > Stop. > $ make foo2 > test "$var1" = "no" && var2=". $var2"; echo OK > OK > Certainly, there is a problem somewhere above, but the following makefiles work as expected: # cat ~/Makefile.1 foo1: var1=yes; test "$$var1" = "no" && var2=". $$var2" || :; echo OK foo2: test "$$var1" = "no" && var2=". $$var2" || :; echo OK # cat ~/Makefile.2 foo1: var1=yes; if test "$$var1" = "no"; then var2=". $$var2"; fi; echo OK foo2: if test "$$var1" = "no"; then var2=". $$var2"; fi; echo OK Cheers, -- Ruslan Ermilov Sysadmin and DBA of the ru@ucb.crimea.ua United Commercial Bank, ru@FreeBSD.org FreeBSD committer, +380.652.247.647 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age Hi! It turns out to be a sh(1) bug: $ sh -e -c 'test "yes" = "no" && :; echo OK'; echo $? OK 0 $ sh -e -c ':; test "yes" = "no" && :; echo OK'; echo $? 1 Here is what sh(1) manpage says about `-e' option: : :-e errexit : If not interactive, exit immediately if any untested command : fails. The exit status of a command is considered to be explicitly : tested if the command is used to control an if, elif, while, : or until; or if the command is the left hand operand of an ``&&'' : or ``||'' operator. On Mon, Oct 25, 1999 at 10:08:43AM +0300, Ruslan Ermilov wrote: > On Sun, Oct 24, 1999 at 08:44:41PM -0700, Archie Cobbs wrote: > > > > >How-To-Repeat: > > > > $ cat makefile > > foo1: > > var1=yes; test "$$var1" = "no" && var2=". $$var2"; echo OK > > foo2: > > test "$$var1" = "no" && var2=". $$var2"; echo OK > > $ make foo1 > > var1=yes; test "$var1" = "no" && var2=". $var2"; echo OK > > *** Error code 1 > > > > Stop. > > $ make foo2 > > test "$var1" = "no" && var2=". $var2"; echo OK > > OK > > > Certainly, there is a problem somewhere above, but the following makefiles > work as expected: > > # cat ~/Makefile.1 > foo1: > var1=yes; test "$$var1" = "no" && var2=". $$var2" || :; echo OK > > foo2: > test "$$var1" = "no" && var2=". $$var2" || :; echo OK > > # cat ~/Makefile.2 > foo1: > var1=yes; if test "$$var1" = "no"; then var2=". $$var2"; fi; echo OK > > foo2: > if test "$$var1" = "no"; then var2=". $$var2"; fi; echo OK > -- Ruslan Ermilov Sysadmin and DBA of the ru@ucb.crimea.ua United Commercial Bank, ru@FreeBSD.org FreeBSD committer, +380.652.247.647 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age Responsible Changed From-To: freebsd-bugs->cracauer I thought I'd seen this problem with sh(1) fixed. I'm sure Martin will be interested. Could you please test the appended diff? There are possibly other types of nodes that must be excluded from exiting, but this seems to be the most urgent. Martin -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Martin Cracauer <cracauer@cons.org> http://www.cons.org/cracauer/ Tel.: (private) +4940 5221829 Fax.: (private) +4940 5228536 On Mon, Oct 25, 1999 at 12:55:45PM +0200, Martin Cracauer wrote: > Could you please test the appended diff? > > There are possibly other types of nodes that must be excluded from > exiting, but this seems to be the most urgent. > Yup, it works now! -- Ruslan Ermilov Sysadmin and DBA of the ru@ucb.crimea.ua United Commercial Bank, ru@FreeBSD.org FreeBSD committer, +380.652.247.647 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age State Changed From-To: open->closed Diff I sent for testing committed to -current. Will be in -stable after some time. |