From nobody@FreeBSD.org  Tue Mar 12 23:02:26 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id 9FF72957
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 12 Mar 2013 23:02:26 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 783AEEEA
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 12 Mar 2013 23:02:26 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r2CN2QIb031084
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 12 Mar 2013 23:02:26 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r2CN2QlJ031083;
	Tue, 12 Mar 2013 23:02:26 GMT
	(envelope-from nobody)
Message-Id: <201303122302.r2CN2QlJ031083@red.freebsd.org>
Date: Tue, 12 Mar 2013 23:02:26 GMT
From: Garrett Cooper <yaneurabeya@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] make distrib-dirs doesn't detect missing mtree files
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         176897
>Category:       conf
>Synopsis:       [PATCH] make distrib-dirs doesn't detect missing mtree files
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    brooks
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Mar 12 23:10:00 UTC 2013
>Closed-Date:    Thu May 09 18:43:26 UTC 2013
>Last-Modified:  Thu May  9 18:50:00 UTC 2013
>Originator:     Garrett Cooper
>Release:        10-CURRENT
>Organization:
EMC Isilon
>Environment:
FreeBSD fuji-current.local 10.0-CURRENT FreeBSD 10.0-CURRENT #5 r+6fb31dd: Tue Mar 12 15:32:36 PDT 2013     root@fuji-current.local:/usr/obj/usr/src/sys/FUJI  i386
>Description:
Ran make hierarchy and didn't realize there was a typo on my git branch with the MTREES var (BSD.test.dist -> BSD.tests.dist).

At the very least distrib-dirs should depend on the mtree file. This hack (a proper solution would be to make it a dependency of the target, but that would involve a large degree of gymnastics) would address that:

diff --git a/etc/Makefile b/etc/Makefile
index 3a10b02..7ac3bec 100644
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -335,6 +335,7 @@ distrib-dirs:
        @set ${MTREES}; \
        while test $$# -ge 2; do \
                m=${.CURDIR}/$$1; \
+               test -e $$m; \
                shift; \
                d=${DESTDIR}$$1; \
                shift; \
>How-To-Repeat:
1. Apply this patch:

diff --git a/etc/Makefile b/etc/Makefile
index 3a10b02..6f15fd0 100644
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -308,7 +308,7 @@ distribution:
 
 MTREE_CMD?=    mtree
 
-MTREES=                mtree/BSD.root.dist             /               \
+MTREES=                mtree/BSD.roots.dist            /               \
                mtree/BSD.var.dist              /var            \
                mtree/BSD.usr.dist              /usr            \
                mtree/BSD.include.dist          /usr/include
2. Run make hierarchy from the top-level directory.
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->brooks 
Responsible-Changed-By: brooks 
Responsible-Changed-When: Wed Mar 13 20:38:57 UTC 2013 
Responsible-Changed-Why:  
I wrote this code. 

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

From: Brooks Davis <brooks@FreeBSD.org>
To: Garrett Cooper <yaneurabeya@gmail.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: conf/176897: [PATCH] make distrib-dirs doesn't detect missing
 mtree files
