Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Jul 2007 19:55:56 GMT
From:      Gabor Kovesdan <gabor@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 124375 for review
Message-ID:  <200707301955.l6UJtu9v099406@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=124375

Change 124375 by gabor@gabor_server on 2007/07/30 19:55:13

	Only print debug messages if WITH_DESTDIR_DEBUG is set.

Affected files ...

.. //depot/projects/soc2006/gabor_destdir/Mk/bsd.destdir.mk#29 edit

Differences ...

==== //depot/projects/soc2006/gabor_destdir/Mk/bsd.destdir.mk#29 (text+ko) ====

@@ -69,6 +69,11 @@
 
 _DESTDIRMKINCLUDED=	yes
 
+
+.if !defined(WITH_DESTDIR_DEBUG)
+_DESTDIR_DEBUG=	>/dev/null 2<&1
+.endif
+
 DESTDIR_ENV_LIST?=
 DESTDIR_ENV=	CHROOTED=yes
 .for _var in ${DESTDIR_ENV_LIST:NDESTDIR:NCHROOTED:NPORTSDIR}
@@ -128,16 +133,16 @@
 	for _dir in tmp dev; do \
 		[ -d $${_destdir}/$${_dir} ] || \
 			if ${MKDIR} $${_destdir}/$${_dir}; then \
-				${ECHO_MSG} "=> /$${_dir} subdirectory has been successfully created"; \
+				${ECHO_MSG} "===> /$${_dir} subdirectory has been successfully created"; \
 				_created_mountpoints_list="$${_destdir}/$${_dir} $${_created_mountpoints_list}"; \
 			else \
-				${ECHO_MSG} "=> /$${_dir} subdirectory could not be created"; \
+				${ECHO_MSG} "===> /$${_dir} subdirectory could not be created"; \
 				exit 2; \
 			fi; \
 	done; \
-	${ECHO_MSG} "_DESTDIR_MOUNT_LIST=${_DESTDIR_MOUNT_LIST}"; \
+	${ECHO_MSG} "DEBUG: _DESTDIR_MOUNT_LIST=${_DESTDIR_MOUNT_LIST}" ${_DESTDIR_DEBUG}; \
 	for _entry in ${_DESTDIR_MOUNT_LIST}; do \
