Subject: A patch for aborting if missing checksum files
To: None <tech-pkg@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 04/05/2001 01:27:56
If the checksum (md5) is bad, then it aborts. If it is good, then it tells
you.
If the patch-sum is bad, then it aborts. But if the patch-sum checks are
successful, it does not tell you. (I think it should. A patch is below.)
If the checksum is missing, then it says "No checksum file" and continues.
But if the patchsum file is missing, then it continues and it gives no
message at all. (I think it should report that it is missing. A patch is
below.)
What are the reasons why it shouldn't abort if missing a checksum file?
I believe a missing checksum file is as wrong as a bad file.
I made a patch. Here are some examples:
Abort if missing checksum (md5) file:
$ make
===> Validating dependencies for libao-0.6.0nb1
No checksum file.
*** Error code 1
Report and abort if missing patch-sum file:
$ make
...
===> Patching for libao-0.6.0nb1
===> Applying NetBSD patches for libao-0.6.0nb1
Patching failed due to missing patch-sum file.
*** Error code 1
Report that patches checksums are okay:
$ make
...
===> Patching for libao-0.6.0nb1
===> Applying NetBSD patches for libao-0.6.0nb1
===> Checksum OK for patches
===> Configuring for libao-0.6.0nb1
Here is a patch to implement my ideas:
--- ../../mk/bsd.pkg.mk.orig Wed Apr 4 23:02:55 2001
+++ bsd.pkg.mk Thu Apr 5 01:17:06 2001
@@ -1509,6 +1509,9 @@
fail="$$fail $$filename"; \
continue; \
fi; \
+ else \
+ ${ECHO_MSG} "Patching failed due to missing patch-sum file."; \
+ exit 1; \
fi; \
;; \
esac; \
@@ -1523,6 +1526,7 @@
if [ "X$$fail" != "X" ]; then \
${ECHO_MSG} "Patching failed due to modified patch file(s): $$fail"; \
exit 1; \
+ else ${ECHO_MSG} "===> Checksum OK for patches";\
fi; \
fi; \
fi
@@ -2538,7 +2542,8 @@
checksum: fetch uptodate-digest
${_PKG_SILENT}${_PKG_DEBUG} \
if [ ! -f ${DIGEST_FILE} ]; then \
- ${ECHO_MSG} "=> No checksum file."; \
+ ${ECHO_MSG} "No checksum file."; \
+ exit 1; \
else \
(cd ${DISTDIR}; OK="true"; \
for file in "" ${_CKSUMFILES}; do \
Any thoughts before I send-pr this?
By the way, what is the significance of the "===>" arrow?
Jeremy C. Reed
http://www.reedmedia.net/