Module Name:    src
Committed By:   apb
Date:           Fri Sep 23 21:13:14 UTC 2011

Modified Files:
        src/share/mk: bsd.clean.mk

Log Message:
* use a :M* modifier when testing whether the expanded list of
  files is empty.  Sometimes the variable contains one or more spaces,
  and testing against "" gave the wrong result, but applying the
  :M* modifier discards the spaces.  This should fix PR 45396.
* Instead of using "-" to ignore the exit status from the rm command,
  use ||true.  This should work around the bug in PR 45356, but that
  bug is not fixed.
* Suppress the ${MKMSG} command with .if 0.  People who build with
  MAKEVERBOSE=1 don't want to see the message, and people who build
  with MAKEVERBOSE=2 or higher will see the actual rm command.  The
  message may be useful for debugging this makefile itself, so it's
  only disabled, not deleted.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/mk/bsd.clean.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/mk/bsd.clean.mk
diff -u src/share/mk/bsd.clean.mk:1.2 src/share/mk/bsd.clean.mk:1.3
--- src/share/mk/bsd.clean.mk:1.2	Sat Sep 10 19:25:10 2011
+++ src/share/mk/bsd.clean.mk	Fri Sep 23 21:13:14 2011
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.clean.mk,v 1.2 2011/09/10 19:25:10 apb Exp $
+# $NetBSD: bsd.clean.mk,v 1.3 2011/09/23 21:13:14 apb Exp $
 
 # <bsd.clean.mk>
 #
@@ -41,14 +41,16 @@
 # both .OBJDIR and .SRCDIR.
 #
 __cleanuse: .USE
-	${"${.ALLSRC:@v@${${v}}@}" == "":?@true:${_MKMSG} \
+.if 0	# print "# clean CLEANFILES" for debugging
+	${"${.ALLSRC:@v@${${v}:M*}@}" == "":?@true:${_MKMSG} \
 		"clean" ${.ALLSRC} }
+.endif
 .for _d in ${"${.OBJDIR}" == "${.CURDIR}" \
 		:? ${.OBJDIR} \
 		:  ${.OBJDIR} ${.CURDIR} }
-	-${"${.ALLSRC:@v@${${v}}@}" == "":?@true: \
-	    (cd ${_d} && rm -f ${.ALLSRC:@v@${${v}}@}) }
-	@${"${.ALLSRC:@v@${${v}}@}" == "":?true: \
+	${"${.ALLSRC:@v@${${v}:M*}@}" == "":?@true: \
+	    (cd ${_d} && rm -f ${.ALLSRC:@v@${${v}}@} || true) }
+	@${"${.ALLSRC:@v@${${v}:M*}@}" == "":?true: \
 	    bad="\$(cd ${_d} && ls -d ${.ALLSRC:@v@${${v}}@} 2>/dev/null)"; \
 	    if test -n "\$bad"; then \
 	        echo "Failed to remove files from ${_d}:" ; \

Reply via email to