-		${ECHO_MSG} "===>  Processing $${_entry}"; \
+		${ECHO_MSG} "DEBUG: Processing $${_entry}" ${_DESTDIR_DEBUG}; \
 		_mount_var=$${_entry%%:*}; \
 		_tp=$${_entry#*:}; \
 		_host_path=`${REALPATH} $${_tp%:*}`; \
@@ -145,66 +150,66 @@
 		_full_dest_path=`${REALPATH} $${_destdir}/$${_dest_path}`; \
 		_entry_was_created=0; \
 		_entry_should_mount=0; \
-		${ECHO_CMD} "$${_mount_var}:$${_host_path}:$${_full_dest_path}"; \
+		${ECHO_CMD} "DEBUG: $${_mount_var}:$${_host_path}:$${_full_dest_path}" ${_DESTDIR_DEBUG}; \
 		if [ "$${_dest_path}" = "___temp___" ]; then \
-			${ECHO_CMD} "Creating temporary mount point"; \
+			${ECHO_CMD} "DEBUG: Creating temporary mount point" ${_DESTDIR_DEBUG}; \
 			if _full_dest_path=`${MKTEMP} -d $${_destdir}/tmp/mountpoint.XXXXXX`; then \
-				${ECHO_CMD} "Temporary mount point $${_full_dest_path} created successfully"; \
+				${ECHO_CMD} "DEBUG: Temporary mount point $${_full_dest_path} created successfully" ${_DESTDIR_DEBUG}; \
 				_entry_was_created=1; \
 				_entry_should_mount=1; \
 				_dest_path=$${_full_dest_path#$${_destdir}}; \
 				_created_mountpoints_list="$${_full_dest_path} $${_created_mountpoints_list}"; \
 			else \
-				${ECHO_CMD} "Failed to create temporary mount point"; \
+				${ECHO_CMD} "===> Failed to create temporary mount point"; \
 				exit 9; \
 			fi; \
 		else \
-			${ECHO_CMD} "Checking if already mounted"; \
+			${ECHO_CMD} "DEBUG: Checking if already mounted" ${_DESTDIR_DEBUG}; \
 			if ${MOUNT}|${GREP} -qs "^$${_host_path} on $${_full_dest_path} ("; then \
-				${ECHO_CMD} "$${_host_path} is already mounted on $${_full_dest_path}"; \
+				${ECHO_CMD} "DEBUG: $${_host_path} is already mounted on $${_full_dest_path} ${_DESTDIR_DEBUG}"; \
 				_var_path_list="$${_var_path_list} $${_mount_var}=$${_dest_path}"; \
 			else \
-				${ECHO_CMD} "$${_host_path} is not mounted on $${_full_dest_path}"; \
+				${ECHO_CMD} "DEBUG: $${_host_path} is not mounted on $${_full_dest_path}" ${_DESTDIR_DEBUG}; \
 				_entry_should_mount=1; \
 			fi; \
 		fi; \
 		[ -d $${_full_dest_path} ] || \
 			if ${MKDIR} $${_full_dest_path}; then \
-				${ECHO_CMD} "Mount point $${_full_dest_path} created"; \
+				${ECHO_CMD} "DEBUG: Mount point $${_full_dest_path} created" ${_DESTDIR_DEBUG}; \
 				_entry_was_created=1; \
 				_created_mountpoints_list="$${_created_mountpoints_list} ${_full_dest_path}"; \
 			else \
-				${ECHO_CMD} "Mount point $${_full_dest_path} could not be created"; \
+				${ECHO_CMD} "===> Mount point $${_full_dest_path} could not be created"; \
 				exit 7; \
 			fi; \
 		[ "$${_entry_should_mount}" = "0" ] || \
 			if ${MOUNT_NULLFS} $${_host_path} $${_full_dest_path}; then \
-				${ECHO_CMD} "Dir $${_host_path} mounted"; \
+				${ECHO_CMD} "DEBUG: Dir $${_host_path} mounted" ${_DESTDIR_DEBUG}; \
 				_mounted_entries_list="$${_full_dest_path} $${_mounted_entries_list}"; \
 				_var_path_list="$${_var_path_list} $${_mount_var}=$${_dest_path}"; \
 			else \
-				${ECHO_CMD} "Dir $${_host_path} could not be mounted"; \
+				${ECHO_CMD} "===> Dir $${_host_path} could not be mounted"; \
 				[ "$${_entry_was_created}" = "0" ] || \
 					${RMDIR} $${_full_dest_path} || ${TRUE}; \
 				exit 8; \
 			fi; \
 	done; \
-	${ECHO_CMD} "Handling devfs separately"; \
+	${ECHO_CMD} "DEBUG: Handling devfs separately" ${_DESTDIR_DEBUG}; \
 	_full_dest_path=$${_destdir}/dev; \
 	${MOUNT}|${GREP} -qs "^devfs on $${_full_dest_path} (" || \
 		if ${MOUNT_DEVFS} $${_full_dest_path}; then \
-			${ECHO_CMD} "devfs mounted"; \
+			${ECHO_CMD} "DEBUG: devfs mounted" ${_DESTDIR_DEBUG}; \
 			_mounted_entries_list="$${_full_dest_path} $${_mounted_entries_list}"; \
 		else \
-			${ECHO_CMD} "devfs could not be mounted"; \
+			${ECHO_CMD} "===> devfs could not be mounted"; \
 			[ -n "$${_created_mountpoints_list%%* $${_destdir}/dev *}" ] || \
 				${RMDIR} $${_destdir}/dev || ${TRUE}; \
 			exit 9; \
 		fi; \
 	_var_path_list="$${_var_path_list} DEVFS=/dev"; \
-	${ECHO_CMD} "Things we mounted: $${_mounted_entries_list}"; \
-	${ECHO_CMD} "Things we created: $${_created_mountpoints_list}"; \
-	${ECHO_CMD} "_var_path_list: $${_var_path_list}"; \
+	${ECHO_CMD} "DEBUG: Things we mounted: $${_mounted_entries_list}" ${_DESTDIR_DEBUG}; \
+	${ECHO_CMD} "DEBUG: Things we created: $${_created_mountpoints_list}" ${_DESTDIR_DEBUG}; \
+	${ECHO_CMD} "DEBUG: _var_path_list: $${_var_path_list}" ${_DESTDIR_DEBUG}; \
 	${ECHO_CMD} "===>  Starting chrooted make in ${DESTDIR}..."; \
 	export $${_var_path_list}; \
 	${CHROOT} $${_destdir} ${SH} -c "\
@@ -219,7 +224,6 @@
 	for _entry in $${_created_mountpoints_list}; do \
 		${RMDIR} $${_entry} || ${TRUE}; \
 	done; \
-	${ECHO_CMD} "===> Congratulations!"; \
 	exit 0
 .endif	# !target(do-chroot)
 .endif	# !defined(_DESTDIRMKINCLUDED)



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