b=450088 backing out (new reftest failed)
[wine-gecko.git] / testing / release / common / download_mars.sh
blob16567e57456a3d67f2f0d423cf181e90095e2816
1 download_mars () {
2 update_url="$1"
3 only="$2"
4 test_only="$3"
6 echo "Using $update_url"
7 wget --no-check-certificate -q -O update.xml $update_url
9 mkdir -p update/
10 if [ -z $only ]; then
11 only="partial complete"
13 for patch_type in $only
15 line=`fgrep "patch type=\"$patch_type" update.xml`
16 grep_rv=$?
18 if [ 0 -ne $grep_rv ]; then
19 echo "FAIL: no $patch_type update found for $update_url"
20 return 1
23 command=`echo $line | sed -e 's/^.*<patch //' -e 's:/>.*$::' -e 's:\&amp;:\&:g'`
24 eval "export $command"
26 if [ "$test_only" == "1" ]
27 then
28 echo "Testing $URL"
29 curl -k -s -I -L $URL
30 return
31 else
32 wget --no-check-certificate -nv -O update/$patch_type.mar $URL 2>&1
34 if [ "$?" != 0 ]; then
35 echo "Could not download $patch_type!"
36 echo "from: $URL"
38 actual_size=`perl -e "printf \"%d\n\", (stat(\"update/$patch_type.mar\"))[7]"`
39 actual_hash=`openssl dgst -$hashFunction update/$patch_type.mar | sed -e 's/^.*= //'`
41 if [ $actual_size != $size ]; then
42 echo "FAIL: $patch_type from $update_url wrong size"
43 echo "FAIL: update.xml size: $size"
44 echo "FAIL: actual size: $actual_size"
45 return 1
48 if [ $actual_hash != $hashValue ]; then
49 echo "FAIL: $patch_type from $update_url wrong hash"
50 echo "FAIL: update.xml hash: $hashValue"
51 echo "FAIL: actual hash: $actual_hash"
52 return 1
55 cp update/$patch_type.mar update/update.mar
57 done