From owner-freebsd-bugs@FreeBSD.ORG Sat Oct 12 17:40:05 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 67CE2DAD for ; Sat, 12 Oct 2013 17:40:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 55953285B for ; Sat, 12 Oct 2013 17:40:05 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r9CHe5NF074957 for ; Sat, 12 Oct 2013 17:40:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r9CHe4DP074953; Sat, 12 Oct 2013 17:40:04 GMT (envelope-from gnats) Date: Sat, 12 Oct 2013 17:40:04 GMT Message-Id: <201310121740.r9CHe4DP074953@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: dfilter@FreeBSD.ORG (dfilter service) Subject: Re: misc/160646: commit references a PR X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: dfilter service List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Oct 2013 17:40:05 -0000 The following reply was made to PR misc/160646; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: misc/160646: commit references a PR Date: Sat, 12 Oct 2013 17:31:29 +0000 (UTC) Author: ian Date: Sat Oct 12 17:31:21 2013 New Revision: 256386 URL: http://svnweb.freebsd.org/changeset/base/256386 Log: MFC r255775 r255796 r255807 r255930 r255929 r255957: Create a separate script to generate osreldate.h rather than sourcing newvers.sh into a temporary subshell with inline make rules. Fixes PR 160646. Allow the path to the system source directory to be passed in to newvers.sh. Pass it in from include/Makefile. If it isn't passed in, fall back to the old logic of using dirname $0. Fixes PR 174422. PR: 160646 174422 Added: stable/9/include/mk-osreldate.sh - copied, changed from r255775, head/include/mk-osreldate.sh Modified: stable/9/include/Makefile stable/9/sys/conf/newvers.sh Directory Properties: stable/9/include/ (props changed) stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/include/Makefile ============================================================================== --- stable/9/include/Makefile Sat Oct 12 17:27:59 2013 (r256385) +++ stable/9/include/Makefile Sat Oct 12 17:31:21 2013 (r256386) @@ -99,19 +99,18 @@ SHARED?= copies INCS+= osreldate.h -osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh ${.CURDIR}/../sys/sys/param.h \ - ${.CURDIR}/Makefile - @${ECHO} creating osreldate.h from newvers.sh - @MAKE=${MAKE}; \ - PARAMFILE=${.CURDIR}/../sys/sys/param.h; \ - . ${.CURDIR}/../sys/conf/newvers.sh; \ - echo "$$COPYRIGHT" > osreldate.h; \ - echo "#ifdef _KERNEL" >> osreldate.h; \ - echo "#error \" cannot be used in the kernel, use \"" >> osreldate.h; \ - echo "#else" >> osreldate.h; \ - echo "#undef __FreeBSD_version" >> osreldate.h; \ - echo "#define __FreeBSD_version $$RELDATE" >> osreldate.h; \ - echo "#endif" >> osreldate.h +SYSDIR= ${.CURDIR}/../sys +NEWVERS_SH= ${SYSDIR}/conf/newvers.sh +PARAM_H= ${SYSDIR}/sys/param.h +MK_OSRELDATE_SH= ${.CURDIR}/mk-osreldate.sh + +osreldate.h vers.c: ${NEWVERS_SH} ${PARAM_H} ${MK_OSRELDATE_SH} + env ECHO="${ECHO}" \ + MAKE="${MAKE}" \ + NEWVERS_SH=${NEWVERS_SH} \ + PARAM_H=${PARAM_H} \ + SYSDIR=${SYSDIR} \ + sh ${MK_OSRELDATE_SH} .for i in ${LHDRS} INCSLINKS+= sys/$i ${INCLUDEDIR}/$i Copied and modified: stable/9/include/mk-osreldate.sh (from r255775, head/include/mk-osreldate.sh) ============================================================================== --- head/include/mk-osreldate.sh Sat Sep 21 22:36:07 2013 (r255775, copy source) +++ stable/9/include/mk-osreldate.sh Sat Oct 12 17:31:21 2013 (r256386) @@ -36,7 +36,9 @@ trap "rm -f $tmpfile" EXIT ${ECHO} creating osreldate.h from newvers.sh export PARAMFILE="${PARAM_H:=$CURDIR/../sys/sys/param.h}" -. "${NEWVERS_SH:=$CURDIR/../sys/conf/newvers.sh}" +set +e +. "${NEWVERS_SH:=$CURDIR/../sys/conf/newvers.sh}" || exit 1 +set -e cat > $tmpfile <