设置Darwin Calendar Server会收到有关“MD5 sum for download file ...”的错误

时间:2013-09-02 15:56:41

标签: python calendar darwin python-dateutil

当我设置Darwin Calendar Server时,有关于下载dateutil的错误:

    Downloading dateutil...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
149   298  149   298    0     0    316      0 --:--:-- --:--:-- --:--:--  1828

dateutil is not available from calendarserver.org; trying upstream source.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
124   372  124   372    0     0    267      0  0:00:01  0:00:01 --:--:--   267

Checking MD5 sum for dateutil...
ERROR: MD5 sum for downloaded file is wrong: 7b65d6a65095c36ba426124d67284244 != 35f3732db3f2cc4afdc68a8533b60a52
dateutil from upstream source is invalid: http://www.labix.org/download/python-dateutil/python-dateutil-1.5.tar.gz

我找到了日历服务器的源代码并找到下面的代码(https://github.com/trevor/calendarserver/blob/master/support/build.sh): check_hash(){         local file =“$ 1”;移位;

    local sum="$(md5 "${file}" | perl -pe 's|^.*([0-9a-f]{32}).*$|\1|')";
    if [ -n "${md5}" ]; then
      echo "Checking MD5 sum for ${name}...";
      if [ "${md5}" != "${sum}" ]; then
        echo "ERROR: MD5 sum for downloaded file is wrong: ${sum} != ${md5}";
        return 1;
      fi;
    else
      echo "MD5 sum for ${name} is ${sum}";
    fi;

    local sum="$(sha1 "${file}" | perl -pe 's|^.*([0-9a-f]{40}).*$|\1|')";
    if [ -n "${sha1}" ]; then
      echo "Checking SHA1 sum for ${name}...";
      if [ "${sha1}" != "${sum}" ]; then
        echo "ERROR: SHA1 sum for downloaded file is wrong: ${sum} != ${sha1}";
        return 1;
      fi;
    else
      echo "SHA1 sum for ${name} is ${sum}";
    fi;
  }

有谁知道如何解决这个问题? 我无法从谷歌找到任何有用的页面。

1 个答案:

答案 0 :(得分:0)

看起来下载的文件确实已损坏。这是我在这里下载的md5sum:

% wget -q http://www.labix.org/download/python-dateutil/python-dateutil-1.5.tar.gz                                                              
% md5sum python-dateutil-1.5.tar.gz
35f3732db3f2cc4afdc68a8533b60a52  python-dateutil-1.5.tar.gz

也许再试一次?