Subject: man page installation.
To: None <tech-install@netbsd.org>
From: Simon Burge <simonb@netbsd.org>
List: tech-install
Date: 03/19/2000 14:11:57
One thing that has bugged me for a while is that catman pages get
reinstalled all the time with UPDATE=1, even the page itself hasn't
changed.  There's probably more ``problems'' in the same line but
this is the one that bugs me most.

The following is cobbled out of bsd.inc.mk and DTRT.  Note that it isn't
possible without doing a lot more work for compressed man pages - the
.gz file includes the last mod time in the header.  Something could be
done by comparing the decompressed output of the installed file, but it
a) seemed like much more work and b) I don't use compressed pages so
would have been an extra hassle to test.  I suppose that's no excuse
and I'll put it on my endless list of things to do.

Any objections to this as it is?

Simon.

Index: bsd.man.mk
===================================================================
RCS file: /cvsroot/sharesrc/share/mk/bsd.man.mk,v
retrieving revision 1.51
diff -p -u -r1.51 bsd.man.mk
--- bsd.man.mk	2000/02/19 22:54:08	1.51
+++ bsd.man.mk	2000/03/19 03:00:00
@@ -69,7 +69,9 @@ __installpage: .USE
 	@chown ${MANOWN}:${MANGRP} ${.TARGET}
 	@chmod ${MANMODE} ${.TARGET}
 .else
-	${MINSTALL} ${.ALLSRC} ${.TARGET}
+	@cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
+	    (echo "${MINSTALL} ${.ALLSRC} ${.TARGET}" && \
+	     ${MINSTALL} ${.ALLSRC} ${.TARGET})
 .endif