Mercurial Web 服务器 - 为什么我下载的是 .bz2.tar 文件而不是 .tar.bz2 文件?
据我了解,.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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想我看到了问题所在。下载中的
Content-Type
标头很奇怪:请注意,
Content-Disposition
标头建议浏览器使用具有正确扩展名的文件名,但Content-Type
标头表明它是一个.tar
文件。当我在 Google Chrome 中进行下载时,我得到一个名为 mayorguard-hashid.tar.gz.tar 的结果文件,该文件不正确。上面的例子来自 hgweb,下面的例子来自 bitbucket:
我想说 Mercurial 提供了错误的信息,并且浏览器过度考虑了文件名。
I think I see the problem. The
Content-Type
header in the download is wonky:Notice the
Content-Disposition
header suggests the browser use a filename with the correct extension, but theContent-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:
I'd say that Mercurial is giving bad info and the browser is overthinking the filename.
这是 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/