diff options
| author | Tomas V.V.Cox <cox@php.net> | 2002-06-19 23:38:59 +0000 |
|---|---|---|
| committer | Tomas V.V.Cox <cox@php.net> | 2002-06-19 23:38:59 +0000 |
| commit | 77acb22bbaab3088a95395b951f8ac87ca450113 (patch) | |
| tree | 86eb394f38345e0161f750429ae7bb03fa4fb534 /pear/PEAR/Command | |
| parent | fa2ee37313929e5004997ba540fe47a634be40cc (diff) | |
| download | php-git-77acb22bbaab3088a95395b951f8ac87ca450113.tar.gz | |
- Force params to version_compare() to be strings, otherwise some
comparations will fail (ex. 0.9 will be equal to 0.90)
- Other minor cleanup's
Diffstat (limited to 'pear/PEAR/Command')
| -rw-r--r-- | pear/PEAR/Command/Install.php | 7 | ||||
| -rw-r--r-- | pear/PEAR/Command/Registry.php | 4 | ||||
| -rw-r--r-- | pear/PEAR/Command/Remote.php | 12 |
3 files changed, 15 insertions, 8 deletions
diff --git a/pear/PEAR/Command/Install.php b/pear/PEAR/Command/Install.php index 6c24be19ad..36c0b80cd3 100644 --- a/pear/PEAR/Command/Install.php +++ b/pear/PEAR/Command/Install.php @@ -182,13 +182,16 @@ specified at once. if (empty($this->installer)) { $this->installer = &new PEAR_Installer($this->ui); } + if (sizeof($params) < 1) { + return $this->raiseError("Please supply the package(s) you want to uninstall"); + } foreach ($params as $pkg) { if ($this->installer->uninstall($pkg, $options)) { if ($this->config->get('verbose') > 0) { - $this->ui->outputData("uninstall ok", $command); + $this->ui->outputData("uninstall $pkg ok", $command); } } else { - return $this->raiseError("uninstall failed"); + return $this->raiseError("uninstall $pkg failed"); } } return true; diff --git a/pear/PEAR/Command/Registry.php b/pear/PEAR/Command/Registry.php index 57bc616544..95650befbb 100644 --- a/pear/PEAR/Command/Registry.php +++ b/pear/PEAR/Command/Registry.php @@ -189,13 +189,13 @@ installed package.' // "pear shell-test Foo 1.0" } elseif (sizeof($params) == 2) { $v = $reg->packageInfo($params[0], 'version'); - if (!$v || !version_compare($v, $params[1], "ge")) { + if (!$v || !version_compare("$v", "{$params[1]}", "ge")) { exit(1); } // "pear shell-test Foo ge 1.0" } elseif (sizeof($params) == 3) { $v = $reg->packageInfo($params[0], 'version'); - if (!$v || !version_compare($v, $params[2], $params[1])) { + if (!$v || !version_compare("$v", "{$params[2]}", $params[1])) { exit(1); } } else { diff --git a/pear/PEAR/Command/Remote.php b/pear/PEAR/Command/Remote.php index c92d6e36cc..e373abb50a 100644 --- a/pear/PEAR/Command/Remote.php +++ b/pear/PEAR/Command/Remote.php @@ -125,7 +125,7 @@ version of DB is 1.2, the downloaded file will be DB-1.2.tgz.', $info['installed'] = $installed['version'] ? $installed['version'] : '- no -'; $this->ui->outputData($info, $command); - + return true; } @@ -190,7 +190,7 @@ version of DB is 1.2, the downloaded file will be DB-1.2.tgz.', continue; if ($options['mode'] == 'notinstalled' && isset($installed['version'])) continue; - if ($options['mode'] == 'upgrades' + if ($options['mode'] == 'upgrades' && (!isset($installed['version']) || $installed['version'] == $info['stable'])) { continue; @@ -329,7 +329,7 @@ version of DB is 1.2, the downloaded file will be DB-1.2.tgz.', } extract($info); $inst_version = $reg->packageInfo($package, 'version'); - if (version_compare($version, $inst_version, "le")) { + if (version_compare("$version", "$inst_version", "le")) { // installed version is up-to-date continue; } @@ -344,7 +344,11 @@ version of DB is 1.2, the downloaded file will be DB-1.2.tgz.', } $data['data'][] = array($package, $version, $fs); } - $this->ui->outputData($data, $command); + if (empty($data['data'])) { + $this->ui->outputData('No upgrades avaible'); + } else { + $this->ui->outputData($data, $command); + } return true; } |
