Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jul 2007 08:32:18 GMT
From:      Andrew Pantyukhin <sat@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 124000 for review
Message-ID:  <200707240832.l6O8WIQm001792@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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/.*://'`; \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200707240832.l6O8WIQm001792>