drush_mime_content_type() is a function living in commands/make/make.download.inc.

drush_tarball_extract() duplicates effort and try to guess the content type for files by similar means.

make_download_file_unpack() overlaps with drush_tarball_extract() to some extent.

The task is to consolidate drush_mime_content_type() in includes/drush.inc and decouple tarball management.

Comments

jonhattan’s picture

Title: Extend and leverage drush_mime_content_type() » Clean up mime type detection and tarball management
jonhattan’s picture

Status: Active » Fixed

Commit f59b229

Changes done:

* consolidate drush_mime_content_type(): 1. try php's builtin ; 2. try magic headers (add support for bz2) ; 3. try filename extensions (only for .tar at present)
* remove any mime detection code from drush_tarball_extract()
* new function drush_file_is_tarball() to check if a file has a format valid for drush extraction.
* error handling in drush_tarball_extract()
* fix a dirty hack in drush_lib_fetch()

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Updated issue summary.