diff options
author | hubertf <hubertf@pkgsrc.org> | 1998-07-13 20:39:32 +0000 |
---|---|---|
committer | hubertf <hubertf@pkgsrc.org> | 1998-07-13 20:39:32 +0000 |
commit | b400acae4b836cbedc3813424b1eb352b8ac6f71 (patch) | |
tree | a1a3b223eb503ea444543e25a59e39631dd4c5bc | |
parent | faee05a3077b8396186d71cecd0f98fdbccd7fea (diff) | |
download | pkgsrc-b400acae4b836cbedc3813424b1eb352b8ac6f71.tar.gz |
Only update README.html if it has changed.
-rw-r--r-- | mk/bsd.pkg.subdir.mk | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/mk/bsd.pkg.subdir.mk b/mk/bsd.pkg.subdir.mk index ceebdd5d63e..7c91e34bce1 100644 --- a/mk/bsd.pkg.subdir.mk +++ b/mk/bsd.pkg.subdir.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.subdir.mk,v 1.18 1998/07/07 15:08:10 hubertf Exp $ +# $NetBSD: bsd.pkg.subdir.mk,v 1.19 1998/07/13 20:39:32 hubertf Exp $ # Derived from: FreeBSD Id: bsd.port.subdir.mk,v 1.19 1997/03/09 23:10:56 wosch Exp # from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91 # @@ -112,7 +112,7 @@ readmes: readme _SUBDIRUSE .if !target(readme) readme: - @rm -f README.html + @if [ -f README.html ]; then mv -f README.html README.html.BAK ; fi @${MAKE} README.html .endif @@ -125,7 +125,6 @@ README= ../templates/README.category HTMLIFY= sed -e 's/&/\&/g' -e 's/>/\>/g' -e 's/</\</g' README.html: .PRECIOUS - @echo "===> Creating README.html for ${_THISDIR_}${.CURDIR:T}" @> $@.tmp .for entry in ${SUBDIR} .if defined(PKGSRCTOP) @@ -151,7 +150,15 @@ README.html: .PRECIOUS -e '/%%DESCR%%/d' \ -e '/%%SUBDIR%%/r$@.tmp2' \ -e '/%%SUBDIR%%/d' \ - > $@ + > $@.tmp4 + @if cmp -s $@.tmp4 $@.BAK ; then \ + mv $@.BAK $@ ; \ + rm $@.tmp4 ; \ + else \ + ${ECHO_MSG} "===> Creating README.html for ${_THISDIR_}${.CURDIR:T}" ; \ + mv $@.tmp4 $@ ; \ + rm -f $@.BAK ; \ + fi @rm -f $@.tmp $@.tmp2 $@.tmp3 .for subdir in ${SUBDIR} @cd ${subdir} && ${MAKE} "_THISDIR_=${_THISDIR_}${.CURDIR:T}/" readme |