PERFORCE change 124000 for review

Andrew Pantyukhin sat at FreeBSD.org
Tue Jul 24 08:32:19 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=124000

Change 124000 by sat at 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/.*://'`; \


More information about the p4-projects mailing list