From sada@rr.iij4u.or.jp  Thu Feb  4 12:30:53 1999
Received: from rr.iij4u.or.jp (h069.p060.iij4u.or.jp [210.130.60.69])
          by hub.freebsd.org (8.8.8/8.8.8) with SMTP id MAA16390
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 4 Feb 1999 12:30:50 -0800 (PST)
          (envelope-from sada@rr.iij4u.or.jp)
Received: (qmail 2934 invoked by uid 1000); 5 Feb 1999 05:30:48 +0900
Message-Id: <19990204203048.2933.sada@rr.iij4u.or.jp>
Date: 5 Feb 1999 05:30:48 +0900
From: sada@FreeBSD.ORG
Reply-To: sada@FreeBSD.ORG
To: FreeBSD-gnats-submit@freebsd.org
Subject: make release would fail for lack of /etc/resolv.conf or $DISTFILES/
X-Send-Pr-Version: 3.2

>Number:         9913
>Category:       misc
>Synopsis:       make release would fail for lack of /etc/resolv.conf or $DISTFILES/
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb  4 12:40:01 PST 1999
>Closed-Date:    Wed Mar 31 03:19:10 PST 1999
>Last-Modified:  Wed Mar 31 03:19:48 PST 1999
>Originator:     SADA Kenji
>Release:        FreeBSD 4.0-current i386
>Organization:
Nagoya.Aichi.Japan
>Environment:

	FreeBSD 4.0-current i386

>Description:

	If you don't have /etc/resolv.conf nor $DISTFILES/,
	``make release'' would fail.

	This was pointed out by
	YAMAMOTO Shigeru <shigeru@bremen.or.jp>.

>How-To-Repeat:

	On a machine without /etc/resolv.conf nor /usr/ports/distfiles:

		# cd /usr/src/release && make release

>Fix:

Index: Makefile
===================================================================
RCS file: /home/ncvs/src/release/Makefile,v
retrieving revision 1.467
diff -u -r1.467 Makefile
--- Makefile	1999/02/01 18:08:07	1.467
+++ Makefile	1999/02/04 20:20:13
@@ -147,7 +147,9 @@
 	-mkdir -p ${CHROOTDIR}
 	cd ${.CURDIR}/../etc && ${MAKE} distrib-dirs DESTDIR=${CHROOTDIR}
 	cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR}
-	[ -f /etc/resolv.conf ] && cp -p /etc/resolv.conf ${CHROOTDIR}/etc
+	if [ -f /etc/resolv.conf ]; then \
+		cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \
+	fi
 	cd ${.CURDIR}/.. && ${MAKE} installworld DESTDIR=${CHROOTDIR} NOMAN=1
 	mkdir ${CHROOTDIR}/${BOOTSTRAPDIR}
 	for i in ${BOOTSTRAPUTILS} ; do \
@@ -171,7 +173,9 @@
 .endif
 .if !defined(NODOC)
 	cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co -P ${RELEASEDOCMODULE}
-	[ -d ${DISTFILES}/ ] && cp -rp ${DISTFILES} ${CHROOTDIR}/usr/ports/distfiles
+	if [ -d ${DISTFILES}/ ]; then \
+		cp -rp ${DISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \
+	fi
 .endif
 .endif
 .if make(rerelease)
>Release-Note:
>Audit-Trail:

From: jin@george.lbl.gov
To: FreeBSD-gnats-submit@FreeBSD.ORG, sada@FreeBSD.ORG
Cc:  
Subject: Re: misc/9913: make release would fail for lack of /etc/resolv.conf or $DISTFILES/
Date: Thu, 4 Feb 1999 13:25:34 -0800 (PST)

 Interesting! The '-' line and '+' lines are exactly same.
 What is changed?
 
 ----------------- original message ---------------------
 
 >Fix:
  
 Index: Makefile
 ===================================================================
 RCS file: /home/ncvs/src/release/Makefile,v
 retrieving revision 1.467
 diff -u -r1.467 Makefile
 --- Makefile    1999/02/01 18:08:07     1.467
 +++ Makefile    1999/02/04 20:20:13
 @@ -147,7 +147,9 @@
         -mkdir -p ${CHROOTDIR}
         cd ${.CURDIR}/../etc && ${MAKE} distrib-dirs DESTDIR=${CHROOTDIR}
         cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR}
 -       [ -f /etc/resolv.conf ] && cp -p /etc/resolv.conf ${CHROOTDIR}/etc
 +       if [ -f /etc/resolv.conf ]; then \
 +               cp -p /etc/resolv.conf ${CHROOTDIR}/etc; \
 +       fi
         cd ${.CURDIR}/.. && ${MAKE} installworld DESTDIR=${CHROOTDIR} NOMAN=1
         mkdir ${CHROOTDIR}/${BOOTSTRAPDIR}
         for i in ${BOOTSTRAPUTILS} ; do \
 @@ -171,7 +173,9 @@
  .endif
  .if !defined(NODOC)
         cd ${CHROOTDIR}/usr && rm -rf doc && cvs -R -d ${CVSROOT} co -P ${RELEAS
 EDOCMODULE}
 -       [ -d ${DISTFILES}/ ] && cp -rp ${DISTFILES} ${CHROOTDIR}/usr/ports/distf
 iles
 +       if [ -d ${DISTFILES}/ ]; then \
 +               cp -rp ${DISTFILES} ${CHROOTDIR}/usr/ports/distfiles; \
 +       fi
  .endif
  .endif
  .if make(rerelease)

From: sada@rr.iij4u.or.jp (SADA Kenji)
To: jin@george.lbl.gov
Cc: FreeBSD-gnats-submit@FreeBSD.ORG, sada@FreeBSD.ORG
Subject: Re: misc/9913: make release would fail for lack of /etc/resolv.conf
	 or $DISTFILES/
Date: 5 Feb 1999 07:20:39 +0900

 >> Interesting! The '-' line and '+' lines are exactly same.
 
 No.
 
 >> What is changed?
 
 '-' lines could return negative state and make process would abort.
 Try 'How to repeat' or test by shorter Makefile.
 
 # Adding '-' letters to head of the lines would work as same.

From: Bill Fenner <fenner@parc.xerox.com>
To: jin@george.lbl.gov
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: misc/9913: make release would fail for lack of /etc/resolv.conf or $DISTFILES/ 
Date: Thu, 4 Feb 1999 14:24:19 PST

 In message <199902042140.NAA03940@freefall.freebsd.org>you write:
 > Interesting! The '-' line and '+' lines are exactly same.
 > What is changed?
 
 The return value to make, which determines whether or not it continues.
 
 mango% cat makefile
 a:
         [ -f /tmp/nosuch ] && echo hi
         echo Won't get here!
 
 b:
         if [ -f /tmp/nosuch ]; then \
                 echo hi; \
         fi
         @echo Got here!
 mango% make a
 [ -f /tmp/nosuch ] && echo hi
 *** Error code 1
 
 Stop.
 mango% make b
 if [ -f /tmp/nosuch ]; then  echo hi;  fi
 Got here!
 
   Bill
State-Changed-From-To: open->closed 
State-Changed-By: sada 
State-Changed-When: Wed Mar 31 03:19:10 PST 1999 
State-Changed-Why:  
Committed. 
>Unformatted:
