summaryrefslogtreecommitdiff
path: root/Mk/bsd.port.mk
diff options
context:
space:
mode:
authorSatoshi Asami <asami@FreeBSD.org>1996-12-23 02:49:35 +0000
committerSatoshi Asami <asami@FreeBSD.org>1996-12-23 02:49:35 +0000
commit751417b7a982f35e4051af889a745d5a5f7c59fe (patch)
tree259ed9d400eeb7585b4b3f7cc4fd64339fa42a3a /Mk/bsd.port.mk
parentAdd newline to end of file. (diff)
Suggested by: msmith
Add a little more sophistication to the md5 grep command. Change the md5 checksum logic a bit. Now, the message is printed out for every successfully/unsuccessfully matched checksum, and it aborts at the end if there was a mismatch. Also, make missing checksum and IGNORE file inconsistency fatal, as there is now no reason to have a missing checksum.
Notes
Notes: svn path=/head/; revision=5064
Diffstat (limited to 'Mk/bsd.port.mk')
-rw-r--r--Mk/bsd.port.mk20
1 files changed, 11 insertions, 9 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 66220f84f311..aae6baff20e5 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -6,7 +6,7 @@
# bsd.port.mk - 940820 Jordan K. Hubbard.
# This file is in the public domain.
#
-# $Id: bsd.port.mk,v 1.239 1996/12/17 12:20:53 asami Exp $
+# $Id: bsd.port.mk,v 1.240 1996/12/18 02:27:44 asami Exp $
#
# Please view me with 4 column tabs!
@@ -1237,7 +1237,7 @@ checksum: fetch
(cd ${DISTDIR}; OK="true"; \
for file in ${_CKSUMFILES}; do \
CKSUM=`${MD5} < $$file`; \
- CKSUM2=`${GREP} "($$file)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \
+ CKSUM2=`${GREP} "^MD5 ($$file)" ${MD5_FILE} | ${AWK} '{print $$4}'`; \
if [ "$$CKSUM2" = "" ]; then \
${ECHO_MSG} ">> No checksum recorded for $$file."; \
OK="false"; \
@@ -1245,9 +1245,11 @@ checksum: fetch
${ECHO_MSG} ">> Checksum for $$file is set to IGNORE in md5 file even though"; \
${ECHO_MSG} " the file is not in the "'$$'"{IGNOREFILES} list."; \
OK="false"; \
- elif [ "$$CKSUM" != "$$CKSUM2" ]; then \
+ elif [ "$$CKSUM" = "$$CKSUM2" ]; then \
+ ${ECHO_MSG} ">> Checksum OK for $$file."; \
+ else \
${ECHO_MSG} ">> Checksum mismatch for $$file."; \
- exit 1; \
+ OK="false"; \
fi; \
done; \
for file in ${_IGNOREFILES}; do \
@@ -1261,11 +1263,11 @@ checksum: fetch
OK="false"; \
fi; \
done; \
- if [ "$$OK" = "true" ]; then \
- ${ECHO_MSG} "Checksums OK."; \
- else \
- ${ECHO_MSG} "There may be some inconsistencies, make sure the Makefile and md5 file"; \
- ${ECHO_MSG} "(\"${MD5_FILE}\") are up to date."; \
+ if [ "$$OK" != "true" ]; then \
+ ${ECHO_MSG} "Make sure the Makefile and md5 file (${MD5_FILE})"; \
+ ${ECHO_MSG} "are up to date. If you want to override this check, type"; \
+ ${ECHO_MSG} "\"make NO_CHECKSUM=yes [other args]\"."; \
+ exit 1; \
fi) ; \
fi
.endif