我的理解是.tar文件包含目录和其他文件,而.bz2是用bzip2压缩压缩的文件。
因此,大多数使用bzip2压缩的tarball结束于:
.tar.bz2
这是应用于tarball的bzip2压缩。
但是,每当我从Mercurial网络服务器下载源代码时,您可以从中获取内部代码:
hg serve
或者从BitBucket,我得到了以
结尾的东西.bz2.tar
这对我没有意义,因为你不能对多个文件应用bzip2压缩,这就是为什么你需要首先“tar”它们。
这是Mercurial中的错误吗?或者这是我的网络浏览器中的错误(我在Windows中尝试过Google Chrome,在Ubuntu中尝试过Firefox)?或者这是一个奇怪的东西,但没有什么区别?
我下载的最新资源来自http://bitbucket.org/bos/hgbook,它是Mercurial书籍的存储库。
答案 0 :(得分:1)
这是bitbucket中的一个错误,请向他们报告:http://bitbucket.org/jespern/bitbucket/issues/new/
答案 1 :(得分:1)
我想我看到了问题。下载中的Content-Type
标题很不可靠:
% GET -Ssed http://host/mayorguard/archive/tip.tar.bz2
GET http://ry4an.org/hg/mayorguard/archive/tip.tar.bz2 --> 200 Script output follows
Connection: close
Date: Mon, 20 Sep 2010 19:01:00 GMT
Server: Apache/2.2.14 (Ubuntu)
Content-Type: application/x-tar
Client-Date: Mon, 20 Sep 2010 19:01:00 GMT
Client-Peer: 75.146.191.221:80
Client-Response-Num: 1
Client-Transfer-Encoding: chunked
Content-Disposition: attachment; filename=mayorguard-dee99508cd77.tar.bz2
请注意,Content-Disposition
标头建议浏览器使用具有正确扩展名的文件名,但Content-Type
标头表示它是.tar
文件。当我在谷歌浏览器中下载时,我得到一个名为mayorguard-hashid.tar.gz.tar的结果文件,这是不对的。
上面的例子来自hgweb,下面的例子来自bitbucket:
% GET -Ssed http://bitbucket.org/mailchimp/etsy-php/get/000000000000.bz2
GET http://bitbucket.org/mailchimp/etsy-php/get/000000000000.bz2 --> 200 OK
Cache-Control: max-age=1800
Connection: close
Date: Mon, 20 Sep 2010 19:05:16 GMT
Accept-Ranges: bytes
Server: nginx/0.7.67
Content-Length: 189
Content-Type: application/x-tar
Expires: Mon, 20 Sep 2010 19:35:16 GMT
Last-Modified: Mon, 20 Sep 2010 19:05:16 GMT
Client-Date: Mon, 20 Sep 2010 19:05:16 GMT
Client-Peer: 207.223.240.182:80
Client-Response-Num: 1
Content-Disposition: attachment; filename=etsy-php-000000000000.bz2
我会说Mercurial正在提供错误的信息,浏览器正在过度调用文件名。