composer没有解压缩bzip2包类型存档

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了composer没有解压缩bzip2包类型存档相关的知识,希望对你有一定的参考价值。

我正在尝试在我的作曲家中使用bzip包:

{
    "name": "<my-proj-name>",
    "optimize-autoloader": true,
    "classmap-authoritative": true,
    "config": {
      "secure-http": false
    },
    "autoload":{
        "psr-0":{
            "":"src/"
        }
    },
    "repositories": [
      {
        "type":"package",
        "package":{
          "name":"<my-local-lib-name>",
          "version":"15.0.0",
          "dist":{
            "url":"file:///Users/<mypath>/test.tar.bz2",
            "type":"tar"
          },
          "autoload":{
            "classmap":["./"]
          }
        }
      }
    ],
    "require": {
      "<my-local-lib-name>":"*"
    }
}

但我得到的是以下错误:

MacBook-Pro-de-Matteo:proj myusername$ composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing mylib/mylib (15.0.0): Downloading (100%)         


  [PharException]                                                                                                                                           
  Extraction from phar "/<path>/<hash>.bz2" failed:   
  Cannot extract ".", internal error    

我没有任何其他信息,也不知道如何调试它。手动完全通过tar提取文件,我的本地php似乎与bzip2一起编译:

MacBook-Pro-de-Matteo:Downloads mbertamini$ php -i | grep -i bz2
Configure Command =>  './configure'  '--prefix=/usr/local/Cellar/php70/7.0.25_17' '--localstatedir=/usr/local/var' '--sysconfdir=/usr/local/etc/php/7.0' '--with-config-file-path=/usr/local/etc/php/7.0' '--with-config-file-scan-dir=/usr/local/etc/php/7.0/conf.d' '--mandir=/usr/local/Cellar/php70/7.0.25_17/share/man' '--enable-bcmath' '--enable-calendar' '--enable-dba' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-mbregex' '--enable-mbstring' '--enable-shmop' '--enable-soap' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx' '--enable-zip' '--with-freetype-dir=/usr/local/opt/freetype' '--with-gd' '--with-gettext=/usr/local/opt/gettext' '--with-iconv-dir=/usr' '--with-icu-dir=/usr/local/opt/icu4c' '--with-jpeg-dir=/usr/local/opt/jpeg' '--with-kerberos=/usr' '--with-mhash' '--with-ndbm=/usr' '--with-png-dir=/usr/local/opt/libpng' '--with-xmlrpc' '--with-zlib=/usr' '--with-readline=/usr/local/opt/readline' '--without-gmp' '--without-snmp' '--with-libxml-dir=/usr/local/opt/libxml2' '--with-pdo-odbc=unixODBC,/usr/local/opt/unixodbc' '--with-unixODBC=/usr/local/opt/unixodbc' '--with-bz2=/usr' '--with-openssl=/usr/local/opt/openssl' '--enable-fpm' '--with-fpm-user=_www' '--with-fpm-group=_www' '--with-curl' '--with-xsl=/usr' '--with-ldap' '--with-ldap-sasl=/usr' '--with-mysql-sock=/tmp/mysql.sock' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--disable-opcache' '--enable-pcntl' '--without-pear' '--enable-dtrace' '--disable-phpdbg' '--enable-zend-signals'
bz2

More info about the error

安装时添加-vvv详细选项我得到以下stacktrace:

Exception trace:
 () at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Downloader/TarDownloader.php:29
 PharData->extractTo() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Downloader/TarDownloader.php:29
 ComposerDownloaderTarDownloader->extract() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Downloader/ArchiveDownloader.php:43
 ComposerDownloaderArchiveDownloader->download() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Downloader/DownloadManager.php:213
 ComposerDownloaderDownloadManager->download() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Installer/LibraryInstaller.php:186
 ComposerInstallerLibraryInstaller->installCode() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Installer/LibraryInstaller.php:90
 ComposerInstallerLibraryInstaller->install() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Installer/InstallationManager.php:173
 ComposerInstallerInstallationManager->install() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Installer/InstallationManager.php:160
 ComposerInstallerInstallationManager->execute() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Installer.php:587
 ComposerInstaller->doInstall() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Installer.php:223
 ComposerInstaller->run() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Command/InstallCommand.php:119
 ComposerCommandInstallCommand->execute() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/vendor/symfony/console/Command/Command.php:266
 SymfonyComponentConsoleCommandCommand->run() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/vendor/symfony/console/Application.php:861
 SymfonyComponentConsoleApplication->doRunCommand() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/vendor/symfony/console/Application.php:208
 SymfonyComponentConsoleApplication->doRun() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Console/Application.php:245
 ComposerConsoleApplication->doRun() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/vendor/symfony/console/Application.php:127
 SymfonyComponentConsoleApplication->run() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Console/Application.php:100
 ComposerConsoleApplication->run() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/bin/composer:54
 require() at /usr/local/Cellar/composer/1.5.2/libexec/composer.phar:24

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...
答案

这是我报告的一个错误。以下是该问题的官方链接:

https://github.com/composer/composer/issues/6916

以上是关于composer没有解压缩bzip2包类型存档的主要内容,如果未能解决你的问题,请参考以下文章

linux中源代码包安装的基本步骤是啥?

压缩命令解压缩命令

Linux文件目录压缩/解压缩

Linux bzip2命令:压缩文件(.bz2格式)

压缩后如何立即使用 Phar 解压缩存档?

Linux 解压缩的命令怎么用?