Find the system's MD5 binary.
Different binaries calculate MD5 checksums on different systems. Try
a couple known programs and only calculate and verify the checksum
if they exist. This should silence warnings on eg OpenBSD.
--- a/hgeditor Tue Aug 29 14:04:54 2006 -0500
+++ b/hgeditor Fri Jul 28 13:46:19 2006 -0500
@@ -41,13 +41,15 @@
cat "$1" > "$HGTMP/msg"
-CHECKSUM=`md5sum "$HGTMP/msg"`
+MD5=$(which md5sum 2>/dev/null) || \
+ MD5=$(which md5 2>/dev/null)
+[ -x "${MD5}" ] && CHECKSUM=`${MD5} "$HGTMP/msg"`
if [ -s "$HGTMP/diff" ]; then
$EDITOR "$HGTMP/msg" "$HGTMP/diff" || exit $?
else
$EDITOR "$HGTMP/msg" || exit $?
fi
-echo "$CHECKSUM" | md5sum -c >/dev/null 2>&1 && exit 13
+[ -x "${MD5}" ] && (echo "$CHECKSUM" | ${MD5} -c >/dev/null 2>&1 && exit 13)
mv "$HGTMP/msg" "$1"