In D6 I am pretty sure the list of downloads on a project page said "tar.gz" for the tarball download, now it just says "gz".

Comments

TR’s picture

Yes, I can confirm this. D6 did say tar.gz, now it says simply gz

tvn’s picture

Status: Active » Postponed

Yes, this indeed changed. But do we absolutely need 'tar.gz' on those tables?

longwave’s picture

Well, the file extension of a tarball is .tar.gz, so I think it makes more sense to show the full extension; .gz only tells half the story.

markhalliwell’s picture

Status: Postponed » Active

This is indeed wrong and needs to be fixed.

From: http://askubuntu.com/a/122149

In Unix and Unix-like systems (like Ubuntu), archiving and compression are separate.

tar puts multiple files into a single (tar) file.
gzip compresses one file (only).

So to get a compressed archive, you combine the two, first use tar or pax to get all files into a single file (archive.tar), then gzip it (archive.tar.gz). If you only have one file you need to compress (notes.txt), there's no need for tar, so you just do gzip notes.txt which will result in notes.txt.gz. There are other types of compression, such as compress, bzip2 and xz which work in the same manner as gzip (apart from using different types of compression of course)

markhalliwell’s picture

FWIW and to clarify even more, I gzip SQL dumps all the time: .sql.gz. Just having .gz doesn't define what type of file is gzipped.

tvn’s picture

Issue tags: +Drupal.org 7.1
kalman.hosszu’s picture

Status: Active » Needs review

I checked the problem and I see the following things:

  • the "Downloads" table is generated by Views
  • the data is comming from the filefiled relation
  • the data is rewrited with Views module's "[extension] == File: Extension" token
  • the token generated from "views_handler_field_file_extension" class's "render()" function
  • the funcion gets the extension with a regular expression "preg_match('/\.([^\.]+)$/', $value, $match)"
  • if I changed it to PHP's SplFileInfo::getExtension() method, it returs with the same ("gz")

I think if PHP's core function doesn't handle tar.gz extension as a special one, we shouldn't. Maybe we could use tgz extension instead of tar.gz but I'm not sure it's in the scope.

longwave’s picture

The problem is that .tar.gz is *two* extensions, not just one, so PHP might technically be doing the right thing, it just doesn't handle two file extensions. The .gz alone does not convey the full meaning, as described above.

drumm’s picture

This is fixed in Views 7.x-3.x, #1791970: Optionally detect tar.* as extension instead of * on views file extension field handler. When 7.x-3.8 is released, we can upgrade to get this.

tvn’s picture

Status: Needs review » Postponed

Postponing then, till that release is available.

kalman.hosszu’s picture

tvn’s picture

Status: Postponed » Reviewed & tested by the community
Issue tags: +needs drupal.org deployment
drumm’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -needs drupal.org deployment

Now deployed. Release download tables are cached and regenerated when a release for the project is edited/added/removed. I cleared the cache for https://drupal.org/project/drupal, and it is working.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.