From owner-freebsd-current@FreeBSD.ORG Wed Sep 25 18:16:57 2013 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 805C26DF for ; Wed, 25 Sep 2013 18:16:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5526A289B for ; Wed, 25 Sep 2013 18:16:57 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1VOtdp-0004B0-T6; Wed, 25 Sep 2013 18:16:50 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r8PIGl2M003182; Wed, 25 Sep 2013 12:16:47 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/hnOV2/TPcCrEsVJrrDDwI Subject: Re: Problem with r255775 include/mk-osreldate.sh From: Ian Lepore To: Doug Ambrisko In-Reply-To: <20130925175210.GA56575@ambrisko.com> References: <20130925175210.GA56575@ambrisko.com> Content-Type: multipart/mixed; boundary="=-b4v9g1nm7Kc0ou0cegLT" Date: Wed, 25 Sep 2013 12:16:47 -0600 Message-ID: <1380133007.1197.209.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Cc: freebsd-current@FreeBSD.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Sep 2013 18:16:57 -0000 --=-b4v9g1nm7Kc0ou0cegLT Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Wed, 2013-09-25 at 10:52 -0700, Doug Ambrisko wrote: > I don't know if others have run into this but I hit a problem with > include/mk-osreldate.sh. It does a set -e to exit on commands failing > and sources in sys/conf/newvers.sh to get various things set. > In newvers.sh it does a bunch of > > if [ $? -eq 0 ]; then > to decide what to do when it passes or fails. Unfortunately, when > it fails due to the "set -e" it just exits and doesn't do the > else clause. For me I check out a svn tree then build in a chroot. > In the chroot svn was failing then not creating a osreldate.h > resulting in the build dying. This happened on two different machines > of which I use this method. > > Removing the set -e in mk-osreldate.sh "fixed" my problem. It should > probably be reworked to not depend on set -e and print errors when things > fail. I guess newvers.sh could be reworked to do > if ; then > which should pass set -e. > > What do folks think? It would be good to get this fixed before MFC > and before 10 is released. > > Doug A. For such a "simple" little change, this sure has been problematic. There are as many ways for it to fail as there are ways to arrange checkout-and-build workflows, apparently. I've been mostly inclined to stay away from any big changes in newvers.sh for fear of breaking it when it's used in some way I'm not familiar with (such as building a release). Sticking with that theory, I'd be inclined to leave it alone again, and not push the 'set -e' problem into its world, and instead do something like the attached. My thinking is that newvers.sh does a variety of things, only some of which are germane to the needs of mk-osreldate.h, so have mk-osreldate check for just what it needs, and let newvers.sh take care of its internal errors however it likes. -- Ian --=-b4v9g1nm7Kc0ou0cegLT Content-Disposition: inline; filename="osreldate_e.diff" Content-Type: text/x-patch; name="osreldate_e.diff"; charset="us-ascii" Content-Transfer-Encoding: 7bit Index: include/mk-osreldate.sh =================================================================== --- include/mk-osreldate.sh (revision 255775) +++ include/mk-osreldate.sh (working copy) @@ -25,8 +25,6 @@ # # $FreeBSD$ -set -e - CURDIR=$(pwd) ECHO=${ECHO:=echo} @@ -37,6 +35,12 @@ ${ECHO} creating osreldate.h from newvers.sh export PARAMFILE="${PARAM_H:=$CURDIR/../sys/sys/param.h}" . "${NEWVERS_SH:=$CURDIR/../sys/conf/newvers.sh}" + +if [ -z "${COPYRIGHT}" -o -z "${RELDATE}" ] ; then + ${ECHO} "newvers.sh did not generate required information" + exit 1 +fi + cat > $tmpfile <