Mercurial Web 服务器 - 为什么我下载的是 .bz2.tar 文件而不是 .tar.bz2 文件?

发布于 2024-09-24 04:28:29 字数 652 浏览 8 评论 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 书籍的存储库。

It is my understanding that a .tar file contains directories and other files, and a .bz2 is a file that's compressed with bzip2 compression.

Therefore, most tarballs with bzip2 compression end in:

.tar.bz2

Which is bzip2 compression applied to a tarball.

However, whenever I download source code from a Mercurial webserver, either the internal one that you get from:

hg serve

Or from BitBucket, I get something that ends in

.bz2.tar

Which doesn't make sense to me, because you can't apply bzip2 compression on multiple files, which is why you need to "tar" them up first.

Is this a bug in Mercurial? Or is this a bug in my web browser (I've tried Google Chrome in Windows and Firefox in Ubuntu)? Or is this something that's just weird but doesn't make a difference?

The latest source that I downloaded was from http://bitbucket.org/bos/hgbook which is the repository for the Mercurial book.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

旧梦荧光笔 2024-10-01 04:28:29

我想我看到了问题所在。下载中的 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 提供了错误的信息,并且浏览器过度考虑了文件名。

I think I see the problem. The Content-Type header in the download is wonky:

% 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

Notice the Content-Disposition header suggests the browser use a filename with the correct extension, but the Content-Type header says it's a .tar file. When I do that download in Google Chrome I get a resulting file named mayorguard-hashid.tar.gz.tar which isn't right.

The example above was from hgweb and the one below is from 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

I'd say that Mercurial is giving bad info and the browser is overthinking the filename.

℉絮湮 2024-10-01 04:28:29

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

This is a bug in bitbucket, please report it to them: http://bitbucket.org/jespern/bitbucket/issues/new/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文