From owner-p4-projects@FreeBSD.ORG Tue Jul 24 08:32:18 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B5CA916A46E; Tue, 24 Jul 2007 08:32:18 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 758E316A419 for ; Tue, 24 Jul 2007 08:32:18 +0000 (UTC) (envelope-from sat@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 60CEF13C46A for ; Tue, 24 Jul 2007 08:32:18 +0000 (UTC) (envelope-from sat@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l6O8WIMC001795 for ; Tue, 24 Jul 2007 08:32:18 GMT (envelope-from sat@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l6O8WIQm001792 for perforce@freebsd.org; Tue, 24 Jul 2007 08:32:18 GMT (envelope-from sat@freebsd.org) Date: Tue, 24 Jul 2007 08:32:18 GMT Message-Id: <200707240832.l6O8WIQm001792@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sat@freebsd.org using -f From: Andrew Pantyukhin To: Perforce Change Reviews Cc: Subject: PERFORCE change 124000 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2007 08:32:19 -0000 http://perforce.freebsd.org/chv.cgi?CH=124000 Change 124000 by sat@sat_amilo on 2007/07/24 08:31:32 - Check if DESTDIR and DESTDIR/tmp exist - Fail if DESTDIR doesn't - Create /tmp if needed, fail if we can't - Define .MAIN:all to deal with no-targets make invocations Affected files ... .. //depot/projects/soc2006/gabor_destdir/Mk/bsd.destdir.mk#23 edit Differences ... ==== //depot/projects/soc2006/gabor_destdir/Mk/bsd.destdir.mk#23 (text+ko) ==== @@ -51,6 +51,7 @@ DESTDIR_ENV+= ${_var}="${${_var}}" .endfor +.MAIN: all .for _target in ${.TARGETS} ${_target}: pre-chroot do-chroot @${TRUE} @@ -69,7 +70,21 @@ .if defined(WITH_EXPERIMENTAL_DESTDIR) do-chroot: - @for _entry in ${DESTDIR_MOUNT_LIST}; do \ + @if [ ! -d ${DESTDIR} ]; then \ + ${ECHO_MSG} "===> Directory ${DESTDIR} does not exist"; \ + ${ECHO_MSG} "=> Please set DESTDIR to a valid jail environment."; \ + exit 1; \ + fi; \ + if [ ! -d ${DESTDIR}/tmp ]; then \ + ${ECHO_MSG} "===> Directory ${DESTDIR}/tmp does not exist"; \ + if mkdir ${DESTDIR}/tmp; then \ + ${ECHO_MSG} "=> tmp subdirectory has been successfully created"; \ + else \ + ${ECHO_MSG} "=> tmp subdirectory could not be created"; \ + exit 2; \ + fi; \ + fi; \ + for _entry in ${DESTDIR_MOUNT_LIST}; do \ _var= `${ECHO_CMD} $${_entry} | ${SED} -e 's/:.*//'`; \ _path1= `${ECHO_CMD} $${_entry} | ${SED} -e 's/[^:]*://'`; \ _path2= `${ECHO_CMD} $${_path1} | ${SED} -e 's/.*://'`; \