Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
jonhattanComment #2
jonhattanCommit 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()
Comment #3.0
(not verified) CreditAttribution: commentedUpdated issue summary.