0

我的理解是 .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 书的存储库。

4

2 回答 2

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文件。当我在 Google Chrome 中进行下载时,我得到一个名为 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 提供了错误的信息,并且浏览器过度考虑了文件名。

于 2010-09-20T19:06:36.617 回答
1

这是 bitbucket 中的错误,请向他们报告:http: //bitbucket.org/jespern/bitbucket/issues/new/

于 2010-09-20T17:28:47.167 回答