From neuhauser@chello.cz  Sat Apr 10 09:02:25 2004
Return-Path: <neuhauser@chello.cz>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A725D16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 10 Apr 2004 09:02:25 -0700 (PDT)
Received: from smtp.dkm.cz (smtp.dkm.cz [62.24.64.34])
	by mx1.FreeBSD.org (Postfix) with SMTP id 85F2B43D31
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 10 Apr 2004 09:02:24 -0700 (PDT)
	(envelope-from neuhauser@chello.cz)
Received: (qmail 22105 invoked by uid 0); 10 Apr 2004 16:02:23 -0000
Received: from r3al16.mistral.cz (HELO isis.wad.cz) (213.220.229.16)
  by smtp.dkm.cz with SMTP; 10 Apr 2004 16:02:23 -0000
Received: by isis.wad.cz (Postfix, from userid 1001)
	id 345D32FDA01; Sat, 10 Apr 2004 17:02:52 +0200 (CEST)
Message-Id: <20040410150252.345D32FDA01@isis.wad.cz>
Date: Sat, 10 Apr 2004 17:02:52 +0200 (CEST)
From: Roman Neuhauser <neuhauser@chello.cz>
To: FreeBSD-gnats-submit@freebsd.org
Subject: make.1: better wording in BUGS section
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         65400
>Category:       docs
>Synopsis:       make.1: better wording in BUGS section
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    harti
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 10 09:10:14 PDT 2004
>Closed-Date:    Mon Jul 19 14:44:38 GMT 2004
>Last-Modified:  Mon Jul 19 14:44:38 GMT 2004
>Originator:     Roman Neuhauser
>Release:        FreeBSD 4.9-RELEASE-p2 i386
>Organization:
>Environment:
System: FreeBSD isis.wad.cz 4.9-RELEASE-p2 FreeBSD 4.9-RELEASE-p2 #3: Sun Mar 7 02:11:16 CET 2004 root@isis.wad.cz:/usr/obj/usr/src/sys/FREEPUPPY2_6 i386


	
>Description:
	the make manual page says:

     For loops are expanded before tests, so a fragment such as:

     .for TMACHINE in ${SHARED_ARCHS}
     .if ${TMACHINE} = ${MACHINE}
          ...
     .endif
     .endfor
     won't work, and should be rewritten the other way around.

    This formulation isn't as clear as it could be, it sounds like the
    loop should be inside the condition. I know it confused me when
    I was trying to learn make, and recently saw someone else's post
    about the same thing on one of the lists.
>How-To-Repeat:
	
>Fix:

	The attached shar contains patches for both CURRENT and RELENG_4.

--- src::usr.bin::make::make.1.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	/home/roman/codex/patches/FreeBSD/make.1.CURRENT.patch
#	/home/roman/codex/patches/FreeBSD/make.1.STABLE.patch
#
echo x - /home/roman/codex/patches/FreeBSD/make.1.CURRENT.patch
sed 's/^X//' >/home/roman/codex/patches/FreeBSD/make.1.CURRENT.patch << 'END-of-/home/roman/codex/patches/FreeBSD/make.1.CURRENT.patch'
XIndex: make.1
X===================================================================
XRCS file: /home/ncvs/src/usr.bin/make/make.1,v
Xretrieving revision 1.66
Xdiff -u -r1.66 make.1
X--- make.1	21 Jan 2004 17:58:33 -0000	1.66
X+++ make.1	10 Apr 2004 14:31:14 -0000
X@@ -1260,7 +1260,7 @@
X \&.endfor
X .Ed
X .Pp
X-won't work, and should be rewritten the other way around.
X+won't work, and should be rewritten with the operands swapped.
X .Pp
X The parsing code is broken with respect to handling a semicolon
X after a colon, so a fragment like this will fail:
END-of-/home/roman/codex/patches/FreeBSD/make.1.CURRENT.patch
echo x - /home/roman/codex/patches/FreeBSD/make.1.STABLE.patch
sed 's/^X//' >/home/roman/codex/patches/FreeBSD/make.1.STABLE.patch << 'END-of-/home/roman/codex/patches/FreeBSD/make.1.STABLE.patch'
XIndex: make.1
X===================================================================
XRCS file: /home/ncvs/src/usr.bin/make/make.1,v
Xretrieving revision 1.29.2.15
Xdiff -u -r1.29.2.15 make.1
X--- make.1	17 Dec 2002 19:01:18 -0000	1.29.2.15
X+++ make.1	10 Apr 2004 14:36:27 -0000
X@@ -1265,7 +1265,7 @@
X \&.endif
X \&.endfor
X .Ed
X-won't work, and should be rewritten the other way around.
X+won't work, and should be rewritten with the operands swapped.
X .Sh SEE ALSO
X .Xr mkdep 1 ,
X .Xr make.conf 5
END-of-/home/roman/codex/patches/FreeBSD/make.1.STABLE.patch
exit
--- src::usr.bin::make::make.1.shar ends here ---


>Release-Note:
>Audit-Trail:

