summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Nowicki <sebnow@gmail.com>2008-05-31 14:35:16 +0800
committerDan McGee <dan@archlinux.org>2008-06-15 13:52:03 -0500
commitb8a66d68593d1f267c3bb8cd8943724711626903 (patch)
tree0c8748c07048fca0d57802c664a6518ead141a02
parenta1dfa8e61f385a6b388b66f4860e96a62f3edae6 (diff)
downloadpacman-b8a66d68593d1f267c3bb8cd8943724711626903.tar.xz
Use openssl for checksum verification instead of *sum utilities
md5sum, sha1sum, etc, do not exist on BSD systems by default. Openssl is a good portable alternative. This also brings in a dependency for openssl. Closes FS#10530. Signed-off-by: Sebastian Nowicki <sebnow@gmail.com> Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--scripts/makepkg.sh.in14
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index e38f8a98..998c768d 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -27,7 +27,7 @@
# makepkg uses quite a few external programs during its execution. You
# need to have at least the following installed for makepkg to function:
# awk, bsdtar (libarchive), bzip2, coreutils, fakeroot, find (findutils),
-# getopt (util-linux), gettext, grep, gzip, sed
+# getopt (util-linux), gettext, grep, gzip, openssl, sed
# gettext initialization
export TEXTDOMAIN='pacman'
@@ -484,8 +484,8 @@ generate_checksums() {
exit 1;; # $E_CONFIG_ERROR
esac
- if [ ! $(type -p "${integ}sum") ]; then
- error "$(gettext "Cannot find the '%s' program.")" "${integ}sum"
+ if [ ! $(type -p openssl) ]; then
+ error "$(gettext "Cannot find openssl.")"
exit 1 # $E_MISSING_PROGRAM
fi
@@ -514,7 +514,7 @@ generate_checksums() {
fi
fi
- local sum="$(${integ}sum "$file" | cut -d ' ' -f 1)"
+ local sum="$(openssl dgst -${integ} "$file" | awk '{print $NF}')"
[ $ct -gt 0 ] && echo -n "$indent"
echo -n "'$sum'"
ct=$(($ct+1))
@@ -536,8 +536,8 @@ check_checksums() {
exit 1;; # $E_CONFIG_ERROR
esac
- if [ ! $(type -p "${integ}sum") ]; then
- error "$(gettext "Cannot find the '%s' program.")" "${integ}sum"
+ if [ ! $(type -p openssl) ]; then
+ error "$(gettext "Cannot find openssl.")"
exit 1 # $E_MISSING_PROGRAM
fi
@@ -561,7 +561,7 @@ check_checksums() {
fi
fi
- if echo "${integrity_sums[$idx]} $file" | ${integ}sum --status -c - &>/dev/null; then
+ if [ "${integrity_sums[$idx]}" = "$(openssl dgst -${integ} "$file" | awk '{print $NF}')" ]; then
echo "$(gettext "Passed")" >&2
else
echo "$(gettext "FAILED")" >&2