diff options
author | agc <agc@pkgsrc.org> | 1999-10-19 12:04:45 +0000 |
---|---|---|
committer | agc <agc@pkgsrc.org> | 1999-10-19 12:04:45 +0000 |
commit | 80baf913092bad9ac42120084a2c824004ed9509 (patch) | |
tree | 8a7b6a976ca4e65c16597836f94caa58adad769b /mk | |
parent | b10661c576f6c54b20aa6b9a7177d5c4d01beef0 (diff) | |
download | pkgsrc-80baf913092bad9ac42120084a2c824004ed9509.tar.gz |
Be a bit more efficient when calculating whether patch-sum files have
changed, and avoid extraneous gibberish at the end of a cmp(1) command,
so that patch-sum creation works on Solaris.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bsd.pkg.mk | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index 4f824d4b9bb..f18823bf7b9 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.355 1999/10/14 05:31:22 fredb Exp $ +# $NetBSD: bsd.pkg.mk,v 1.356 1999/10/19 12:04:45 agc Exp $ # # This file is in the public domain. # @@ -1825,6 +1825,7 @@ makepatchsum: ${ECHO} "$$" >> ${PATCH_SUM_FILE}.new; \ fi; \ ${ECHO} "" >> ${PATCH_SUM_FILE}.new; \ + havepatches=0; \ if [ -d ${PATCHDIR} ]; then \ cd ${PATCHDIR}; \ for sumfile in "" patch-*; do \ @@ -1833,11 +1834,12 @@ makepatchsum: case $$sumfile in \ patch-local-*) ;; \ *.orig) continue ;; \ - *) ${ECHO} "MD5 ($$sumfile) = `${SED} -e '/\$$NetBSD.*/d' $$sumfile | ${MD5}`" >> ${PATCH_SUM_FILE}.new; \ + *) ${ECHO} "MD5 ($$sumfile) = `${SED} -e '/\$$NetBSD.*/d' $$sumfile | ${MD5}`" >> ${PATCH_SUM_FILE}.new; \ + havepatches=1 ;; \ esac; \ done; \ fi; \ - if [ "`${AWK} -- '{nlines++} END {print nlines}' < ${PATCH_SUM_FILE}.new`" = "2" ]; then \ + if [ $$havepatches = 0 ]; then \ if [ -f "${PATCH_SUM_FILE}" ]; then \ ${ECHO} "This placeholder file is generated by the \`\`makepatchsum'' target" >> ${PATCH_SUM_FILE}.new; \ ${ECHO} "whenever the patches directory is empty or missing. Its purpose" >> ${PATCH_SUM_FILE}.new; \ @@ -1850,9 +1852,9 @@ makepatchsum: exit 0; \ fi; \ fi; \ - if cmp -s ${PATCH_SUM_FILE}.new ${PATCH_SUM_FILE} ""; then \ + if cmp -s ${PATCH_SUM_FILE}.new ${PATCH_SUM_FILE}; then \ ${RM} -f ${PATCH_SUM_FILE}.new; \ - ${ECHO_MSG} ">> patch-sum file unchanged!"; \ + ${ECHO_MSG} ">> patch-sum file unchanged"; \ else \ ${MV} ${PATCH_SUM_FILE}.new ${PATCH_SUM_FILE}; \ fi) |