From: Warren Block <wblock@wonkity.com>
To: Roman Neuhauser <neuhauser@chello.cz>
Cc: FreeBSD-gnats-submit@freebsd.org, freebsd-doc@freebsd.org
Subject: Re: docs/65400: make.1: better wording in BUGS section
Date: Sat, 10 Apr 2004 10:33:30 -0600 (MDT)

 On Sat, 10 Apr 2004, Roman Neuhauser wrote:
 
 > >Description:
 > 	the make manual page says:
 >
 >      For loops are expanded before tests, so a fragment such as:
 >
 >      .for TMACHINE in ${SHARED_ARCHS}
 >      .if ${TMACHINE} = ${MACHINE}
 >           ...
 >      .endif
 >      .endfor
 >      won't work, and should be rewritten the other way around.
 >
 >     This formulation isn't as clear as it could be, it sounds like the
 >     loop should be inside the condition. I know it confused me when
 >     I was trying to learn make, and recently saw someone else's post
 >     about the same thing on one of the lists.
 
 > X-won't work, and should be rewritten the other way around.
 > X+won't work, and should be rewritten with the operands swapped.
 
 It's still not very clear (arguments to the .for or the .if?).  Beyond
 that, "won't work" is just the sort of thing that most of us hate
 because it doesn't provide any details.  Best is to show the right way
 in the first place, with a note about why other ways will fail.
 
 The preceding paragraph is not good, either:
 
   "The evaluation of expression in a test is very simple-minded.  Currently,
    the only form that works is `.if ${VAR} op something' For instance,
    you should write tests as `.if ${VAR} = string' not the other way around,
    which doesn't work."
 
 I can't tell if this applies to the .for/.if paragraph, which has
 ".if ${VAR} = ${VAR}".
 
 -Warren Block * Rapid City, South Dakota USA
 
State-Changed-From-To: open->feedback 
State-Changed-By: harti 
State-Changed-When: Mon Jul 19 12:28:05 GMT 2004 
State-Changed-Why:  
Grab this PR. Also request feedback from the submitter on an enhanced 
patch. 


Responsible-Changed-From-To: freebsd-doc->harti 
Responsible-Changed-By: harti 
Responsible-Changed-When: Mon Jul 19 12:28:05 GMT 2004 
Responsible-Changed-Why:  
Grab this PR. Also request feedback from the submitter on an enhanced 
patch. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=65400 

From: Harti Brandt <harti@freebsd.org>
To: freebsd-gnats-submit@freebsd.org
Cc: neuhauser@chello.cz
Subject: Re: docs/65400
Date: Mon, 19 Jul 2004 14:27:45 +0200 (CEST)

 Hi Roman,
 
 please check the attached patch for make.1. I decided to just give the 
 correct usage in addition to the false example. This should make things 
 clear. Additionally this patch fixes the use of '=' in conditionals (they 
 should be '==').
 
 harti
 
 Index: make.1
 ===================================================================
 RCS file: /home/ncvs/src/usr.bin/make/make.1,v
 retrieving revision 1.72
 diff -u -r1.72 make.1
 --- make.1	18 Jul 2004 02:26:30 -0000	1.72
 +++ make.1	19 Jul 2004 12:25:33 -0000
 @@ -1270,19 +1270,26 @@
   Currently, the only form that works is
   .Ql .if ${VAR} op something
   For instance, you should write tests as
 -.Ql .if ${VAR} = "string"
 -not the other way around, which doesn't work.
 +.Ql .if ${VAR} == "string"
 +not the other way around, which would give you an error.
   .Pp
   For loops are expanded before tests, so a fragment such as:
   .Bd -literal -offset indent
   \&.for TMACHINE in ${SHARED_ARCHS}
 -\&.if ${TMACHINE} = ${MACHINE}
 +\&.if ${TMACHINE} == ${MACHINE}
        ...
   \&.endif
   \&.endfor
   .Ed
   .Pp
 -won't work, and should be rewritten the other way around.
 +won't work, and should be rewritten as:
 +.Bd -literal -offset indent
 +\&.for TMACHINE in ${SHARED_ARCHS}
 +\&.if ${MACHINE} == ${TMACHINE} 
 +     ...
 +\&.endif
 +\&.endfor
 +.Ed
   .Pp
   The parsing code is broken with respect to handling a semicolon
   after a colon, so a fragment like this will fail:

From: Roman Neuhauser <neuhauser@chello.cz>
To: Harti Brandt <harti@freebsd.org>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: docs/65400
Date: Mon, 19 Jul 2004 16:34:30 +0200

 # harti@freebsd.org / 2004-07-19 14:27:45 +0200:
 >  For loops are expanded before tests, so a fragment such as:
 >  .Bd -literal -offset indent
 >  \&.for TMACHINE in ${SHARED_ARCHS}
 > -\&.if ${TMACHINE} = ${MACHINE}
 > +\&.if ${TMACHINE} == ${MACHINE}
 >       ...
 >  \&.endif
 >  \&.endfor
 >  .Ed
 >  .Pp
 > -won't work, and should be rewritten the other way around.
 > +won't work, and should be rewritten as:
 > +.Bd -literal -offset indent
 > +\&.for TMACHINE in ${SHARED_ARCHS}
 > +\&.if ${MACHINE} == ${TMACHINE} 
 > +     ...
 > +\&.endif
 > +\&.endfor
 
     ok, except perhaps you could choose a different name for the
     TMACHINE variable to make it easily distinguishable from MACHINE.
 
 -- 
 FreeBSD 4.10-STABLE
 4:32PM up 8:56, 2 users, load averages: 0.00, 0.00, 0.00
State-Changed-From-To: feedback->closed 
State-Changed-By: harti 
State-Changed-When: Mon Jul 19 14:43:21 GMT 2004 
State-Changed-Why:  
Committed with TMACHINE changed to ARCH for better human 
parsability. 

Thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=65400 
>Unformatted:
