今天编译mail core2的时候发现curl一直下不回文件,导致编译失败,错误如下:
1 2 3 |
unzip: cannot find zipfile directory in one of ctemplate-osx-3.zip or ctemplate-osx-3.zip.zip, and cannot find ctemplate-osx-3.zip.ZIP, period. /Users/somewhere/mailcore2-0.6.2/scripts/include.sh/build-dep.sh: line 329: cd: ctemplate-osx-3: No such file or directory |
应该是curl下载失败了。
自己手动执行了一下curl命令,或许是我的curl版本有问题,下回来的文件大小为0。
1 |
curl -O http://d.etpan.org/mailcore2-deps/ctemplate-osx/ctemplate-osx-3.zip |
用curl -I 拿回来的头Content-Length并没有什么问题,状态码也是200。
或许是网络问题,或许是curl的bug,curl版本 7.43.0。
既然没查出原因,就先绕条路,把curl下载改为wget(mac需要额外安装,使用brew就可以),把mailcore2项目scripts/include.sh目录下的build-dep.sh(约325行):
1 |
curl -O "$url/$name/$name-$version.zip" |
替换为
1 |
wget "$url/$name/$name-$version.zip" |
再编译,就通过了。
至于curl无法通过的原因,待查。