summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-05-20 16:19:28 (GMT)
committerJoey Hess <joey@kitenet.net>2011-05-20 16:19:28 (GMT)
commitf957b3b90f103a1468fa499a88eb3d2357367f3c (patch)
tree3e6a27cd1a5ceb36679218a2bd080859648fd49e /functions
parent9cc47c88a2ea16f75a05709f213bf14c48603a19 (diff)
downloaddebootstrap-f957b3b90f103a1468fa499a88eb3d2357367f3c.zip
debootstrap-f957b3b90f103a1468fa499a88eb3d2357367f3c.tar.gz
debootstrap-f957b3b90f103a1468fa499a88eb3d2357367f3c.tar.bz2
Use md5sums for woody and potato, which only had those checksums in the Packages files. Closes: #627365
Diffstat (limited to 'functions')
-rw-r--r--functions13
1 files changed, 11 insertions, 2 deletions
diff --git a/functions b/functions
index 48ba59e..b6e3ba8 100644
--- a/functions
+++ b/functions
@@ -226,11 +226,20 @@ mirror_style () {
export DOWNLOAD_DEBS
}
+force_md5 () {
+ DEBOOTSTRAP_CHECKSUM_FIELD=MD5SUM
+ export DEBOOTSTRAP_CHECKSUM_FIELD
+}
+
verify_checksum () {
# args: dest checksum size
local expchecksum="$2"
local expsize="$3"
- relchecksum=`sha${SHA_SIZE}sum < "$1" | sed 's/ .*$//'`
+ if [ "$DEBOOTSTRAP_CHECKSUM_FIELD" = "MD5SUM" ]; then
+ relchecksum=`md5sum < "$1" | sed 's/ .*$//'`
+ else
+ relchecksum=`sha${SHA_SIZE}sum < "$1" | sed 's/ .*$//'`
+ fi
relsize=`wc -c < "$1"`
if [ "$expsize" -ne "$relsize" ] || [ "$expchecksum" != "$relchecksum" ]; then
return 1
@@ -1027,7 +1036,7 @@ while (<STDIN>) {
$ver = $v if ($f eq "version:");
$arc = $v if ($f eq "architecture:");
$fil = $v if ($f eq "filename:");
- $chk = $v if ($f eq lc($ENV{DEBOOTSTRAP_CHECKSUM_FIELD}).":");
+ $chk = $v if (lc $f eq lc($ENV{DEBOOTSTRAP_CHECKSUM_FIELD}).":");
$siz = $v if ($f eq "size:");
$val = $v if ($f eq $field);
} elsif (/^$/) {