Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/man/man7 Remove tests.7 in objdir before copying to it.



details:   https://anonhg.NetBSD.org/src/rev/28aa5d1a379b
branches:  trunk
changeset: 788958:28aa5d1a379b
user:      gdt <gdt%NetBSD.org@localhost>
date:      Wed Jul 31 11:57:24 2013 +0000

description:
Remove tests.7 in objdir before copying to it.

If one's source tree has non-writable files (because of CVSREAD=t, or
someone else owns it, or it's on some read-only filesystems, some
other reason), recently-added makefile code would cp tests.foo.7 in
the sources to tests.7 in objdir, preserving permissions, but not
forcing the copy.  A subsequent copy would result in an error, failing
the build.  Therefore, rm -f the target file before doing the copy.

(Arguably there should some standard support for this, but copying
files from the source directory to objdir is quite unusual.)

diffstat:

 share/man/man7/Makefile |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (22 lines):

diff -r fe3bd6890cb1 -r 28aa5d1a379b share/man/man7/Makefile
--- a/share/man/man7/Makefile   Wed Jul 31 06:58:23 2013 +0000
+++ b/share/man/man7/Makefile   Wed Jul 31 11:57:24 2013 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.29 2013/02/25 02:02:41 jmmv Exp $
+#      $NetBSD: Makefile,v 1.30 2013/07/31 11:57:24 gdt Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/5/93
 
 .include <bsd.init.mk>
@@ -13,10 +13,10 @@
 CLEANFILES=    tests.7
 .if ${MKKYUA} != "no"
 tests.7: tests.kyua.7
-       cp ${.ALLSRC} ${.TARGET}
+       rm -f ${.TARGET} && cp ${.ALLSRC} ${.TARGET}
 .else
 tests.7: tests.atf.7
-       cp ${.ALLSRC} ${.TARGET}
+       rm -f ${.TARGET} && cp ${.ALLSRC} ${.TARGET}
 .endif
 
 MLINKS+=c.7 c78.7 \



Home | Main Index | Thread Index | Old Index