summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-05-20 13:22:01 -0400
committerJoey Hess <joey@kitenet.net>2011-05-20 13:22:01 -0400
commit360f4422c54cb76c5132f071bdcf0284d5f68b54 (patch)
tree574265d04086e4a0da701843c406c9a24b3329b5
parenta2055ea149ab00acc864c45db909463a40404a8f (diff)
downloaddebootstrap-360f4422c54cb76c5132f071bdcf0284d5f68b54.tar.gz
also look for md5sum in release file if using md5sums
-rw-r--r--functions7
1 files changed, 6 insertions, 1 deletions
diff --git a/functions b/functions
index 725ab15..113b060 100644
--- a/functions
+++ b/functions
@@ -452,7 +452,12 @@ apt_dest () {
get_release_checksum () {
local reldest="$1"
local path="$2"
- sed -n "/^[Ss][Hh][Aa]$SHA_SIZE:/,/^[^ ]/p" < "$reldest" | \
+ if [ "$DEBOOTSTRAP_CHECKSUM_FIELD" = MD5SUM ]; then
+ local match="^[Mm][Dd]5[Ss][Uu][Mm]"
+ else
+ local match="^[Ss][Hh][Aa]$SHA_SIZE:"
+ fi
+ sed -n "/$match/,/^[^ ]/p" < "$reldest" | \
while read a b c; do
if [ "$c" = "$path" ]; then echo "$a $b"; fi
done | head -n 1