improve pear package-dependencies command

From: Date: Sat, 30 Oct 2004 09:12:14 +0000
Subject: improve pear package-dependencies command
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-34177@lists.php.net to get a copy of this message
With the new release 1.3.2 of PEAR i've discovered a command i don't used before: pear package-dependencies But i was surprised to see not run when i gave following syntax: pear package-dependencies html_progress Actual result is : This package does not have any dependencies. while in same time, if i send (CLI) command pear info html_progress i got all expected results. BTW if i give a .tgz syntax all run fine. ( pear package-dependencies [path_to_bundle]\html_progress-1.2.0.tgz ) So i've investigated and found some differences between two implementations. And i suggest to improve pear package-dependencies as follow Allow .xml, .tgz and also only name package syntax with few lines. Into PEAR/Command/Package.php // $Id: Package.php,v 1.61.2.3 2004/10/23 17:01:26 cellog Exp $ On function doPackageDependencies (line 499) replace lines:
        $obj = new PEAR_Common();
        if (PEAR::isError($info = $obj->infoFromAny($params[0]))) {
            return $this->raiseError($info);
        }
by lines:
        if (@is_file($params[0])) {
            $obj  = &new PEAR_Common();
            $info = $obj->infoFromAny($params[0]);
        } else {
            $reg = &new PEAR_Registry($this->config->get('php_dir'));
            $info = $reg->packageInfo($params[0]);
        }
        if (PEAR::isError($info)) {
            return $info;
        }
Actual results with pear package-dependencies html-progress This package does not have any dependencies. After hack: DEPENDENCIES FOR HTML_PROGRESS ==============================
TYPE    NAME                      RELATION VERSION
Package PEAR                      >=       1.3.1
PHP                               >=       4.1.0
Package HTML_Common               >=       1.2
Package HTML_CSS                  >=       0.3.4
Package HTML_Page                 >=       2.0.0RC2
Package HTML_QuickForm            >=       3.1.1
Package HTML_QuickForm_Controller >=       0.9.3
Package Config                    >=       1.9
Package Image_Color               >=       1.0.0
ext     GD                        >=       2.0.1
of course if you have HTML_Progress 1.2.0 installed Best regards Laurent

« previous php.pear.dev (#34177) next »