Date: Wed, 13 Mar 2013 17:36:10 -0500

 On Tue, Mar 12, 2013 at 11:02:26PM +0000, Garrett Cooper wrote:
 > 
 > At the very least distrib-dirs should depend on the mtree file. This
 > hack (a proper solution would be to make it a dependency of the
 > target, but that would involve a large degree of gymnastics) would
 > address that:
 >
 
 I think this will add the dependency:
 
 Index: etc/Makefile
 ===================================================================
 --- etc/Makefile        (revision 247105)
 +++ etc/Makefile        (working copy)
 @@ -328,7 +328,7 @@
  MTREES+=	../${mtree}			/
  .endfor
  
 -distrib-dirs:
 +distrib-dirs: ${MTREES:N/*}
 	@set ${MTREES}; \
 	while test $$# -ge 2; do \
 		m=${.CURDIR}/$$1; \
 
 
 -- Brooks

From: Garrett Cooper <yaneurabeya@gmail.com>
To: Brooks Davis <brooks@freebsd.org>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: conf/176897: [PATCH] make distrib-dirs doesn't detect missing
 mtree files
Date: Wed, 13 Mar 2013 16:27:57 -0700

 On Wed, Mar 13, 2013 at 3:36 PM, Brooks Davis <brooks@freebsd.org> wrote:
 > On Tue, Mar 12, 2013 at 11:02:26PM +0000, Garrett Cooper wrote:
 >>
 >> At the very least distrib-dirs should depend on the mtree file. This
 >> hack (a proper solution would be to make it a dependency of the
 >> target, but that would involve a large degree of gymnastics) would
 >> address that:
 >>
 >
 > I think this will add the dependency:
 
     Assuming the paths to the mtrees aren't absolute, yes.
 Thanks!
 -Garrett
 
 $ cat Makefile.mtrees
 MTREES= a/b/c /d/e/f \
         g/h/i /j/k/l \
         /m/n/o /p/q/r \
 
 .warning "${MTREES:N/*}"
 
 all:
 $ make -f Makefile.mtrees
 "Makefile.mtrees", line 5: warning: "a/b/c g/h/i"

From: Brooks Davis <brooks@freebsd.org>
To: Garrett Cooper <yaneurabeya@gmail.com>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: conf/176897: [PATCH] make distrib-dirs doesn't detect missing
 mtree files
Date: Thu, 14 Mar 2013 08:50:51 -0500

 On Wed, Mar 13, 2013 at 04:27:57PM -0700, Garrett Cooper wrote:
 > On Wed, Mar 13, 2013 at 3:36 PM, Brooks Davis <brooks@freebsd.org> wrote:
 > > On Tue, Mar 12, 2013 at 11:02:26PM +0000, Garrett Cooper wrote:
 > >>
 > >> At the very least distrib-dirs should depend on the mtree file. This
 > >> hack (a proper solution would be to make it a dependency of the
 > >> target, but that would involve a large degree of gymnastics) would
 > >> address that:
 > >>
 > >
 > > I think this will add the dependency:
 > 
 >     Assuming the paths to the mtrees aren't absolute, yes.
 
 They can't be actual absolute paths due to this: m=${.CURDIR}/$$1
 
 Given that this is just hand holding for developers, I think this is
 sufficient.
 
 -- Brooks
State-Changed-From-To: open->patched 
State-Changed-By: brooks 
State-Changed-When: Tue Apr 30 19:26:54 UTC 2013 
State-Changed-Why:  
Patched in HEAD. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: conf/176897: commit references a PR
Date: Tue, 30 Apr 2013 19:26:52 +0000 (UTC)

 Author: brooks
 Date: Tue Apr 30 19:26:44 2013
 New Revision: 250116
 URL: http://svnweb.freebsd.org/changeset/base/250116
 
 Log:
   Make an attempt to detect missing MTREE files in distrib-dirs.  Not
   perfect, but this is just a developer seatbelt.
   
   PR:		conf/176897
   Submitted by:	Garrett Cooper <yaneurabeya@gmail.com>
   MFC after:	1 week
 
 Modified:
   head/etc/Makefile
 
 Modified: head/etc/Makefile
 ==============================================================================
 --- head/etc/Makefile	Tue Apr 30 18:48:11 2013	(r250115)
 +++ head/etc/Makefile	Tue Apr 30 19:26:44 2013	(r250116)
 @@ -328,7 +328,7 @@ MTREES+=	mtree/BSD.sendmail.dist		/
  MTREES+=	../${mtree}			/
  .endfor
  
 -distrib-dirs:
 +distrib-dirs: ${MTREES:N/*}
  	@set ${MTREES}; \
  	while test $$# -ge 2; do \
  		m=${.CURDIR}/$$1; \
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: brooks 
State-Changed-When: Thu May 9 18:43:14 UTC 2013 
State-Changed-Why:  
Merged to 9. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: conf/176897: commit references a PR
Date: Thu,  9 May 2013 18:43:11 +0000 (UTC)

 Author: brooks
 Date: Thu May  9 18:43:01 2013
 New Revision: 250417
 URL: http://svnweb.freebsd.org/changeset/base/250417
 
 Log:
   MFC r250116:
   
   Make an attempt to detect missing MTREE files in distrib-dirs.  Not
   perfect, but this is just a developer seatbelt
   
   PR:		conf/176897
   Submitted by:	Garrett Cooper <yaneurabeya@gmail.com>
 
 Modified:
   stable/9/etc/Makefile
 Directory Properties:
   stable/9/etc/   (props changed)
 
 Modified: stable/9/etc/Makefile
 ==============================================================================
 --- stable/9/etc/Makefile	Thu May  9 18:38:49 2013	(r250416)
 +++ stable/9/etc/Makefile	Thu May  9 18:43:01 2013	(r250417)
 @@ -310,7 +310,7 @@ MTREES+=	mtree/BSD.sendmail.dist		/
  MTREES+=	../${mtree}			/
  .endfor
  
 -distrib-dirs:
 +distrib-dirs: ${MTREES:N/*}
  	@set ${MTREES}; \
  	while test $$# -ge 2; do \
  		m=${.CURDIR}/$$1; \
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
